diff options
Diffstat (limited to 'lib/Parser/ParserFunction.cc')
| -rw-r--r-- | lib/Parser/ParserFunction.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parser/ParserFunction.cc b/lib/Parser/ParserFunction.cc index 25375f2..c47485e 100644 --- a/lib/Parser/ParserFunction.cc +++ b/lib/Parser/ParserFunction.cc @@ -222,7 +222,8 @@ std::unique_ptr<StmtAST> Parser::ParseReturnStmt() { getNextToken(); std::unique_ptr<ExprAST> Expr = nullptr; // A bare RETURN is recognized right before any block terminator. - if (CurTok != tok_endif && CurTok != tok_else && CurTok != tok_endfunction && + if (!atCaseBoundary() && CurTok != tok_endcase && CurTok != tok_otherwise && + CurTok != tok_endif && CurTok != tok_else && CurTok != tok_endfunction && CurTok != tok_endprocedure && CurTok != tok_endwhile && CurTok != tok_until && CurTok != tok_next && CurTok != tok_catch && CurTok != tok_endtry && CurTok != tok_eof) { |
