From baaf027da04445c18e6d50b0956b234d33c1a2f1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 29 Sep 2018 14:53:23 +0300 Subject: support 2018 paths --- crates/ra_syntax/src/grammar/paths.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/ra_syntax/src/grammar') 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 @@ use super::*; pub(super) const PATH_FIRST: TokenSet = - token_set![IDENT, SELF_KW, SUPER_KW, COLONCOLON, L_ANGLE]; + token_set![IDENT, SELF_KW, SUPER_KW, CRATE_KW, COLONCOLON, L_ANGLE]; pub(super) fn is_path_start(p: &Parser) -> bool { match p.current() { - IDENT | SELF_KW | SUPER_KW | COLONCOLON => true, + IDENT | SELF_KW | SUPER_KW | CRATE_KW | COLONCOLON => true, _ => false, } } @@ -74,7 +74,9 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) { name_ref(p); opt_path_type_args(p, mode); } - SELF_KW | SUPER_KW => p.bump(), + // test crate_path + // use crate::foo; + SELF_KW | SUPER_KW | CRATE_KW => p.bump(), _ => { p.err_and_bump("expected identifier"); } -- cgit v1.2.3