Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar.rs')
| -rw-r--r-- | crates/parser/src/grammar.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index 34715628f1..4e5837312f 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs @@ -244,7 +244,7 @@ impl BlockLike { } } -const VISIBILITY_FIRST: TokenSet = TokenSet::new(&[T![pub], T![crate]]); +const VISIBILITY_FIRST: TokenSet = TokenSet::new(&[T![pub]]); fn opt_visibility(p: &mut Parser<'_>, in_tuple_field: bool) -> bool { if !p.at(T![pub]) { @@ -416,14 +416,12 @@ fn delimited( if !parser(p) { break; } - if !p.at(delim) { + if !p.eat(delim) { if p.at_ts(first_set) { p.error(format!("expected {:?}", delim)); } else { break; } - } else { - p.bump(delim); } } p.expect(ket); |