aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llex.c5
-rw-r--r--llex.h4
-rw-r--r--lparser.c5
3 files changed, 7 insertions, 7 deletions
diff --git a/llex.c b/llex.c
index 4bbe6cfb..adb3527c 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 2.23 2006/09/18 16:06:41 roberto Exp roberto $ 2** $Id: llex.c,v 2.24 2007/02/07 17:49:18 roberto Exp roberto $
3** Lexical Analyzer 3** Lexical Analyzer
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -442,8 +442,9 @@ void luaX_next (LexState *ls) {
442} 442}
443 443
444 444
445void luaX_lookahead (LexState *ls) { 445int luaX_lookahead (LexState *ls) {
446 lua_assert(ls->lookahead.token == TK_EOS); 446 lua_assert(ls->lookahead.token == TK_EOS);
447 ls->lookahead.token = llex(ls, &ls->lookahead.seminfo); 447 ls->lookahead.token = llex(ls, &ls->lookahead.seminfo);
448 return ls->lookahead.token;
448} 449}
449 450
diff --git a/llex.h b/llex.h
index fedcbc9e..0148a17f 100644
--- a/llex.h
+++ b/llex.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.h,v 1.58 2006/03/23 18:23:32 roberto Exp roberto $ 2** $Id: llex.h,v 1.59 2007/02/07 17:49:18 roberto Exp roberto $
3** Lexical Analyzer 3** Lexical Analyzer
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -68,7 +68,7 @@ LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z,
68 TString *source); 68 TString *source);
69LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l); 69LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l);
70LUAI_FUNC void luaX_next (LexState *ls); 70LUAI_FUNC void luaX_next (LexState *ls);
71LUAI_FUNC void luaX_lookahead (LexState *ls); 71LUAI_FUNC int luaX_lookahead (LexState *ls);
72LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token); 72LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token);
73LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s); 73LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);
74LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); 74LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
diff --git a/lparser.c b/lparser.c
index dce3db5c..8468ab0e 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 2.51 2007/02/07 17:49:18 roberto Exp roberto $ 2** $Id: lparser.c,v 2.52 2007/03/27 14:11:38 roberto Exp roberto $
3** Lua Parser 3** Lua Parser
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -522,8 +522,7 @@ static void constructor (LexState *ls, expdesc *t) {
522 closelistfield(fs, &cc); 522 closelistfield(fs, &cc);
523 switch(ls->t.token) { 523 switch(ls->t.token) {
524 case TK_NAME: { /* may be listfields or recfields */ 524 case TK_NAME: { /* may be listfields or recfields */
525 luaX_lookahead(ls); 525 if (luaX_lookahead(ls) != '=') /* expression? */
526 if (ls->lookahead.token != '=') /* expression? */
527 listfield(ls, &cc); 526 listfield(ls, &cc);
528 else 527 else
529 recfield(ls, &cc); 528 recfield(ls, &cc);