[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Smallest Lua-only single-file JSON parser
- From: Duncan Cross <duncan.cross@...>
- Date: Thu, 27 Oct 2011 23:11:07 +0100
On Thu, Oct 27, 2011 at 7:34 PM, Alexander Gladysh <email@example.com> wrote:
> On Thu, Oct 27, 2011 at 13:50, Alexander Gladysh <firstname.lastname@example.org> wrote:
>> On Thu, Oct 27, 2011 at 01:45, Matthew Wild <email@example.com> wrote:
>>> On 26 October 2011 15:22, Alexander Gladysh <firstname.lastname@example.org> wrote:
>>>> I need to parse JSON in Lua-only environment.
>>>> Is there some primitive single-file JSON parser that I can paste
>>>> directly into my script? (Doh, no multi-file support as well...)
>>> I thought you'd never ask.
>>> MIT-licensed (see project root directory, though I can add a copyright
>>> header if you require that):
>>> The decoder starts after line 132.
>> Thank you! I'll give it a try as well!
> For the record: ended up using this one, as it is the shortest.
> Thanks again,
I'm not seriously advocating this approach, but I was inspired to
write this proof-of-concept minimal module that uses Lua's own parser:
It didn't end up much shorter than the one you already have, but I
hope it's interesting to someone, at least. :)