Optional trailing comma for match arms.

This commit is contained in:
chriseth
2023-04-24 14:47:12 +02:00
parent 7c77081f0b
commit 56f002ae2c

View File

@@ -357,7 +357,12 @@ PublicReference: String = {
}
MatchExpression: Box<Expression> = {
"match" <BoxedExpression> "{" <(<MatchArm> ",")*> "}" => Box::new(Expression::MatchExpression(<>))
"match" <BoxedExpression> "{" <MatchArms> "}" => Box::new(Expression::MatchExpression(<>))
}
MatchArms: Vec<(Option<Expression>, Expression)> = {
=> vec![],
<mut list:( <MatchArm> "," )*> <end:MatchArm> ","? => { list.push(end); list }
}
MatchArm: (Option<Expression>, Expression) = {