Made JSON-L parser even more lenient

-- Now allows "empty" values in arrays, e.g., "[1,,,,3]"
This commit is contained in:
Ian Prest 2015-07-17 22:12:14 -04:00
parent ae3e23d395
commit 5e972cd114

View file

@ -69,9 +69,12 @@ exports.grammar = {
"JSONArray": [[ "[ ]", "$$ = [];" ],
[ "[ JSONElementList ]", "$$ = $2;" ]],
"JSONArrayValue": [[ "JSONValue", "$$ = $1;" ],
[ "", "$$ = undefined;" ]],
"JSONElementList": [[ "JSONValue", "$$ = [$1];" ],
[ "JSONElementList , JSONValue", "$$ = $1; $1.push($3);" ]]
[ "JSONElementList , JSONArrayValue", "$$ = $1; $1.push($3);" ]]
}
};