lua-users home
lua-l archive

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


2016-11-16 20:43 GMT+08:00 Javier Guerra Giraldez <javier@guerrag.com>:
> On 16 November 2016 at 04:32, Xavier Wang <weasley.wx@gmail.com> wrote:
>> In my code lifetime, these things are very normal in
>> writing Lua codes, but with something about Json Path[3],
>> it could be done in a very simple way:
>>
>> ```
>>     local result = table.match(sheetData,
>>         [[ $[?(@.tag=="row")][?(@.tag=="c")] ]])
>> ```
>
> i wrote a similar thing for xml long ago:
>
> http://lua-users.org/lists/lua-l/2008-01/msg00144.html
>
> basically it's (was?) a syntax to traverse the lua tables produced by LuaExpat
>
> now i see i didn't publish it then... wonder if it's still somewhere
>
> --
> Javier
>

Compared Lua patterns, your l4x things just like lpeg :-P

It's also worth to discuss about which is better: to implement it like
lpeg, or to implement it like a DSL (just as string patterns)?

-- 
regards,
Xavier Wang.