lua-users home
lua-l archive

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

> As Luiz mentions with the token filter patch, it's mainly _intended_  
> to be used with 'luac', not liblua itself.

That's not quite correct: luac was never the intended target. What I
have said on this subject is that the token filter patch *could* be used
only with luac, thus providing customized syntax that would be compiled
into standard Lua bytecode and so could be run in any unmodified Lua VM.

Anyway, it's a one-line patch that gives you the opportunity to inspect
and alter the stream of tokens coming from the lexer before they go to
the parser. The decision can be made at run time on whether to do it
and how to do it. The scheme I proposed in the workshop and which is
implemented in the tarball is just an example of how to do it in Lua.
I have since posted examples of how to do simple things in C.