MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / repeatstat

Function repeatstat

Source/Misc/lua/src/lua.c:8586–8609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8584
8585
8586static void repeatstat (LexState *ls, int line) {
8587/* repeatstat -> REPEAT block UNTIL cond */
8588int condexit;
8589FuncState *fs = ls->fs;
8590int repeat_init = luaK_getlabel(fs);
8591BlockCnt bl1, bl2;
8592enterblock(fs, &bl1, 1); /* loop block */
8593enterblock(fs, &bl2, 0); /* scope block */
8594luaX_next(ls); /* skip REPEAT */
8595chunk(ls);
8596check_match(ls, TK_UNTIL, TK_REPEAT, line);
8597condexit = cond(ls); /* read condition (inside scope block) */
8598if (!bl2.upval) { /* no upvalues? */
8599leaveblock(fs); /* finish scope */
8600luaK_patchlist(ls->fs, condexit, repeat_init); /* close the loop */
8601}
8602else { /* complete semantics when there are upvalues */
8603breakstat(ls); /* if condition then break */
8604luaK_patchtohere(ls->fs, condexit); /* else... */
8605leaveblock(fs); /* finish scope... */
8606luaK_patchlist(ls->fs, luaK_jump(fs), repeat_init); /* and repeat */
8607}
8608leaveblock(fs); /* finish loop */
8609}
8610
8611
8612static int exp1 (LexState *ls) {

Callers 1

statementFunction · 0.85

Calls 11

luaK_getlabelFunction · 0.85
enterblockFunction · 0.85
luaX_nextFunction · 0.85
chunkFunction · 0.85
condFunction · 0.85
leaveblockFunction · 0.85
luaK_patchlistFunction · 0.85
breakstatFunction · 0.85
luaK_patchtohereFunction · 0.85
luaK_jumpFunction · 0.85
check_matchFunction · 0.70

Tested by

no test coverage detected