2023-08-03 04:05:44 +02:00
|
|
|
root ::= object
|
|
|
|
value ::= object | array | string | number | ("true" | "false" | "null") ws
|
2023-07-24 05:58:10 +02:00
|
|
|
|
|
|
|
object ::=
|
|
|
|
"{" ws (
|
|
|
|
string ":" ws value
|
|
|
|
("," ws string ":" ws value)*
|
2023-08-03 04:05:44 +02:00
|
|
|
)? "}" ws
|
2023-07-24 05:58:10 +02:00
|
|
|
|
|
|
|
array ::=
|
|
|
|
"[" ws (
|
|
|
|
value
|
|
|
|
("," ws value)*
|
2023-08-03 04:05:44 +02:00
|
|
|
)? "]" ws
|
2023-07-24 05:58:10 +02:00
|
|
|
|
2023-08-03 04:05:44 +02:00
|
|
|
string ::=
|
2023-07-24 05:58:10 +02:00
|
|
|
"\"" (
|
2024-03-05 17:33:08 +01:00
|
|
|
[^"\\\x7F\x00-\x1F] |
|
2024-06-11 02:00:30 +02:00
|
|
|
"\\" (["\\bfnrt] | "u" [0-9a-fA-F]{4}) # escapes
|
2023-07-24 05:58:10 +02:00
|
|
|
)* "\"" ws
|
|
|
|
|
2024-06-11 02:00:30 +02:00
|
|
|
number ::= ("-"? ([0-9] | [1-9] [0-9]{0,15})) ("." [0-9]+)? ([eE] [-+]? [0-9] [1-9]{0,15})? ws
|
2023-07-24 05:58:10 +02:00
|
|
|
|
|
|
|
# Optional space: by convention, applied in this grammar after literal chars when allowed
|
2024-06-11 03:22:57 +02:00
|
|
|
ws ::= | " " | "\n" [ \t]{0,20}
|