MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / getlocalattribute

Function getlocalattribute

lib/lua/src/lparser.c:1701–1715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1699
1700
1701static int getlocalattribute (LexState *ls) {
1702 /* ATTRIB -> ['<' Name '>'] */
1703 if (testnext(ls, '<')) {
1704 const char *attr = getstr(str_checkname(ls));
1705 checknext(ls, '>');
1706 if (strcmp(attr, "const") == 0)
1707 return RDKCONST; /* read-only variable */
1708 else if (strcmp(attr, "close") == 0)
1709 return RDKTOCLOSE; /* to-be-closed variable */
1710 else
1711 luaK_semerror(ls,
1712 luaO_pushfstring(ls->L, "unknown attribute '%s'", attr));
1713 }
1714 return VDKREG; /* regular variable */
1715}
1716
1717
1718static void checktoclose (FuncState *fs, 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