lua-users home
lua-l archive

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

On Sun, Sep 12, 2010 at 06:46, Thomas Harning Jr. <> wrote:
> On Sat, Sep 11, 2010 at 5:07 PM, Alexander Gladysh <> wrote:
>> On Sun, Sep 12, 2010 at 01:23, Thomas Harning Jr. <> wrote:>
>>> On 9/11/10, Alexander Gladysh <> wrote:

>>>> While we're on it: I have a special case (not for default json2lua
>>>> mode) where I need luajson to convert JSON string keys that are
>>>> numbers (like "1" or "123.456", but not "123a") to numbers in Lua.


> Alrighty, now that I at least have source access...  If you have
> numbers as keys, but without quotes, it will put them in numeric
> indices.  If you want to transform all strings that happen to be
> numbers, here is a small patch to my current source code that would
> have the effect that you desire...


> Looks like 'key' handling could use customizability in my library...

Thomas, I've sent you a pull request on GitHub with this
functionality. Please review.