mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Merge #10268
10268: intenral: simplify parser r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
c72a30af63
1 changed files with 4 additions and 10 deletions
|
@ -166,22 +166,16 @@ fn opt_visibility(p: &mut Parser) -> bool {
|
||||||
// struct B(pub (super::A));
|
// struct B(pub (super::A));
|
||||||
// struct B(pub (crate::A,));
|
// struct B(pub (crate::A,));
|
||||||
T![crate] | T![self] | T![super] | T![ident] if p.nth(2) != T![:] => {
|
T![crate] | T![self] | T![super] | T![ident] if p.nth(2) != T![:] => {
|
||||||
p.bump_any();
|
p.bump(T!['(']);
|
||||||
let path_m = p.start();
|
paths::use_path(p);
|
||||||
let path_segment_m = p.start();
|
|
||||||
let name_ref_m = p.start();
|
|
||||||
p.bump_any();
|
|
||||||
name_ref_m.complete(p, NAME_REF);
|
|
||||||
path_segment_m.complete(p, PATH_SEGMENT);
|
|
||||||
path_m.complete(p, PATH);
|
|
||||||
p.expect(T![')']);
|
p.expect(T![')']);
|
||||||
}
|
}
|
||||||
// test crate_visibility_in
|
// test crate_visibility_in
|
||||||
// pub(in super::A) struct S;
|
// pub(in super::A) struct S;
|
||||||
// pub(in crate) struct S;
|
// pub(in crate) struct S;
|
||||||
T![in] => {
|
T![in] => {
|
||||||
p.bump_any();
|
p.bump(T!['(']);
|
||||||
p.bump_any();
|
p.bump(T![in]);
|
||||||
paths::use_path(p);
|
paths::use_path(p);
|
||||||
p.expect(T![')']);
|
p.expect(T![')']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue