diff options
Diffstat (limited to 'lparser.c')
-rw-r--r-- | lparser.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.90 2010/07/07 16:27:29 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.91 2010/08/23 17:32:34 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -289,7 +289,7 @@ static void singlevar (LexState *ls, expdesc *var) { | |||
289 | FuncState *fs = ls->fs; | 289 | FuncState *fs = ls->fs; |
290 | if (singlevaraux(fs, varname, var, 1) == VVOID) { /* global name? */ | 290 | if (singlevaraux(fs, varname, var, 1) == VVOID) { /* global name? */ |
291 | expdesc key; | 291 | expdesc key; |
292 | singlevaraux(fs, ls->envn, var, 1); /* get _ENV variable */ | 292 | singlevaraux(fs, ls->envn, var, 1); /* get environment variable */ |
293 | lua_assert(var->k == VLOCAL || var->k == VUPVAL); | 293 | lua_assert(var->k == VLOCAL || var->k == VUPVAL); |
294 | codestring(ls, &key, varname); /* key is variable name */ | 294 | codestring(ls, &key, varname); /* key is variable name */ |
295 | luaK_indexed(fs, var, &key); /* env[varname] */ | 295 | luaK_indexed(fs, var, &key); /* env[varname] */ |
@@ -433,14 +433,14 @@ static void close_func (LexState *ls) { | |||
433 | 433 | ||
434 | /* | 434 | /* |
435 | ** opens the main function, which is a regular vararg function with an | 435 | ** opens the main function, which is a regular vararg function with an |
436 | ** upvalue named '_ENV' | 436 | ** upvalue named LUA_ENV |
437 | */ | 437 | */ |
438 | static void open_mainfunc (LexState *ls, FuncState *fs) { | 438 | static void open_mainfunc (LexState *ls, FuncState *fs) { |
439 | expdesc v; | 439 | expdesc v; |
440 | open_func(ls, fs); | 440 | open_func(ls, fs); |
441 | fs->f->is_vararg = 1; /* main function is always vararg */ | 441 | fs->f->is_vararg = 1; /* main function is always vararg */ |
442 | init_exp(&v, VLOCAL, 0); | 442 | init_exp(&v, VLOCAL, 0); |
443 | newupvalue(fs, ls->envn, &v); /* create '_ENV' upvalue */ | 443 | newupvalue(fs, ls->envn, &v); /* create environment upvalue */ |
444 | } | 444 | } |
445 | 445 | ||
446 | 446 | ||