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] |
|
2024-06-11 00:00:30 +00:00
|
|
|
"\\" (["\\bfnrt] | "u" [0-9a-fA-F]{4}) # escapes
|
2023-07-24 03:58:10 +00:00
|
|
|
)* "\"" ws
|
|
|
|
|
2024-06-11 00:00:30 +00:00
|
|
|
number ::= ("-"? ([0-9] | [1-9] [0-9]{0,15})) ("." [0-9]+)? ([eE] [-+]? [0-9] [1-9]{0,15})? ws
|
2023-07-24 03:58:10 +00:00
|
|
|
|
|
|
|
# Optional space: by convention, applied in this grammar after literal chars when allowed
|
2024-06-11 01:22:57 +00:00
|
|
|
ws ::= | " " | "\n" [ \t]{0,20}
|