From 78edc241e95d467e2b6c9a26b5311a62c7b04459 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 5 Mar 1999 17:45:01 -0300 Subject: details about debug info. --- ldo.c | 4 ++-- liolib.c | 8 +++++--- llex.c | 5 ++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ldo.c b/ldo.c index 19b36613..951348b9 100644 --- a/ldo.c +++ b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 1.36 1999/02/26 15:48:55 roberto Exp roberto $ +** $Id: ldo.c,v 1.37 1999/03/04 21:17:26 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -367,7 +367,7 @@ int lua_dofile (char *filename) { if (f == NULL) return 2; if (filename == NULL) - strcpy(name, "@stdin"); + strcpy(name, "@(stdin)"); else sprintf(name, "@%.*s", MAXFILENAME, filename); c = fgetc(f); diff --git a/liolib.c b/liolib.c index 7b3eb9ea..c430c155 100644 --- a/liolib.c +++ b/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 1.31 1999/02/22 14:17:24 roberto Exp roberto $ +** $Id: liolib.c,v 1.32 1999/03/04 21:17:26 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -488,7 +488,9 @@ static void errorfb (void) { default: { if (linedefined == 0) sprintf(buff+strlen(buff), "main of %.50s", buffchunk); - else if (linedefined > 0) + else if (linedefined < 0) + sprintf(buff+strlen(buff), "%.50s", buffchunk); + else sprintf(buff+strlen(buff), "function <%d:%.50s>", linedefined, buffchunk); chunkname = NULL; @@ -497,7 +499,7 @@ static void errorfb (void) { if ((currentline = lua_currentline(func)) > 0) sprintf(buff+strlen(buff), " at line %d", currentline); if (chunkname) - sprintf(buff+strlen(buff), " [in %.50s]", buffchunk); + sprintf(buff+strlen(buff), " [%.50s]", buffchunk); strcat(buff, "\n"); } func = lua_rawgetglobal("_ALERT"); diff --git a/llex.c b/llex.c index 0addaf47..16ed522e 100644 --- a/llex.c +++ b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 1.30 1999/02/25 19:13:56 roberto Exp roberto $ +** $Id: llex.c,v 1.31 1999/03/04 21:17:26 roberto Exp roberto $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -48,8 +48,7 @@ void luaX_syntaxerror (LexState *ls, char *s, char *token) { luaL_chunkid(buff, zname(ls->lex_z), MAXSRC); if (token[0] == '\0') token = ""; - luaL_verror("%.100s;\n last token read: `%.50s' " - "at line %d from %.50s", + luaL_verror("%.100s;\n last token read: `%.50s' at line %d in %.50s", s, token, ls->linenumber, buff); } -- cgit v1.2.3-55-g6feb