Skip to content

Commit f04cff1

Browse files
committed
Simplify
1 parent 836784f commit f04cff1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

crates/parser/src/grammar/expressions/atom.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,8 @@ fn match_arm(p: &mut Parser) {
448448
// _ => ()
449449
// }
450450
// }
451-
if blocklike.is_block() {
452-
p.eat(T![,]);
453-
} else if !p.at(T!['}']) {
454-
p.expect(T![,]);
451+
if !p.eat(T![,]) && !blocklike.is_block() && !p.at(T!['}']) {
452+
p.error("expected `,`");
455453
}
456454
m.complete(p, MATCH_ARM);
457455
}

crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ SOURCE_FILE@0..293
194194
error 52..52: expected `[`
195195
error 52..52: expected pattern
196196
error 53..53: expected FAT_ARROW
197-
error 78..78: expected COMMA
197+
error 78..78: expected `,`
198198
error 161..161: expected `[`
199199
error 161..161: expected pattern
200200
error 162..162: expected FAT_ARROW
201201
error 232..232: expected `[`
202202
error 232..232: expected pattern
203203
error 233..233: expected FAT_ARROW
204-
error 250..250: expected COMMA
204+
error 250..250: expected `,`

0 commit comments

Comments
 (0)