[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 - How do I resume an interrupted parse?
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Thu, 2 Feb 2012 00:08:20 +0100
On Wed, Feb 1, 2012 at 23:20, <StephenSimpson@eaton.com> wrote:
> The parser-tokeniser would feed the stack and as soon as the stack gets to an
> executable state, the lua runtime would execute it.
Now I understand better.
You'll need something more subtle. For example take `a = math.sin(b)`.
The expected result is obvious, but the approach you suggest would
stop parsing before the dot and assign the `math` table to `a`.
A possible solution would be to compile each statement as a chunk,
i.e. wait for a semi-column or the beginning of the next statement to
compile the last one.
It should be possible to patch the parser to that end, but I haven't
looked at it in a while so I can't guide you...
-- Pierre-Yves