lua-users home
lua-l archive

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

Miles Bader <> wrote:
> [Hmm, that brings to mind another question:  How much of the input
> string does it have to accumulate in memory?  Can it start discarding
> earlier portions of it at some point?  If not, it wouldn't be so useful
> for the use I have in mind: parsing really big files without needing to
> have them entirely in memory.]

lpeg doesn't bother trying to discard unneeded string prefixes. In theory
it can only discard the prefix of a string that is not covered by any
captures and which has no alternation backtracking points in it.

f.anthony.n.finch  <>
Rockall, Malin: South 5 to 7, decreasing 4 at times in Malin. Moderate or
rough, occasionally very rough in Rockall. Occasional rain in Rockall.
Moderate or good.