mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 20:43:21 +00:00
Merge #5560
5560: Fix nameref parsing r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
5a8124273d
3 changed files with 8 additions and 7 deletions
|
@ -270,10 +270,6 @@ fn name_ref(p: &mut Parser) {
|
|||
let m = p.start();
|
||||
p.bump(IDENT);
|
||||
m.complete(p, NAME_REF);
|
||||
} else if p.at(T![self]) {
|
||||
let m = p.start();
|
||||
p.bump(T![self]);
|
||||
m.complete(p, T![self]);
|
||||
} else {
|
||||
p.err_and_bump("expected identifier");
|
||||
}
|
||||
|
|
|
@ -304,7 +304,13 @@ fn extern_crate_item(p: &mut Parser, m: Marker) {
|
|||
p.bump(T![extern]);
|
||||
assert!(p.at(T![crate]));
|
||||
p.bump(T![crate]);
|
||||
name_ref(p);
|
||||
|
||||
if p.at(T![self]) {
|
||||
p.bump(T![self]);
|
||||
} else {
|
||||
name_ref(p);
|
||||
}
|
||||
|
||||
opt_alias(p);
|
||||
p.expect(T![;]);
|
||||
m.complete(p, EXTERN_CRATE_ITEM);
|
||||
|
|
|
@ -28,8 +28,7 @@ SOURCE_FILE@0..69
|
|||
WHITESPACE@49..50 " "
|
||||
CRATE_KW@50..55 "crate"
|
||||
WHITESPACE@55..56 " "
|
||||
SELF_KW@56..60
|
||||
SELF_KW@56..60 "self"
|
||||
SELF_KW@56..60 "self"
|
||||
WHITESPACE@60..61 " "
|
||||
ALIAS@61..67
|
||||
AS_KW@61..63 "as"
|
||||
|
|
Loading…
Reference in a new issue