lua-users home
lua-l archive

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


Now that I think of it there may be a non-invasive method to achieve
what you want, but it would require some discipline at the code
emitting side.

Your reader could use an approach similar to the one found in the
REPL, but using semi-columns as a trigger instead of line ends. If you
insert semi-columns after each top-level statement, you'll get what
you want.

If you want to avoid failed parsing attempts based on semi-columns
inserted in other places, you could use a group of semi-columns
instead... Or a pattern less likely to be found accidentally in code,
like ";;--;;\n".

-- Pierre-Yves