aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/grammar')
-rw-r--r--crates/ra_syntax/src/grammar/paths.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/grammar/paths.rs b/crates/ra_syntax/src/grammar/paths.rs
index 7c9fb8be2..b6d44d53a 100644
--- a/crates/ra_syntax/src/grammar/paths.rs
+++ b/crates/ra_syntax/src/grammar/paths.rs
@@ -1,11 +1,11 @@
1use super::*; 1use super::*;
2 2
3pub(super) const PATH_FIRST: TokenSet = 3pub(super) const PATH_FIRST: TokenSet =
4 token_set![IDENT, SELF_KW, SUPER_KW, COLONCOLON, L_ANGLE]; 4 token_set![IDENT, SELF_KW, SUPER_KW, CRATE_KW, COLONCOLON, L_ANGLE];
5 5
6pub(super) fn is_path_start(p: &Parser) -> bool { 6pub(super) fn is_path_start(p: &Parser) -> bool {
7 match p.current() { 7 match p.current() {
8 IDENT | SELF_KW | SUPER_KW | COLONCOLON => true, 8 IDENT | SELF_KW | SUPER_KW | CRATE_KW | COLONCOLON => true,
9 _ => false, 9 _ => false,
10 } 10 }
11} 11}
@@ -74,7 +74,9 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) {
74 name_ref(p); 74 name_ref(p);
75 opt_path_type_args(p, mode); 75 opt_path_type_args(p, mode);
76 } 76 }
77 SELF_KW | SUPER_KW => p.bump(), 77 // test crate_path
78 // use crate::foo;
79 SELF_KW | SUPER_KW | CRATE_KW => p.bump(),
78 _ => { 80 _ => {
79 p.err_and_bump("expected identifier"); 81 p.err_and_bump("expected identifier");
80 } 82 }