lua-users home
lua-l archive

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


This is correct code:
       if a then (x)(2) end

This isn't:
       if a (x)(2) end

Ok, that certainly explains why testnext() isn't the default behavior :)

As best as I can tell, the patch implies that an implicit "then" is placed at the end of the maximally long complete _expression_ immediately following the if? So, "if (a) (x)(2) end" becomes an abbreviation for "if (a)(x)(2) then end"?

That's a little dangerous, but, compared to the sorts of obscure parse rules people have gotten used to dealing with in C++, it doesn't seem that bad...  Maybe the patch is still worth posting on the wiki, provided an appropriate warning about the occasional need to use an explicit "then" to break up potentially ambiguous sequences of expressions?