JSON parser grammar

Mark S. Miller erights at google.com
Wed Jun 23 08:08:39 PDT 2010


On Tue, Jun 22, 2010 at 8:27 PM, Oliver Hunt <oliver at apple.com> wrote:

>
> On Jun 22, 2010, at 8:17 PM, Dean Landolt wrote:
> > There are countless JSON parsers in the wild -- likely > 1 for almost
> every obscure language in existence, not counting all the one-offs. Any
> number of these were written with the expectation of not expecting control
> characters -- not too long ago I wrote a .NET streaming parser that I'm
> fairly sure would blow up at the first sight of a \t.
>
> I am not suggesting that browser should not escape tabs, the issue is
> whether a conforming JSON implementation is allowed to parse a string that
> includes tab characters.
>

AFAIK, none of the other JSON implementations at json.org claim to be a
validating parser. If what you want is a valid but non-validating JSON
implementation, <http://code.google.com/p/json-sans-eval/> is fine as a JS
library. It is fast and safe. Much of the point of having ES5 include a JSON
implementation is that no one's been able to write in JS a JSON parser
that's fast, safe, and validating.



>
> --Oliver
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20100623/92cb8cda/attachment-0001.html>


More information about the es-discuss mailing list