lua

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

commit a0e9bfbb48fdfae8188333710c2ce86051477a96
parent 2f19e0ba164d38989dea4a3389753ed75858e5a1
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  8 Nov 1996 10:49:15 -0200

syntax error function is in "lex.c" (it has the token)

Diffstat:
Mlex.h | 4++--
Mlua.stx | 10++--------
2 files changed, 4 insertions(+), 10 deletions(-)

diff --git 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 @@ -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 <stdio.h> #include <stdlib.h> @@ -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 = "<eof>"; - 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)