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

Function getlocalattribute

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

Source from the content-addressed store, hash-verified

1687
1688
1689static int getlocalattribute (LexState *ls) {
1690 /* ATTRIB -> ['<' Name '>'] */
1691 if (testnext(ls, '<')) {
1692 const char *attr = getstr(str_checkname(ls));
1693 checknext(ls, '>');
1694 if (strcmp(attr, "const") == 0)
1695 return RDKCONST; /* read-only variable */
1696 else if (strcmp(attr, "close") == 0)
1697 return RDKTOCLOSE; /* to-be-closed variable */
1698 else
1699 luaK_semerror(ls,
1700 luaO_pushfstring(ls->L, "unknown attribute '%s'", attr));
1701 }
1702 return VDKREG; /* regular variable */
1703}
1704
1705
1706static void checktoclose (LexState *ls, int level) {

Callers 1

localstatFunction · 0.85

Calls 5

testnextFunction · 0.85
str_checknameFunction · 0.85
checknextFunction · 0.85
luaK_semerrorFunction · 0.85
luaO_pushfstringFunction · 0.85

Tested by

no test coverage detected