mirror of
https://github.com/lua/lua
synced 2024-11-23 05:11:45 +03:00
details about debug info.
This commit is contained in:
parent
e907c711c0
commit
78edc241e9
4
ldo.c
4
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
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -367,7 +367,7 @@ int lua_dofile (char *filename) {
|
|||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
return 2;
|
return 2;
|
||||||
if (filename == NULL)
|
if (filename == NULL)
|
||||||
strcpy(name, "@stdin");
|
strcpy(name, "@(stdin)");
|
||||||
else
|
else
|
||||||
sprintf(name, "@%.*s", MAXFILENAME, filename);
|
sprintf(name, "@%.*s", MAXFILENAME, filename);
|
||||||
c = fgetc(f);
|
c = fgetc(f);
|
||||||
|
8
liolib.c
8
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
|
** Standard I/O (and system) library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -488,7 +488,9 @@ static void errorfb (void) {
|
|||||||
default: {
|
default: {
|
||||||
if (linedefined == 0)
|
if (linedefined == 0)
|
||||||
sprintf(buff+strlen(buff), "main of %.50s", buffchunk);
|
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>",
|
sprintf(buff+strlen(buff), "function <%d:%.50s>",
|
||||||
linedefined, buffchunk);
|
linedefined, buffchunk);
|
||||||
chunkname = NULL;
|
chunkname = NULL;
|
||||||
@ -497,7 +499,7 @@ static void errorfb (void) {
|
|||||||
if ((currentline = lua_currentline(func)) > 0)
|
if ((currentline = lua_currentline(func)) > 0)
|
||||||
sprintf(buff+strlen(buff), " at line %d", currentline);
|
sprintf(buff+strlen(buff), " at line %d", currentline);
|
||||||
if (chunkname)
|
if (chunkname)
|
||||||
sprintf(buff+strlen(buff), " [in %.50s]", buffchunk);
|
sprintf(buff+strlen(buff), " [%.50s]", buffchunk);
|
||||||
strcat(buff, "\n");
|
strcat(buff, "\n");
|
||||||
}
|
}
|
||||||
func = lua_rawgetglobal("_ALERT");
|
func = lua_rawgetglobal("_ALERT");
|
||||||
|
5
llex.c
5
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
|
** Lexical Analyzer
|
||||||
** See Copyright Notice in lua.h
|
** 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);
|
luaL_chunkid(buff, zname(ls->lex_z), MAXSRC);
|
||||||
if (token[0] == '\0')
|
if (token[0] == '\0')
|
||||||
token = "<eof>";
|
token = "<eof>";
|
||||||
luaL_verror("%.100s;\n last token read: `%.50s' "
|
luaL_verror("%.100s;\n last token read: `%.50s' at line %d in %.50s",
|
||||||
"at line %d from %.50s",
|
|
||||||
s, token, ls->linenumber, buff);
|
s, token, ls->linenumber, buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user