lua-users home
lua-l archive

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



On 5-Sep-05, at 3:26 AM, Mike Pall wrote:

BTW: Has anyone noticed that the following:

  x=1y=2print(x,y)

is accepted by the lexer as valid Lua code (with or without
my patch)?

I guess most tools parsing Lua files won't handle this

Yeah, LuaParse tries to get this "right" but I can't say that I'm very fond of this behaviour.

e=1f=2  <-- two statements
f=1e=2  <-- error

On 5-Sep-05, at 5:47 AM, Luiz Henrique de Figueiredo wrote:

Why shouldn't it?  It may be ugly but it's valid.
Hence my insistence on reusing the Lua lexer...

I don't think it's entirely reasonable to expect every editor/source-code-highlighter/... in the world to incorporate Lua's lexer in order to syntax highlight Lua. Lua is *much* easier to lex than Perl, and somewhat easier to lex than Python, but getting rid of a few rough edges wouldn't hurt, imho.