From cb863390f23bc2eac6561d55def9bd3ba54605fc Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 15 Jan 2021 18:57:32 +0100 Subject: Handle self/super/crate in PathSegment as NameRef --- crates/parser/src/grammar/paths.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/parser') 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) { } // test crate_path // use crate::foo; - T![self] | T![super] | T![crate] => p.bump_any(), + T![self] | T![super] | T![crate] => { + let m = p.start(); + p.bump_any(); + m.complete(p, NAME_REF); + } _ => { p.err_recover("expected identifier", items::ITEM_RECOVERY_SET); if empty { -- cgit v1.2.3