diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-22 15:52:20 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-22 15:52:20 -0200 |
| commit | fae0b5282562cb1814f1bcaf9a6eb25cb0d37111 (patch) | |
| tree | 0cde48a2eca767e56364285b153773477e391502 | |
| parent | 22439a7511f45c4180e532857a4f831046460778 (diff) | |
| download | lua-fae0b5282562cb1814f1bcaf9a6eb25cb0d37111.tar.gz lua-fae0b5282562cb1814f1bcaf9a6eb25cb0d37111.tar.bz2 lua-fae0b5282562cb1814f1bcaf9a6eb25cb0d37111.zip | |
small bugs in error report
| -rw-r--r-- | lapi.c | 6 | ||||
| -rw-r--r-- | llex.c | 6 |
2 files changed, 7 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 1.14 1997/12/15 16:17:20 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.15 1997/12/18 18:32:39 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -60,7 +60,7 @@ static void set_normalized (TObject *d, TObject *s) | |||
| 60 | 60 | ||
| 61 | static TObject *luaA_protovalue (TObject *o) | 61 | static TObject *luaA_protovalue (TObject *o) |
| 62 | { | 62 | { |
| 63 | return (ttype(o) == LUA_T_CLOSURE) ? protovalue(o) : o; | 63 | return (normalized_type(o) == LUA_T_CLOSURE) ? protovalue(o) : o; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | 66 | ||
| @@ -509,7 +509,7 @@ void lua_funcinfo (lua_Object func, char **filename, int *linedefined) | |||
| 509 | lua_error("API - `funcinfo' called with a non-function value"); | 509 | lua_error("API - `funcinfo' called with a non-function value"); |
| 510 | else { | 510 | else { |
| 511 | TObject *f = luaA_protovalue(Address(func)); | 511 | TObject *f = luaA_protovalue(Address(func)); |
| 512 | if (ttype(f) == LUA_T_PROTO) { | 512 | if (normalized_type(f) == LUA_T_PROTO) { |
| 513 | *filename = tfvalue(f)->fileName->str; | 513 | *filename = tfvalue(f)->fileName->str; |
| 514 | *linedefined = tfvalue(f)->lineDefined; | 514 | *linedefined = tfvalue(f)->lineDefined; |
| 515 | } | 515 | } |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llex.c,v 1.10 1997/12/09 13:35:19 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.11 1997/12/17 20:48:58 roberto Exp roberto $ |
| 3 | ** Lexical Analizer | 3 | ** Lexical Analizer |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -50,8 +50,10 @@ void luaX_init (void) | |||
| 50 | static void firstline (LexState *LS) | 50 | static void firstline (LexState *LS) |
| 51 | { | 51 | { |
| 52 | int c = zgetc(LS->lex_z); | 52 | int c = zgetc(LS->lex_z); |
| 53 | if (c == '#') | 53 | if (c == '#') { |
| 54 | LS->linenumber++; | ||
| 54 | while ((c=zgetc(LS->lex_z)) != '\n' && c != EOZ) /* skip first line */; | 55 | while ((c=zgetc(LS->lex_z)) != '\n' && c != EOZ) /* skip first line */; |
| 56 | } | ||
| 55 | zungetc(LS->lex_z); | 57 | zungetc(LS->lex_z); |
| 56 | } | 58 | } |
| 57 | 59 | ||
