lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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
into UTF-8.

> 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
more thoroughly.