aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-29 11:14:49 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-29 11:14:49 -0200
commitcaf01b5bfa33617b7bb2c40292f74599f6030eba (patch)
tree7ebc6352b89f9c331d693701aa4824a7320195e5 /lparser.c
parentca1f28b829090e99fb82d688dac34b2055d2963e (diff)
downloadlua-caf01b5bfa33617b7bb2c40292f74599f6030eba.tar.gz
lua-caf01b5bfa33617b7bb2c40292f74599f6030eba.tar.bz2
lua-caf01b5bfa33617b7bb2c40292f74599f6030eba.zip
better implementation for list "for"
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lparser.c b/lparser.c
index d796fabd..83496128 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.124 2001/01/15 16:13:24 roberto Exp roberto $ 2** $Id: lparser.c,v 1.125 2001/01/19 13:20:30 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*/
@@ -890,9 +890,10 @@ static void forlist (LexState *ls, TString *indexname) {
890 next(ls); /* skip `in' */ 890 next(ls); /* skip `in' */
891 exp1(ls); /* table */ 891 exp1(ls); /* table */
892 new_localvarstr(ls, "(table)", 0); 892 new_localvarstr(ls, "(table)", 0);
893 new_localvar(ls, indexname, 1); 893 new_localvarstr(ls, "(index)", 1);
894 new_localvar(ls, valname, 2); 894 new_localvar(ls, indexname, 2);
895 forbody(ls, 3, OP_LFORPREP, OP_LFORLOOP); 895 new_localvar(ls, valname, 3);
896 forbody(ls, 4, OP_LFORPREP, OP_LFORLOOP);
896} 897}
897 898
898 899