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