| 1231 | |
| 1232 | |
| 1233 | static void whilestat (LexState *ls, int line) { |
| 1234 | /* whilestat -> WHILE cond DO block END */ |
| 1235 | FuncState *fs = ls->fs; |
| 1236 | int whileinit; |
| 1237 | int condexit; |
| 1238 | BlockCnt bl; |
| 1239 | luaX_next(ls); /* skip WHILE */ |
| 1240 | whileinit = luaK_getlabel(fs); |
| 1241 | condexit = cond(ls); |
| 1242 | enterblock(fs, &bl, 1); |
| 1243 | checknext(ls, TK_DO); |
| 1244 | block(ls); |
| 1245 | luaK_jumpto(fs, whileinit); |
| 1246 | check_match(ls, TK_END, TK_WHILE, line); |
| 1247 | leaveblock(fs); |
| 1248 | luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ |
| 1249 | } |
| 1250 | |
| 1251 | |
| 1252 | static void repeatstat (LexState *ls, int line) { |
no test coverage detected