diff options
author | Evgenii P <[email protected]> | 2019-08-08 03:12:07 +0100 |
---|---|---|
committer | Evgenii P <[email protected]> | 2019-08-08 03:12:07 +0100 |
commit | 6fa2d8214784b6ecfc3fbcd98778d4e58fa8664e (patch) | |
tree | 77c26fd7d8066d14283258b118faf1d98e90ee12 /crates/ra_syntax/test_data/parser | |
parent | 77f4ab3e9bff67d9efbbf1c1be5575630bcbb1d8 (diff) |
Fix parser tests according to review
Diffstat (limited to 'crates/ra_syntax/test_data/parser')
18 files changed, 576 insertions, 485 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rs b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rs index 7811f52c0..80c0a43f5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rs +++ b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rs | |||
@@ -4,10 +4,4 @@ impl S { | |||
4 | fn c(&'a self,) {} | 4 | fn c(&'a self,) {} |
5 | fn d(&'a mut self, x: i32) {} | 5 | fn d(&'a mut self, x: i32) {} |
6 | fn e(mut self) {} | 6 | fn e(mut self) {} |
7 | fn f(#[must_use] self) {} | ||
8 | fn g1(#[attr] self) {} | ||
9 | fn g2(#[attr] &self) {} | ||
10 | fn g3<'a>(#[attr] &mut self) {} | ||
11 | fn g4<'a>(#[attr] &'a self) {} | ||
12 | fn g5<'a>(#[attr] &'a mut self) {} | ||
13 | } | 7 | } |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt index 5c75b6c75..8e210a6ca 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@[0; 323) | 1 | SOURCE_FILE@[0; 128) |
2 | IMPL_BLOCK@[0; 322) | 2 | IMPL_BLOCK@[0; 127) |
3 | IMPL_KW@[0; 4) "impl" | 3 | IMPL_KW@[0; 4) "impl" |
4 | WHITESPACE@[4; 5) " " | 4 | WHITESPACE@[4; 5) " " |
5 | PATH_TYPE@[5; 6) | 5 | PATH_TYPE@[5; 6) |
@@ -8,7 +8,7 @@ SOURCE_FILE@[0; 323) | |||
8 | NAME_REF@[5; 6) | 8 | NAME_REF@[5; 6) |
9 | IDENT@[5; 6) "S" | 9 | IDENT@[5; 6) "S" |
10 | WHITESPACE@[6; 7) " " | 10 | WHITESPACE@[6; 7) " " |
11 | ITEM_LIST@[7; 322) | 11 | ITEM_LIST@[7; 127) |
12 | L_CURLY@[7; 8) "{" | 12 | L_CURLY@[7; 8) "{" |
13 | WHITESPACE@[8; 13) "\n " | 13 | WHITESPACE@[8; 13) "\n " |
14 | FN_DEF@[13; 26) | 14 | FN_DEF@[13; 26) |
@@ -111,165 +111,6 @@ SOURCE_FILE@[0; 323) | |||
111 | BLOCK@[123; 125) | 111 | BLOCK@[123; 125) |
112 | L_CURLY@[123; 124) "{" | 112 | L_CURLY@[123; 124) "{" |
113 | R_CURLY@[124; 125) "}" | 113 | R_CURLY@[124; 125) "}" |
114 | WHITESPACE@[125; 130) "\n " | 114 | WHITESPACE@[125; 126) "\n" |
115 | FN_DEF@[130; 155) | 115 | R_CURLY@[126; 127) "}" |
116 | FN_KW@[130; 132) "fn" | 116 | WHITESPACE@[127; 128) "\n" |
117 | WHITESPACE@[132; 133) " " | ||
118 | NAME@[133; 134) | ||
119 | IDENT@[133; 134) "f" | ||
120 | PARAM_LIST@[134; 152) | ||
121 | L_PAREN@[134; 135) "(" | ||
122 | ATTR@[135; 146) | ||
123 | POUND@[135; 136) "#" | ||
124 | TOKEN_TREE@[136; 146) | ||
125 | L_BRACK@[136; 137) "[" | ||
126 | IDENT@[137; 145) "must_use" | ||
127 | R_BRACK@[145; 146) "]" | ||
128 | WHITESPACE@[146; 147) " " | ||
129 | SELF_PARAM@[147; 151) | ||
130 | SELF_KW@[147; 151) "self" | ||
131 | R_PAREN@[151; 152) ")" | ||
132 | WHITESPACE@[152; 153) " " | ||
133 | BLOCK@[153; 155) | ||
134 | L_CURLY@[153; 154) "{" | ||
135 | R_CURLY@[154; 155) "}" | ||
136 | WHITESPACE@[155; 160) "\n " | ||
137 | FN_DEF@[160; 182) | ||
138 | FN_KW@[160; 162) "fn" | ||
139 | WHITESPACE@[162; 163) " " | ||
140 | NAME@[163; 165) | ||
141 | IDENT@[163; 165) "g1" | ||
142 | PARAM_LIST@[165; 179) | ||
143 | L_PAREN@[165; 166) "(" | ||
144 | ATTR@[166; 173) | ||
145 | POUND@[166; 167) "#" | ||
146 | TOKEN_TREE@[167; 173) | ||
147 | L_BRACK@[167; 168) "[" | ||
148 | IDENT@[168; 172) "attr" | ||
149 | R_BRACK@[172; 173) "]" | ||
150 | WHITESPACE@[173; 174) " " | ||
151 | SELF_PARAM@[174; 178) | ||
152 | SELF_KW@[174; 178) "self" | ||
153 | R_PAREN@[178; 179) ")" | ||
154 | WHITESPACE@[179; 180) " " | ||
155 | BLOCK@[180; 182) | ||
156 | L_CURLY@[180; 181) "{" | ||
157 | R_CURLY@[181; 182) "}" | ||
158 | WHITESPACE@[182; 187) "\n " | ||
159 | FN_DEF@[187; 210) | ||
160 | FN_KW@[187; 189) "fn" | ||
161 | WHITESPACE@[189; 190) " " | ||
162 | NAME@[190; 192) | ||
163 | IDENT@[190; 192) "g2" | ||
164 | PARAM_LIST@[192; 207) | ||
165 | L_PAREN@[192; 193) "(" | ||
166 | ATTR@[193; 200) | ||
167 | POUND@[193; 194) "#" | ||
168 | TOKEN_TREE@[194; 200) | ||
169 | L_BRACK@[194; 195) "[" | ||
170 | IDENT@[195; 199) "attr" | ||
171 | R_BRACK@[199; 200) "]" | ||
172 | WHITESPACE@[200; 201) " " | ||
173 | SELF_PARAM@[201; 206) | ||
174 | AMP@[201; 202) "&" | ||
175 | SELF_KW@[202; 206) "self" | ||
176 | R_PAREN@[206; 207) ")" | ||
177 | WHITESPACE@[207; 208) " " | ||
178 | BLOCK@[208; 210) | ||
179 | L_CURLY@[208; 209) "{" | ||
180 | R_CURLY@[209; 210) "}" | ||
181 | WHITESPACE@[210; 215) "\n " | ||
182 | FN_DEF@[215; 246) | ||
183 | FN_KW@[215; 217) "fn" | ||
184 | WHITESPACE@[217; 218) " " | ||
185 | NAME@[218; 220) | ||
186 | IDENT@[218; 220) "g3" | ||
187 | TYPE_PARAM_LIST@[220; 224) | ||
188 | L_ANGLE@[220; 221) "<" | ||
189 | LIFETIME_PARAM@[221; 223) | ||
190 | LIFETIME@[221; 223) "\'a" | ||
191 | R_ANGLE@[223; 224) ">" | ||
192 | PARAM_LIST@[224; 243) | ||
193 | L_PAREN@[224; 225) "(" | ||
194 | ATTR@[225; 232) | ||
195 | POUND@[225; 226) "#" | ||
196 | TOKEN_TREE@[226; 232) | ||
197 | L_BRACK@[226; 227) "[" | ||
198 | IDENT@[227; 231) "attr" | ||
199 | R_BRACK@[231; 232) "]" | ||
200 | WHITESPACE@[232; 233) " " | ||
201 | SELF_PARAM@[233; 242) | ||
202 | AMP@[233; 234) "&" | ||
203 | MUT_KW@[234; 237) "mut" | ||
204 | WHITESPACE@[237; 238) " " | ||
205 | SELF_KW@[238; 242) "self" | ||
206 | R_PAREN@[242; 243) ")" | ||
207 | WHITESPACE@[243; 244) " " | ||
208 | BLOCK@[244; 246) | ||
209 | L_CURLY@[244; 245) "{" | ||
210 | R_CURLY@[245; 246) "}" | ||
211 | WHITESPACE@[246; 251) "\n " | ||
212 | FN_DEF@[251; 281) | ||
213 | FN_KW@[251; 253) "fn" | ||
214 | WHITESPACE@[253; 254) " " | ||
215 | NAME@[254; 256) | ||
216 | IDENT@[254; 256) "g4" | ||
217 | TYPE_PARAM_LIST@[256; 260) | ||
218 | L_ANGLE@[256; 257) "<" | ||
219 | LIFETIME_PARAM@[257; 259) | ||
220 | LIFETIME@[257; 259) "\'a" | ||
221 | R_ANGLE@[259; 260) ">" | ||
222 | PARAM_LIST@[260; 278) | ||
223 | L_PAREN@[260; 261) "(" | ||
224 | ATTR@[261; 268) | ||
225 | POUND@[261; 262) "#" | ||
226 | TOKEN_TREE@[262; 268) | ||
227 | L_BRACK@[262; 263) "[" | ||
228 | IDENT@[263; 267) "attr" | ||
229 | R_BRACK@[267; 268) "]" | ||
230 | WHITESPACE@[268; 269) " " | ||
231 | SELF_PARAM@[269; 277) | ||
232 | AMP@[269; 270) "&" | ||
233 | LIFETIME@[270; 272) "\'a" | ||
234 | WHITESPACE@[272; 273) " " | ||
235 | SELF_KW@[273; 277) "self" | ||
236 | R_PAREN@[277; 278) ")" | ||
237 | WHITESPACE@[278; 279) " " | ||
238 | BLOCK@[279; 281) | ||
239 | L_CURLY@[279; 280) "{" | ||
240 | R_CURLY@[280; 281) "}" | ||
241 | WHITESPACE@[281; 286) "\n " | ||
242 | FN_DEF@[286; 320) | ||
243 | FN_KW@[286; 288) "fn" | ||
244 | WHITESPACE@[288; 289) " " | ||
245 | NAME@[289; 291) | ||
246 | IDENT@[289; 291) "g5" | ||
247 | TYPE_PARAM_LIST@[291; 295) | ||
248 | L_ANGLE@[291; 292) "<" | ||
249 | LIFETIME_PARAM@[292; 294) | ||
250 | LIFETIME@[292; 294) "\'a" | ||
251 | R_ANGLE@[294; 295) ">" | ||
252 | PARAM_LIST@[295; 317) | ||
253 | L_PAREN@[295; 296) "(" | ||
254 | ATTR@[296; 303) | ||
255 | POUND@[296; 297) "#" | ||
256 | TOKEN_TREE@[297; 303) | ||
257 | L_BRACK@[297; 298) "[" | ||
258 | IDENT@[298; 302) "attr" | ||
259 | R_BRACK@[302; 303) "]" | ||
260 | WHITESPACE@[303; 304) " " | ||
261 | SELF_PARAM@[304; 316) | ||
262 | AMP@[304; 305) "&" | ||
263 | LIFETIME@[305; 307) "\'a" | ||
264 | WHITESPACE@[307; 308) " " | ||
265 | MUT_KW@[308; 311) "mut" | ||
266 | WHITESPACE@[311; 312) " " | ||
267 | SELF_KW@[312; 316) "self" | ||
268 | R_PAREN@[316; 317) ")" | ||
269 | WHITESPACE@[317; 318) " " | ||
270 | BLOCK@[318; 320) | ||
271 | L_CURLY@[318; 319) "{" | ||
272 | R_CURLY@[319; 320) "}" | ||
273 | WHITESPACE@[320; 321) "\n" | ||
274 | R_CURLY@[321; 322) "}" | ||
275 | WHITESPACE@[322; 323) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rs b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rs index 077216dae..6a170d5ac 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rs +++ b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rs | |||
@@ -1,6 +1,4 @@ | |||
1 | impl S { | 1 | impl S { |
2 | fn a(self: &Self) {} | 2 | fn a(self: &Self) {} |
3 | fn b(mut self: Box<Self>) {} | 3 | fn b(mut self: Box<Self>) {} |
4 | fn c(#[attr] self: Self) {} | ||
5 | fn d(#[attr] self: Rc<Self>) {} | ||
6 | } | 4 | } |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt index ca49bcc26..67d0de0f0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@[0; 137) | 1 | SOURCE_FILE@[0; 69) |
2 | IMPL_BLOCK@[0; 136) | 2 | IMPL_BLOCK@[0; 68) |
3 | IMPL_KW@[0; 4) "impl" | 3 | IMPL_KW@[0; 4) "impl" |
4 | WHITESPACE@[4; 5) " " | 4 | WHITESPACE@[4; 5) " " |
5 | PATH_TYPE@[5; 6) | 5 | PATH_TYPE@[5; 6) |
@@ -8,7 +8,7 @@ SOURCE_FILE@[0; 137) | |||
8 | NAME_REF@[5; 6) | 8 | NAME_REF@[5; 6) |
9 | IDENT@[5; 6) "S" | 9 | IDENT@[5; 6) "S" |
10 | WHITESPACE@[6; 7) " " | 10 | WHITESPACE@[6; 7) " " |
11 | ITEM_LIST@[7; 136) | 11 | ITEM_LIST@[7; 68) |
12 | L_CURLY@[7; 8) "{" | 12 | L_CURLY@[7; 8) "{" |
13 | WHITESPACE@[8; 13) "\n " | 13 | WHITESPACE@[8; 13) "\n " |
14 | FN_DEF@[13; 33) | 14 | FN_DEF@[13; 33) |
@@ -67,73 +67,6 @@ SOURCE_FILE@[0; 137) | |||
67 | BLOCK@[64; 66) | 67 | BLOCK@[64; 66) |
68 | L_CURLY@[64; 65) "{" | 68 | L_CURLY@[64; 65) "{" |
69 | R_CURLY@[65; 66) "}" | 69 | R_CURLY@[65; 66) "}" |
70 | WHITESPACE@[66; 71) "\n " | 70 | WHITESPACE@[66; 67) "\n" |
71 | FN_DEF@[71; 98) | 71 | R_CURLY@[67; 68) "}" |
72 | FN_KW@[71; 73) "fn" | 72 | WHITESPACE@[68; 69) "\n" |
73 | WHITESPACE@[73; 74) " " | ||
74 | NAME@[74; 75) | ||
75 | IDENT@[74; 75) "c" | ||
76 | PARAM_LIST@[75; 95) | ||
77 | L_PAREN@[75; 76) "(" | ||
78 | ATTR@[76; 83) | ||
79 | POUND@[76; 77) "#" | ||
80 | TOKEN_TREE@[77; 83) | ||
81 | L_BRACK@[77; 78) "[" | ||
82 | IDENT@[78; 82) "attr" | ||
83 | R_BRACK@[82; 83) "]" | ||
84 | WHITESPACE@[83; 84) " " | ||
85 | SELF_PARAM@[84; 94) | ||
86 | SELF_KW@[84; 88) "self" | ||
87 | COLON@[88; 89) ":" | ||
88 | WHITESPACE@[89; 90) " " | ||
89 | PATH_TYPE@[90; 94) | ||
90 | PATH@[90; 94) | ||
91 | PATH_SEGMENT@[90; 94) | ||
92 | NAME_REF@[90; 94) | ||
93 | IDENT@[90; 94) "Self" | ||
94 | R_PAREN@[94; 95) ")" | ||
95 | WHITESPACE@[95; 96) " " | ||
96 | BLOCK@[96; 98) | ||
97 | L_CURLY@[96; 97) "{" | ||
98 | R_CURLY@[97; 98) "}" | ||
99 | WHITESPACE@[98; 103) "\n " | ||
100 | FN_DEF@[103; 134) | ||
101 | FN_KW@[103; 105) "fn" | ||
102 | WHITESPACE@[105; 106) " " | ||
103 | NAME@[106; 107) | ||
104 | IDENT@[106; 107) "d" | ||
105 | PARAM_LIST@[107; 131) | ||
106 | L_PAREN@[107; 108) "(" | ||
107 | ATTR@[108; 115) | ||
108 | POUND@[108; 109) "#" | ||
109 | TOKEN_TREE@[109; 115) | ||
110 | L_BRACK@[109; 110) "[" | ||
111 | IDENT@[110; 114) "attr" | ||
112 | R_BRACK@[114; 115) "]" | ||
113 | WHITESPACE@[115; 116) " " | ||
114 | SELF_PARAM@[116; 130) | ||
115 | SELF_KW@[116; 120) "self" | ||
116 | COLON@[120; 121) ":" | ||
117 | WHITESPACE@[121; 122) " " | ||
118 | PATH_TYPE@[122; 130) | ||
119 | PATH@[122; 130) | ||
120 | PATH_SEGMENT@[122; 130) | ||
121 | NAME_REF@[122; 124) | ||
122 | IDENT@[122; 124) "Rc" | ||
123 | TYPE_ARG_LIST@[124; 130) | ||
124 | L_ANGLE@[124; 125) "<" | ||
125 | TYPE_ARG@[125; 129) | ||
126 | PATH_TYPE@[125; 129) | ||
127 | PATH@[125; 129) | ||
128 | PATH_SEGMENT@[125; 129) | ||
129 | NAME_REF@[125; 129) | ||
130 | IDENT@[125; 129) "Self" | ||
131 | R_ANGLE@[129; 130) ">" | ||
132 | R_PAREN@[130; 131) ")" | ||
133 | WHITESPACE@[131; 132) " " | ||
134 | BLOCK@[132; 134) | ||
135 | L_CURLY@[132; 133) "{" | ||
136 | R_CURLY@[133; 134) "}" | ||
137 | WHITESPACE@[134; 135) "\n" | ||
138 | R_CURLY@[135; 136) "}" | ||
139 | WHITESPACE@[136; 137) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs index 9833dd8f1..9b93442c0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs +++ b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs | |||
@@ -1,2 +1 @@ | |||
1 | fn foo<F: FnMut(&mut Foo<'a>)>(){} | fn foo<F: FnMut(&mut Foo<'a>)>(){} | |
2 | fn foo<F: FnMut(#[attr] &mut Foo<'a>)>(){} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt index 0b377dfd4..f85d6a4bc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | SOURCE_FILE@[0; 78) | 1 | SOURCE_FILE@[0; 35) |
2 | FN_DEF@[0; 34) | 2 | FN_DEF@[0; 34) |
3 | FN_KW@[0; 2) "fn" | 3 | FN_KW@[0; 2) "fn" |
4 | WHITESPACE@[2; 3) " " | 4 | WHITESPACE@[2; 3) " " |
@@ -44,55 +44,3 @@ SOURCE_FILE@[0; 78) | |||
44 | L_CURLY@[32; 33) "{" | 44 | L_CURLY@[32; 33) "{" |
45 | R_CURLY@[33; 34) "}" | 45 | R_CURLY@[33; 34) "}" |
46 | WHITESPACE@[34; 35) "\n" | 46 | WHITESPACE@[34; 35) "\n" |
47 | FN_DEF@[35; 77) | ||
48 | FN_KW@[35; 37) "fn" | ||
49 | WHITESPACE@[37; 38) " " | ||
50 | NAME@[38; 41) | ||
51 | IDENT@[38; 41) "foo" | ||
52 | TYPE_PARAM_LIST@[41; 73) | ||
53 | L_ANGLE@[41; 42) "<" | ||
54 | TYPE_PARAM@[42; 72) | ||
55 | NAME@[42; 43) | ||
56 | IDENT@[42; 43) "F" | ||
57 | COLON@[43; 44) ":" | ||
58 | WHITESPACE@[44; 45) " " | ||
59 | TYPE_BOUND_LIST@[45; 72) | ||
60 | TYPE_BOUND@[45; 72) | ||
61 | PATH_TYPE@[45; 72) | ||
62 | PATH@[45; 72) | ||
63 | PATH_SEGMENT@[45; 72) | ||
64 | NAME_REF@[45; 50) | ||
65 | IDENT@[45; 50) "FnMut" | ||
66 | PARAM_LIST@[50; 72) | ||
67 | L_PAREN@[50; 51) "(" | ||
68 | ATTR@[51; 58) | ||
69 | POUND@[51; 52) "#" | ||
70 | TOKEN_TREE@[52; 58) | ||
71 | L_BRACK@[52; 53) "[" | ||
72 | IDENT@[53; 57) "attr" | ||
73 | R_BRACK@[57; 58) "]" | ||
74 | WHITESPACE@[58; 59) " " | ||
75 | PARAM@[59; 71) | ||
76 | REFERENCE_TYPE@[59; 71) | ||
77 | AMP@[59; 60) "&" | ||
78 | MUT_KW@[60; 63) "mut" | ||
79 | WHITESPACE@[63; 64) " " | ||
80 | PATH_TYPE@[64; 71) | ||
81 | PATH@[64; 71) | ||
82 | PATH_SEGMENT@[64; 71) | ||
83 | NAME_REF@[64; 67) | ||
84 | IDENT@[64; 67) "Foo" | ||
85 | TYPE_ARG_LIST@[67; 71) | ||
86 | L_ANGLE@[67; 68) "<" | ||
87 | LIFETIME_ARG@[68; 70) | ||
88 | LIFETIME@[68; 70) "\'a" | ||
89 | R_ANGLE@[70; 71) ">" | ||
90 | R_PAREN@[71; 72) ")" | ||
91 | R_ANGLE@[72; 73) ">" | ||
92 | PARAM_LIST@[73; 75) | ||
93 | L_PAREN@[73; 74) "(" | ||
94 | R_PAREN@[74; 75) ")" | ||
95 | BLOCK@[75; 77) | ||
96 | L_CURLY@[75; 76) "{" | ||
97 | R_CURLY@[76; 77) "}" | ||
98 | WHITESPACE@[77; 78) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rs b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rs index 83d870ba7..9d55bedbb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rs +++ b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rs | |||
@@ -2,5 +2,3 @@ fn a() {} | |||
2 | fn b(x: i32) {} | 2 | fn b(x: i32) {} |
3 | fn c(x: i32, ) {} | 3 | fn c(x: i32, ) {} |
4 | fn d(x: i32, y: ()) {} | 4 | fn d(x: i32, y: ()) {} |
5 | fn g1(#[attr1] #[attr2] pat: Type) {} | ||
6 | fn g2(#[attr1] x: u8) {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt index a9c63fa93..80d636819 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | SOURCE_FILE@[0; 130) | 1 | SOURCE_FILE@[0; 67) |
2 | FN_DEF@[0; 9) | 2 | FN_DEF@[0; 9) |
3 | FN_KW@[0; 2) "fn" | 3 | FN_KW@[0; 2) "fn" |
4 | WHITESPACE@[2; 3) " " | 4 | WHITESPACE@[2; 3) " " |
@@ -97,72 +97,3 @@ SOURCE_FILE@[0; 130) | |||
97 | L_CURLY@[64; 65) "{" | 97 | L_CURLY@[64; 65) "{" |
98 | R_CURLY@[65; 66) "}" | 98 | R_CURLY@[65; 66) "}" |
99 | WHITESPACE@[66; 67) "\n" | 99 | WHITESPACE@[66; 67) "\n" |
100 | FN_DEF@[67; 104) | ||
101 | FN_KW@[67; 69) "fn" | ||
102 | WHITESPACE@[69; 70) " " | ||
103 | NAME@[70; 72) | ||
104 | IDENT@[70; 72) "g1" | ||
105 | PARAM_LIST@[72; 101) | ||
106 | L_PAREN@[72; 73) "(" | ||
107 | ATTR@[73; 81) | ||
108 | POUND@[73; 74) "#" | ||
109 | TOKEN_TREE@[74; 81) | ||
110 | L_BRACK@[74; 75) "[" | ||
111 | IDENT@[75; 80) "attr1" | ||
112 | R_BRACK@[80; 81) "]" | ||
113 | WHITESPACE@[81; 82) " " | ||
114 | ATTR@[82; 90) | ||
115 | POUND@[82; 83) "#" | ||
116 | TOKEN_TREE@[83; 90) | ||
117 | L_BRACK@[83; 84) "[" | ||
118 | IDENT@[84; 89) "attr2" | ||
119 | R_BRACK@[89; 90) "]" | ||
120 | WHITESPACE@[90; 91) " " | ||
121 | PARAM@[91; 100) | ||
122 | BIND_PAT@[91; 94) | ||
123 | NAME@[91; 94) | ||
124 | IDENT@[91; 94) "pat" | ||
125 | COLON@[94; 95) ":" | ||
126 | WHITESPACE@[95; 96) " " | ||
127 | PATH_TYPE@[96; 100) | ||
128 | PATH@[96; 100) | ||
129 | PATH_SEGMENT@[96; 100) | ||
130 | NAME_REF@[96; 100) | ||
131 | IDENT@[96; 100) "Type" | ||
132 | R_PAREN@[100; 101) ")" | ||
133 | WHITESPACE@[101; 102) " " | ||
134 | BLOCK@[102; 104) | ||
135 | L_CURLY@[102; 103) "{" | ||
136 | R_CURLY@[103; 104) "}" | ||
137 | WHITESPACE@[104; 105) "\n" | ||
138 | FN_DEF@[105; 129) | ||
139 | FN_KW@[105; 107) "fn" | ||
140 | WHITESPACE@[107; 108) " " | ||
141 | NAME@[108; 110) | ||
142 | IDENT@[108; 110) "g2" | ||
143 | PARAM_LIST@[110; 126) | ||
144 | L_PAREN@[110; 111) "(" | ||
145 | ATTR@[111; 119) | ||
146 | POUND@[111; 112) "#" | ||
147 | TOKEN_TREE@[112; 119) | ||
148 | L_BRACK@[112; 113) "[" | ||
149 | IDENT@[113; 118) "attr1" | ||
150 | R_BRACK@[118; 119) "]" | ||
151 | WHITESPACE@[119; 120) " " | ||
152 | PARAM@[120; 125) | ||
153 | BIND_PAT@[120; 121) | ||
154 | NAME@[120; 121) | ||
155 | IDENT@[120; 121) "x" | ||
156 | COLON@[121; 122) ":" | ||
157 | WHITESPACE@[122; 123) " " | ||
158 | PATH_TYPE@[123; 125) | ||
159 | PATH@[123; 125) | ||
160 | PATH_SEGMENT@[123; 125) | ||
161 | NAME_REF@[123; 125) | ||
162 | IDENT@[123; 125) "u8" | ||
163 | R_PAREN@[125; 126) ")" | ||
164 | WHITESPACE@[126; 127) " " | ||
165 | BLOCK@[127; 129) | ||
166 | L_CURLY@[127; 128) "{" | ||
167 | R_CURLY@[128; 129) "}" | ||
168 | WHITESPACE@[129; 130) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.rs b/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.rs index 90c4dcd2d..472cb8803 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.rs +++ b/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.rs | |||
@@ -1,4 +1,3 @@ | |||
1 | trait Foo { | 1 | trait Foo { |
2 | fn bar(_: u64, mut x: i32); | 2 | fn bar(_: u64, mut x: i32); |
3 | fn bar(#[attr] _: u64, #[attr] mut x: i32); | ||
4 | } | 3 | } |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.txt b/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.txt index b5c6e0a2a..158236c5a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.txt | |||
@@ -1,11 +1,11 @@ | |||
1 | SOURCE_FILE@[0; 94) | 1 | SOURCE_FILE@[0; 46) |
2 | TRAIT_DEF@[0; 93) | 2 | TRAIT_DEF@[0; 45) |
3 | TRAIT_KW@[0; 5) "trait" | 3 | TRAIT_KW@[0; 5) "trait" |
4 | WHITESPACE@[5; 6) " " | 4 | WHITESPACE@[5; 6) " " |
5 | NAME@[6; 9) | 5 | NAME@[6; 9) |
6 | IDENT@[6; 9) "Foo" | 6 | IDENT@[6; 9) "Foo" |
7 | WHITESPACE@[9; 10) " " | 7 | WHITESPACE@[9; 10) " " |
8 | ITEM_LIST@[10; 93) | 8 | ITEM_LIST@[10; 45) |
9 | L_CURLY@[10; 11) "{" | 9 | L_CURLY@[10; 11) "{" |
10 | WHITESPACE@[11; 16) "\n " | 10 | WHITESPACE@[11; 16) "\n " |
11 | FN_DEF@[16; 43) | 11 | FN_DEF@[16; 43) |
@@ -42,55 +42,6 @@ SOURCE_FILE@[0; 94) | |||
42 | IDENT@[38; 41) "i32" | 42 | IDENT@[38; 41) "i32" |
43 | R_PAREN@[41; 42) ")" | 43 | R_PAREN@[41; 42) ")" |
44 | SEMI@[42; 43) ";" | 44 | SEMI@[42; 43) ";" |
45 | WHITESPACE@[43; 48) "\n " | 45 | WHITESPACE@[43; 44) "\n" |
46 | FN_DEF@[48; 91) | 46 | R_CURLY@[44; 45) "}" |
47 | FN_KW@[48; 50) "fn" | 47 | WHITESPACE@[45; 46) "\n" |
48 | WHITESPACE@[50; 51) " " | ||
49 | NAME@[51; 54) | ||
50 | IDENT@[51; 54) "bar" | ||
51 | PARAM_LIST@[54; 90) | ||
52 | L_PAREN@[54; 55) "(" | ||
53 | ATTR@[55; 62) | ||
54 | POUND@[55; 56) "#" | ||
55 | TOKEN_TREE@[56; 62) | ||
56 | L_BRACK@[56; 57) "[" | ||
57 | IDENT@[57; 61) "attr" | ||
58 | R_BRACK@[61; 62) "]" | ||
59 | WHITESPACE@[62; 63) " " | ||
60 | PARAM@[63; 69) | ||
61 | PLACEHOLDER_PAT@[63; 64) | ||
62 | UNDERSCORE@[63; 64) "_" | ||
63 | COLON@[64; 65) ":" | ||
64 | WHITESPACE@[65; 66) " " | ||
65 | PATH_TYPE@[66; 69) | ||
66 | PATH@[66; 69) | ||
67 | PATH_SEGMENT@[66; 69) | ||
68 | NAME_REF@[66; 69) | ||
69 | IDENT@[66; 69) "u64" | ||
70 | COMMA@[69; 70) "," | ||
71 | WHITESPACE@[70; 71) " " | ||
72 | ATTR@[71; 78) | ||
73 | POUND@[71; 72) "#" | ||
74 | TOKEN_TREE@[72; 78) | ||
75 | L_BRACK@[72; 73) "[" | ||
76 | IDENT@[73; 77) "attr" | ||
77 | R_BRACK@[77; 78) "]" | ||
78 | WHITESPACE@[78; 79) " " | ||
79 | PARAM@[79; 89) | ||
80 | BIND_PAT@[79; 84) | ||
81 | MUT_KW@[79; 82) "mut" | ||
82 | WHITESPACE@[82; 83) " " | ||
83 | NAME@[83; 84) | ||
84 | IDENT@[83; 84) "x" | ||
85 | COLON@[84; 85) ":" | ||
86 | WHITESPACE@[85; 86) " " | ||
87 | PATH_TYPE@[86; 89) | ||
88 | PATH@[86; 89) | ||
89 | PATH_SEGMENT@[86; 89) | ||
90 | NAME_REF@[86; 89) | ||
91 | IDENT@[86; 89) "i32" | ||
92 | R_PAREN@[89; 90) ")" | ||
93 | SEMI@[90; 91) ";" | ||
94 | WHITESPACE@[91; 92) "\n" | ||
95 | R_CURLY@[92; 93) "}" | ||
96 | WHITESPACE@[93; 94) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs index 723d868ee..c59addaf4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs +++ b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs | |||
@@ -1,2 +1 @@ | |||
1 | extern "C" { fn printf(format: *const i8, ...) -> i32; } | extern "C" { fn printf(format: *const i8, ...) -> i32; } | |
2 | extern "C" { fn printf(format: *const i8, #[attr] ...) -> i32; } | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.txt b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.txt index 8a6672781..836e8e55b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | SOURCE_FILE@[0; 122) | 1 | SOURCE_FILE@[0; 57) |
2 | EXTERN_BLOCK@[0; 56) | 2 | EXTERN_BLOCK@[0; 56) |
3 | ABI@[0; 10) | 3 | ABI@[0; 10) |
4 | EXTERN_KW@[0; 6) "extern" | 4 | EXTERN_KW@[0; 6) "extern" |
@@ -47,58 +47,3 @@ SOURCE_FILE@[0; 122) | |||
47 | WHITESPACE@[54; 55) " " | 47 | WHITESPACE@[54; 55) " " |
48 | R_CURLY@[55; 56) "}" | 48 | R_CURLY@[55; 56) "}" |
49 | WHITESPACE@[56; 57) "\n" | 49 | WHITESPACE@[56; 57) "\n" |
50 | EXTERN_BLOCK@[57; 121) | ||
51 | ABI@[57; 67) | ||
52 | EXTERN_KW@[57; 63) "extern" | ||
53 | WHITESPACE@[63; 64) " " | ||
54 | STRING@[64; 67) "\"C\"" | ||
55 | WHITESPACE@[67; 68) " " | ||
56 | EXTERN_ITEM_LIST@[68; 121) | ||
57 | L_CURLY@[68; 69) "{" | ||
58 | WHITESPACE@[69; 70) " " | ||
59 | FN_DEF@[70; 119) | ||
60 | FN_KW@[70; 72) "fn" | ||
61 | WHITESPACE@[72; 73) " " | ||
62 | NAME@[73; 79) | ||
63 | IDENT@[73; 79) "printf" | ||
64 | PARAM_LIST@[79; 111) | ||
65 | L_PAREN@[79; 80) "(" | ||
66 | PARAM@[80; 97) | ||
67 | BIND_PAT@[80; 86) | ||
68 | NAME@[80; 86) | ||
69 | IDENT@[80; 86) "format" | ||
70 | COLON@[86; 87) ":" | ||
71 | WHITESPACE@[87; 88) " " | ||
72 | POINTER_TYPE@[88; 97) | ||
73 | STAR@[88; 89) "*" | ||
74 | CONST_KW@[89; 94) "const" | ||
75 | WHITESPACE@[94; 95) " " | ||
76 | PATH_TYPE@[95; 97) | ||
77 | PATH@[95; 97) | ||
78 | PATH_SEGMENT@[95; 97) | ||
79 | NAME_REF@[95; 97) | ||
80 | IDENT@[95; 97) "i8" | ||
81 | COMMA@[97; 98) "," | ||
82 | WHITESPACE@[98; 99) " " | ||
83 | ATTR@[99; 106) | ||
84 | POUND@[99; 100) "#" | ||
85 | TOKEN_TREE@[100; 106) | ||
86 | L_BRACK@[100; 101) "[" | ||
87 | IDENT@[101; 105) "attr" | ||
88 | R_BRACK@[105; 106) "]" | ||
89 | WHITESPACE@[106; 107) " " | ||
90 | DOTDOTDOT@[107; 110) "..." | ||
91 | R_PAREN@[110; 111) ")" | ||
92 | WHITESPACE@[111; 112) " " | ||
93 | RET_TYPE@[112; 118) | ||
94 | THIN_ARROW@[112; 114) "->" | ||
95 | WHITESPACE@[114; 115) " " | ||
96 | PATH_TYPE@[115; 118) | ||
97 | PATH@[115; 118) | ||
98 | PATH_SEGMENT@[115; 118) | ||
99 | NAME_REF@[115; 118) | ||
100 | IDENT@[115; 118) "i32" | ||
101 | SEMI@[118; 119) ";" | ||
102 | WHITESPACE@[119; 120) " " | ||
103 | R_CURLY@[120; 121) "}" | ||
104 | WHITESPACE@[121; 122) "\n" | ||
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) "}" | ||