| 1617 | |
| 1618 | |
| 1619 | static void forstat (LexState *ls, int line) { |
| 1620 | /* forstat -> FOR (fornum | forlist) END */ |
| 1621 | FuncState *fs = ls->fs; |
| 1622 | TString *varname; |
| 1623 | BlockCnt bl; |
| 1624 | enterblock(fs, &bl, 1); /* scope for loop and control variables */ |
| 1625 | luaX_next(ls); /* skip 'for' */ |
| 1626 | varname = str_checkname(ls); /* first variable name */ |
| 1627 | switch (ls->t.token) { |
| 1628 | case '=': fornum(ls, varname, line); break; |
| 1629 | case ',': case TK_IN: forlist(ls, varname); break; |
| 1630 | default: luaX_syntaxerror(ls, "'=' or 'in' expected"); |
| 1631 | } |
| 1632 | check_match(ls, TK_END, TK_FOR, line); |
| 1633 | leaveblock(fs); /* loop scope ('break' jumps to this point) */ |
| 1634 | } |
| 1635 | |
| 1636 | |
| 1637 | static void test_then_block (LexState *ls, int *escapelist) { |
no test coverage detected