From cd2e3c3e32a5c30acda68fe5851818b7d7362bf1 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 5 May 2025 04:16:37 -0400 Subject: [PATCH] cl-parser: change match parse slightly --- compiler/cl-parser/src/parser.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/compiler/cl-parser/src/parser.rs b/compiler/cl-parser/src/parser.rs index abf5292..177f58f 100644 --- a/compiler/cl-parser/src/parser.rs +++ b/compiler/cl-parser/src/parser.rs @@ -1101,13 +1101,14 @@ impl Parse<'_> for Match { /// [Match] = `match` [Expr] `{` [MatchArm],* `}` fn parse(p: &mut Parser<'_>) -> PResult { p.match_type(TokenKind::Match, Parsing::Match)?; - let scrutinee = condition(p)?.into(); - let arms = delim( - sep(MatchArm::parse, TokenKind::Comma, CURLIES.1, Parsing::Match), - CURLIES, - Parsing::Match, - )(p)?; - Ok(Match { scrutinee, arms }) + Ok(Match { + scrutinee: condition(p)?.into(), + arms: delim( + sep(MatchArm::parse, TokenKind::Comma, CURLIES.1, Parsing::Match), + CURLIES, + Parsing::Match, + )(p)?, + }) } }