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

Function labelstat

depends/lua/src/lparser.c:1224–1239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1222
1223
1224static void labelstat (LexState *ls, TString *label, int line) {
1225 /* label -> '::' NAME '::' */
1226 FuncState *fs = ls->fs;
1227 Labellist *ll = &ls->dyd->label;
1228 int l; /* index of new label being created */
1229 checkrepeated(fs, ll, label); /* check for repeated labels */
1230 checknext(ls, TK_DBCOLON); /* skip double colon */
1231 /* create new entry for this label */
1232 l = newlabelentry(ls, ll, label, line, luaK_getlabel(fs));
1233 skipnoopstat(ls); /* skip other no-op statements */
1234 if (block_follow(ls, 0)) { /* label is last no-op statement in the block? */
1235 /* assume that locals are already out of scope */
1236 ll->arr[l].nactvar = fs->bl->nactvar;
1237 }
1238 findgotos(ls, &ll->arr[l]);
1239}
1240
1241
1242static void whilestat (LexState *ls, int line) {

Callers 1

statementFunction · 0.85

Calls 7

checkrepeatedFunction · 0.85
checknextFunction · 0.85
newlabelentryFunction · 0.85
luaK_getlabelFunction · 0.85
skipnoopstatFunction · 0.85
block_followFunction · 0.85
findgotosFunction · 0.85

Tested by

no test coverage detected