lua-users home
lua-l archive

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

> [So basically I could just define my suggested "lpeg.flush" like:
>  function lpeg_flush (pattern)
>    return lpeg.Cmt (pattern, function () return true end)
>  end

Yes. (This "flush" flushes all captures and throws away any occasional

> Are you saying I can just do:
> FILE =
>    (lpeg.P"begin"
>                function () return true end)^0
>     * lpeg.P"end")
> ?


> Will the use of Cmt here affect the speed of

Only real measure can answer that question, but a match-time capture is
only a little more expensive than a function capture (the kind you are
already using to create your side effects).

-- Roberto