lua-users home
lua-l archive

Re: Lua 5.2 - How do I resume an interrupted parse?

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


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

AltStyle によって変換されたページ (->オリジナル) /