[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: syntax likes and dislikes (RE: Evaluating LUA)
- From: "John Passaniti" <jpass@...>
- Date: Mon, 12 Aug 2002 16:09:21 -0400
> Well, 'end' is hard to get rid of, but 'then'
> is already totally unneeded by the compiler.
> It could be made optional by tweaking one line
> of code, with zero side effects. Same goes for
> the "do" following "for" and "while" loops,
> totally unneeded.
I had always just assumed that 'DO' and 'THEN' were necessary because of
some ambiguity regarding parsing the conditional expression prior to it.
But after reading your message, I looked deeper and found that DO and
THEN do indeed seem superfluous.
Here's a diff off the current version, on lparser.c. Works for me!
Would be nice if the Lua authors considered making DO and THEN optional.
811c811
< check(ls, TK_DO);
---
> optional(ls, TK_DO);
841c841
< check(ls, TK_DO);
---
> optional(ls, TK_DO);
908c908
< check(ls, TK_THEN);
---
> optional(ls, TK_THEN);