From 98718e0544f42e55642d2838b00d6a7bef1e2414 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 15 Jan 2021 21:07:38 +0100 Subject: Wrap remaining self/super/crate in Name{Ref} --- .../parser/inline/ok/0006_self_param.rast | 15 ++++--- .../parser/inline/ok/0018_arb_self_types.rast | 6 ++- .../parser/inline/ok/0021_impl_item_list.rast | 3 +- .../parser/inline/ok/0022_crate_visibility.rast | 50 ++++++++++------------ .../parser/inline/ok/0022_crate_visibility.rs | 3 +- .../inline/ok/0138_self_param_outer_attr.rast | 3 +- .../parser/inline/ok/0160_crate_visibility_in.rast | 42 ++++++++++++++++++ .../parser/inline/ok/0160_crate_visibility_in.rs | 2 + 8 files changed, 86 insertions(+), 38 deletions(-) create mode 100644 crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rast create mode 100644 crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rs (limited to 'crates/syntax/test_data/parser/inline/ok') diff --git a/crates/syntax/test_data/parser/inline/ok/0006_self_param.rast b/crates/syntax/test_data/parser/inline/ok/0006_self_param.rast index 8048f5fad..f0d152d33 100644 --- a/crates/syntax/test_data/parser/inline/ok/0006_self_param.rast +++ b/crates/syntax/test_data/parser/inline/ok/0006_self_param.rast @@ -19,7 +19,8 @@ SOURCE_FILE@0..128 PARAM_LIST@17..23 L_PAREN@17..18 "(" SELF_PARAM@18..22 - SELF_KW@18..22 "self" + NAME@18..22 + SELF_KW@18..22 "self" R_PAREN@22..23 ")" WHITESPACE@23..24 " " BLOCK_EXPR@24..26 @@ -35,7 +36,8 @@ SOURCE_FILE@0..128 L_PAREN@35..36 "(" SELF_PARAM@36..41 AMP@36..37 "&" - SELF_KW@37..41 "self" + NAME@37..41 + SELF_KW@37..41 "self" COMMA@41..42 "," R_PAREN@42..43 ")" WHITESPACE@43..44 " " @@ -55,7 +57,8 @@ SOURCE_FILE@0..128 LIFETIME@57..59 LIFETIME_IDENT@57..59 "\'a" WHITESPACE@59..60 " " - SELF_KW@60..64 "self" + NAME@60..64 + SELF_KW@60..64 "self" COMMA@64..65 "," R_PAREN@65..66 ")" WHITESPACE@66..67 " " @@ -77,7 +80,8 @@ SOURCE_FILE@0..128 WHITESPACE@82..83 " " MUT_KW@83..86 "mut" WHITESPACE@86..87 " " - SELF_KW@87..91 "self" + NAME@87..91 + SELF_KW@87..91 "self" COMMA@91..92 "," WHITESPACE@92..93 " " PARAM@93..99 @@ -107,7 +111,8 @@ SOURCE_FILE@0..128 SELF_PARAM@113..121 MUT_KW@113..116 "mut" WHITESPACE@116..117 " " - SELF_KW@117..121 "self" + NAME@117..121 + SELF_KW@117..121 "self" R_PAREN@121..122 ")" WHITESPACE@122..123 " " BLOCK_EXPR@123..125 diff --git a/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast b/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast index ddbd66588..df59f37a2 100644 --- a/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast +++ b/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast @@ -19,7 +19,8 @@ SOURCE_FILE@0..69 PARAM_LIST@17..30 L_PAREN@17..18 "(" SELF_PARAM@18..29 - SELF_KW@18..22 "self" + NAME@18..22 + SELF_KW@18..22 "self" COLON@22..23 ":" WHITESPACE@23..24 " " REF_TYPE@24..29 @@ -45,7 +46,8 @@ SOURCE_FILE@0..69 SELF_PARAM@43..62 MUT_KW@43..46 "mut" WHITESPACE@46..47 " " - SELF_KW@47..51 "self" + NAME@47..51 + SELF_KW@47..51 "self" COLON@51..52 ":" WHITESPACE@52..53 " " PATH_TYPE@53..62 diff --git a/crates/syntax/test_data/parser/inline/ok/0021_impl_item_list.rast b/crates/syntax/test_data/parser/inline/ok/0021_impl_item_list.rast index ca0702aba..dc7f6295b 100644 --- a/crates/syntax/test_data/parser/inline/ok/0021_impl_item_list.rast +++ b/crates/syntax/test_data/parser/inline/ok/0021_impl_item_list.rast @@ -67,7 +67,8 @@ SOURCE_FILE@0..89 L_PAREN@76..77 "(" SELF_PARAM@77..82 AMP@77..78 "&" - SELF_KW@78..82 "self" + NAME@78..82 + SELF_KW@78..82 "self" R_PAREN@82..83 ")" WHITESPACE@83..84 " " BLOCK_EXPR@84..86 diff --git a/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rast b/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rast index 50742cbcf..f2ead8a62 100644 --- a/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rast +++ b/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rast @@ -1,9 +1,12 @@ -SOURCE_FILE@0..81 +SOURCE_FILE@0..62 STRUCT@0..20 VISIBILITY@0..10 PUB_KW@0..3 "pub" L_PAREN@3..4 "(" - CRATE_KW@4..9 "crate" + PATH@4..9 + PATH_SEGMENT@4..9 + NAME_REF@4..9 + CRATE_KW@4..9 "crate" R_PAREN@9..10 ")" WHITESPACE@10..11 " " STRUCT_KW@11..17 "struct" @@ -16,7 +19,10 @@ SOURCE_FILE@0..81 VISIBILITY@21..30 PUB_KW@21..24 "pub" L_PAREN@24..25 "(" - SELF_KW@25..29 "self" + PATH@25..29 + PATH_SEGMENT@25..29 + NAME_REF@25..29 + SELF_KW@25..29 "self" R_PAREN@29..30 ")" WHITESPACE@30..31 " " STRUCT_KW@31..37 "struct" @@ -25,29 +31,19 @@ SOURCE_FILE@0..81 IDENT@38..39 "S" SEMICOLON@39..40 ";" WHITESPACE@40..41 "\n" - STRUCT@41..60 - VISIBILITY@41..50 + STRUCT@41..61 + VISIBILITY@41..51 PUB_KW@41..44 "pub" L_PAREN@44..45 "(" - SELF_KW@45..49 "self" - R_PAREN@49..50 ")" - WHITESPACE@50..51 " " - STRUCT_KW@51..57 "struct" - WHITESPACE@57..58 " " - NAME@58..59 - IDENT@58..59 "S" - SEMICOLON@59..60 ";" - WHITESPACE@60..61 "\n" - STRUCT@61..80 - VISIBILITY@61..70 - PUB_KW@61..64 "pub" - L_PAREN@64..65 "(" - SELF_KW@65..69 "self" - R_PAREN@69..70 ")" - WHITESPACE@70..71 " " - STRUCT_KW@71..77 "struct" - WHITESPACE@77..78 " " - NAME@78..79 - IDENT@78..79 "S" - SEMICOLON@79..80 ";" - WHITESPACE@80..81 "\n" + PATH@45..50 + PATH_SEGMENT@45..50 + NAME_REF@45..50 + SUPER_KW@45..50 "super" + R_PAREN@50..51 ")" + WHITESPACE@51..52 " " + STRUCT_KW@52..58 "struct" + WHITESPACE@58..59 " " + NAME@59..60 + IDENT@59..60 "S" + SEMICOLON@60..61 ";" + WHITESPACE@61..62 "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rs b/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rs index faeefde94..a790a485f 100644 --- a/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rs +++ b/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rs @@ -1,4 +1,3 @@ pub(crate) struct S; pub(self) struct S; -pub(self) struct S; -pub(self) struct S; +pub(super) struct S; diff --git a/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast b/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast index d3219f0b2..c54e64e3f 100644 --- a/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast +++ b/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast @@ -16,7 +16,8 @@ SOURCE_FILE@0..26 IDENT@7..15 "must_use" R_BRACK@15..16 "]" WHITESPACE@16..17 " " - SELF_KW@17..21 "self" + NAME@17..21 + SELF_KW@17..21 "self" R_PAREN@21..22 ")" WHITESPACE@22..23 " " BLOCK_EXPR@23..25 diff --git a/crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rast b/crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rast new file mode 100644 index 000000000..3d855fc6b --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rast @@ -0,0 +1,42 @@ +SOURCE_FILE@0..51 + STRUCT@0..26 + VISIBILITY@0..16 + PUB_KW@0..3 "pub" + L_PAREN@3..4 "(" + IN_KW@4..6 "in" + WHITESPACE@6..7 " " + PATH@7..15 + PATH@7..12 + PATH_SEGMENT@7..12 + NAME_REF@7..12 + SUPER_KW@7..12 "super" + COLON2@12..14 "::" + PATH_SEGMENT@14..15 + NAME_REF@14..15 + IDENT@14..15 "A" + R_PAREN@15..16 ")" + WHITESPACE@16..17 " " + STRUCT_KW@17..23 "struct" + WHITESPACE@23..24 " " + NAME@24..25 + IDENT@24..25 "S" + SEMICOLON@25..26 ";" + WHITESPACE@26..27 "\n" + STRUCT@27..50 + VISIBILITY@27..40 + PUB_KW@27..30 "pub" + L_PAREN@30..31 "(" + IN_KW@31..33 "in" + WHITESPACE@33..34 " " + PATH@34..39 + PATH_SEGMENT@34..39 + NAME_REF@34..39 + CRATE_KW@34..39 "crate" + R_PAREN@39..40 ")" + WHITESPACE@40..41 " " + STRUCT_KW@41..47 "struct" + WHITESPACE@47..48 " " + NAME@48..49 + IDENT@48..49 "S" + SEMICOLON@49..50 ";" + WHITESPACE@50..51 "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rs b/crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rs new file mode 100644 index 000000000..2856dbd84 --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rs @@ -0,0 +1,2 @@ +pub(in super::A) struct S; +pub(in crate) struct S; -- cgit v1.2.3