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

Function globalfunc

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

Source from the content-addressed store, hash-verified

1945
1946
1947static void globalfunc (LexState *ls, int line) {
1948 /* globalfunc -> (GLOBAL FUNCTION) NAME body */
1949 expdesc var, b;
1950 FuncState *fs = ls->fs;
1951 TString *fname = str_checkname(ls);
1952 new_varkind(ls, fname, GDKREG); /* declare global variable */
1953 fs->nactvar++; /* enter its scope */
1954 buildglobal(ls, fname, &var);
1955 body(ls, &b, 0, ls->linenumber); /* compile and return closure in 'b' */
1956 checkglobal(ls, fname, line);
1957 luaK_storevar(fs, &var, &b);
1958 luaK_fixline(fs, line); /* definition "happens" in the first line */
1959}
1960
1961
1962static void globalstatfunc (LexState *ls, int line) {

Callers 1

globalstatfuncFunction · 0.85

Calls 7

new_varkindFunction · 0.85
buildglobalFunction · 0.85
checkglobalFunction · 0.85
str_checknameFunction · 0.70
bodyFunction · 0.70
luaK_storevarFunction · 0.70
luaK_fixlineFunction · 0.70

Tested by

no test coverage detected