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

This commit is contained in:
Olivier Chafik 2024-06-11 02:22:57 +01:00 committed by GitHub
parent 396b18dfec
commit b61eb9644d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 44 additions and 45 deletions

View file

@ -31,4 +31,4 @@ string ::=
number ::= ("-"? ([0-9] | [1-9] [0-9]{0,15})) ("." [0-9]+)? ([eE] [-+]? [1-9] [0-9]{0,15})? ws
# Optional space: by convention, applied in this grammar after literal chars when allowed
ws ::= [ \t\n]{0,20}
ws ::= | " " | "\n" [ \t]{0,20}