From 45c9d37eb27d204a6202b33cb37e890af0171357 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 16 Oct 2026 10:04:27 +0000 Subject: feat(control-flow): implement ordered CASE OF matching Co-Authored-By: Claude Fable 5.1 --- lib/Parser/ParserFunction.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Parser/ParserFunction.cc') 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 Parser::ParseReturnStmt() { getNextToken(); std::unique_ptr 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) { -- cgit v1.3.1-4-g156e