cl-parser: change match parse slightly
This commit is contained in:
parent
8c23aea4af
commit
cd2e3c3e32
@ -1101,13 +1101,14 @@ impl Parse<'_> for Match {
|
||||
/// [Match] = `match` [Expr] `{` [MatchArm],* `}`
|
||||
fn parse(p: &mut Parser<'_>) -> PResult<Self> {
|
||||
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)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user