Notation
{
key(value)
array_value[
Hello,
World!,
]
inline_array[Hello, World!]
/*
This is a comment
*/
map<
(key):(value)
>
pointer->0000000000000000
}
The example above contain every thing that is supported by YAPION. You can see some similarities between the YAPION notation and the JSON notation. Since YAPION is a superset of JSON, any JSON file is a valid YAPION file.
Info:
Difference between YAPION and JSON
The building blocks
YAPION itself is composed of the following building blocks:
- Objects: Identified by the
{
and}
characters. Present in JSON - Arrays: Identified by the
[
and]
characters. Present in JSON - Maps: Identified by the
<
and>
characters. - Pointers: Starting with
->
. - Comments: Starting with
/*
and ending with*/
. Present in JSON5 - Values: Identified by the
(
and)
characters. Present in JSON with a different syntax.
Objects
Objects are very similar to JSON objects. They start with {
and end with }
. They also contain a list of key-value pairs. The key is a string and the value is any valid building block.
{
key{}
}
Warning:
Object Notation differences
{
"key": {}
}
Arrays
Arrays are very similar to JSON arrays. They start with [
and end with ]
. They also contain a list of values. The values are any valid building block.
[
[],
[],
{}
]
Maps
Maps start with <
and end with >
. They contain a list of key-value pairs. The key and the value are both any valid building block. Both seperated by a :
.
<
{}:{}
>
Warning:
No maps in JSON
Pointers
Pointers start with ->
. They are used to identify a building block in the YAPION hierarchy. The pointer is followed by a 64-bit hexadecimal number, which is later known under the name reference-id
.
->0000000000000000
Warning:
References like in YAML
Comments
Comments start with /*
and end with */
. They are used to add comments to the YAPION hierarchy.
/*
This is a comment
*/
Warning:
Comments in JSON
Values
Values start with (
and end with )
. They are used to identify a value in the YAPION hierarchy.
// TODO: Finish this section with examples and code as well as array examples