server: improve spacing for JSON grammar (#10131)

This commit is contained in:
Parth Sareen 2025-04-24 16:47:57 -07:00 committed by GitHub
parent a53d744b01
commit 11dde41824
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -640,20 +640,20 @@ root ::= object
value ::= object | array | string | number | ("true" | "false" | "null") ws
object ::=
"{" ws (
string ":" ws value
string ":" ws value
("," ws string ":" ws value)*
)? "}" ws
)? ws "}"
array ::=
"[" ws (
value
("," ws value)*
)? "]" ws
)? ws "]"
string ::=
"\"" (
[^"\\\x7F\x00-\x1F] |
"\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
)* "\"" ws
number ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? ws
)* "\""
number ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)?
# Optional space: by convention, applied in this grammar after literal chars when allowed
ws ::= ([ \t\n] ws)?
`