better implementation for list "for"
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lparser.c,v 1.124 2001/01/15 16:13:24 roberto Exp roberto $
|
||||
** $Id: lparser.c,v 1.125 2001/01/19 13:20:30 roberto Exp roberto $
|
||||
** LL(1) Parser and code generator for Lua
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -890,9 +890,10 @@ static void forlist (LexState *ls, TString *indexname) {
|
||||
next(ls); /* skip `in' */
|
||||
exp1(ls); /* table */
|
||||
new_localvarstr(ls, "(table)", 0);
|
||||
new_localvar(ls, indexname, 1);
|
||||
new_localvar(ls, valname, 2);
|
||||
forbody(ls, 3, OP_LFORPREP, OP_LFORLOOP);
|
||||
new_localvarstr(ls, "(index)", 1);
|
||||
new_localvar(ls, indexname, 2);
|
||||
new_localvar(ls, valname, 3);
|
||||
forbody(ls, 4, OP_LFORPREP, OP_LFORLOOP);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user