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 | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index 382cc4fcc5..7243b89583 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs @@ -194,10 +194,12 @@ fn opt_visibility(p: &mut Parser) -> bool { // crate fn main() { } // struct S { crate field: u32 } // struct T(crate u32); - // - // test crate_keyword_path - // fn foo() { crate::foo(); } - T![crate] if !p.nth_at(1, T![::]) => { + T![crate] => { + if p.nth_at(1, T![::]) { + // test crate_keyword_path + // fn foo() { crate::foo(); } + return false; + } let m = p.start(); p.bump(T![crate]); m.complete(p, VISIBILITY); |