| 1315 | |
| 1316 | |
| 1317 | static void repeatstat(LexState *ls, int line) { |
| 1318 | /* repeatstat -> REPEAT block UNTIL cond */ |
| 1319 | int condexit; |
| 1320 | FuncState *fs = ls->fs; |
| 1321 | int repeat_init = luaK_getlabel(fs); |
| 1322 | BlockCnt bl1, bl2; |
| 1323 | enterblock(fs, &bl1, 1); /* loop block */ |
| 1324 | enterblock(fs, &bl2, 0); /* scope block */ |
| 1325 | luaX_next(ls); /* skip REPEAT */ |
| 1326 | statlist(ls); |
| 1327 | check_match(ls, TK_UNTIL, TK_REPEAT, line); |
| 1328 | condexit = cond(ls); /* read condition (inside scope block) */ |
| 1329 | if (bl2.upval) /* upvalues? */ |
| 1330 | luaK_patchclose(fs, condexit, bl2.nactvar); |
| 1331 | leaveblock(fs); /* finish scope */ |
| 1332 | luaK_patchlist(fs, condexit, repeat_init); /* close the loop */ |
| 1333 | leaveblock(fs); /* finish loop */ |
| 1334 | } |
| 1335 | |
| 1336 | |
| 1337 | static int exp1(LexState *ls) { |
no test coverage detected