MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / whilestat

Function whilestat

xrepo/packages/l/lua/port/lua/src/lparser.c:1467–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1465
1466
1467static void whilestat (LexState *ls, int line) {
1468 /* whilestat -> WHILE cond DO block END */
1469 FuncState *fs = ls->fs;
1470 int whileinit;
1471 int condexit;
1472 BlockCnt bl;
1473 luaX_next(ls); /* skip WHILE */
1474 whileinit = luaK_getlabel(fs);
1475 condexit = cond(ls);
1476 enterblock(fs, &bl, 1);
1477 checknext(ls, TK_DO);
1478 block(ls);
1479 luaK_jumpto(fs, whileinit);
1480 check_match(ls, TK_END, TK_WHILE, line);
1481 leaveblock(fs);
1482 luaK_patchtohere(fs, condexit); /* false conditions finish the loop */
1483}
1484
1485
1486static 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