char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Olivier Chafikjson: refine constraint for whitespace to avoid runaways yet allow pretty print (#7866)b61eb9644

char/aliceai-t5-moe
601 B25 linesraw
1root   ::= object
2value  ::= object | array | string | number | ("true" | "false" | "null") ws
3
4object ::=
5  "{" ws (
6            string ":" ws value
7    ("," ws string ":" ws value)*
8  )? "}" ws
9
10array  ::=
11  "[" ws (
12            value
13    ("," ws value)*
14  )? "]" ws
15
16string ::=
17  "\"" (
18    [^"\\\x7F\x00-\x1F] |
19    "\\" (["\\bfnrt] | "u" [0-9a-fA-F]{4}) # escapes
20  )* "\"" ws
21
22number ::= ("-"? ([0-9] | [1-9] [0-9]{0,15})) ("." [0-9]+)? ([eE] [-+]? [0-9] [1-9]{0,15})? ws
23
24# Optional space: by convention, applied in this grammar after literal chars when allowed
25ws ::= | " " | "\n" [ \t]{0,20}