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

Function checkrepeated

depends/lua/src/lparser.c:1204–1214  ·  view source on GitHub ↗

check for repeated labels on the same block */

Source from the content-addressed store, hash-verified

1202
1203/* check for repeated labels on the same block */
1204static void checkrepeated (FuncState *fs, Labellist *ll, TString *label) {
1205 int i;
1206 for (i = fs->bl->firstlabel; i < ll->n; i++) {
1207 if (eqstr(label, ll->arr[i].name)) {
1208 const char *msg = luaO_pushfstring(fs->ls->L,
1209 "label '%s' already defined on line %d",
1210 getstr(label), ll->arr[i].line);
1211 semerror(fs->ls, msg);
1212 }
1213 }
1214}
1215
1216
1217/* skip no-op statements */

Callers 1

labelstatFunction · 0.85

Calls 2

luaO_pushfstringFunction · 0.85
semerrorFunction · 0.85

Tested by

no test coverage detected