lua-users home
lua-l archive

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


Use lpeg.Cg() around NAME and PLIST, like this:

local WS    = lpeg.S' \n\t'^0
local NAME  = lpeg.C( lpeg.R'az'^1 )
local PLIST = lpeg.Ct( WS * ( NAME * ( WS * ',' * WS * NAME )^0 )^-1 )
local FCALL = lpeg.Cc'FCALL' * lpeg.Ct( WS * lpeg.Cg(NAME,'name')
              * '(' * lpeg.Cg(PLIST,'args') * WS * ')' )
local ALL   = lpeg.Ct( FCALL^0 )