MCPcopy Create free account
hub / github.com/DFHack/dfhack / gotostat

Function gotostat

depends/lua/src/lparser.c:1188–1200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1186
1187
1188static void gotostat (LexState *ls, int pc) {
1189 int line = ls->linenumber;
1190 TString *label;
1191 int g;
1192 if (testnext(ls, TK_GOTO))
1193 label = str_checkname(ls);
1194 else {
1195 luaX_next(ls); /* skip break */
1196 label = luaS_new(ls->L, "break");
1197 }
1198 g = newlabelentry(ls, &ls->dyd->gt, label, line, pc);
1199 findlabel(ls, g); /* close it if label already defined */
1200}
1201
1202
1203/* check for repeated labels on the same block */

Callers 2

test_then_blockFunction · 0.85
statementFunction · 0.85

Calls 6

testnextFunction · 0.85
str_checknameFunction · 0.85
luaX_nextFunction · 0.85
luaS_newFunction · 0.85
newlabelentryFunction · 0.85
findlabelFunction · 0.85

Tested by 1

test_then_blockFunction · 0.68