"3rdparty/core-r22.12/src/backend_manager.cc" did not exist on "e38ee081a0495769e25766b894abe19bc8a6209e"
json_arr.gbnf 796 Bytes
Newer Older
mashun1's avatar
v1  
mashun1 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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" ws (
            value
    (",\n" ws value)*
  )? "]"

object ::=
  "{" ws (
            string ":" ws value
    ("," ws string ":" ws value)*
  )? "}" ws

array  ::=
  "[" ws (
            value
    ("," ws value)*
  )? "]" ws

string ::=
  "\"" (
    [^"\\\x7F\x00-\x1F] |
xuxzh1's avatar
init  
xuxzh1 committed
28
    "\\" (["\\bfnrt] | "u" [0-9a-fA-F]{4}) # escapes
mashun1's avatar
v1  
mashun1 committed
29
30
  )* "\"" ws

xuxzh1's avatar
init  
xuxzh1 committed
31
number ::= ("-"? ([0-9] | [1-9] [0-9]{0,15})) ("." [0-9]+)? ([eE] [-+]? [1-9] [0-9]{0,15})? ws
mashun1's avatar
v1  
mashun1 committed
32
33

# Optional space: by convention, applied in this grammar after literal chars when allowed
xuxzh1's avatar
init  
xuxzh1 committed
34
ws ::= | " " | "\n" [ \t]{0,20}