lua-users home
lua-l archive

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


> I just hopes to know how Luiz & Roberto think about add a #line (or
> other syntax) to Lua, specific the line number of next line, this is
> useful when you write a preprocessor (somethings like [1] or [2] or
> LuaMacro[3])
> 
> the implement may very easy: when llex read a #line, it set the
> lastline (or linenumber?) field of LexState.

It is not that easy. A #line directive without a file name is a half
baked solution, and to store multiple file names in a chunk would
require some new data structures. (Nothing impossible, but it is
not trivial.)

-- Roberto