mirror of
https://github.com/lua/lua.git
synced 2025-02-04 06:13:04 +08:00
small bug (error of "chunk has too many lines" might use 't.token'
before reading the first token)
This commit is contained in:
parent
cb59019f58
commit
5873786e27
5
llex.c
5
llex.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: llex.c,v 2.87 2014/10/30 18:53:28 roberto Exp roberto $
|
** $Id: llex.c,v 2.88 2014/11/02 19:19:04 roberto Exp roberto $
|
||||||
** Lexical Analyzer
|
** Lexical Analyzer
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -156,12 +156,13 @@ static void inclinenumber (LexState *ls) {
|
|||||||
if (currIsNewline(ls) && ls->current != old)
|
if (currIsNewline(ls) && ls->current != old)
|
||||||
next(ls); /* skip '\n\r' or '\r\n' */
|
next(ls); /* skip '\n\r' or '\r\n' */
|
||||||
if (++ls->linenumber >= MAX_INT)
|
if (++ls->linenumber >= MAX_INT)
|
||||||
luaX_syntaxerror(ls, "chunk has too many lines");
|
lexerror(ls, "chunk has too many lines", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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) {
|
int firstchar) {
|
||||||
|
ls->t.token = 0;
|
||||||
ls->decpoint = '.';
|
ls->decpoint = '.';
|
||||||
ls->L = L;
|
ls->L = L;
|
||||||
ls->current = firstchar;
|
ls->current = firstchar;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user