MCPcopy Create free account
hub / github.com/F-Stack/f-stack / repeatstat

Function repeatstat

app/redis-6.2.6/deps/lua/src/lparser.c:1014–1037  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012
1013
1014static void repeatstat (LexState *ls, int line) {
1015 /* repeatstat -> REPEAT block UNTIL cond */
1016 int condexit;
1017 FuncState *fs = ls->fs;
1018 int repeat_init = luaK_getlabel(fs);
1019 BlockCnt bl1, bl2;
1020 enterblock(fs, &bl1, 1); /* loop block */
1021 enterblock(fs, &bl2, 0); /* scope block */
1022 luaX_next(ls); /* skip REPEAT */
1023 chunk(ls);
1024 check_match(ls, TK_UNTIL, TK_REPEAT, line);
1025 condexit = cond(ls); /* read condition (inside scope block) */
1026 if (!bl2.upval) { /* no upvalues? */
1027 leaveblock(fs); /* finish scope */
1028 luaK_patchlist(ls->fs, condexit, repeat_init); /* close the loop */
1029 }
1030 else { /* complete semantics when there are upvalues */
1031 breakstat(ls); /* if condition then break */
1032 luaK_patchtohere(ls->fs, condexit); /* else... */
1033 leaveblock(fs); /* finish scope... */
1034 luaK_patchlist(ls->fs, luaK_jump(fs), repeat_init); /* and repeat */
1035 }
1036 leaveblock(fs); /* finish loop */
1037}
1038
1039
1040static int exp1 (LexState *ls) {

Callers 1

statementFunction · 0.70

Calls 11

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

Tested by

no test coverage detected