[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPEG output
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 25 Jun 2019 12:53:22 -0300
> A couple of questions:
> - the white paper says that a 'commit' pops the first element off the
> stack, which it states must be a 'choice' stack element. However, if
> there was a 'call' instruction in between, the 'choice' and the
> 'commit' or 'fail' instructions, there will be another type of element
> on the stack.
There cannot be a 'call' instruction in between. A commit is always in
the same rule that generated the corresponding choice; so, any call
between a choice and its corresponding commit must have returned.
> - what does the 'closeruntime' instruction do?
It closes a runtime capture, which involves calling the corresponding
Lua function. (This is by far the most complex instruction.)
-- Roberto