diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-11-14 14:06:09 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-11-14 14:06:09 -0200 |
commit | 5873786e276d4c6f2b5c27880a676cb53059df57 (patch) | |
tree | 1fd68aace4af6e0ae3c1f5fa72213a8f30e31663 /llex.c | |
parent | cb59019f580ae0cb863cbf903efae28cf67c33af (diff) | |
download | lua-5873786e276d4c6f2b5c27880a676cb53059df57.tar.gz lua-5873786e276d4c6f2b5c27880a676cb53059df57.tar.bz2 lua-5873786e276d4c6f2b5c27880a676cb53059df57.zip |
small bug (error of "chunk has too many lines" might use 't.token'
before reading the first token)
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.87 2014/10/30 18:53:28 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.88 2014/11/02 19:19:04 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 | */ |
@@ -156,12 +156,13 @@ static void inclinenumber (LexState *ls) { | |||
156 | if (currIsNewline(ls) && ls->current != old) | 156 | if (currIsNewline(ls) && ls->current != old) |
157 | next(ls); /* skip '\n\r' or '\r\n' */ | 157 | next(ls); /* skip '\n\r' or '\r\n' */ |
158 | if (++ls->linenumber >= MAX_INT) | 158 | if (++ls->linenumber >= MAX_INT) |
159 | luaX_syntaxerror(ls, "chunk has too many lines"); | 159 | lexerror(ls, "chunk has too many lines", 0); |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, | 163 | void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, |
164 | int firstchar) { | 164 | int firstchar) { |
165 | ls->t.token = 0; | ||
165 | ls->decpoint = '.'; | 166 | ls->decpoint = '.'; |
166 | ls->L = L; | 167 | ls->L = L; |
167 | ls->current = firstchar; | 168 | ls->current = firstchar; |