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

Function ifstat

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

Source from the content-addressed store, hash-verified

1143
1144
1145static void ifstat (LexState *ls, int line) {
1146 /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */
1147 FuncState *fs = ls->fs;
1148 int flist;
1149 int escapelist = NO_JUMP;
1150 flist = test_then_block(ls); /* IF cond THEN block */
1151 while (ls->t.token == TK_ELSEIF) {
1152 luaK_concat(fs, &escapelist, luaK_jump(fs));
1153 luaK_patchtohere(fs, flist);
1154 flist = test_then_block(ls); /* ELSEIF cond THEN block */
1155 }
1156 if (ls->t.token == TK_ELSE) {
1157 luaK_concat(fs, &escapelist, luaK_jump(fs));
1158 luaK_patchtohere(fs, flist);
1159 luaX_next(ls); /* skip ELSE (after patch, for correct line info) */
1160 block(ls); /* `else' part */
1161 }
1162 else
1163 luaK_concat(fs, &escapelist, flist);
1164 luaK_patchtohere(fs, escapelist);
1165 check_match(ls, TK_END, TK_IF, line);
1166}
1167
1168
1169static void localfunc (LexState *ls) {

Callers 1

statementFunction · 0.70

Calls 7

test_then_blockFunction · 0.70
luaK_concatFunction · 0.70
luaK_jumpFunction · 0.70
luaK_patchtohereFunction · 0.70
luaX_nextFunction · 0.70
blockFunction · 0.70
check_matchFunction · 0.70

Tested by

no test coverage detected