lua-users home
lua-l archive

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


On Tue, Apr 2, 2013 at 7:32 PM, Miles Bader <miles@gnu.org> wrote:
> Are you saying I can just do:
>
> FILE =
>    (lpeg.P"begin"
>     * lpeg.Cmt(SUPER_COMPLEX_GRAMMAR_WITH_LOTS_OF_CAPTURES,
>                function () return true end)^0
>     * lpeg.P"end")
>
> ?

Yup!

> Will the use of Cmt here affect the speed of
> SUPER_COMPLEX_GRAMMAR_WITH_LOTS_OF_CAPTURES?

No.

> [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.

--
- Patrick Donnelly