MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / checkrepeated

Function checkrepeated

3rd/lua-5.4.3/src/lparser.c:1436–1443  ·  view source on GitHub ↗

** Check whether there is already a label with the given 'name'. */

Source from the content-addressed store, hash-verified

1434** Check whether there is already a label with the given 'name'.
1435*/
1436static void checkrepeated (LexState *ls, TString *name) {
1437 Labeldesc *lb = findlabel(ls, name);
1438 if (l_unlikely(lb != NULL)) { /* already defined? */
1439 const char *msg = "label '%s' already defined on line %d";
1440 msg = luaO_pushfstring(ls->L, msg, getstr(name), lb->line);
1441 luaK_semerror(ls, msg); /* error */
1442 }
1443}
1444
1445
1446static void labelstat (LexState *ls, TString *name, int line) {

Callers 1

labelstatFunction · 0.85

Calls 3

findlabelFunction · 0.85
luaO_pushfstringFunction · 0.85
luaK_semerrorFunction · 0.85

Tested by

no test coverage detected