mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Add vis test
This commit is contained in:
parent
9500ad5211
commit
52dc0ddc84
3 changed files with 62 additions and 0 deletions
|
@ -47,6 +47,11 @@ fn visibility(p: &mut Parser) {
|
|||
p.bump();
|
||||
if p.at(L_PAREN) {
|
||||
match p.nth(1) {
|
||||
// test crate_visibility
|
||||
// pub(crate) struct S;
|
||||
// pub(self) struct S;
|
||||
// pub(self) struct S;
|
||||
// pub(self) struct S;
|
||||
CRATE_KW | SELF_KW | SUPER_KW => {
|
||||
p.bump();
|
||||
p.bump();
|
||||
|
|
4
tests/data/parser/inline/0037_crate_visibility.rs
Normal file
4
tests/data/parser/inline/0037_crate_visibility.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
pub(crate) struct S;
|
||||
pub(self) struct S;
|
||||
pub(self) struct S;
|
||||
pub(self) struct S;
|
53
tests/data/parser/inline/0037_crate_visibility.txt
Normal file
53
tests/data/parser/inline/0037_crate_visibility.txt
Normal file
|
@ -0,0 +1,53 @@
|
|||
FILE@[0; 81)
|
||||
STRUCT_ITEM@[0; 21)
|
||||
VISIBILITY@[0; 11)
|
||||
PUB_KW@[0; 3)
|
||||
L_PAREN@[3; 4)
|
||||
CRATE_KW@[4; 9)
|
||||
R_PAREN@[9; 10)
|
||||
WHITESPACE@[10; 11)
|
||||
STRUCT_KW@[11; 17)
|
||||
NAME@[17; 19)
|
||||
WHITESPACE@[17; 18)
|
||||
IDENT@[18; 19) "S"
|
||||
SEMI@[19; 20)
|
||||
WHITESPACE@[20; 21)
|
||||
STRUCT_ITEM@[21; 41)
|
||||
VISIBILITY@[21; 31)
|
||||
PUB_KW@[21; 24)
|
||||
L_PAREN@[24; 25)
|
||||
SELF_KW@[25; 29)
|
||||
R_PAREN@[29; 30)
|
||||
WHITESPACE@[30; 31)
|
||||
STRUCT_KW@[31; 37)
|
||||
NAME@[37; 39)
|
||||
WHITESPACE@[37; 38)
|
||||
IDENT@[38; 39) "S"
|
||||
SEMI@[39; 40)
|
||||
WHITESPACE@[40; 41)
|
||||
STRUCT_ITEM@[41; 61)
|
||||
VISIBILITY@[41; 51)
|
||||
PUB_KW@[41; 44)
|
||||
L_PAREN@[44; 45)
|
||||
SELF_KW@[45; 49)
|
||||
R_PAREN@[49; 50)
|
||||
WHITESPACE@[50; 51)
|
||||
STRUCT_KW@[51; 57)
|
||||
NAME@[57; 59)
|
||||
WHITESPACE@[57; 58)
|
||||
IDENT@[58; 59) "S"
|
||||
SEMI@[59; 60)
|
||||
WHITESPACE@[60; 61)
|
||||
STRUCT_ITEM@[61; 81)
|
||||
VISIBILITY@[61; 71)
|
||||
PUB_KW@[61; 64)
|
||||
L_PAREN@[64; 65)
|
||||
SELF_KW@[65; 69)
|
||||
R_PAREN@[69; 70)
|
||||
WHITESPACE@[70; 71)
|
||||
STRUCT_KW@[71; 77)
|
||||
NAME@[77; 79)
|
||||
WHITESPACE@[77; 78)
|
||||
IDENT@[78; 79) "S"
|
||||
SEMI@[79; 80)
|
||||
WHITESPACE@[80; 81)
|
Loading…
Reference in a new issue