diff options
author | Daniel McNab <[email protected]> | 2018-10-03 21:47:03 +0100 |
---|---|---|
committer | Daniel McNab <[email protected]> | 2018-10-03 21:47:03 +0100 |
commit | a55ef9b3ed66a057bb3e58ab698f26e58afb5b7d (patch) | |
tree | f064862cf43cd219c2ab52aff460205228cee0cf /crates/ra_syntax/src/grammar/expressions/atom.rs | |
parent | cd9c5f4ab205e092b87be6affe6d7e78d877dbf0 (diff) |
Support leading pipe in match arms
Diffstat (limited to 'crates/ra_syntax/src/grammar/expressions/atom.rs')
-rw-r--r-- | crates/ra_syntax/src/grammar/expressions/atom.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs index f01df56bc..a720d255f 100644 --- a/crates/ra_syntax/src/grammar/expressions/atom.rs +++ b/crates/ra_syntax/src/grammar/expressions/atom.rs | |||
@@ -319,10 +319,13 @@ pub(crate) fn match_arm_list(p: &mut Parser) { | |||
319 | // match () { | 319 | // match () { |
320 | // _ => (), | 320 | // _ => (), |
321 | // X | Y if Z => (), | 321 | // X | Y if Z => (), |
322 | // | X | Y if Z => (), | ||
323 | // | X => (), | ||
322 | // }; | 324 | // }; |
323 | // } | 325 | // } |
324 | fn match_arm(p: &mut Parser) -> BlockLike { | 326 | fn match_arm(p: &mut Parser) -> BlockLike { |
325 | let m = p.start(); | 327 | let m = p.start(); |
328 | p.eat(PIPE); | ||
326 | patterns::pattern_r(p, TokenSet::EMPTY); | 329 | patterns::pattern_r(p, TokenSet::EMPTY); |
327 | while p.eat(PIPE) { | 330 | while p.eat(PIPE) { |
328 | patterns::pattern(p); | 331 | patterns::pattern(p); |