mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
syntax error function is in "lex.c" (it has the token)
This commit is contained in:
parent
2f19e0ba16
commit
a0e9bfbb48
2 changed files with 4 additions and 10 deletions
10
lua.stx
10
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue