diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-04-25 16:35:19 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-04-25 16:35:19 -0300 |
commit | 5951c79ae12b31556f8a64886b1d7fd0801d7889 (patch) | |
tree | a420ebf2aaee6cde6e6f4d397d7857c5bfecd4fb /lparser.c | |
parent | e381c582de1b80a5f3df2c0d36fc25b415b48de0 (diff) | |
download | lua-5951c79ae12b31556f8a64886b1d7fd0801d7889.tar.gz lua-5951c79ae12b31556f8a64886b1d7fd0801d7889.tar.bz2 lua-5951c79ae12b31556f8a64886b1d7fd0801d7889.zip |
default increment for 'for' loop is an integer (1, not 1.0)
Diffstat (limited to 'lparser.c')
-rw-r--r-- | lparser.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.130 2013/02/06 13:37:39 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.131 2013/04/16 18:46:28 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -1326,7 +1326,7 @@ static void fornum (LexState *ls, TString *varname, int line) { | |||
1326 | if (testnext(ls, ',')) | 1326 | if (testnext(ls, ',')) |
1327 | exp1(ls); /* optional step */ | 1327 | exp1(ls); /* optional step */ |
1328 | else { /* default step = 1 */ | 1328 | else { /* default step = 1 */ |
1329 | luaK_codek(fs, fs->freereg, luaK_numberK(fs, 1)); | 1329 | luaK_codek(fs, fs->freereg, luaK_intK(fs, 1)); |
1330 | luaK_reserveregs(fs, 1); | 1330 | luaK_reserveregs(fs, 1); |
1331 | } | 1331 | } |
1332 | forbody(ls, base, line, 1, 1); | 1332 | forbody(ls, base, line, 1, 1); |