grammar : add comments to new grammar file
This commit is contained in:
parent
e0a8658e7c
commit
2d89da4f77
1 changed files with 9 additions and 6 deletions
|
@ -1,6 +1,15 @@
|
|||
# This is the same as json.gbnf but we restrict whitespaces at the end of the root array
|
||||
# Useful for generating JSON arrays
|
||||
|
||||
root ::= arr
|
||||
value ::= object | array | string | number | ("true" | "false" | "null") ws
|
||||
|
||||
arr ::=
|
||||
"{\n\t[\n" ws (
|
||||
value
|
||||
(",\n" ws value)*
|
||||
)? "\t]\n}"
|
||||
|
||||
object ::=
|
||||
"{" ws (
|
||||
string ":" ws value
|
||||
|
@ -13,12 +22,6 @@ array ::=
|
|||
("," ws value)*
|
||||
)? "]" ws
|
||||
|
||||
arr ::=
|
||||
"[\n" ws (
|
||||
value
|
||||
(",\n" ws value)*
|
||||
)? "]"
|
||||
|
||||
string ::=
|
||||
"\"" (
|
||||
[^"\\] |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue