| 1363 | |
| 1364 | |
| 1365 | static void forstat (LexState *ls, int line) { |
| 1366 | /* forstat -> FOR (fornum | forlist) END */ |
| 1367 | FuncState *fs = ls->fs; |
| 1368 | TString *varname; |
| 1369 | BlockCnt bl; |
| 1370 | enterblock(fs, &bl, 1); /* scope for loop and control variables */ |
| 1371 | luaX_next(ls); /* skip 'for' */ |
| 1372 | varname = str_checkname(ls); /* first variable name */ |
| 1373 | switch (ls->t.token) { |
| 1374 | case '=': fornum(ls, varname, line); break; |
| 1375 | case ',': case TK_IN: forlist(ls, varname); break; |
| 1376 | default: luaX_syntaxerror(ls, "'=' or 'in' expected"); |
| 1377 | } |
| 1378 | check_match(ls, TK_END, TK_FOR, line); |
| 1379 | leaveblock(fs); /* loop scope ('break' jumps to this point) */ |
| 1380 | } |
| 1381 | |
| 1382 | |
| 1383 | static void test_then_block (LexState *ls, int *escapelist) { |
no test coverage detected