diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-15 18:40:47 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-15 18:40:47 +0000 |
commit | 8a869e870ac6328967fb120a0ebe44a9c900eaf0 (patch) | |
tree | f4ad40fc09483af3e9fea77d4b4156130539a70c /crates/parser/src/grammar | |
parent | 148e3d0f6a28f57565538dca7d9c0f5f726a5908 (diff) | |
parent | cb863390f23bc2eac6561d55def9bd3ba54605fc (diff) |
Merge #7288
7288: Handle self/super/crate in PathSegment as NameRef r=matklad a=Veykril
Wrapping self/super/crate in NameRef as per https://github.com/rust-analyzer/rust-analyzer/pull/7261#issuecomment-760023172
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/parser/src/grammar')
-rw-r--r-- | crates/parser/src/grammar/paths.rs | 6 |
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 { |