Skip to content

Commit 94ee9a8

Browse files
committed
grammar : add comments to new grammar file
1 parent 58f4864 commit 94ee9a8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

grammars/json_arr.gbnf

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
# This is the same as json.gbnf but we restrict whitespaces at the end of the root array
2+
# Useful for generating JSON arrays
3+
14
root ::= arr
25
value ::= object | array | string | number | ("true" | "false" | "null") ws
36

7+
arr ::=
8+
"{\n\t[\n" ws (
9+
value
10+
(",\n" ws value)*
11+
)? "\t]\n}"
12+
413
object ::=
514
"{" ws (
615
string ":" ws value
@@ -13,12 +22,6 @@ array ::=
1322
("," ws value)*
1423
)? "]" ws
1524

16-
arr ::=
17-
"[\n" ws (
18-
value
19-
(",\n" ws value)*
20-
)? "]"
21-
2225
string ::=
2326
"\"" (
2427
[^"\\] |

0 commit comments

Comments
 (0)