/*
_ _ _ _ _
/ \ / \ / \ / \ / \
( N | o | j | s | e )
\_/ \_/ \_/ \_/ \_/
The Nojse Data Interchange Standard.
*/
[
about : "Nojse - pronounced as English word: 'nice' - is a Json derivative."
inspiration : [
'https://www.json.org/json-en.html'
'https://json5.org/'
'https://www.relaxedjson.org/'
'https://yaml.org/'
]
this_document : `This document is a valid Nojse file`
last_update : 0d2026-06-09
parser_source : "https://nojse.org/Nojse2026.pb"
design_goals : [
"Clean look and feel."
"Easy to read, easy to write for humans & machines."
"Suitable for configuration files."
'Simplified version of Json.'
'Enhanced version of Json.'
]
nojse_features :
[
containers : [
`Objects (keyvaluelists) and arrays (valuelists) use brackets [ ... ]`
`Standard json curly brackets { ... } are not allowed.`
`Commas are not allowed.`
]
keys : [
`Keys must be an identifier name.`
`Quoted keys, as used in standard json, are not allowed.`
`Keys with non-standard characters are possible with special $ notation.`
]
strings : [
"Strings may be double quoted."
'Strings may be single quoted.'
`Strings may be backtick quoted.`
"Strings may span" +
' multiple lines ' +
`by concatenation.`
"Strings may include \t the standard json \t character escapes. \n"
]
numbers : [
`Numbers may be hexadecimal.`
`Numbers may be dates (UTC format).`
`Numbers may have a leading point.`
`Numbers may begin with an explicit plus sign.`
`Numbers may have underscores for better reading experience`
`The same is true for hexadecimal numbers`
]
reserved_words: [
`Nojse does not define reserved words like true, false & null`
`Reserved words start with a dot.`
`The dot is followed by a valid identifier name.`
]
comments : [
`Single line comments are allowed` // single line comment
`Multi line comments are allowed` /* multi line comment */
]
whitespace : `All ascii characters <= " " are treated as whitespace.`
]
autodetect:
[
what_it_is : 'Nojse has no separate arrays and objects.'
+ 'It has a "container" type instead.'
+ 'The Nojse parser will autodetect the elements in a container:'
+ 'First element is a key ? -> keyvaluelist (object).'
+ 'Otherwise: -> valuelist (array).'
empty : []
v_one : [ 123.45 ]
kv_one : [ test : 123.45 ]
v_two : [ 0x89ab 0x67ef ]
kv_two : [ hex1 : 0x89ab hex2 : 0x67ef ]
v_three : [ "Crimson" "Olive" "Turquoise" ]
kv_three : [ red : "Crimson" green : "Olive" blue : "Turquoise" ]
// You can't go wrong with Nojse: a container is always [ ... ] and never { ... }
]
keys: // if you really want, you can use 'special' characters in Nojse keys
[
Simple_Identifier_123 : 1 // First char is a..z or A..Z or _ Next char also 0..9
$Kastkær: 2 // Place in Denmark (note: no space before semicolon)
$Hillerød: 3 // Place in Denmark
$Key with spaces: 4 // The key is "Key with spaces"
// Key is the characters between $ and :
]
reserved_words:
[
json : [ .true .false .null ] // Json has three reserved words
json5 : [ .Infinity .NaN ] // Json5 adds two more reserved words
nojse : [ .pi .avogadro ] // Nojse lets you define any constant you would like to use
// Nojse reserved words start with a dot: they are parsed as 'numbers'
// This is a design choice: keys (without dot) and constants (with dot) are two different things
]
numbers:
[
+123 // not possible in standard Json
123
-123
.123 // not possible in standard Json
0.123
/*
For large numbers a separator offers a better reading experience.
But unfortunately this depends on the language.
US/UK : 1,048,576
Europe : 1.048.576
Nojse is language agnostic and uses underscores.
*/
1_024
1_048_576
1_073_741_824
]
hexnumbers: // some random guids (underscore allowed)
[
0x_16e4156c_53a24181_a9cd16df_6327a50d
0x_420870a4_38af4b20_954e3c04_504b0dfd
0x_e4ad5b25_c0814fa6_9ee5e221_9f12434b
0x_8123d9b2_495f4364_8c8b7087_a8553068
0x_d7b7e0b3_5f774d0d_9bbbe923_2fceaea6
]
datetime: // UTC datetime (ISO 8601) is standard in Nojse
[
0d2026-06-07
0d2026-06-07T14:26
0d2026-06-07T14:26:54
0d2026-06-07T14:26:54.567
0d2026-06-07T14:26Z+01:00
0d2026-06-07T14:26Z-02:00
]
]