lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 78edc241e95d467e2b6c9a26b5311a62c7b04459
parent e907c711c04b3e09164e7654623e1f48a689f5cc
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  5 Mar 1999 17:44:39 -0300

details about debug info.

Diffstat:
Mldo.c | 4++--
Mliolib.c | 8+++++---
Mllex.c | 5++---
3 files changed, 9 insertions(+), 8 deletions(-)

diff --git 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 @@ -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 @@ -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 = "<eof>"; - 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); }