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 1.130 2001/02/08 11:19:10 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.131 2001/02/09 18:37:33 roberto Exp roberto $ |
| 3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -209,7 +209,7 @@ static int search_local (LexState *ls, TString *n, expdesc *var) { | |||
| 209 | static void singlevar (LexState *ls, TString *n, expdesc *var) { | 209 | static void singlevar (LexState *ls, TString *n, expdesc *var) { |
| 210 | int level = search_local(ls, n, var); | 210 | int level = search_local(ls, n, var); |
| 211 | if (level >= 1) /* neither local (0) nor global (-1)? */ | 211 | if (level >= 1) /* neither local (0) nor global (-1)? */ |
| 212 | luaX_syntaxerror(ls, "cannot access a variable in outer scope", n->str); | 212 | luaX_syntaxerror(ls, "cannot access a variable in outer scope", getstr(n)); |
| 213 | else if (level == -1) /* global? */ | 213 | else if (level == -1) /* global? */ |
| 214 | var->u.index = string_constant(ls->fs, n); | 214 | var->u.index = string_constant(ls->fs, n); |
| 215 | } | 215 | } |
| @@ -235,12 +235,12 @@ static void pushupvalue (LexState *ls, TString *n) { | |||
| 235 | int level = search_local(ls, n, &v); | 235 | int level = search_local(ls, n, &v); |
| 236 | if (level == -1) { /* global? */ | 236 | if (level == -1) { /* global? */ |
| 237 | if (fs->prev == NULL) | 237 | if (fs->prev == NULL) |
| 238 | luaX_syntaxerror(ls, "cannot access an upvalue at top level", n->str); | 238 | luaX_syntaxerror(ls, "cannot access an upvalue at top level", getstr(n)); |
| 239 | v.u.index = string_constant(fs->prev, n); | 239 | v.u.index = string_constant(fs->prev, n); |
| 240 | } | 240 | } |
| 241 | else if (level != 1) | 241 | else if (level != 1) |
| 242 | luaX_syntaxerror(ls, | 242 | luaX_syntaxerror(ls, |
| 243 | "upvalue must be global or local to immediately outer scope", n->str); | 243 | "upvalue must be global or local to immediately outer scope", getstr(n)); |
| 244 | luaK_code1(fs, OP_PUSHUPVALUE, indexupvalue(ls, &v)); | 244 | luaK_code1(fs, OP_PUSHUPVALUE, indexupvalue(ls, &v)); |
| 245 | } | 245 | } |
| 246 | 246 | ||
