aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/llex.c b/llex.c
index a49358f8..f251ab9c 100644
--- a/llex.c
+++ b/llex.c
@@ -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
64void luaX_syntaxerror (LexState *ls, const char *s, const char *token) { 64void 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
135void luaX_setinput (lua_State *L, LexState *LS, ZIO *z) { 135void 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 */