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

Function buildglobal

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

Source from the content-addressed store, hash-verified

500
501
502static void buildglobal (LexState *ls, TString *varname, expdesc *var) {
503 FuncState *fs = ls->fs;
504 expdesc key;
505 init_exp(var, VGLOBAL, -1); /* global by default */
506 singlevaraux(fs, ls->envn, var, 1); /* get environment variable */
507 if (var->k == VGLOBAL)
508 luaK_semerror(ls, "%s is global when accessing variable '%s'",
509 LUA_ENV, getstr(varname));
510 luaK_exp2anyregup(fs, var); /* _ENV could be a constant */
511 codestring(&key, varname); /* key is variable name */
512 luaK_indexed(fs, var, &key); /* 'var' represents _ENV[varname] */
513}
514
515
516/*

Callers 4

buildvarFunction · 0.85
checkglobalFunction · 0.85
initglobalFunction · 0.85
globalfuncFunction · 0.85

Calls 6

init_expFunction · 0.70
singlevarauxFunction · 0.70
luaK_semerrorFunction · 0.70
luaK_exp2anyregupFunction · 0.70
codestringFunction · 0.70
luaK_indexedFunction · 0.70

Tested by

no test coverage detected