| 1465 | |
| 1466 | |
| 1467 | static void whilestat (LexState *ls, int line) { |
| 1468 | /* whilestat -> WHILE cond DO block END */ |
| 1469 | FuncState *fs = ls->fs; |
| 1470 | int whileinit; |
| 1471 | int condexit; |
| 1472 | BlockCnt bl; |
| 1473 | luaX_next(ls); /* skip WHILE */ |
| 1474 | whileinit = luaK_getlabel(fs); |
| 1475 | condexit = cond(ls); |
| 1476 | enterblock(fs, &bl, 1); |
| 1477 | checknext(ls, TK_DO); |
| 1478 | block(ls); |
| 1479 | luaK_jumpto(fs, whileinit); |
| 1480 | check_match(ls, TK_END, TK_WHILE, line); |
| 1481 | leaveblock(fs); |
| 1482 | luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ |
| 1483 | } |
| 1484 | |
| 1485 | |
| 1486 | static void repeatstat (LexState *ls, int line) { |
no test coverage detected