MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / checkrepeated

Function checkrepeated

third-party/lua-5.2.4/src/lparser.c:1195–1205  ·  view source on GitHub ↗

check for repeated labels on the same block */

Source from the content-addressed store, hash-verified

1193
1194/* check for repeated labels on the same block */
1195static void checkrepeated (FuncState *fs, Labellist *ll, TString *label) {
1196 int i;
1197 for (i = fs->bl->firstlabel; i < ll->n; i++) {
1198 if (luaS_eqstr(label, ll->arr[i].name)) {
1199 const char *msg = luaO_pushfstring(fs->ls->L,
1200 "label " LUA_QS " already defined on line %d",
1201 getstr(label), ll->arr[i].line);
1202 semerror(fs->ls, msg);
1203 }
1204 }
1205}
1206
1207
1208/* skip no-op statements */

Callers 1

labelstatFunction · 0.70

Calls 3

luaS_eqstrFunction · 0.70
luaO_pushfstringFunction · 0.70
semerrorFunction · 0.70

Tested by

no test coverage detected