diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-11-29 09:57:42 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-11-29 09:57:42 -0200 |
commit | fc7b167ae0a0d65f0050299101e7d177550d7120 (patch) | |
tree | abe23b5f00100d17aaf5b2055d361a518d559407 | |
parent | 96253ed8ceb38afa50887ccb5500442b5b220f08 (diff) | |
download | lua-fc7b167ae0a0d65f0050299101e7d177550d7120.tar.gz lua-fc7b167ae0a0d65f0050299101e7d177550d7120.tar.bz2 lua-fc7b167ae0a0d65f0050299101e7d177550d7120.zip |
BUG: parser does not accept a `;' after a `return'
-rw-r--r-- | bugs | 10 | ||||
-rw-r--r-- | lparser.c | 4 |
2 files changed, 12 insertions, 2 deletions
@@ -235,3 +235,13 @@ Thu Oct 26 10:50:46 EDT 2000 | |||
235 | >> allocate new memory | 235 | >> allocate new memory |
236 | (by Mauro Vezzosi; since 4.0b) | 236 | (by Mauro Vezzosi; since 4.0b) |
237 | 237 | ||
238 | |||
239 | |||
240 | ================================================================= | ||
241 | --- Version 4.0 | ||
242 | |||
243 | ** lparser.c | ||
244 | Wed Nov 29 09:51:44 EDT 2000 | ||
245 | >> parser does not accept a `;' after a `return' | ||
246 | (by lhf; since 4.0b) | ||
247 | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 1.115 2000/10/10 19:51:15 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.116 2000/10/27 11:39:52 roberto Exp roberto $ |
3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -997,7 +997,7 @@ static void retstat (LexState *ls) { | |||
997 | /* stat -> RETURN explist */ | 997 | /* stat -> RETURN explist */ |
998 | FuncState *fs = ls->fs; | 998 | FuncState *fs = ls->fs; |
999 | next(ls); /* skip RETURN */ | 999 | next(ls); /* skip RETURN */ |
1000 | if (!block_follow(ls->t.token)) | 1000 | if (!block_follow(ls->t.token) && ls->t.token != ';') |
1001 | explist1(ls); /* optional return values */ | 1001 | explist1(ls); /* optional return values */ |
1002 | luaK_code1(fs, OP_RETURN, ls->fs->nactloc); | 1002 | luaK_code1(fs, OP_RETURN, ls->fs->nactloc); |
1003 | fs->stacklevel = fs->nactloc; /* removes all temp values */ | 1003 | fs->stacklevel = fs->nactloc; /* removes all temp values */ |