diff options
Diffstat (limited to 'crates')
9 files changed, 571 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/params.rs b/crates/ra_parser/src/grammar/params.rs index 723b56343..0b09f1874 100644 --- a/crates/ra_parser/src/grammar/params.rs +++ b/crates/ra_parser/src/grammar/params.rs | |||
@@ -41,9 +41,20 @@ fn list_(p: &mut Parser, flavor: Flavor) { | |||
41 | let m = p.start(); | 41 | let m = p.start(); |
42 | p.bump(); | 42 | p.bump(); |
43 | if flavor.type_required() { | 43 | if flavor.type_required() { |
44 | // test self_param_outer_attr | ||
45 | // fn f(#[must_use] self) {} | ||
46 | attributes::outer_attributes(p); | ||
44 | opt_self_param(p); | 47 | opt_self_param(p); |
45 | } | 48 | } |
46 | while !p.at(EOF) && !p.at(ket) && !(flavor.type_required() && p.at(T![...])) { | 49 | while !p.at(EOF) && !p.at(ket) { |
50 | // test param_outer_arg | ||
51 | // fn f(#[attr1] pat: Type) {} | ||
52 | attributes::outer_attributes(p); | ||
53 | |||
54 | if flavor.type_required() && p.at(T![...]) { | ||
55 | break; | ||
56 | } | ||
57 | |||
47 | if !p.at_ts(VALUE_PARAMETER_FIRST) { | 58 | if !p.at_ts(VALUE_PARAMETER_FIRST) { |
48 | p.error("expected value parameter"); | 59 | p.error("expected value parameter"); |
49 | break; | 60 | break; |
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index da8cf4ae8..f322e1d84 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -2013,6 +2013,7 @@ impl AstNode for Param { | |||
2013 | 2013 | ||
2014 | 2014 | ||
2015 | impl ast::TypeAscriptionOwner for Param {} | 2015 | impl ast::TypeAscriptionOwner for Param {} |
2016 | impl ast::AttrsOwner for Param {} | ||
2016 | impl Param { | 2017 | impl Param { |
2017 | pub fn pat(&self) -> Option<Pat> { | 2018 | pub fn pat(&self) -> Option<Pat> { |
2018 | super::child_opt(self) | 2019 | super::child_opt(self) |
@@ -2667,6 +2668,7 @@ impl AstNode for SelfParam { | |||
2667 | 2668 | ||
2668 | 2669 | ||
2669 | impl ast::TypeAscriptionOwner for SelfParam {} | 2670 | impl ast::TypeAscriptionOwner for SelfParam {} |
2671 | impl ast::AttrsOwner for SelfParam {} | ||
2670 | impl SelfParam {} | 2672 | impl SelfParam {} |
2671 | 2673 | ||
2672 | // SlicePat | 2674 | // SlicePat |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 817dedfbf..f2c20573e 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -642,12 +642,14 @@ Grammar( | |||
642 | "SelfParam": ( | 642 | "SelfParam": ( |
643 | traits: [ | 643 | traits: [ |
644 | "TypeAscriptionOwner", | 644 | "TypeAscriptionOwner", |
645 | "AttrsOwner", | ||
645 | ] | 646 | ] |
646 | ), | 647 | ), |
647 | "Param": ( | 648 | "Param": ( |
648 | options: [ "Pat" ], | 649 | options: [ "Pat" ], |
649 | traits: [ | 650 | traits: [ |
650 | "TypeAscriptionOwner", | 651 | "TypeAscriptionOwner", |
652 | "AttrsOwner", | ||
651 | ] | 653 | ] |
652 | ), | 654 | ), |
653 | "UseItem": ( | 655 | "UseItem": ( |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rs b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rs new file mode 100644 index 000000000..35155057a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rs | |||
@@ -0,0 +1 @@ | |||
fn f(#[must_use] self) {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.txt new file mode 100644 index 000000000..49b14e632 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | SOURCE_FILE@[0; 26) | ||
2 | FN_DEF@[0; 25) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "f" | ||
7 | PARAM_LIST@[4; 22) | ||
8 | L_PAREN@[4; 5) "(" | ||
9 | ATTR@[5; 16) | ||
10 | POUND@[5; 6) "#" | ||
11 | TOKEN_TREE@[6; 16) | ||
12 | L_BRACK@[6; 7) "[" | ||
13 | IDENT@[7; 15) "must_use" | ||
14 | R_BRACK@[15; 16) "]" | ||
15 | WHITESPACE@[16; 17) " " | ||
16 | SELF_PARAM@[17; 21) | ||
17 | SELF_KW@[17; 21) "self" | ||
18 | R_PAREN@[21; 22) ")" | ||
19 | WHITESPACE@[22; 23) " " | ||
20 | BLOCK@[23; 25) | ||
21 | L_CURLY@[23; 24) "{" | ||
22 | R_CURLY@[24; 25) "}" | ||
23 | WHITESPACE@[25; 26) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rs b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rs new file mode 100644 index 000000000..c238be791 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rs | |||
@@ -0,0 +1 @@ | |||
fn f(#[attr1] pat: Type) {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.txt b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.txt new file mode 100644 index 000000000..91c5e5f9a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | SOURCE_FILE@[0; 28) | ||
2 | FN_DEF@[0; 27) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "f" | ||
7 | PARAM_LIST@[4; 24) | ||
8 | L_PAREN@[4; 5) "(" | ||
9 | ATTR@[5; 13) | ||
10 | POUND@[5; 6) "#" | ||
11 | TOKEN_TREE@[6; 13) | ||
12 | L_BRACK@[6; 7) "[" | ||
13 | IDENT@[7; 12) "attr1" | ||
14 | R_BRACK@[12; 13) "]" | ||
15 | WHITESPACE@[13; 14) " " | ||
16 | PARAM@[14; 23) | ||
17 | BIND_PAT@[14; 17) | ||
18 | NAME@[14; 17) | ||
19 | IDENT@[14; 17) "pat" | ||
20 | COLON@[17; 18) ":" | ||
21 | WHITESPACE@[18; 19) " " | ||
22 | PATH_TYPE@[19; 23) | ||
23 | PATH@[19; 23) | ||
24 | PATH_SEGMENT@[19; 23) | ||
25 | NAME_REF@[19; 23) | ||
26 | IDENT@[19; 23) "Type" | ||
27 | R_PAREN@[23; 24) ")" | ||
28 | WHITESPACE@[24; 25) " " | ||
29 | BLOCK@[25; 27) | ||
30 | L_CURLY@[25; 26) "{" | ||
31 | R_CURLY@[26; 27) "}" | ||
32 | WHITESPACE@[27; 28) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rs b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rs new file mode 100644 index 000000000..de350d858 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rs | |||
@@ -0,0 +1,21 @@ | |||
1 | fn g1(#[attr1] #[attr2] pat: Type) {} | ||
2 | fn g2(#[attr1] x: u8) {} | ||
3 | |||
4 | extern "C" { fn printf(format: *const i8, #[attr] ...) -> i32; } | ||
5 | |||
6 | fn foo<F: FnMut(#[attr] &mut Foo<'a>)>(){} | ||
7 | |||
8 | trait Foo { | ||
9 | fn bar(#[attr] _: u64, # [attr] mut x: i32); | ||
10 | } | ||
11 | |||
12 | impl S { | ||
13 | fn f(#[must_use] self) {} | ||
14 | fn g1(#[attr] self) {} | ||
15 | fn g2(#[attr] &self) {} | ||
16 | fn g3<'a>(#[attr] &mut self) {} | ||
17 | fn g4<'a>(#[attr] &'a self) {} | ||
18 | fn g5<'a>(#[attr] &'a mut self) {} | ||
19 | fn c(#[attr] self: Self) {} | ||
20 | fn d(#[attr] self: Rc<Self>) {} | ||
21 | } \ No newline at end of file | ||
diff --git a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.txt b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.txt new file mode 100644 index 000000000..b360f29f4 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.txt | |||
@@ -0,0 +1,477 @@ | |||
1 | SOURCE_FILE@[0; 519) | ||
2 | FN_DEF@[0; 37) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 5) | ||
6 | IDENT@[3; 5) "g1" | ||
7 | PARAM_LIST@[5; 34) | ||
8 | L_PAREN@[5; 6) "(" | ||
9 | ATTR@[6; 14) | ||
10 | POUND@[6; 7) "#" | ||
11 | TOKEN_TREE@[7; 14) | ||
12 | L_BRACK@[7; 8) "[" | ||
13 | IDENT@[8; 13) "attr1" | ||
14 | R_BRACK@[13; 14) "]" | ||
15 | WHITESPACE@[14; 15) " " | ||
16 | ATTR@[15; 23) | ||
17 | POUND@[15; 16) "#" | ||
18 | TOKEN_TREE@[16; 23) | ||
19 | L_BRACK@[16; 17) "[" | ||
20 | IDENT@[17; 22) "attr2" | ||
21 | R_BRACK@[22; 23) "]" | ||
22 | WHITESPACE@[23; 24) " " | ||
23 | PARAM@[24; 33) | ||
24 | BIND_PAT@[24; 27) | ||
25 | NAME@[24; 27) | ||
26 | IDENT@[24; 27) "pat" | ||
27 | COLON@[27; 28) ":" | ||
28 | WHITESPACE@[28; 29) " " | ||
29 | PATH_TYPE@[29; 33) | ||
30 | PATH@[29; 33) | ||
31 | PATH_SEGMENT@[29; 33) | ||
32 | NAME_REF@[29; 33) | ||
33 | IDENT@[29; 33) "Type" | ||
34 | R_PAREN@[33; 34) ")" | ||
35 | WHITESPACE@[34; 35) " " | ||
36 | BLOCK@[35; 37) | ||
37 | L_CURLY@[35; 36) "{" | ||
38 | R_CURLY@[36; 37) "}" | ||
39 | WHITESPACE@[37; 38) "\n" | ||
40 | FN_DEF@[38; 62) | ||
41 | FN_KW@[38; 40) "fn" | ||
42 | WHITESPACE@[40; 41) " " | ||
43 | NAME@[41; 43) | ||
44 | IDENT@[41; 43) "g2" | ||
45 | PARAM_LIST@[43; 59) | ||
46 | L_PAREN@[43; 44) "(" | ||
47 | ATTR@[44; 52) | ||
48 | POUND@[44; 45) "#" | ||
49 | TOKEN_TREE@[45; 52) | ||
50 | L_BRACK@[45; 46) "[" | ||
51 | IDENT@[46; 51) "attr1" | ||
52 | R_BRACK@[51; 52) "]" | ||
53 | WHITESPACE@[52; 53) " " | ||
54 | PARAM@[53; 58) | ||
55 | BIND_PAT@[53; 54) | ||
56 | NAME@[53; 54) | ||
57 | IDENT@[53; 54) "x" | ||
58 | COLON@[54; 55) ":" | ||
59 | WHITESPACE@[55; 56) " " | ||
60 | PATH_TYPE@[56; 58) | ||
61 | PATH@[56; 58) | ||
62 | PATH_SEGMENT@[56; 58) | ||
63 | NAME_REF@[56; 58) | ||
64 | IDENT@[56; 58) "u8" | ||
65 | R_PAREN@[58; 59) ")" | ||
66 | WHITESPACE@[59; 60) " " | ||
67 | BLOCK@[60; 62) | ||
68 | L_CURLY@[60; 61) "{" | ||
69 | R_CURLY@[61; 62) "}" | ||
70 | WHITESPACE@[62; 64) "\n\n" | ||
71 | EXTERN_BLOCK@[64; 128) | ||
72 | ABI@[64; 74) | ||
73 | EXTERN_KW@[64; 70) "extern" | ||
74 | WHITESPACE@[70; 71) " " | ||
75 | STRING@[71; 74) "\"C\"" | ||
76 | WHITESPACE@[74; 75) " " | ||
77 | EXTERN_ITEM_LIST@[75; 128) | ||
78 | L_CURLY@[75; 76) "{" | ||
79 | WHITESPACE@[76; 77) " " | ||
80 | FN_DEF@[77; 126) | ||
81 | FN_KW@[77; 79) "fn" | ||
82 | WHITESPACE@[79; 80) " " | ||
83 | NAME@[80; 86) | ||
84 | IDENT@[80; 86) "printf" | ||
85 | PARAM_LIST@[86; 118) | ||
86 | L_PAREN@[86; 87) "(" | ||
87 | PARAM@[87; 104) | ||
88 | BIND_PAT@[87; 93) | ||
89 | NAME@[87; 93) | ||
90 | IDENT@[87; 93) "format" | ||
91 | COLON@[93; 94) ":" | ||
92 | WHITESPACE@[94; 95) " " | ||
93 | POINTER_TYPE@[95; 104) | ||
94 | STAR@[95; 96) "*" | ||
95 | CONST_KW@[96; 101) "const" | ||
96 | WHITESPACE@[101; 102) " " | ||
97 | PATH_TYPE@[102; 104) | ||
98 | PATH@[102; 104) | ||
99 | PATH_SEGMENT@[102; 104) | ||
100 | NAME_REF@[102; 104) | ||
101 | IDENT@[102; 104) "i8" | ||
102 | COMMA@[104; 105) "," | ||
103 | WHITESPACE@[105; 106) " " | ||
104 | ATTR@[106; 113) | ||
105 | POUND@[106; 107) "#" | ||
106 | TOKEN_TREE@[107; 113) | ||
107 | L_BRACK@[107; 108) "[" | ||
108 | IDENT@[108; 112) "attr" | ||
109 | R_BRACK@[112; 113) "]" | ||
110 | WHITESPACE@[113; 114) " " | ||
111 | DOTDOTDOT@[114; 117) "..." | ||
112 | R_PAREN@[117; 118) ")" | ||
113 | WHITESPACE@[118; 119) " " | ||
114 | RET_TYPE@[119; 125) | ||
115 | THIN_ARROW@[119; 121) "->" | ||
116 | WHITESPACE@[121; 122) " " | ||
117 | PATH_TYPE@[122; 125) | ||
118 | PATH@[122; 125) | ||
119 | PATH_SEGMENT@[122; 125) | ||
120 | NAME_REF@[122; 125) | ||
121 | IDENT@[122; 125) "i32" | ||
122 | SEMI@[125; 126) ";" | ||
123 | WHITESPACE@[126; 127) " " | ||
124 | R_CURLY@[127; 128) "}" | ||
125 | WHITESPACE@[128; 130) "\n\n" | ||
126 | FN_DEF@[130; 172) | ||
127 | FN_KW@[130; 132) "fn" | ||
128 | WHITESPACE@[132; 133) " " | ||
129 | NAME@[133; 136) | ||
130 | IDENT@[133; 136) "foo" | ||
131 | TYPE_PARAM_LIST@[136; 168) | ||
132 | L_ANGLE@[136; 137) "<" | ||
133 | TYPE_PARAM@[137; 167) | ||
134 | NAME@[137; 138) | ||
135 | IDENT@[137; 138) "F" | ||
136 | COLON@[138; 139) ":" | ||
137 | WHITESPACE@[139; 140) " " | ||
138 | TYPE_BOUND_LIST@[140; 167) | ||
139 | TYPE_BOUND@[140; 167) | ||
140 | PATH_TYPE@[140; 167) | ||
141 | PATH@[140; 167) | ||
142 | PATH_SEGMENT@[140; 167) | ||
143 | NAME_REF@[140; 145) | ||
144 | IDENT@[140; 145) "FnMut" | ||
145 | PARAM_LIST@[145; 167) | ||
146 | L_PAREN@[145; 146) "(" | ||
147 | ATTR@[146; 153) | ||
148 | POUND@[146; 147) "#" | ||
149 | TOKEN_TREE@[147; 153) | ||
150 | L_BRACK@[147; 148) "[" | ||
151 | IDENT@[148; 152) "attr" | ||
152 | R_BRACK@[152; 153) "]" | ||
153 | WHITESPACE@[153; 154) " " | ||
154 | PARAM@[154; 166) | ||
155 | REFERENCE_TYPE@[154; 166) | ||
156 | AMP@[154; 155) "&" | ||
157 | MUT_KW@[155; 158) "mut" | ||
158 | WHITESPACE@[158; 159) " " | ||
159 | PATH_TYPE@[159; 166) | ||
160 | PATH@[159; 166) | ||
161 | PATH_SEGMENT@[159; 166) | ||
162 | NAME_REF@[159; 162) | ||
163 | IDENT@[159; 162) "Foo" | ||
164 | TYPE_ARG_LIST@[162; 166) | ||
165 | L_ANGLE@[162; 163) "<" | ||
166 | LIFETIME_ARG@[163; 165) | ||
167 | LIFETIME@[163; 165) "\'a" | ||
168 | R_ANGLE@[165; 166) ">" | ||
169 | R_PAREN@[166; 167) ")" | ||
170 | R_ANGLE@[167; 168) ">" | ||
171 | PARAM_LIST@[168; 170) | ||
172 | L_PAREN@[168; 169) "(" | ||
173 | R_PAREN@[169; 170) ")" | ||
174 | BLOCK@[170; 172) | ||
175 | L_CURLY@[170; 171) "{" | ||
176 | R_CURLY@[171; 172) "}" | ||
177 | WHITESPACE@[172; 174) "\n\n" | ||
178 | TRAIT_DEF@[174; 236) | ||
179 | TRAIT_KW@[174; 179) "trait" | ||
180 | WHITESPACE@[179; 180) " " | ||
181 | NAME@[180; 183) | ||
182 | IDENT@[180; 183) "Foo" | ||
183 | WHITESPACE@[183; 184) " " | ||
184 | ITEM_LIST@[184; 236) | ||
185 | L_CURLY@[184; 185) "{" | ||
186 | WHITESPACE@[185; 190) "\n " | ||
187 | FN_DEF@[190; 234) | ||
188 | FN_KW@[190; 192) "fn" | ||
189 | WHITESPACE@[192; 193) " " | ||
190 | NAME@[193; 196) | ||
191 | IDENT@[193; 196) "bar" | ||
192 | PARAM_LIST@[196; 233) | ||
193 | L_PAREN@[196; 197) "(" | ||
194 | ATTR@[197; 204) | ||
195 | POUND@[197; 198) "#" | ||
196 | TOKEN_TREE@[198; 204) | ||
197 | L_BRACK@[198; 199) "[" | ||
198 | IDENT@[199; 203) "attr" | ||
199 | R_BRACK@[203; 204) "]" | ||
200 | WHITESPACE@[204; 205) " " | ||
201 | PARAM@[205; 211) | ||
202 | PLACEHOLDER_PAT@[205; 206) | ||
203 | UNDERSCORE@[205; 206) "_" | ||
204 | COLON@[206; 207) ":" | ||
205 | WHITESPACE@[207; 208) " " | ||
206 | PATH_TYPE@[208; 211) | ||
207 | PATH@[208; 211) | ||
208 | PATH_SEGMENT@[208; 211) | ||
209 | NAME_REF@[208; 211) | ||
210 | IDENT@[208; 211) "u64" | ||
211 | COMMA@[211; 212) "," | ||
212 | WHITESPACE@[212; 213) " " | ||
213 | ATTR@[213; 221) | ||
214 | POUND@[213; 214) "#" | ||
215 | WHITESPACE@[214; 215) " " | ||
216 | TOKEN_TREE@[215; 221) | ||
217 | L_BRACK@[215; 216) "[" | ||
218 | IDENT@[216; 220) "attr" | ||
219 | R_BRACK@[220; 221) "]" | ||
220 | WHITESPACE@[221; 222) " " | ||
221 | PARAM@[222; 232) | ||
222 | BIND_PAT@[222; 227) | ||
223 | MUT_KW@[222; 225) "mut" | ||
224 | WHITESPACE@[225; 226) " " | ||
225 | NAME@[226; 227) | ||
226 | IDENT@[226; 227) "x" | ||
227 | COLON@[227; 228) ":" | ||
228 | WHITESPACE@[228; 229) " " | ||
229 | PATH_TYPE@[229; 232) | ||
230 | PATH@[229; 232) | ||
231 | PATH_SEGMENT@[229; 232) | ||
232 | NAME_REF@[229; 232) | ||
233 | IDENT@[229; 232) "i32" | ||
234 | R_PAREN@[232; 233) ")" | ||
235 | SEMI@[233; 234) ";" | ||
236 | WHITESPACE@[234; 235) "\n" | ||
237 | R_CURLY@[235; 236) "}" | ||
238 | WHITESPACE@[236; 238) "\n\n" | ||
239 | IMPL_BLOCK@[238; 519) | ||
240 | IMPL_KW@[238; 242) "impl" | ||
241 | WHITESPACE@[242; 243) " " | ||
242 | PATH_TYPE@[243; 244) | ||
243 | PATH@[243; 244) | ||
244 | PATH_SEGMENT@[243; 244) | ||
245 | NAME_REF@[243; 244) | ||
246 | IDENT@[243; 244) "S" | ||
247 | WHITESPACE@[244; 245) " " | ||
248 | ITEM_LIST@[245; 519) | ||
249 | L_CURLY@[245; 246) "{" | ||
250 | WHITESPACE@[246; 252) "\n " | ||
251 | FN_DEF@[252; 277) | ||
252 | FN_KW@[252; 254) "fn" | ||
253 | WHITESPACE@[254; 255) " " | ||
254 | NAME@[255; 256) | ||
255 | IDENT@[255; 256) "f" | ||
256 | PARAM_LIST@[256; 274) | ||
257 | L_PAREN@[256; 257) "(" | ||
258 | ATTR@[257; 268) | ||
259 | POUND@[257; 258) "#" | ||
260 | TOKEN_TREE@[258; 268) | ||
261 | L_BRACK@[258; 259) "[" | ||
262 | IDENT@[259; 267) "must_use" | ||
263 | R_BRACK@[267; 268) "]" | ||
264 | WHITESPACE@[268; 269) " " | ||
265 | SELF_PARAM@[269; 273) | ||
266 | SELF_KW@[269; 273) "self" | ||
267 | R_PAREN@[273; 274) ")" | ||
268 | WHITESPACE@[274; 275) " " | ||
269 | BLOCK@[275; 277) | ||
270 | L_CURLY@[275; 276) "{" | ||
271 | R_CURLY@[276; 277) "}" | ||
272 | WHITESPACE@[277; 283) "\n " | ||
273 | FN_DEF@[283; 305) | ||
274 | FN_KW@[283; 285) "fn" | ||
275 | WHITESPACE@[285; 286) " " | ||
276 | NAME@[286; 288) | ||
277 | IDENT@[286; 288) "g1" | ||
278 | PARAM_LIST@[288; 302) | ||
279 | L_PAREN@[288; 289) "(" | ||
280 | ATTR@[289; 296) | ||
281 | POUND@[289; 290) "#" | ||
282 | TOKEN_TREE@[290; 296) | ||
283 | L_BRACK@[290; 291) "[" | ||
284 | IDENT@[291; 295) "attr" | ||
285 | R_BRACK@[295; 296) "]" | ||
286 | WHITESPACE@[296; 297) " " | ||
287 | SELF_PARAM@[297; 301) | ||
288 | SELF_KW@[297; 301) "self" | ||
289 | R_PAREN@[301; 302) ")" | ||
290 | WHITESPACE@[302; 303) " " | ||
291 | BLOCK@[303; 305) | ||
292 | L_CURLY@[303; 304) "{" | ||
293 | R_CURLY@[304; 305) "}" | ||
294 | WHITESPACE@[305; 311) "\n " | ||
295 | FN_DEF@[311; 334) | ||
296 | FN_KW@[311; 313) "fn" | ||
297 | WHITESPACE@[313; 314) " " | ||
298 | NAME@[314; 316) | ||
299 | IDENT@[314; 316) "g2" | ||
300 | PARAM_LIST@[316; 331) | ||
301 | L_PAREN@[316; 317) "(" | ||
302 | ATTR@[317; 324) | ||
303 | POUND@[317; 318) "#" | ||
304 | TOKEN_TREE@[318; 324) | ||
305 | L_BRACK@[318; 319) "[" | ||
306 | IDENT@[319; 323) "attr" | ||
307 | R_BRACK@[323; 324) "]" | ||
308 | WHITESPACE@[324; 325) " " | ||
309 | SELF_PARAM@[325; 330) | ||
310 | AMP@[325; 326) "&" | ||
311 | SELF_KW@[326; 330) "self" | ||
312 | R_PAREN@[330; 331) ")" | ||
313 | WHITESPACE@[331; 332) " " | ||
314 | BLOCK@[332; 334) | ||
315 | L_CURLY@[332; 333) "{" | ||
316 | R_CURLY@[333; 334) "}" | ||
317 | WHITESPACE@[334; 340) "\n " | ||
318 | FN_DEF@[340; 371) | ||
319 | FN_KW@[340; 342) "fn" | ||
320 | WHITESPACE@[342; 343) " " | ||
321 | NAME@[343; 345) | ||
322 | IDENT@[343; 345) "g3" | ||
323 | TYPE_PARAM_LIST@[345; 349) | ||
324 | L_ANGLE@[345; 346) "<" | ||
325 | LIFETIME_PARAM@[346; 348) | ||
326 | LIFETIME@[346; 348) "\'a" | ||
327 | R_ANGLE@[348; 349) ">" | ||
328 | PARAM_LIST@[349; 368) | ||
329 | L_PAREN@[349; 350) "(" | ||
330 | ATTR@[350; 357) | ||
331 | POUND@[350; 351) "#" | ||
332 | TOKEN_TREE@[351; 357) | ||
333 | L_BRACK@[351; 352) "[" | ||
334 | IDENT@[352; 356) "attr" | ||
335 | R_BRACK@[356; 357) "]" | ||
336 | WHITESPACE@[357; 358) " " | ||
337 | SELF_PARAM@[358; 367) | ||
338 | AMP@[358; 359) "&" | ||
339 | MUT_KW@[359; 362) "mut" | ||
340 | WHITESPACE@[362; 363) " " | ||
341 | SELF_KW@[363; 367) "self" | ||
342 | R_PAREN@[367; 368) ")" | ||
343 | WHITESPACE@[368; 369) " " | ||
344 | BLOCK@[369; 371) | ||
345 | L_CURLY@[369; 370) "{" | ||
346 | R_CURLY@[370; 371) "}" | ||
347 | WHITESPACE@[371; 377) "\n " | ||
348 | FN_DEF@[377; 407) | ||
349 | FN_KW@[377; 379) "fn" | ||
350 | WHITESPACE@[379; 380) " " | ||
351 | NAME@[380; 382) | ||
352 | IDENT@[380; 382) "g4" | ||
353 | TYPE_PARAM_LIST@[382; 386) | ||
354 | L_ANGLE@[382; 383) "<" | ||
355 | LIFETIME_PARAM@[383; 385) | ||
356 | LIFETIME@[383; 385) "\'a" | ||
357 | R_ANGLE@[385; 386) ">" | ||
358 | PARAM_LIST@[386; 404) | ||
359 | L_PAREN@[386; 387) "(" | ||
360 | ATTR@[387; 394) | ||
361 | POUND@[387; 388) "#" | ||
362 | TOKEN_TREE@[388; 394) | ||
363 | L_BRACK@[388; 389) "[" | ||
364 | IDENT@[389; 393) "attr" | ||
365 | R_BRACK@[393; 394) "]" | ||
366 | WHITESPACE@[394; 395) " " | ||
367 | SELF_PARAM@[395; 403) | ||
368 | AMP@[395; 396) "&" | ||
369 | LIFETIME@[396; 398) "\'a" | ||
370 | WHITESPACE@[398; 399) " " | ||
371 | SELF_KW@[399; 403) "self" | ||
372 | R_PAREN@[403; 404) ")" | ||
373 | WHITESPACE@[404; 405) " " | ||
374 | BLOCK@[405; 407) | ||
375 | L_CURLY@[405; 406) "{" | ||
376 | R_CURLY@[406; 407) "}" | ||
377 | WHITESPACE@[407; 413) "\n " | ||
378 | FN_DEF@[413; 447) | ||
379 | FN_KW@[413; 415) "fn" | ||
380 | WHITESPACE@[415; 416) " " | ||
381 | NAME@[416; 418) | ||
382 | IDENT@[416; 418) "g5" | ||
383 | TYPE_PARAM_LIST@[418; 422) | ||
384 | L_ANGLE@[418; 419) "<" | ||
385 | LIFETIME_PARAM@[419; 421) | ||
386 | LIFETIME@[419; 421) "\'a" | ||
387 | R_ANGLE@[421; 422) ">" | ||
388 | PARAM_LIST@[422; 444) | ||
389 | L_PAREN@[422; 423) "(" | ||
390 | ATTR@[423; 430) | ||
391 | POUND@[423; 424) "#" | ||
392 | TOKEN_TREE@[424; 430) | ||
393 | L_BRACK@[424; 425) "[" | ||
394 | IDENT@[425; 429) "attr" | ||
395 | R_BRACK@[429; 430) "]" | ||
396 | WHITESPACE@[430; 431) " " | ||
397 | SELF_PARAM@[431; 443) | ||
398 | AMP@[431; 432) "&" | ||
399 | LIFETIME@[432; 434) "\'a" | ||
400 | WHITESPACE@[434; 435) " " | ||
401 | MUT_KW@[435; 438) "mut" | ||
402 | WHITESPACE@[438; 439) " " | ||
403 | SELF_KW@[439; 443) "self" | ||
404 | R_PAREN@[443; 444) ")" | ||
405 | WHITESPACE@[444; 445) " " | ||
406 | BLOCK@[445; 447) | ||
407 | L_CURLY@[445; 446) "{" | ||
408 | R_CURLY@[446; 447) "}" | ||
409 | WHITESPACE@[447; 453) "\n " | ||
410 | FN_DEF@[453; 480) | ||
411 | FN_KW@[453; 455) "fn" | ||
412 | WHITESPACE@[455; 456) " " | ||
413 | NAME@[456; 457) | ||
414 | IDENT@[456; 457) "c" | ||
415 | PARAM_LIST@[457; 477) | ||
416 | L_PAREN@[457; 458) "(" | ||
417 | ATTR@[458; 465) | ||
418 | POUND@[458; 459) "#" | ||
419 | TOKEN_TREE@[459; 465) | ||
420 | L_BRACK@[459; 460) "[" | ||
421 | IDENT@[460; 464) "attr" | ||
422 | R_BRACK@[464; 465) "]" | ||
423 | WHITESPACE@[465; 466) " " | ||
424 | SELF_PARAM@[466; 476) | ||
425 | SELF_KW@[466; 470) "self" | ||
426 | COLON@[470; 471) ":" | ||
427 | WHITESPACE@[471; 472) " " | ||
428 | PATH_TYPE@[472; 476) | ||
429 | PATH@[472; 476) | ||
430 | PATH_SEGMENT@[472; 476) | ||
431 | NAME_REF@[472; 476) | ||
432 | IDENT@[472; 476) "Self" | ||
433 | R_PAREN@[476; 477) ")" | ||
434 | WHITESPACE@[477; 478) " " | ||
435 | BLOCK@[478; 480) | ||
436 | L_CURLY@[478; 479) "{" | ||
437 | R_CURLY@[479; 480) "}" | ||
438 | WHITESPACE@[480; 486) "\n " | ||
439 | FN_DEF@[486; 517) | ||
440 | FN_KW@[486; 488) "fn" | ||
441 | WHITESPACE@[488; 489) " " | ||
442 | NAME@[489; 490) | ||
443 | IDENT@[489; 490) "d" | ||
444 | PARAM_LIST@[490; 514) | ||
445 | L_PAREN@[490; 491) "(" | ||
446 | ATTR@[491; 498) | ||
447 | POUND@[491; 492) "#" | ||
448 | TOKEN_TREE@[492; 498) | ||
449 | L_BRACK@[492; 493) "[" | ||
450 | IDENT@[493; 497) "attr" | ||
451 | R_BRACK@[497; 498) "]" | ||
452 | WHITESPACE@[498; 499) " " | ||
453 | SELF_PARAM@[499; 513) | ||
454 | SELF_KW@[499; 503) "self" | ||
455 | COLON@[503; 504) ":" | ||
456 | WHITESPACE@[504; 505) " " | ||
457 | PATH_TYPE@[505; 513) | ||
458 | PATH@[505; 513) | ||
459 | PATH_SEGMENT@[505; 513) | ||
460 | NAME_REF@[505; 507) | ||
461 | IDENT@[505; 507) "Rc" | ||
462 | TYPE_ARG_LIST@[507; 513) | ||
463 | L_ANGLE@[507; 508) "<" | ||
464 | TYPE_ARG@[508; 512) | ||
465 | PATH_TYPE@[508; 512) | ||
466 | PATH@[508; 512) | ||
467 | PATH_SEGMENT@[508; 512) | ||
468 | NAME_REF@[508; 512) | ||
469 | IDENT@[508; 512) "Self" | ||
470 | R_ANGLE@[512; 513) ">" | ||
471 | R_PAREN@[513; 514) ")" | ||
472 | WHITESPACE@[514; 515) " " | ||
473 | BLOCK@[515; 517) | ||
474 | L_CURLY@[515; 516) "{" | ||
475 | R_CURLY@[516; 517) "}" | ||
476 | WHITESPACE@[517; 518) "\n" | ||
477 | R_CURLY@[518; 519) "}" | ||