From fc7b167ae0a0d65f0050299101e7d177550d7120 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 29 Nov 2000 09:57:42 -0200 Subject: [PATCH] BUG: parser does not accept a `;' after a `return' --- bugs | 10 ++++++++++ lparser.c | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bugs b/bugs index 92c172ed..1aff4595 100644 --- a/bugs +++ b/bugs @@ -235,3 +235,13 @@ Thu Oct 26 10:50:46 EDT 2000 >> allocate new memory (by Mauro Vezzosi; since 4.0b) + + +================================================================= +--- Version 4.0 + +** lparser.c +Wed Nov 29 09:51:44 EDT 2000 +>> parser does not accept a `;' after a `return' +(by lhf; since 4.0b) + diff --git a/lparser.c b/lparser.c index 7e6da470..b635a418 100644 --- a/lparser.c +++ b/lparser.c @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 1.115 2000/10/10 19:51:15 roberto Exp roberto $ +** $Id: lparser.c,v 1.116 2000/10/27 11:39:52 roberto Exp roberto $ ** LL(1) Parser and code generator for Lua ** See Copyright Notice in lua.h */ @@ -997,7 +997,7 @@ static void retstat (LexState *ls) { /* stat -> RETURN explist */ FuncState *fs = ls->fs; next(ls); /* skip RETURN */ - if (!block_follow(ls->t.token)) + if (!block_follow(ls->t.token) && ls->t.token != ';') explist1(ls); /* optional return values */ luaK_code1(fs, OP_RETURN, ls->fs->nactloc); fs->stacklevel = fs->nactloc; /* removes all temp values */