diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-06-28 17:21:06 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-06-28 17:21:06 -0300 |
commit | 014a09c5095be3ef11366530e4630ee817a526a7 (patch) | |
tree | 1460ff0d01cd4adf8fac2609ca2ba90411babf2c /lparser.c | |
parent | b62228297372c7b24b6661ac1bdd7df2e8ece64e (diff) | |
download | lua-014a09c5095be3ef11366530e4630ee817a526a7.tar.gz lua-014a09c5095be3ef11366530e4630ee817a526a7.tar.bz2 lua-014a09c5095be3ef11366530e4630ee817a526a7.zip |
better error messages
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.99 2000/06/26 19:28:31 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.100 2000/06/28 17:06:07 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 | */ |
@@ -154,7 +154,7 @@ static int checkname (LexState *ls) { | |||
154 | 154 | ||
155 | static void luaI_registerlocalvar (LexState *ls, TString *varname, int pc) { | 155 | static void luaI_registerlocalvar (LexState *ls, TString *varname, int pc) { |
156 | FuncState *fs = ls->fs; | 156 | FuncState *fs = ls->fs; |
157 | if (fs->f->debug) { | 157 | if (fs->debug) { |
158 | Proto *f = fs->f; | 158 | Proto *f = fs->f; |
159 | luaM_growvector(ls->L, f->locvars, fs->nvars, 1, LocVar, "", MAX_INT); | 159 | luaM_growvector(ls->L, f->locvars, fs->nvars, 1, LocVar, "", MAX_INT); |
160 | f->locvars[fs->nvars].varname = varname; | 160 | f->locvars[fs->nvars].varname = varname; |
@@ -359,7 +359,7 @@ Proto *luaY_parser (lua_State *L, ZIO *z) { | |||
359 | luaX_setinput(L, &lexstate, z, luaS_new(L, zname(z))); | 359 | luaX_setinput(L, &lexstate, z, luaS_new(L, zname(z))); |
360 | open_func(&lexstate, &funcstate); | 360 | open_func(&lexstate, &funcstate); |
361 | next(&lexstate); /* read first token */ | 361 | next(&lexstate); /* read first token */ |
362 | funcstate.f->debug = L->debug; /* previous `next' may scan a pragma */ | 362 | funcstate.debug = L->debug; /* previous `next' may scan a pragma */ |
363 | chunk(&lexstate); | 363 | chunk(&lexstate); |
364 | check_condition(&lexstate, (lexstate.t.token == TK_EOS), "<eof> expected"); | 364 | check_condition(&lexstate, (lexstate.t.token == TK_EOS), "<eof> expected"); |
365 | close_func(&lexstate); | 365 | close_func(&lexstate); |
@@ -1085,7 +1085,7 @@ static void body (LexState *ls, int needself, int line) { | |||
1085 | FuncState new_fs; | 1085 | FuncState new_fs; |
1086 | open_func(ls, &new_fs); | 1086 | open_func(ls, &new_fs); |
1087 | new_fs.f->lineDefined = line; | 1087 | new_fs.f->lineDefined = line; |
1088 | new_fs.f->debug = ls->L->debug; | 1088 | new_fs.debug = ls->L->debug; |
1089 | check(ls, '('); | 1089 | check(ls, '('); |
1090 | if (needself) { | 1090 | if (needself) { |
1091 | new_localvarstr(ls, "self", 0); | 1091 | new_localvarstr(ls, "self", 0); |