lua-users home
lua-l archive

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


Hi,

I had a first look into the new release and noticed, that
the constructors are still broken.  A { foo"bar" } tries
to call function bar.  The problem is within the lookahead
function.  The lexval of the current token is overwritten
and that of the lookahead one dropped.  This patch will
fix it but IMHO a cleaner solution would be to pass an
additional struct Token to luaX_lex.

Ciao, ET.

--- lua-4b-orig/src/lparser.c   Wed Sep 20 19:57:08 2000
+++ lua-4b/src/lparser.c        Fri Sep 22 22:27:01 2000
@@ -65,8 +65,12 @@
 
 
 static void lookahead (LexState *ls) {
+  struct Token t;
   LUA_ASSERT(ls->lookahead.token == TK_EOS, "two look-aheads");
+  t.seminfo = ls->t.seminfo;
   ls->lookahead.token = luaX_lex(ls);
+  ls->lookahead.seminfo = ls->t.seminfo;
+  ls->t.seminfo = t.seminfo;
 }