Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/patterns.rs')
-rw-r--r--crates/parser/src/grammar/patterns.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/parser/src/grammar/patterns.rs b/crates/parser/src/grammar/patterns.rs
index 5036742337..eff6b66404 100644
--- a/crates/parser/src/grammar/patterns.rs
+++ b/crates/parser/src/grammar/patterns.rs
@@ -255,9 +255,7 @@ fn is_literal_pat_start(p: &Parser<'_>) -> bool {
fn literal_pat(p: &mut Parser<'_>) -> CompletedMarker {
assert!(is_literal_pat_start(p));
let m = p.start();
- if p.at(T![-]) {
- p.bump(T![-]);
- }
+ p.eat(T![-]);
expressions::literal(p);
m.complete(p, LITERAL_PAT)
}
@@ -468,14 +466,12 @@ fn slice_pat(p: &mut Parser<'_>) -> CompletedMarker {
fn pat_list(p: &mut Parser<'_>, ket: SyntaxKind) {
while !p.at(EOF) && !p.at(ket) {
pattern_top(p);
- if !p.at(T![,]) {
+ if !p.eat(T![,]) {
if p.at_ts(PAT_TOP_FIRST) {
p.error(format!("expected {:?}, got {:?}", T![,], p.current()));
} else {
break;
}
- } else {
- p.bump(T![,]);
}
}
}