lua-users home
lua-l archive

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


> [...]
> 
> This example raises a "too many pending calls/choices" error.
> 
> I imagined Lpeg stores on stack some sort of closure for the inner
> captures it might find, and reading the source I've noticed the 400
> entries limitation.
> 
> My questions are: did I understand it right? if so, is there a
> recipe to circumvent this limitation?

Yes. Currently no. (For many patterns you can rewrite it to avoid
pending choices or calls, but not if you need a recursive pattern able
to descend so many levels.)

The next version of LPEG will have a resizable stack. It will still
have a limit, to detect bad-written patterns, but there is a function
to change that limit.

-- Roberto