aboutsummaryrefslogtreecommitdiff
path: root/crates/parser
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-01-15 17:57:32 +0000
committerLukas Wirth <[email protected]>2021-01-15 18:21:23 +0000
commitcb863390f23bc2eac6561d55def9bd3ba54605fc (patch)
treeb19b39d9b6231e8857a4096cc803cf35e2ddbe81 /crates/parser
parent0c58aa9dc0e24f0fa6a6ee7eb0c35041dedddb0a (diff)
Handle self/super/crate in PathSegment as NameRef
Diffstat (limited to 'crates/parser')
-rw-r--r--crates/parser/src/grammar/paths.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/parser/src/grammar/paths.rs b/crates/parser/src/grammar/paths.rs
index 5d297e2d6..b10f48fe1 100644
--- a/crates/parser/src/grammar/paths.rs
+++ b/crates/parser/src/grammar/paths.rs
@@ -82,7 +82,11 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) {
82 } 82 }
83 // test crate_path 83 // test crate_path
84 // use crate::foo; 84 // use crate::foo;
85 T![self] | T![super] | T![crate] => p.bump_any(), 85 T![self] | T![super] | T![crate] => {
86 let m = p.start();
87 p.bump_any();
88 m.complete(p, NAME_REF);
89 }
86 _ => { 90 _ => {
87 p.err_recover("expected identifier", items::ITEM_RECOVERY_SET); 91 p.err_recover("expected identifier", items::ITEM_RECOVERY_SET);
88 if empty { 92 if empty {