[Web-SIG] Time a for JSON parser in the standard library?
pywebsig at xhaus.com
Thu Apr 10 10:22:47 CEST 2008
> simplejson would give you an error and tell you exactly where the
> problem was,
Another good point.
Other JSON modules should follow simplejson's lead, and provide access
to the location in the document where the lexical or parse error
occurred, so that the offending document can be opened in a text
editor to determine the source of the problem, and perhaps fix it.
This should also apply to "junk" after the document object, i.e. JSON
expressions present in the document after the main document has been
successfully parsed. A strict interpretation of the spec is that such
"junk" is not permitted, and makes the JSON document broken, even
though the main object representation is valid.
Simplejson has an option for the user to control this, and jyson does
too; I don't know about the others.
> but there isn't currently a non-strict mode and honestly
> nobody has asked for it.
If we only need "strict mode", then why do all of our parsers have options?
Isn't "permissive mode" just a way of setting all of the parse options
to liberal, in one go?
More information about the Web-SIG