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