| 500 | |
| 501 | |
| 502 | static 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 | /* |
no test coverage detected