Support leading pipe in match arms

This commit is contained in:
Daniel McNab 2018-10-03 21:47:03 +01:00
parent cd9c5f4ab2
commit a55ef9b3ed
3 changed files with 59 additions and 12 deletions

View file

@ -319,10 +319,13 @@ pub(crate) fn match_arm_list(p: &mut Parser) {
// match () {
// _ => (),
// X | Y if Z => (),
// | X | Y if Z => (),
// | X => (),
// };
// }
fn match_arm(p: &mut Parser) -> BlockLike {
let m = p.start();
p.eat(PIPE);
patterns::pattern_r(p, TokenSet::EMPTY);
while p.eat(PIPE) {
patterns::pattern(p);