diff options
Diffstat (limited to '')
| -rw-r--r-- | lex.h | 4 | ||||
| -rw-r--r-- | lua.stx | 10 |
2 files changed, 4 insertions, 10 deletions
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** lex.h | 2 | ** lex.h |
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | ** $Id: lex.h,v 1.1 1996/02/13 17:30:39 roberto Exp roberto $ | 4 | ** $Id: lex.h,v 1.2 1996/02/14 13:35:51 roberto Exp roberto $ |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #ifndef lex_h | 7 | #ifndef lex_h |
| @@ -11,7 +11,7 @@ | |||
| 11 | typedef int (*Input) (void); | 11 | typedef int (*Input) (void); |
| 12 | 12 | ||
| 13 | void lua_setinput (Input fn); | 13 | void lua_setinput (Input fn); |
| 14 | char *lua_lasttext (void); | 14 | void luaI_syntaxerror (char *s); |
| 15 | int luaY_lex (void); | 15 | int luaY_lex (void); |
| 16 | void luaI_addReserved (void); | 16 | void luaI_addReserved (void); |
| 17 | 17 | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | %{ | 1 | %{ |
| 2 | 2 | ||
| 3 | char *rcs_luastx = "$Id: lua.stx,v 3.39 1996/09/24 17:29:50 roberto Exp roberto $"; | 3 | char *rcs_luastx = "$Id: lua.stx,v 3.40 1996/09/25 21:52:00 roberto Exp roberto $"; |
| 4 | 4 | ||
| 5 | #include <stdio.h> | 5 | #include <stdio.h> |
| 6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
| @@ -59,13 +59,7 @@ int lua_debug = 0; | |||
| 59 | 59 | ||
| 60 | static void yyerror (char *s) | 60 | static void yyerror (char *s) |
| 61 | { | 61 | { |
| 62 | char msg[256]; | 62 | luaI_syntaxerror(s); |
| 63 | char *token = lua_lasttext(); | ||
| 64 | if (token[0] == 0) | ||
| 65 | token = "<eof>"; | ||
| 66 | sprintf (msg,"%s; last token read: \"%s\" at line %d in file `%s'", | ||
| 67 | s, token, lua_linenumber, lua_parsedfile); | ||
| 68 | lua_error (msg); | ||
| 69 | } | 63 | } |
| 70 | 64 | ||
| 71 | static void check_space (int i) | 65 | static void check_space (int i) |
