MCPcopy Create free account
hub / github.com/DFHack/dfhack / singlevar

Function singlevar

depends/lua/src/lparser.c:295–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293
294
295static void singlevar (LexState *ls, expdesc *var) {
296 TString *varname = str_checkname(ls);
297 FuncState *fs = ls->fs;
298 singlevaraux(fs, varname, var, 1);
299 if (var->k == VVOID) { /* global name? */
300 expdesc key;
301 singlevaraux(fs, ls->envn, var, 1); /* get environment variable */
302 lua_assert(var->k != VVOID); /* this one must exist */
303 codestring(ls, &key, varname); /* key is variable name */
304 luaK_indexed(fs, var, &key); /* env[varname] */
305 }
306}
307
308
309static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {

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