mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Support leading pipe in match arms
This commit is contained in:
parent
cd9c5f4ab2
commit
a55ef9b3ed
3 changed files with 59 additions and 12 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue