commit fae0b5282562cb1814f1bcaf9a6eb25cb0d37111
parent 22439a7511f45c4180e532857a4f831046460778
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 22 Dec 1997 15:51:59 -0200
small bugs in error report
Diffstat:
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/lapi.c b/lapi.c
@@ -1,5 +1,5 @@
/*
-** $Id: lapi.c,v 1.14 1997/12/15 16:17:20 roberto Exp roberto $
+** $Id: lapi.c,v 1.15 1997/12/18 18:32:39 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -60,7 +60,7 @@ static void set_normalized (TObject *d, TObject *s)
static TObject *luaA_protovalue (TObject *o)
{
- return (ttype(o) == LUA_T_CLOSURE) ? protovalue(o) : o;
+ return (normalized_type(o) == LUA_T_CLOSURE) ? protovalue(o) : o;
}
@@ -509,7 +509,7 @@ void lua_funcinfo (lua_Object func, char **filename, int *linedefined)
lua_error("API - `funcinfo' called with a non-function value");
else {
TObject *f = luaA_protovalue(Address(func));
- if (ttype(f) == LUA_T_PROTO) {
+ if (normalized_type(f) == LUA_T_PROTO) {
*filename = tfvalue(f)->fileName->str;
*linedefined = tfvalue(f)->lineDefined;
}
diff --git a/llex.c b/llex.c
@@ -1,5 +1,5 @@
/*
-** $Id: llex.c,v 1.10 1997/12/09 13:35:19 roberto Exp roberto $
+** $Id: llex.c,v 1.11 1997/12/17 20:48:58 roberto Exp roberto $
** Lexical Analizer
** See Copyright Notice in lua.h
*/
@@ -50,8 +50,10 @@ void luaX_init (void)
static void firstline (LexState *LS)
{
int c = zgetc(LS->lex_z);
- if (c == '#')
+ if (c == '#') {
+ LS->linenumber++;
while ((c=zgetc(LS->lex_z)) != '\n' && c != EOZ) /* skip first line */;
+ }
zungetc(LS->lex_z);
}