diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-20 18:07:57 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-20 18:07:57 -0300 |
commit | fccadba4b54f8e13c8b9cfc97307f53931496936 (patch) | |
tree | 12c65eb6653b386358b932794fa7afb9c48ae6bb /lparser.c | |
parent | b940f09984b47979caf8142046e1fe813e531e3d (diff) | |
download | lua-fccadba4b54f8e13c8b9cfc97307f53931496936.tar.gz lua-fccadba4b54f8e13c8b9cfc97307f53931496936.tar.bz2 lua-fccadba4b54f8e13c8b9cfc97307f53931496936.zip |
new reserved words `in' and `global'
Diffstat (limited to 'lparser.c')
-rw-r--r-- | lparser.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 1.148 2001/06/11 14:56:42 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.149 2001/06/12 14:36:48 roberto Exp roberto $ |
3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -960,12 +960,7 @@ static void forlist (LexState *ls, TString *indexname) { | |||
960 | TString *valname; | 960 | TString *valname; |
961 | check(ls, l_c(',')); | 961 | check(ls, l_c(',')); |
962 | valname = str_checkname(ls); | 962 | valname = str_checkname(ls); |
963 | /* next test is dirty, but avoids `in' being a reserved word */ | 963 | check(ls, TK_IN); |
964 | check_condition(ls, | ||
965 | (ls->t.token == TK_NAME && | ||
966 | ls->t.seminfo.ts == luaS_newliteral(ls->L, l_s("in"))), | ||
967 | l_s("`in' expected")); | ||
968 | next(ls); /* skip `in' */ | ||
969 | exp1(ls); /* table */ | 964 | exp1(ls); /* table */ |
970 | new_localvarstr(ls, l_s("(table)"), 0); | 965 | new_localvarstr(ls, l_s("(table)"), 0); |
971 | new_localvarstr(ls, l_s("(index)"), 1); | 966 | new_localvarstr(ls, l_s("(index)"), 1); |