Follow spec instead of rfc for top level strings/numbers/null/booleans

This commit is contained in:
Zach Carter
2011-06-12 13:39:54 -04:00
parent acf3cd47bc
commit 348eeb4c11
5 changed files with 34 additions and 42 deletions

View File

@@ -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