diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-16 10:04:27 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-16 10:04:27 +0000 |
| commit | 45c9d37eb27d204a6202b33cb37e890af0171357 (patch) | |
| tree | dba23170b16053c5e1ec4bf78efc2a533cb94a4e /lib/Parser/ParserFunction.cc | |
| parent | 522742e9df7fc5ac596ce4aa53d41b31e4f6a030 (diff) | |
feat(control-flow): implement ordered CASE OF matching
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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) { |
