A
Asen Bozhilov
I implemented full JSON parser. The main goal was to create full JSON
parser according ECMA-262-5 JSON grammar.
<URL: https://github.com/abozhilov/json/blob/master/src/json.js>
I made it not for fallback implementation of `JSON.parse', I made it
for debugging and testing purposes of my JSON strings. If the JSON
string is not syntactical correct, the parser throws a SyntaxError
with line and column numbers of the error.
It covers all test cases from:
<URL: http://asenbozhilov.com/json-parse.html>
Also by suggestions from Scott Sauyet I added and optional `reviver'
parameter to `evalJSON'.
I am planning in the near future, to create front-end of this parser,
to provide test environment of JSON strings.
Any suggestions, improvements or critics are welcome.
parser according ECMA-262-5 JSON grammar.
<URL: https://github.com/abozhilov/json/blob/master/src/json.js>
I made it not for fallback implementation of `JSON.parse', I made it
for debugging and testing purposes of my JSON strings. If the JSON
string is not syntactical correct, the parser throws a SyntaxError
with line and column numbers of the error.
It covers all test cases from:
<URL: http://asenbozhilov.com/json-parse.html>
Also by suggestions from Scott Sauyet I added and optional `reviver'
parameter to `evalJSON'.
I am planning in the near future, to create front-end of this parser,
to provide test environment of JSON strings.
Any suggestions, improvements or critics are welcome.