From a0e9bfbb48fdfae8188333710c2ce86051477a96 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 8 Nov 1996 10:49:35 -0200 Subject: syntax error function is in "lex.c" (it has the token) --- lex.h | 4 ++-- lua.stx | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lex.h b/lex.h index 0c6b14d9..d6789827 100644 --- a/lex.h +++ b/lex.h @@ -1,7 +1,7 @@ /* ** lex.h ** TecCGraf - PUC-Rio -** $Id: lex.h,v 1.1 1996/02/13 17:30:39 roberto Exp roberto $ +** $Id: lex.h,v 1.2 1996/02/14 13:35:51 roberto Exp roberto $ */ #ifndef lex_h @@ -11,7 +11,7 @@ typedef int (*Input) (void); void lua_setinput (Input fn); -char *lua_lasttext (void); +void luaI_syntaxerror (char *s); int luaY_lex (void); void luaI_addReserved (void); diff --git a/lua.stx b/lua.stx index 1e00f88a..a90f5690 100644 --- a/lua.stx +++ b/lua.stx @@ -1,6 +1,6 @@ %{ -char *rcs_luastx = "$Id: lua.stx,v 3.39 1996/09/24 17:29:50 roberto Exp roberto $"; +char *rcs_luastx = "$Id: lua.stx,v 3.40 1996/09/25 21:52:00 roberto Exp roberto $"; #include #include @@ -59,13 +59,7 @@ int lua_debug = 0; static void yyerror (char *s) { - char msg[256]; - char *token = lua_lasttext(); - if (token[0] == 0) - token = ""; - sprintf (msg,"%s; last token read: \"%s\" at line %d in file `%s'", - s, token, lua_linenumber, lua_parsedfile); - lua_error (msg); + luaI_syntaxerror(s); } static void check_space (int i) -- cgit v1.2.3-55-g6feb