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