diff options
Diffstat (limited to 'crates/ra_syntax/test_data')
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0028_macro_2.0.txt | 328 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rs | 5 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.txt | 83 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt | 9 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rs | 1 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.txt | 23 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.txt | 45 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rs | 1 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt | 21 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rs (renamed from crates/ra_syntax/test_data/parser/err/0028_macro_2.0.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.txt | 176 |
12 files changed, 361 insertions, 333 deletions
diff --git a/crates/ra_syntax/test_data/parser/err/0028_macro_2.0.txt b/crates/ra_syntax/test_data/parser/err/0028_macro_2.0.txt deleted file mode 100644 index c5be73a5a..000000000 --- a/crates/ra_syntax/test_data/parser/err/0028_macro_2.0.txt +++ /dev/null | |||
@@ -1,328 +0,0 @@ | |||
1 | SOURCE_FILE@[0; 349) | ||
2 | MACRO_CALL@[0; 41) | ||
3 | PATH@[0; 5) | ||
4 | PATH_SEGMENT@[0; 5) | ||
5 | NAME_REF@[0; 5) | ||
6 | IDENT@[0; 5) "macro" | ||
7 | WHITESPACE@[5; 6) " " | ||
8 | NAME@[6; 21) | ||
9 | IDENT@[6; 21) "parse_use_trees" | ||
10 | TOKEN_TREE@[21; 41) | ||
11 | L_PAREN@[21; 22) "(" | ||
12 | DOLLAR@[22; 23) "$" | ||
13 | TOKEN_TREE@[23; 32) | ||
14 | L_PAREN@[23; 24) "(" | ||
15 | DOLLAR@[24; 25) "$" | ||
16 | IDENT@[25; 26) "s" | ||
17 | COLON@[26; 27) ":" | ||
18 | IDENT@[27; 31) "expr" | ||
19 | R_PAREN@[31; 32) ")" | ||
20 | COMMA@[32; 33) "," | ||
21 | STAR@[33; 34) "*" | ||
22 | WHITESPACE@[34; 35) " " | ||
23 | DOLLAR@[35; 36) "$" | ||
24 | TOKEN_TREE@[36; 39) | ||
25 | L_PAREN@[36; 37) "(" | ||
26 | COMMA@[37; 38) "," | ||
27 | R_PAREN@[38; 39) ")" | ||
28 | STAR@[39; 40) "*" | ||
29 | R_PAREN@[40; 41) ")" | ||
30 | WHITESPACE@[41; 42) " " | ||
31 | ERROR@[42; 93) | ||
32 | L_CURLY@[42; 43) "{" | ||
33 | WHITESPACE@[43; 48) "\n " | ||
34 | MACRO_CALL@[48; 91) | ||
35 | PATH@[48; 51) | ||
36 | PATH_SEGMENT@[48; 51) | ||
37 | NAME_REF@[48; 51) | ||
38 | IDENT@[48; 51) "vec" | ||
39 | EXCL@[51; 52) "!" | ||
40 | TOKEN_TREE@[52; 91) | ||
41 | L_BRACK@[52; 53) "[" | ||
42 | WHITESPACE@[53; 62) "\n " | ||
43 | DOLLAR@[62; 63) "$" | ||
44 | TOKEN_TREE@[63; 84) | ||
45 | L_PAREN@[63; 64) "(" | ||
46 | IDENT@[64; 78) "parse_use_tree" | ||
47 | TOKEN_TREE@[78; 82) | ||
48 | L_PAREN@[78; 79) "(" | ||
49 | DOLLAR@[79; 80) "$" | ||
50 | IDENT@[80; 81) "s" | ||
51 | R_PAREN@[81; 82) ")" | ||
52 | COMMA@[82; 83) "," | ||
53 | R_PAREN@[83; 84) ")" | ||
54 | STAR@[84; 85) "*" | ||
55 | WHITESPACE@[85; 90) "\n " | ||
56 | R_BRACK@[90; 91) "]" | ||
57 | WHITESPACE@[91; 92) "\n" | ||
58 | R_CURLY@[92; 93) "}" | ||
59 | WHITESPACE@[93; 95) "\n\n" | ||
60 | FN_DEF@[95; 348) | ||
61 | ATTR@[95; 102) | ||
62 | POUND@[95; 96) "#" | ||
63 | L_BRACK@[96; 97) "[" | ||
64 | PATH@[97; 101) | ||
65 | PATH_SEGMENT@[97; 101) | ||
66 | NAME_REF@[97; 101) | ||
67 | IDENT@[97; 101) "test" | ||
68 | R_BRACK@[101; 102) "]" | ||
69 | WHITESPACE@[102; 103) "\n" | ||
70 | FN_KW@[103; 105) "fn" | ||
71 | WHITESPACE@[105; 106) " " | ||
72 | NAME@[106; 125) | ||
73 | IDENT@[106; 125) "test_use_tree_merge" | ||
74 | PARAM_LIST@[125; 127) | ||
75 | L_PAREN@[125; 126) "(" | ||
76 | R_PAREN@[126; 127) ")" | ||
77 | WHITESPACE@[127; 128) " " | ||
78 | BLOCK_EXPR@[128; 348) | ||
79 | BLOCK@[128; 348) | ||
80 | L_CURLY@[128; 129) "{" | ||
81 | WHITESPACE@[129; 134) "\n " | ||
82 | EXPR_STMT@[134; 139) | ||
83 | PATH_EXPR@[134; 139) | ||
84 | PATH@[134; 139) | ||
85 | PATH_SEGMENT@[134; 139) | ||
86 | NAME_REF@[134; 139) | ||
87 | IDENT@[134; 139) "macro" | ||
88 | WHITESPACE@[139; 140) " " | ||
89 | EXPR_STMT@[140; 154) | ||
90 | CALL_EXPR@[140; 154) | ||
91 | PATH_EXPR@[140; 150) | ||
92 | PATH@[140; 150) | ||
93 | PATH_SEGMENT@[140; 150) | ||
94 | NAME_REF@[140; 150) | ||
95 | IDENT@[140; 150) "test_merge" | ||
96 | ARG_LIST@[150; 154) | ||
97 | L_PAREN@[150; 151) "(" | ||
98 | ARRAY_EXPR@[151; 154) | ||
99 | L_BRACK@[151; 152) "[" | ||
100 | ERROR@[152; 153) | ||
101 | DOLLAR@[152; 153) "$" | ||
102 | PAREN_EXPR@[153; 154) | ||
103 | L_PAREN@[153; 154) "(" | ||
104 | EXPR_STMT@[154; 155) | ||
105 | ERROR@[154; 155) | ||
106 | DOLLAR@[154; 155) "$" | ||
107 | EXPR_STMT@[155; 160) | ||
108 | PATH_EXPR@[155; 160) | ||
109 | PATH@[155; 160) | ||
110 | PATH_SEGMENT@[155; 160) | ||
111 | NAME_REF@[155; 160) | ||
112 | IDENT@[155; 160) "input" | ||
113 | EXPR_STMT@[160; 161) | ||
114 | ERROR@[160; 161) | ||
115 | COLON@[160; 161) ":" | ||
116 | EXPR_STMT@[161; 165) | ||
117 | PATH_EXPR@[161; 165) | ||
118 | PATH@[161; 165) | ||
119 | PATH_SEGMENT@[161; 165) | ||
120 | NAME_REF@[161; 165) | ||
121 | IDENT@[161; 165) "expr" | ||
122 | EXPR_STMT@[165; 166) | ||
123 | ERROR@[165; 166) | ||
124 | R_PAREN@[165; 166) ")" | ||
125 | EXPR_STMT@[166; 167) | ||
126 | ERROR@[166; 167) | ||
127 | COMMA@[166; 167) "," | ||
128 | EXPR_STMT@[167; 170) | ||
129 | PREFIX_EXPR@[167; 170) | ||
130 | STAR@[167; 168) "*" | ||
131 | WHITESPACE@[168; 169) " " | ||
132 | ERROR@[169; 170) | ||
133 | DOLLAR@[169; 170) "$" | ||
134 | EXPR_STMT@[170; 171) | ||
135 | PAREN_EXPR@[170; 171) | ||
136 | L_PAREN@[170; 171) "(" | ||
137 | EXPR_STMT@[171; 172) | ||
138 | ERROR@[171; 172) | ||
139 | COMMA@[171; 172) "," | ||
140 | EXPR_STMT@[172; 173) | ||
141 | ERROR@[172; 173) | ||
142 | R_PAREN@[172; 173) ")" | ||
143 | EXPR_STMT@[173; 175) | ||
144 | PREFIX_EXPR@[173; 175) | ||
145 | STAR@[173; 174) "*" | ||
146 | ERROR@[174; 175) | ||
147 | R_BRACK@[174; 175) "]" | ||
148 | EXPR_STMT@[175; 176) | ||
149 | ERROR@[175; 176) | ||
150 | COMMA@[175; 176) "," | ||
151 | WHITESPACE@[176; 177) " " | ||
152 | EXPR_STMT@[177; 180) | ||
153 | ARRAY_EXPR@[177; 180) | ||
154 | L_BRACK@[177; 178) "[" | ||
155 | ERROR@[178; 179) | ||
156 | DOLLAR@[178; 179) "$" | ||
157 | PAREN_EXPR@[179; 180) | ||
158 | L_PAREN@[179; 180) "(" | ||
159 | EXPR_STMT@[180; 181) | ||
160 | ERROR@[180; 181) | ||
161 | DOLLAR@[180; 181) "$" | ||
162 | EXPR_STMT@[181; 187) | ||
163 | PATH_EXPR@[181; 187) | ||
164 | PATH@[181; 187) | ||
165 | PATH_SEGMENT@[181; 187) | ||
166 | NAME_REF@[181; 187) | ||
167 | IDENT@[181; 187) "output" | ||
168 | EXPR_STMT@[187; 188) | ||
169 | ERROR@[187; 188) | ||
170 | COLON@[187; 188) ":" | ||
171 | EXPR_STMT@[188; 192) | ||
172 | PATH_EXPR@[188; 192) | ||
173 | PATH@[188; 192) | ||
174 | PATH_SEGMENT@[188; 192) | ||
175 | NAME_REF@[188; 192) | ||
176 | IDENT@[188; 192) "expr" | ||
177 | EXPR_STMT@[192; 193) | ||
178 | ERROR@[192; 193) | ||
179 | R_PAREN@[192; 193) ")" | ||
180 | EXPR_STMT@[193; 194) | ||
181 | ERROR@[193; 194) | ||
182 | COMMA@[193; 194) "," | ||
183 | EXPR_STMT@[194; 197) | ||
184 | PREFIX_EXPR@[194; 197) | ||
185 | STAR@[194; 195) "*" | ||
186 | WHITESPACE@[195; 196) " " | ||
187 | ERROR@[196; 197) | ||
188 | DOLLAR@[196; 197) "$" | ||
189 | EXPR_STMT@[197; 198) | ||
190 | PAREN_EXPR@[197; 198) | ||
191 | L_PAREN@[197; 198) "(" | ||
192 | EXPR_STMT@[198; 199) | ||
193 | ERROR@[198; 199) | ||
194 | COMMA@[198; 199) "," | ||
195 | EXPR_STMT@[199; 200) | ||
196 | ERROR@[199; 200) | ||
197 | R_PAREN@[199; 200) ")" | ||
198 | EXPR_STMT@[200; 202) | ||
199 | PREFIX_EXPR@[200; 202) | ||
200 | STAR@[200; 201) "*" | ||
201 | ERROR@[201; 202) | ||
202 | R_BRACK@[201; 202) "]" | ||
203 | EXPR_STMT@[202; 203) | ||
204 | ERROR@[202; 203) | ||
205 | R_PAREN@[202; 203) ")" | ||
206 | WHITESPACE@[203; 204) " " | ||
207 | BLOCK_EXPR@[204; 346) | ||
208 | BLOCK@[204; 346) | ||
209 | L_CURLY@[204; 205) "{" | ||
210 | WHITESPACE@[205; 214) "\n " | ||
211 | EXPR_STMT@[214; 340) | ||
212 | MACRO_CALL@[214; 339) | ||
213 | PATH@[214; 223) | ||
214 | PATH_SEGMENT@[214; 223) | ||
215 | NAME_REF@[214; 223) | ||
216 | IDENT@[214; 223) "assert_eq" | ||
217 | EXCL@[223; 224) "!" | ||
218 | TOKEN_TREE@[224; 339) | ||
219 | L_PAREN@[224; 225) "(" | ||
220 | WHITESPACE@[225; 238) "\n " | ||
221 | IDENT@[238; 253) "merge_use_trees" | ||
222 | TOKEN_TREE@[253; 284) | ||
223 | L_PAREN@[253; 254) "(" | ||
224 | IDENT@[254; 269) "parse_use_trees" | ||
225 | EXCL@[269; 270) "!" | ||
226 | TOKEN_TREE@[270; 283) | ||
227 | L_PAREN@[270; 271) "(" | ||
228 | DOLLAR@[271; 272) "$" | ||
229 | TOKEN_TREE@[272; 281) | ||
230 | L_PAREN@[272; 273) "(" | ||
231 | DOLLAR@[273; 274) "$" | ||
232 | IDENT@[274; 279) "input" | ||
233 | COMMA@[279; 280) "," | ||
234 | R_PAREN@[280; 281) ")" | ||
235 | STAR@[281; 282) "*" | ||
236 | R_PAREN@[282; 283) ")" | ||
237 | R_PAREN@[283; 284) ")" | ||
238 | COMMA@[284; 285) "," | ||
239 | WHITESPACE@[285; 298) "\n " | ||
240 | IDENT@[298; 313) "parse_use_trees" | ||
241 | EXCL@[313; 314) "!" | ||
242 | TOKEN_TREE@[314; 328) | ||
243 | L_PAREN@[314; 315) "(" | ||
244 | DOLLAR@[315; 316) "$" | ||
245 | TOKEN_TREE@[316; 326) | ||
246 | L_PAREN@[316; 317) "(" | ||
247 | DOLLAR@[317; 318) "$" | ||
248 | IDENT@[318; 324) "output" | ||
249 | COMMA@[324; 325) "," | ||
250 | R_PAREN@[325; 326) ")" | ||
251 | STAR@[326; 327) "*" | ||
252 | R_PAREN@[327; 328) ")" | ||
253 | COMMA@[328; 329) "," | ||
254 | WHITESPACE@[329; 338) "\n " | ||
255 | R_PAREN@[338; 339) ")" | ||
256 | SEMI@[339; 340) ";" | ||
257 | WHITESPACE@[340; 345) "\n " | ||
258 | R_CURLY@[345; 346) "}" | ||
259 | WHITESPACE@[346; 347) "\n" | ||
260 | R_CURLY@[347; 348) "}" | ||
261 | WHITESPACE@[348; 349) "\n" | ||
262 | error 5: expected EXCL | ||
263 | error 41: expected SEMI | ||
264 | error 42: expected an item | ||
265 | error 139: expected SEMI | ||
266 | error 152: expected expression | ||
267 | error 153: expected COMMA | ||
268 | error 154: expected expression | ||
269 | error 154: expected R_PAREN | ||
270 | error 154: expected COMMA | ||
271 | error 154: expected expression | ||
272 | error 154: expected R_BRACK | ||
273 | error 154: expected COMMA | ||
274 | error 154: expected SEMI | ||
275 | error 154: expected expression | ||
276 | error 155: expected SEMI | ||
277 | error 160: expected SEMI | ||
278 | error 160: expected expression | ||
279 | error 161: expected SEMI | ||
280 | error 165: expected SEMI | ||
281 | error 165: expected expression | ||
282 | error 166: expected SEMI | ||
283 | error 166: expected expression | ||
284 | error 167: expected SEMI | ||
285 | error 169: expected expression | ||
286 | error 170: expected SEMI | ||
287 | error 171: expected expression | ||
288 | error 171: expected R_PAREN | ||
289 | error 171: expected SEMI | ||
290 | error 171: expected expression | ||
291 | error 172: expected SEMI | ||
292 | error 172: expected expression | ||
293 | error 173: expected SEMI | ||
294 | error 174: expected expression | ||
295 | error 175: expected SEMI | ||
296 | error 175: expected expression | ||
297 | error 176: expected SEMI | ||
298 | error 178: expected expression | ||
299 | error 179: expected COMMA | ||
300 | error 180: expected expression | ||
301 | error 180: expected R_PAREN | ||
302 | error 180: expected COMMA | ||
303 | error 180: expected expression | ||
304 | error 180: expected R_BRACK | ||
305 | error 180: expected SEMI | ||
306 | error 180: expected expression | ||
307 | error 181: expected SEMI | ||
308 | error 187: expected SEMI | ||
309 | error 187: expected expression | ||
310 | error 188: expected SEMI | ||
311 | error 192: expected SEMI | ||
312 | error 192: expected expression | ||
313 | error 193: expected SEMI | ||
314 | error 193: expected expression | ||
315 | error 194: expected SEMI | ||
316 | error 196: expected expression | ||
317 | error 197: expected SEMI | ||
318 | error 198: expected expression | ||
319 | error 198: expected R_PAREN | ||
320 | error 198: expected SEMI | ||
321 | error 198: expected expression | ||
322 | error 199: expected SEMI | ||
323 | error 199: expected expression | ||
324 | error 200: expected SEMI | ||
325 | error 201: expected expression | ||
326 | error 202: expected SEMI | ||
327 | error 202: expected expression | ||
328 | error 203: expected SEMI | ||
diff --git a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rs b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rs new file mode 100644 index 000000000..a2f74bd87 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() -> i32 { | ||
2 | [1, 2, 3].iter() | ||
3 | .map(|it|) | ||
4 | .max::<i32>(); | ||
5 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.txt b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.txt new file mode 100644 index 000000000..d1544634c --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.txt | |||
@@ -0,0 +1,83 @@ | |||
1 | SOURCE_FILE@[0; 83) | ||
2 | FN_DEF@[0; 82) | ||
3 | FN_KW@[0; 2) "fn" | ||
4 | WHITESPACE@[2; 3) " " | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) "(" | ||
9 | R_PAREN@[7; 8) ")" | ||
10 | WHITESPACE@[8; 9) " " | ||
11 | RET_TYPE@[9; 15) | ||
12 | THIN_ARROW@[9; 11) "->" | ||
13 | WHITESPACE@[11; 12) " " | ||
14 | PATH_TYPE@[12; 15) | ||
15 | PATH@[12; 15) | ||
16 | PATH_SEGMENT@[12; 15) | ||
17 | NAME_REF@[12; 15) | ||
18 | IDENT@[12; 15) "i32" | ||
19 | WHITESPACE@[15; 16) " " | ||
20 | BLOCK_EXPR@[16; 82) | ||
21 | BLOCK@[16; 82) | ||
22 | L_CURLY@[16; 17) "{" | ||
23 | WHITESPACE@[17; 22) "\n " | ||
24 | EXPR_STMT@[22; 80) | ||
25 | METHOD_CALL_EXPR@[22; 79) | ||
26 | METHOD_CALL_EXPR@[22; 57) | ||
27 | METHOD_CALL_EXPR@[22; 38) | ||
28 | ARRAY_EXPR@[22; 31) | ||
29 | L_BRACK@[22; 23) "[" | ||
30 | LITERAL@[23; 24) | ||
31 | INT_NUMBER@[23; 24) "1" | ||
32 | COMMA@[24; 25) "," | ||
33 | WHITESPACE@[25; 26) " " | ||
34 | LITERAL@[26; 27) | ||
35 | INT_NUMBER@[26; 27) "2" | ||
36 | COMMA@[27; 28) "," | ||
37 | WHITESPACE@[28; 29) " " | ||
38 | LITERAL@[29; 30) | ||
39 | INT_NUMBER@[29; 30) "3" | ||
40 | R_BRACK@[30; 31) "]" | ||
41 | DOT@[31; 32) "." | ||
42 | NAME_REF@[32; 36) | ||
43 | IDENT@[32; 36) "iter" | ||
44 | ARG_LIST@[36; 38) | ||
45 | L_PAREN@[36; 37) "(" | ||
46 | R_PAREN@[37; 38) ")" | ||
47 | WHITESPACE@[38; 47) "\n " | ||
48 | DOT@[47; 48) "." | ||
49 | NAME_REF@[48; 51) | ||
50 | IDENT@[48; 51) "map" | ||
51 | ARG_LIST@[51; 57) | ||
52 | L_PAREN@[51; 52) "(" | ||
53 | LAMBDA_EXPR@[52; 56) | ||
54 | PARAM_LIST@[52; 56) | ||
55 | PIPE@[52; 53) "|" | ||
56 | PARAM@[53; 55) | ||
57 | BIND_PAT@[53; 55) | ||
58 | NAME@[53; 55) | ||
59 | IDENT@[53; 55) "it" | ||
60 | PIPE@[55; 56) "|" | ||
61 | R_PAREN@[56; 57) ")" | ||
62 | WHITESPACE@[57; 66) "\n " | ||
63 | DOT@[66; 67) "." | ||
64 | NAME_REF@[67; 70) | ||
65 | IDENT@[67; 70) "max" | ||
66 | TYPE_ARG_LIST@[70; 77) | ||
67 | COLONCOLON@[70; 72) "::" | ||
68 | L_ANGLE@[72; 73) "<" | ||
69 | TYPE_ARG@[73; 76) | ||
70 | PATH_TYPE@[73; 76) | ||
71 | PATH@[73; 76) | ||
72 | PATH_SEGMENT@[73; 76) | ||
73 | NAME_REF@[73; 76) | ||
74 | IDENT@[73; 76) "i32" | ||
75 | R_ANGLE@[76; 77) ">" | ||
76 | ARG_LIST@[77; 79) | ||
77 | L_PAREN@[77; 78) "(" | ||
78 | R_PAREN@[78; 79) ")" | ||
79 | SEMI@[79; 80) ";" | ||
80 | WHITESPACE@[80; 81) "\n" | ||
81 | R_CURLY@[81; 82) "}" | ||
82 | WHITESPACE@[82; 83) "\n" | ||
83 | error 56: expected expression | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt index 4a714ad6b..b05ccc0ed 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt | |||
@@ -16,11 +16,10 @@ SOURCE_FILE@[0; 33) | |||
16 | LET_KW@[16; 19) "let" | 16 | LET_KW@[16; 19) "let" |
17 | WHITESPACE@[19; 20) " " | 17 | WHITESPACE@[19; 20) " " |
18 | MACRO_CALL@[20; 25) | 18 | MACRO_CALL@[20; 25) |
19 | PATH_PAT@[20; 21) | 19 | PATH@[20; 21) |
20 | PATH@[20; 21) | 20 | PATH_SEGMENT@[20; 21) |
21 | PATH_SEGMENT@[20; 21) | 21 | NAME_REF@[20; 21) |
22 | NAME_REF@[20; 21) | 22 | IDENT@[20; 21) "m" |
23 | IDENT@[20; 21) "m" | ||
24 | EXCL@[21; 22) "!" | 23 | EXCL@[21; 22) "!" |
25 | TOKEN_TREE@[22; 25) | 24 | TOKEN_TREE@[22; 25) |
26 | L_PAREN@[22; 23) "(" | 25 | L_PAREN@[22; 23) "(" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rs b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rs new file mode 100644 index 000000000..8cdb3b703 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rs | |||
@@ -0,0 +1 @@ | |||
struct S<const N: u32>; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.txt b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.txt new file mode 100644 index 000000000..f81de7bac --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | SOURCE_FILE@[0; 24) | ||
2 | STRUCT_DEF@[0; 23) | ||
3 | STRUCT_KW@[0; 6) "struct" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | TYPE_PARAM_LIST@[8; 22) | ||
8 | L_ANGLE@[8; 9) "<" | ||
9 | CONST_PARAM@[9; 21) | ||
10 | CONST_KW@[9; 14) "const" | ||
11 | WHITESPACE@[14; 15) " " | ||
12 | NAME@[15; 16) | ||
13 | IDENT@[15; 16) "N" | ||
14 | COLON@[16; 17) ":" | ||
15 | WHITESPACE@[17; 18) " " | ||
16 | PATH_TYPE@[18; 21) | ||
17 | PATH@[18; 21) | ||
18 | PATH_SEGMENT@[18; 21) | ||
19 | NAME_REF@[18; 21) | ||
20 | IDENT@[18; 21) "u32" | ||
21 | R_ANGLE@[21; 22) ">" | ||
22 | SEMI@[22; 23) ";" | ||
23 | WHITESPACE@[23; 24) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rs b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rs new file mode 100644 index 000000000..319a4e2aa --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | macro m { ($i:ident) => {} } | ||
2 | macro m($i:ident) {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.txt b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.txt new file mode 100644 index 000000000..3556099bd --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | SOURCE_FILE@[0; 50) | ||
2 | MACRO_DEF@[0; 28) | ||
3 | MACRO_KW@[0; 5) "macro" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "m" | ||
7 | WHITESPACE@[7; 8) " " | ||
8 | TOKEN_TREE@[8; 28) | ||
9 | L_CURLY@[8; 9) "{" | ||
10 | WHITESPACE@[9; 10) " " | ||
11 | TOKEN_TREE@[10; 20) | ||
12 | L_PAREN@[10; 11) "(" | ||
13 | DOLLAR@[11; 12) "$" | ||
14 | IDENT@[12; 13) "i" | ||
15 | COLON@[13; 14) ":" | ||
16 | IDENT@[14; 19) "ident" | ||
17 | R_PAREN@[19; 20) ")" | ||
18 | WHITESPACE@[20; 21) " " | ||
19 | EQ@[21; 22) "=" | ||
20 | R_ANGLE@[22; 23) ">" | ||
21 | WHITESPACE@[23; 24) " " | ||
22 | TOKEN_TREE@[24; 26) | ||
23 | L_CURLY@[24; 25) "{" | ||
24 | R_CURLY@[25; 26) "}" | ||
25 | WHITESPACE@[26; 27) " " | ||
26 | R_CURLY@[27; 28) "}" | ||
27 | WHITESPACE@[28; 29) "\n" | ||
28 | MACRO_DEF@[29; 49) | ||
29 | MACRO_KW@[29; 34) "macro" | ||
30 | WHITESPACE@[34; 35) " " | ||
31 | NAME@[35; 36) | ||
32 | IDENT@[35; 36) "m" | ||
33 | TOKEN_TREE@[36; 49) | ||
34 | TOKEN_TREE@[36; 46) | ||
35 | L_PAREN@[36; 37) "(" | ||
36 | DOLLAR@[37; 38) "$" | ||
37 | IDENT@[38; 39) "i" | ||
38 | COLON@[39; 40) ":" | ||
39 | IDENT@[40; 45) "ident" | ||
40 | R_PAREN@[45; 46) ")" | ||
41 | WHITESPACE@[46; 47) " " | ||
42 | TOKEN_TREE@[47; 49) | ||
43 | L_CURLY@[47; 48) "{" | ||
44 | R_CURLY@[48; 49) "}" | ||
45 | WHITESPACE@[49; 50) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rs b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rs new file mode 100644 index 000000000..3b2be597f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rs | |||
@@ -0,0 +1 @@ | |||
pub macro m($:ident) {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt new file mode 100644 index 000000000..cfd79d9c2 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | SOURCE_FILE@[0; 24) | ||
2 | MACRO_DEF@[0; 23) | ||
3 | VISIBILITY@[0; 3) | ||
4 | PUB_KW@[0; 3) "pub" | ||
5 | WHITESPACE@[3; 4) " " | ||
6 | MACRO_KW@[4; 9) "macro" | ||
7 | WHITESPACE@[9; 10) " " | ||
8 | NAME@[10; 11) | ||
9 | IDENT@[10; 11) "m" | ||
10 | TOKEN_TREE@[11; 23) | ||
11 | TOKEN_TREE@[11; 20) | ||
12 | L_PAREN@[11; 12) "(" | ||
13 | DOLLAR@[12; 13) "$" | ||
14 | COLON@[13; 14) ":" | ||
15 | IDENT@[14; 19) "ident" | ||
16 | R_PAREN@[19; 20) ")" | ||
17 | WHITESPACE@[20; 21) " " | ||
18 | TOKEN_TREE@[21; 23) | ||
19 | L_CURLY@[21; 22) "{" | ||
20 | R_CURLY@[22; 23) "}" | ||
21 | WHITESPACE@[23; 24) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/err/0028_macro_2.0.rs b/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rs index 781047ba1..781047ba1 100644 --- a/crates/ra_syntax/test_data/parser/err/0028_macro_2.0.rs +++ b/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rs | |||
diff --git a/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.txt b/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.txt new file mode 100644 index 000000000..2be523fc3 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.txt | |||
@@ -0,0 +1,176 @@ | |||
1 | SOURCE_FILE@[0; 349) | ||
2 | MACRO_DEF@[0; 93) | ||
3 | MACRO_KW@[0; 5) "macro" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | NAME@[6; 21) | ||
6 | IDENT@[6; 21) "parse_use_trees" | ||
7 | TOKEN_TREE@[21; 93) | ||
8 | TOKEN_TREE@[21; 41) | ||
9 | L_PAREN@[21; 22) "(" | ||
10 | DOLLAR@[22; 23) "$" | ||
11 | TOKEN_TREE@[23; 32) | ||
12 | L_PAREN@[23; 24) "(" | ||
13 | DOLLAR@[24; 25) "$" | ||
14 | IDENT@[25; 26) "s" | ||
15 | COLON@[26; 27) ":" | ||
16 | IDENT@[27; 31) "expr" | ||
17 | R_PAREN@[31; 32) ")" | ||
18 | COMMA@[32; 33) "," | ||
19 | STAR@[33; 34) "*" | ||
20 | WHITESPACE@[34; 35) " " | ||
21 | DOLLAR@[35; 36) "$" | ||
22 | TOKEN_TREE@[36; 39) | ||
23 | L_PAREN@[36; 37) "(" | ||
24 | COMMA@[37; 38) "," | ||
25 | R_PAREN@[38; 39) ")" | ||
26 | STAR@[39; 40) "*" | ||
27 | R_PAREN@[40; 41) ")" | ||
28 | WHITESPACE@[41; 42) " " | ||
29 | TOKEN_TREE@[42; 93) | ||
30 | L_CURLY@[42; 43) "{" | ||
31 | WHITESPACE@[43; 48) "\n " | ||
32 | IDENT@[48; 51) "vec" | ||
33 | EXCL@[51; 52) "!" | ||
34 | TOKEN_TREE@[52; 91) | ||
35 | L_BRACK@[52; 53) "[" | ||
36 | WHITESPACE@[53; 62) "\n " | ||
37 | DOLLAR@[62; 63) "$" | ||
38 | TOKEN_TREE@[63; 84) | ||
39 | L_PAREN@[63; 64) "(" | ||
40 | IDENT@[64; 78) "parse_use_tree" | ||
41 | TOKEN_TREE@[78; 82) | ||
42 | L_PAREN@[78; 79) "(" | ||
43 | DOLLAR@[79; 80) "$" | ||
44 | IDENT@[80; 81) "s" | ||
45 | R_PAREN@[81; 82) ")" | ||
46 | COMMA@[82; 83) "," | ||
47 | R_PAREN@[83; 84) ")" | ||
48 | STAR@[84; 85) "*" | ||
49 | WHITESPACE@[85; 90) "\n " | ||
50 | R_BRACK@[90; 91) "]" | ||
51 | WHITESPACE@[91; 92) "\n" | ||
52 | R_CURLY@[92; 93) "}" | ||
53 | WHITESPACE@[93; 95) "\n\n" | ||
54 | FN_DEF@[95; 348) | ||
55 | ATTR@[95; 102) | ||
56 | POUND@[95; 96) "#" | ||
57 | L_BRACK@[96; 97) "[" | ||
58 | PATH@[97; 101) | ||
59 | PATH_SEGMENT@[97; 101) | ||
60 | NAME_REF@[97; 101) | ||
61 | IDENT@[97; 101) "test" | ||
62 | R_BRACK@[101; 102) "]" | ||
63 | WHITESPACE@[102; 103) "\n" | ||
64 | FN_KW@[103; 105) "fn" | ||
65 | WHITESPACE@[105; 106) " " | ||
66 | NAME@[106; 125) | ||
67 | IDENT@[106; 125) "test_use_tree_merge" | ||
68 | PARAM_LIST@[125; 127) | ||
69 | L_PAREN@[125; 126) "(" | ||
70 | R_PAREN@[126; 127) ")" | ||
71 | WHITESPACE@[127; 128) " " | ||
72 | BLOCK_EXPR@[128; 348) | ||
73 | BLOCK@[128; 348) | ||
74 | L_CURLY@[128; 129) "{" | ||
75 | WHITESPACE@[129; 134) "\n " | ||
76 | MACRO_DEF@[134; 346) | ||
77 | MACRO_KW@[134; 139) "macro" | ||
78 | WHITESPACE@[139; 140) " " | ||
79 | NAME@[140; 150) | ||
80 | IDENT@[140; 150) "test_merge" | ||
81 | TOKEN_TREE@[150; 346) | ||
82 | TOKEN_TREE@[150; 203) | ||
83 | L_PAREN@[150; 151) "(" | ||
84 | TOKEN_TREE@[151; 175) | ||
85 | L_BRACK@[151; 152) "[" | ||
86 | DOLLAR@[152; 153) "$" | ||
87 | TOKEN_TREE@[153; 166) | ||
88 | L_PAREN@[153; 154) "(" | ||
89 | DOLLAR@[154; 155) "$" | ||
90 | IDENT@[155; 160) "input" | ||
91 | COLON@[160; 161) ":" | ||
92 | IDENT@[161; 165) "expr" | ||
93 | R_PAREN@[165; 166) ")" | ||
94 | COMMA@[166; 167) "," | ||
95 | STAR@[167; 168) "*" | ||
96 | WHITESPACE@[168; 169) " " | ||
97 | DOLLAR@[169; 170) "$" | ||
98 | TOKEN_TREE@[170; 173) | ||
99 | L_PAREN@[170; 171) "(" | ||
100 | COMMA@[171; 172) "," | ||
101 | R_PAREN@[172; 173) ")" | ||
102 | STAR@[173; 174) "*" | ||
103 | R_BRACK@[174; 175) "]" | ||
104 | COMMA@[175; 176) "," | ||
105 | WHITESPACE@[176; 177) " " | ||
106 | TOKEN_TREE@[177; 202) | ||
107 | L_BRACK@[177; 178) "[" | ||
108 | DOLLAR@[178; 179) "$" | ||
109 | TOKEN_TREE@[179; 193) | ||
110 | L_PAREN@[179; 180) "(" | ||
111 | DOLLAR@[180; 181) "$" | ||
112 | IDENT@[181; 187) "output" | ||
113 | COLON@[187; 188) ":" | ||
114 | IDENT@[188; 192) "expr" | ||
115 | R_PAREN@[192; 193) ")" | ||
116 | COMMA@[193; 194) "," | ||
117 | STAR@[194; 195) "*" | ||
118 | WHITESPACE@[195; 196) " " | ||
119 | DOLLAR@[196; 197) "$" | ||
120 | TOKEN_TREE@[197; 200) | ||
121 | L_PAREN@[197; 198) "(" | ||
122 | COMMA@[198; 199) "," | ||
123 | R_PAREN@[199; 200) ")" | ||
124 | STAR@[200; 201) "*" | ||
125 | R_BRACK@[201; 202) "]" | ||
126 | R_PAREN@[202; 203) ")" | ||
127 | WHITESPACE@[203; 204) " " | ||
128 | TOKEN_TREE@[204; 346) | ||
129 | L_CURLY@[204; 205) "{" | ||
130 | WHITESPACE@[205; 214) "\n " | ||
131 | IDENT@[214; 223) "assert_eq" | ||
132 | EXCL@[223; 224) "!" | ||
133 | TOKEN_TREE@[224; 339) | ||
134 | L_PAREN@[224; 225) "(" | ||
135 | WHITESPACE@[225; 238) "\n " | ||
136 | IDENT@[238; 253) "merge_use_trees" | ||
137 | TOKEN_TREE@[253; 284) | ||
138 | L_PAREN@[253; 254) "(" | ||
139 | IDENT@[254; 269) "parse_use_trees" | ||
140 | EXCL@[269; 270) "!" | ||
141 | TOKEN_TREE@[270; 283) | ||
142 | L_PAREN@[270; 271) "(" | ||
143 | DOLLAR@[271; 272) "$" | ||
144 | TOKEN_TREE@[272; 281) | ||
145 | L_PAREN@[272; 273) "(" | ||
146 | DOLLAR@[273; 274) "$" | ||
147 | IDENT@[274; 279) "input" | ||
148 | COMMA@[279; 280) "," | ||
149 | R_PAREN@[280; 281) ")" | ||
150 | STAR@[281; 282) "*" | ||
151 | R_PAREN@[282; 283) ")" | ||
152 | R_PAREN@[283; 284) ")" | ||
153 | COMMA@[284; 285) "," | ||
154 | WHITESPACE@[285; 298) "\n " | ||
155 | IDENT@[298; 313) "parse_use_trees" | ||
156 | EXCL@[313; 314) "!" | ||
157 | TOKEN_TREE@[314; 328) | ||
158 | L_PAREN@[314; 315) "(" | ||
159 | DOLLAR@[315; 316) "$" | ||
160 | TOKEN_TREE@[316; 326) | ||
161 | L_PAREN@[316; 317) "(" | ||
162 | DOLLAR@[317; 318) "$" | ||
163 | IDENT@[318; 324) "output" | ||
164 | COMMA@[324; 325) "," | ||
165 | R_PAREN@[325; 326) ")" | ||
166 | STAR@[326; 327) "*" | ||
167 | R_PAREN@[327; 328) ")" | ||
168 | COMMA@[328; 329) "," | ||
169 | WHITESPACE@[329; 338) "\n " | ||
170 | R_PAREN@[338; 339) ")" | ||
171 | SEMI@[339; 340) ";" | ||
172 | WHITESPACE@[340; 345) "\n " | ||
173 | R_CURLY@[345; 346) "}" | ||
174 | WHITESPACE@[346; 347) "\n" | ||
175 | R_CURLY@[347; 348) "}" | ||
176 | WHITESPACE@[348; 349) "\n" | ||