cl-parser: Promote match scrutinee to position
This commit is contained in:
parent
7d3f189100
commit
2fd08193fd
@ -1097,7 +1097,7 @@ impl Parse<'_> for Match {
|
|||||||
/// [Match] = `match` [Expr] `{` [MatchArm],* `}`
|
/// [Match] = `match` [Expr] `{` [MatchArm],* `}`
|
||||||
fn parse(p: &mut Parser<'_>) -> PResult<Self> {
|
fn parse(p: &mut Parser<'_>) -> PResult<Self> {
|
||||||
p.match_type(TokenKind::Match, Parsing::Match)?;
|
p.match_type(TokenKind::Match, Parsing::Match)?;
|
||||||
let scrutinee = Expr::parse(p)?.into();
|
let scrutinee = condition(p)?.into();
|
||||||
let arms = delim(
|
let arms = delim(
|
||||||
sep(MatchArm::parse, TokenKind::Comma, CURLIES.1, Parsing::Match),
|
sep(MatchArm::parse, TokenKind::Comma, CURLIES.1, Parsing::Match),
|
||||||
CURLIES,
|
CURLIES,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user