MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / singlevar

Function singlevar

extlibs/lua/src/lparser.c:444–455  ·  view source on GitHub ↗

** Find a variable with the given name 'n', handling global variables ** too. */

Source from the content-addressed store, hash-verified

442** too.
443*/
444static void singlevar (LexState *ls, expdesc *var) {
445 TString *varname = str_checkname(ls);
446 FuncState *fs = ls->fs;
447 singlevaraux(fs, varname, var, 1);
448 if (var->k == VVOID) { /* global name? */
449 expdesc key;
450 singlevaraux(fs, ls->envn, var, 1); /* get environment variable */
451 lua_assert(var->k != VVOID); /* this one must exist */
452 codestring(&key, varname); /* key is variable name */
453 luaK_indexed(fs, var, &key); /* env[varname] */
454 }
455}
456
457
458/*

Callers 2

primaryexpFunction · 0.85
funcnameFunction · 0.85

Calls 4

str_checknameFunction · 0.85
singlevarauxFunction · 0.85
codestringFunction · 0.85
luaK_indexedFunction · 0.85

Tested by

no test coverage detected