aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r--crates/ra_parser/src/grammar/paths.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/ra_parser/src/grammar/paths.rs b/crates/ra_parser/src/grammar/paths.rs
index 428aa711e..fd51189d5 100644
--- a/crates/ra_parser/src/grammar/paths.rs
+++ b/crates/ra_parser/src/grammar/paths.rs
@@ -73,8 +73,10 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) {
73 } 73 }
74 p.expect(T![>]); 74 p.expect(T![>]);
75 } else { 75 } else {
76 let mut empty = true;
76 if first { 77 if first {
77 p.eat(T![::]); 78 p.eat(T![::]);
79 empty = false;
78 } 80 }
79 match p.current() { 81 match p.current() {
80 IDENT => { 82 IDENT => {
@@ -86,6 +88,12 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) {
86 T![self] | T![super] | T![crate] => p.bump_any(), 88 T![self] | T![super] | T![crate] => p.bump_any(),
87 _ => { 89 _ => {
88 p.err_recover("expected identifier", items::ITEM_RECOVERY_SET); 90 p.err_recover("expected identifier", items::ITEM_RECOVERY_SET);
91 if empty {
92 // test_err empty_segment
93 // use crate::;
94 m.abandon(p);
95 return;
96 }
89 } 97 }
90 }; 98 };
91 } 99 }