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

Function globalnames

third-party/lua-5.5.0/src/lparser.c:1915–1928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1913
1914
1915static void globalnames (LexState *ls, lu_byte defkind) {
1916 FuncState *fs = ls->fs;
1917 int nvars = 0;
1918 int lastidx; /* index of last registered variable */
1919 do { /* for each name */
1920 TString *vname = str_checkname(ls);
1921 lu_byte kind = getglobalattribute(ls, defkind);
1922 lastidx = new_varkind(ls, vname, kind);
1923 nvars++;
1924 } while (testnext(ls, ','));
1925 if (testnext(ls, '=')) /* initialization? */
1926 initglobal(ls, nvars, lastidx - nvars + 1, 0, ls->linenumber);
1927 fs->nactvar = cast_short(fs->nactvar + nvars); /* activate declaration */
1928}
1929
1930
1931static void globalstat (LexState *ls) {

Callers 1

globalstatFunction · 0.85

Calls 5

getglobalattributeFunction · 0.85
new_varkindFunction · 0.85
initglobalFunction · 0.85
str_checknameFunction · 0.70
testnextFunction · 0.70

Tested by

no test coverage detected