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