MCPcopy Create free account
hub / github.com/DFHack/dfhack / repeatstat

Function repeatstat

depends/lua/src/lparser.c:1261–1278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1259
1260
1261static 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
1281static int exp1 (LexState *ls) {

Callers 1

statementFunction · 0.85

Calls 9

luaK_getlabelFunction · 0.85
enterblockFunction · 0.85
luaX_nextFunction · 0.85
statlistFunction · 0.85
check_matchFunction · 0.85
condFunction · 0.85
luaK_patchcloseFunction · 0.85
leaveblockFunction · 0.85
luaK_patchlistFunction · 0.85

Tested by

no test coverage detected