lua-users home
lua-l archive

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


2017-06-10 8:51 GMT+02:00 Sean Conner <sean@conman.org>:

>         local cmdline do
>           local C  = lpeg.C
>           local P  = lpeg.P
>           local SP = P" "
>
>           local token = C((P(1) - P" ")^1)
>           cmdline = SP^0 * token * (SP * C(P(1)^0))^-1
>         end

Your examples demonstrate what one could call a style idiom:
you are defining and initializing a local value, and enclosing
the code needed for that in a do...end group.