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

Function whilestat

depends/lua/src/lparser.c:1242–1258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1240
1241
1242static 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
1261static void repeatstat (LexState *ls, int line) {

Callers 1

statementFunction · 0.85

Calls 9

luaX_nextFunction · 0.85
luaK_getlabelFunction · 0.85
condFunction · 0.85
enterblockFunction · 0.85
checknextFunction · 0.85
blockFunction · 0.85
check_matchFunction · 0.85
leaveblockFunction · 0.85
luaK_patchtohereFunction · 0.85

Tested by

no test coverage detected