diff options
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 1.62 2000/05/26 14:04:04 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.63 2000/06/12 13:52:05 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -63,7 +63,7 @@ void luaX_checklimit (LexState *ls, int val, int limit, const char *msg) { | |||
63 | 63 | ||
64 | void luaX_syntaxerror (LexState *ls, const char *s, const char *token) { | 64 | void luaX_syntaxerror (LexState *ls, const char *s, const char *token) { |
65 | char buff[MAXSRC]; | 65 | char buff[MAXSRC]; |
66 | luaL_chunkid(buff, zname(ls->z), sizeof(buff)); | 66 | luaL_chunkid(buff, ls->source->str, sizeof(buff)); |
67 | luaL_verror(ls->L, "%.100s;\n last token read: `%.50s' at line %d in %.80s", | 67 | luaL_verror(ls->L, "%.100s;\n last token read: `%.50s' at line %d in %.80s", |
68 | s, token, ls->linenumber, buff); | 68 | s, token, ls->linenumber, buff); |
69 | } | 69 | } |
@@ -132,12 +132,13 @@ static void checkpragma (lua_State *L, LexState *LS) { | |||
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
135 | void luaX_setinput (lua_State *L, LexState *LS, ZIO *z) { | 135 | void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source) { |
136 | LS->L = L; | 136 | LS->L = L; |
137 | LS->lookahead.token = TK_EOS; /* no look-ahead token */ | 137 | LS->lookahead.token = TK_EOS; /* no look-ahead token */ |
138 | LS->z = z; | 138 | LS->z = z; |
139 | LS->fs = NULL; | 139 | LS->fs = NULL; |
140 | LS->linenumber = 1; | 140 | LS->linenumber = 1; |
141 | LS->source = source; | ||
141 | next(LS); /* read first char */ | 142 | next(LS); /* read first char */ |
142 | if (LS->current == '#') { | 143 | if (LS->current == '#') { |
143 | do { /* skip first line */ | 144 | do { /* skip first line */ |