| 989 | |
| 990 | |
| 991 | static void whilestat (LexState *ls, int line) { |
| 992 | /* whilestat -> WHILE cond DO block END */ |
| 993 | FuncState *fs = ls->fs; |
| 994 | int whileinit; |
| 995 | int condexit; |
| 996 | BlockCnt bl; |
| 997 | luaX_next(ls); /* skip WHILE */ |
| 998 | whileinit = luaK_getlabel(fs); |
| 999 | condexit = cond(ls); |
| 1000 | enterblock(fs, &bl, 1); |
| 1001 | checknext(ls, TK_DO); |
| 1002 | block(ls); |
| 1003 | luaK_patchlist(fs, luaK_jump(fs), whileinit); |
| 1004 | check_match(ls, TK_END, TK_WHILE, line); |
| 1005 | leaveblock(fs); |
| 1006 | luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ |
| 1007 | } |
| 1008 | |
| 1009 | |
| 1010 | static void repeatstat (LexState *ls, int line) { |
no test coverage detected