| 1454 | |
| 1455 | |
| 1456 | static void whilestat (LexState *ls, int line) { |
| 1457 | /* whilestat -> WHILE cond DO block END */ |
| 1458 | FuncState *fs = ls->fs; |
| 1459 | int whileinit; |
| 1460 | int condexit; |
| 1461 | BlockCnt bl; |
| 1462 | luaX_next(ls); /* skip WHILE */ |
| 1463 | whileinit = luaK_getlabel(fs); |
| 1464 | condexit = cond(ls); |
| 1465 | enterblock(fs, &bl, 1); |
| 1466 | checknext(ls, TK_DO); |
| 1467 | block(ls); |
| 1468 | luaK_jumpto(fs, whileinit); |
| 1469 | check_match(ls, TK_END, TK_WHILE, line); |
| 1470 | leaveblock(fs); |
| 1471 | luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ |
| 1472 | } |
| 1473 | |
| 1474 | |
| 1475 | static void repeatstat (LexState *ls, int line) { |
no test coverage detected