lua-users home
lua-l archive

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

> Hmmm, could you add my request about LPeg memory management too?
> I'm not really sure how clear that message was, but ... basically it
> would be nice if one could add grammar hints to control memory
> management in LPeg, so that parsing extremely large-but-flat inputs
> with a single grammar is possible.

I am not sure I understood what you want. If you do not want to keep
any captures from ONE_STATEMENT, why does it have captures in the
first place?

Anyway, I guess you can force the release of all captures made by
ONE_STATEMENT with the following code:

  lpeg.Cmt(ONE_STATEMENT / 0, function () return true end)

-- Roberto