[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Smallest Lua-only single-file JSON parser
- From: Patrick Rapin <toupie300@...>
- Date: Fri, 28 Oct 2011 20:42:27 +0200
> That's an interesting approach!
I already used such a trick to implement little parsers, but that was in Perl !
>> Bugs apart, the only missing feature is the \uXXXX string escape.
> Is that hard to add?
Not really, but this will probably double the code size... This is
merely an additional gsub(...,function), encoding the numeric value
> I believe that you o not need a function here, just pass `escapes`
> here. Or even put the table directly, to shorten further.
You are right. I forgot about that feature of string.gsub.
> Anyone knows a good JSON compatibility test suite for the parser?
I have not searched for that, and only performed a minimum test.
If you seriously think about using that code, you will have to test it