| 1259 | |
| 1260 | |
| 1261 | static void repeatstat (LexState *ls, int line) { |
| 1262 | /* repeatstat -> REPEAT block UNTIL cond */ |
| 1263 | int condexit; |
| 1264 | FuncState *fs = ls->fs; |
| 1265 | int repeat_init = luaK_getlabel(fs); |
| 1266 | BlockCnt bl1, bl2; |
| 1267 | enterblock(fs, &bl1, 1); /* loop block */ |
| 1268 | enterblock(fs, &bl2, 0); /* scope block */ |
| 1269 | luaX_next(ls); /* skip REPEAT */ |
| 1270 | statlist(ls); |
| 1271 | check_match(ls, TK_UNTIL, TK_REPEAT, line); |
| 1272 | condexit = cond(ls); /* read condition (inside scope block) */ |
| 1273 | if (bl2.upval) /* upvalues? */ |
| 1274 | luaK_patchclose(fs, condexit, bl2.nactvar); |
| 1275 | leaveblock(fs); /* finish scope */ |
| 1276 | luaK_patchlist(fs, condexit, repeat_init); /* close the loop */ |
| 1277 | leaveblock(fs); /* finish loop */ |
| 1278 | } |
| 1279 | |
| 1280 | |
| 1281 | static int exp1 (LexState *ls) { |
no test coverage detected