MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / whilestat

Function whilestat

3rd/lua-5.4.3/src/lparser.c:1456–1472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1454
1455
1456static void whilestat (LexState *ls, int line) {
1457 /* whilestat -> WHILE cond DO block END */
1458 FuncState *fs = ls->fs;
1459 int whileinit;
1460 int condexit;
1461 BlockCnt bl;
1462 luaX_next(ls); /* skip WHILE */
1463 whileinit = luaK_getlabel(fs);
1464 condexit = cond(ls);
1465 enterblock(fs, &bl, 1);
1466 checknext(ls, TK_DO);
1467 block(ls);
1468 luaK_jumpto(fs, whileinit);
1469 check_match(ls, TK_END, TK_WHILE, line);
1470 leaveblock(fs);
1471 luaK_patchtohere(fs, condexit); /* false conditions finish the loop */
1472}
1473
1474
1475static 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