MCPcopy Create free account
hub / github.com/Cubitect/cubiomes-viewer / singlevar

Function singlevar

lua/src/lparser.c:463–474  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

461** too.
462*/
463static void singlevar (LexState *ls, expdesc *var) {
464 TString *varname = str_checkname(ls);
465 FuncState *fs = ls->fs;
466 singlevaraux(fs, varname, var, 1);
467 if (var->k == VVOID) { /* global name? */
468 expdesc key;
469 singlevaraux(fs, ls->envn, var, 1); /* get environment variable */
470 lua_assert(var->k != VVOID); /* this one must exist */
471 codestring(&key, varname); /* key is variable name */
472 luaK_indexed(fs, var, &key); /* env[varname] */
473 }
474}
475
476
477/*

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