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 /lparser.c | |
parent | 96253ed8ceb38afa50887ccb5500442b5b220f08 (diff) | |
download | lua-fc7b167ae0a0d65f0050299101e7d177550d7120.tar.gz lua-fc7b167ae0a0d65f0050299101e7d177550d7120.tar.bz2 lua-fc7b167ae0a0d65f0050299101e7d177550d7120.zip |
BUG: parser does not accept a `;' after a `return'
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 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 */ |