lua-users home
lua-l archive

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


2014-08-22 11:26 GMT+02:00 Sean Conner <sean@conman.org>:
> I forgot that when you do:
>
>         pattern / "string"
>
> that "string" could contain backreferences in the form of "%1, %2".  It's
> not a feature I use that often in LPeg.

Oh! I use it all the time. But then, I use LPeg almost exclusively for
translating my little DSL's (e.g. APL) into Lua code. That feature allows
one to do everything in a single grammar.

   local lua,pos = (apl_expr*_s^0*Cp()):match(apl)