mirror of
https://github.com/circlecell/jsonlint-mod.git
synced 2026-01-21 05:07:49 +08:00
Follow spec instead of rfc for top level strings/numbers/null/booleans
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
/*
|
||||
/*
|
||||
ECMA-262 5th Edition, 15.12.1 The JSON Grammar.
|
||||
Modified to forbid top level primitives.
|
||||
*/
|
||||
@@ -35,25 +35,17 @@ JSONBooleanLiteral
|
||||
;
|
||||
|
||||
JSONText
|
||||
: JSONObject EOF
|
||||
{return $$ = $1;}
|
||||
| JSONArray EOF
|
||||
: JSONValue EOF
|
||||
{return $$ = $1;}
|
||||
;
|
||||
|
||||
JSONValue
|
||||
: JSONNullLiteral
|
||||
{$$ = $1;}
|
||||
| JSONBooleanLiteral
|
||||
{$$ = $1;}
|
||||
| JSONString
|
||||
{$$ = $1;}
|
||||
| JSONNumber
|
||||
{$$ = $1;}
|
||||
| JSONObject
|
||||
{$$ = $1;}
|
||||
| JSONArray
|
||||
{$$ = $1;}
|
||||
;
|
||||
|
||||
JSONObject
|
||||
|
||||
Reference in New Issue
Block a user