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 68ccfc82..4e0b7a58 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 2.44 2011/01/26 16:30:02 roberto Exp roberto $ 2** $Id: llex.c,v 2.45 2011/02/02 14:55:17 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*/
@@ -152,9 +152,11 @@ static void inclinenumber (LexState *ls) {
152} 152}
153 153
154 154
155void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) { 155void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source,
156 int firstchar) {
156 ls->decpoint = '.'; 157 ls->decpoint = '.';
157 ls->L = L; 158 ls->L = L;
159 ls->current = firstchar;
158 ls->lookahead.token = TK_EOS; /* no look-ahead token */ 160 ls->lookahead.token = TK_EOS; /* no look-ahead token */
159 ls->z = z; 161 ls->z = z;
160 ls->fs = NULL; 162 ls->fs = NULL;
@@ -164,7 +166,6 @@ void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) {
164 ls->envn = luaS_new(L, LUA_ENV); /* create env name */ 166 ls->envn = luaS_new(L, LUA_ENV); /* create env name */
165 luaS_fix(ls->envn); /* never collect this name */ 167 luaS_fix(ls->envn); /* never collect this name */
166 luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ 168 luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */
167 next(ls); /* read first char */
168} 169}
169 170
170 171