no need of lookahead in Zio

This commit is contained in:
Roberto Ierusalimschy
2011-02-23 10:13:10 -03:00
parent 03b769053a
commit 7482e8f914
8 changed files with 29 additions and 41 deletions

7
llex.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 2.44 2011/01/26 16:30:02 roberto Exp roberto $
** $Id: llex.c,v 2.45 2011/02/02 14:55:17 roberto Exp roberto $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -152,9 +152,11 @@ static void inclinenumber (LexState *ls) {
}
void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) {
void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source,
int firstchar) {
ls->decpoint = '.';
ls->L = L;
ls->current = firstchar;
ls->lookahead.token = TK_EOS; /* no look-ahead token */
ls->z = z;
ls->fs = NULL;
@@ -164,7 +166,6 @@ void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) {
ls->envn = luaS_new(L, LUA_ENV); /* create env name */
luaS_fix(ls->envn); /* never collect this name */
luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */
next(ls); /* read first char */
}