diff options
author | DJMcNab <[email protected]> | 2018-12-20 16:45:54 +0000 |
---|---|---|
committer | DJMcNab <[email protected]> | 2018-12-20 16:45:54 +0000 |
commit | 134fe4f566d94fd4ca91c6417fab0ae7b3e4275f (patch) | |
tree | 54d5d31d8df65982163e1ff735e1461d672d8376 /crates/ra_syntax/tests/data/parser/err | |
parent | 466885aa5bad53732786380f7579880fe2fd5645 (diff) |
Fix the tests and fix the precommit hook
Diffstat (limited to 'crates/ra_syntax/tests/data/parser/err')
-rw-r--r-- | crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.rs | 15 | ||||
-rw-r--r-- | crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt | 317 |
2 files changed, 332 insertions, 0 deletions
diff --git a/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.rs b/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.rs new file mode 100644 index 000000000..781047ba1 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.rs | |||
@@ -0,0 +1,15 @@ | |||
1 | macro parse_use_trees($($s:expr),* $(,)*) { | ||
2 | vec![ | ||
3 | $(parse_use_tree($s),)* | ||
4 | ] | ||
5 | } | ||
6 | |||
7 | #[test] | ||
8 | fn test_use_tree_merge() { | ||
9 | macro test_merge([$($input:expr),* $(,)*], [$($output:expr),* $(,)*]) { | ||
10 | assert_eq!( | ||
11 | merge_use_trees(parse_use_trees!($($input,)*)), | ||
12 | parse_use_trees!($($output,)*), | ||
13 | ); | ||
14 | } | ||
15 | } | ||
diff --git a/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt b/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt new file mode 100644 index 000000000..12919fab7 --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt | |||
@@ -0,0 +1,317 @@ | |||
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 | err: `expected EXCL` | ||
8 | WHITESPACE@[5; 6) | ||
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 | err: `expected SEMI` | ||
31 | WHITESPACE@[41; 42) | ||
32 | err: `expected an item` | ||
33 | ERROR@[42; 93) | ||
34 | L_CURLY@[42; 43) | ||
35 | WHITESPACE@[43; 48) | ||
36 | IDENT@[48; 51) "vec" | ||
37 | EXCL@[51; 52) | ||
38 | L_BRACK@[52; 53) | ||
39 | WHITESPACE@[53; 62) | ||
40 | DOLLAR@[62; 63) | ||
41 | L_PAREN@[63; 64) | ||
42 | IDENT@[64; 78) "parse_use_tree" | ||
43 | L_PAREN@[78; 79) | ||
44 | DOLLAR@[79; 80) | ||
45 | IDENT@[80; 81) "s" | ||
46 | R_PAREN@[81; 82) | ||
47 | COMMA@[82; 83) | ||
48 | R_PAREN@[83; 84) | ||
49 | STAR@[84; 85) | ||
50 | WHITESPACE@[85; 90) | ||
51 | R_BRACK@[90; 91) | ||
52 | WHITESPACE@[91; 92) | ||
53 | R_CURLY@[92; 93) | ||
54 | WHITESPACE@[93; 95) | ||
55 | FN_DEF@[95; 348) | ||
56 | ATTR@[95; 102) | ||
57 | POUND@[95; 96) | ||
58 | TOKEN_TREE@[96; 102) | ||
59 | L_BRACK@[96; 97) | ||
60 | IDENT@[97; 101) "test" | ||
61 | R_BRACK@[101; 102) | ||
62 | WHITESPACE@[102; 103) | ||
63 | FN_KW@[103; 105) | ||
64 | WHITESPACE@[105; 106) | ||
65 | NAME@[106; 125) | ||
66 | IDENT@[106; 125) "test_use_tree_merge" | ||
67 | PARAM_LIST@[125; 127) | ||
68 | L_PAREN@[125; 126) | ||
69 | R_PAREN@[126; 127) | ||
70 | WHITESPACE@[127; 128) | ||
71 | BLOCK@[128; 348) | ||
72 | L_CURLY@[128; 129) | ||
73 | WHITESPACE@[129; 134) | ||
74 | EXPR_STMT@[134; 139) | ||
75 | PATH_EXPR@[134; 139) | ||
76 | PATH@[134; 139) | ||
77 | PATH_SEGMENT@[134; 139) | ||
78 | NAME_REF@[134; 139) | ||
79 | IDENT@[134; 139) "macro" | ||
80 | err: `expected SEMI` | ||
81 | WHITESPACE@[139; 140) | ||
82 | EXPR_STMT@[140; 154) | ||
83 | CALL_EXPR@[140; 154) | ||
84 | PATH_EXPR@[140; 150) | ||
85 | PATH@[140; 150) | ||
86 | PATH_SEGMENT@[140; 150) | ||
87 | NAME_REF@[140; 150) | ||
88 | IDENT@[140; 150) "test_merge" | ||
89 | ARG_LIST@[150; 154) | ||
90 | L_PAREN@[150; 151) | ||
91 | ARRAY_EXPR@[151; 154) | ||
92 | L_BRACK@[151; 152) | ||
93 | err: `expected expression` | ||
94 | ERROR@[152; 153) | ||
95 | DOLLAR@[152; 153) | ||
96 | err: `expected COMMA` | ||
97 | PAREN_EXPR@[153; 154) | ||
98 | L_PAREN@[153; 154) | ||
99 | err: `expected expression` | ||
100 | err: `expected R_PAREN` | ||
101 | err: `expected COMMA` | ||
102 | err: `expected expression` | ||
103 | err: `expected R_BRACK` | ||
104 | err: `expected COMMA` | ||
105 | err: `expected SEMI` | ||
106 | err: `expected expression` | ||
107 | EXPR_STMT@[154; 155) | ||
108 | ERROR@[154; 155) | ||
109 | DOLLAR@[154; 155) | ||
110 | err: `expected SEMI` | ||
111 | EXPR_STMT@[155; 160) | ||
112 | PATH_EXPR@[155; 160) | ||
113 | PATH@[155; 160) | ||
114 | PATH_SEGMENT@[155; 160) | ||
115 | NAME_REF@[155; 160) | ||
116 | IDENT@[155; 160) "input" | ||
117 | err: `expected SEMI` | ||
118 | err: `expected expression` | ||
119 | EXPR_STMT@[160; 161) | ||
120 | ERROR@[160; 161) | ||
121 | COLON@[160; 161) | ||
122 | err: `expected SEMI` | ||
123 | EXPR_STMT@[161; 165) | ||
124 | PATH_EXPR@[161; 165) | ||
125 | PATH@[161; 165) | ||
126 | PATH_SEGMENT@[161; 165) | ||
127 | NAME_REF@[161; 165) | ||
128 | IDENT@[161; 165) "expr" | ||
129 | err: `expected SEMI` | ||
130 | err: `expected expression` | ||
131 | EXPR_STMT@[165; 166) | ||
132 | ERROR@[165; 166) | ||
133 | R_PAREN@[165; 166) | ||
134 | err: `expected SEMI` | ||
135 | err: `expected expression` | ||
136 | EXPR_STMT@[166; 167) | ||
137 | ERROR@[166; 167) | ||
138 | COMMA@[166; 167) | ||
139 | err: `expected SEMI` | ||
140 | EXPR_STMT@[167; 170) | ||
141 | PREFIX_EXPR@[167; 170) | ||
142 | STAR@[167; 168) | ||
143 | WHITESPACE@[168; 169) | ||
144 | err: `expected expression` | ||
145 | ERROR@[169; 170) | ||
146 | DOLLAR@[169; 170) | ||
147 | err: `expected SEMI` | ||
148 | EXPR_STMT@[170; 171) | ||
149 | PAREN_EXPR@[170; 171) | ||
150 | L_PAREN@[170; 171) | ||
151 | err: `expected expression` | ||
152 | err: `expected R_PAREN` | ||
153 | err: `expected SEMI` | ||
154 | err: `expected expression` | ||
155 | EXPR_STMT@[171; 172) | ||
156 | ERROR@[171; 172) | ||
157 | COMMA@[171; 172) | ||
158 | err: `expected SEMI` | ||
159 | err: `expected expression` | ||
160 | EXPR_STMT@[172; 173) | ||
161 | ERROR@[172; 173) | ||
162 | R_PAREN@[172; 173) | ||
163 | err: `expected SEMI` | ||
164 | EXPR_STMT@[173; 175) | ||
165 | PREFIX_EXPR@[173; 175) | ||
166 | STAR@[173; 174) | ||
167 | err: `expected expression` | ||
168 | ERROR@[174; 175) | ||
169 | R_BRACK@[174; 175) | ||
170 | err: `expected SEMI` | ||
171 | err: `expected expression` | ||
172 | EXPR_STMT@[175; 176) | ||
173 | ERROR@[175; 176) | ||
174 | COMMA@[175; 176) | ||
175 | err: `expected SEMI` | ||
176 | WHITESPACE@[176; 177) | ||
177 | EXPR_STMT@[177; 180) | ||
178 | ARRAY_EXPR@[177; 180) | ||
179 | L_BRACK@[177; 178) | ||
180 | err: `expected expression` | ||
181 | ERROR@[178; 179) | ||
182 | DOLLAR@[178; 179) | ||
183 | err: `expected COMMA` | ||
184 | PAREN_EXPR@[179; 180) | ||
185 | L_PAREN@[179; 180) | ||
186 | err: `expected expression` | ||
187 | err: `expected R_PAREN` | ||
188 | err: `expected COMMA` | ||
189 | err: `expected expression` | ||
190 | err: `expected R_BRACK` | ||
191 | err: `expected SEMI` | ||
192 | err: `expected expression` | ||
193 | EXPR_STMT@[180; 181) | ||
194 | ERROR@[180; 181) | ||
195 | DOLLAR@[180; 181) | ||
196 | err: `expected SEMI` | ||
197 | EXPR_STMT@[181; 187) | ||
198 | PATH_EXPR@[181; 187) | ||
199 | PATH@[181; 187) | ||
200 | PATH_SEGMENT@[181; 187) | ||
201 | NAME_REF@[181; 187) | ||
202 | IDENT@[181; 187) "output" | ||
203 | err: `expected SEMI` | ||
204 | err: `expected expression` | ||
205 | EXPR_STMT@[187; 188) | ||
206 | ERROR@[187; 188) | ||
207 | COLON@[187; 188) | ||
208 | err: `expected SEMI` | ||
209 | EXPR_STMT@[188; 192) | ||
210 | PATH_EXPR@[188; 192) | ||
211 | PATH@[188; 192) | ||
212 | PATH_SEGMENT@[188; 192) | ||
213 | NAME_REF@[188; 192) | ||
214 | IDENT@[188; 192) "expr" | ||
215 | err: `expected SEMI` | ||
216 | err: `expected expression` | ||
217 | EXPR_STMT@[192; 193) | ||
218 | ERROR@[192; 193) | ||
219 | R_PAREN@[192; 193) | ||
220 | err: `expected SEMI` | ||
221 | err: `expected expression` | ||
222 | EXPR_STMT@[193; 194) | ||
223 | ERROR@[193; 194) | ||
224 | COMMA@[193; 194) | ||
225 | err: `expected SEMI` | ||
226 | EXPR_STMT@[194; 197) | ||
227 | PREFIX_EXPR@[194; 197) | ||
228 | STAR@[194; 195) | ||
229 | WHITESPACE@[195; 196) | ||
230 | err: `expected expression` | ||
231 | ERROR@[196; 197) | ||
232 | DOLLAR@[196; 197) | ||
233 | err: `expected SEMI` | ||
234 | EXPR_STMT@[197; 198) | ||
235 | PAREN_EXPR@[197; 198) | ||
236 | L_PAREN@[197; 198) | ||
237 | err: `expected expression` | ||
238 | err: `expected R_PAREN` | ||
239 | err: `expected SEMI` | ||
240 | err: `expected expression` | ||
241 | EXPR_STMT@[198; 199) | ||
242 | ERROR@[198; 199) | ||
243 | COMMA@[198; 199) | ||
244 | err: `expected SEMI` | ||
245 | err: `expected expression` | ||
246 | EXPR_STMT@[199; 200) | ||
247 | ERROR@[199; 200) | ||
248 | R_PAREN@[199; 200) | ||
249 | err: `expected SEMI` | ||
250 | EXPR_STMT@[200; 202) | ||
251 | PREFIX_EXPR@[200; 202) | ||
252 | STAR@[200; 201) | ||
253 | err: `expected expression` | ||
254 | ERROR@[201; 202) | ||
255 | R_BRACK@[201; 202) | ||
256 | err: `expected SEMI` | ||
257 | err: `expected expression` | ||
258 | EXPR_STMT@[202; 203) | ||
259 | ERROR@[202; 203) | ||
260 | R_PAREN@[202; 203) | ||
261 | err: `expected SEMI` | ||
262 | WHITESPACE@[203; 204) | ||
263 | BLOCK_EXPR@[204; 346) | ||
264 | BLOCK@[204; 346) | ||
265 | L_CURLY@[204; 205) | ||
266 | WHITESPACE@[205; 214) | ||
267 | EXPR_STMT@[214; 340) | ||
268 | MACRO_CALL@[214; 339) | ||
269 | PATH@[214; 223) | ||
270 | PATH_SEGMENT@[214; 223) | ||
271 | NAME_REF@[214; 223) | ||
272 | IDENT@[214; 223) "assert_eq" | ||
273 | EXCL@[223; 224) | ||
274 | TOKEN_TREE@[224; 339) | ||
275 | L_PAREN@[224; 225) | ||
276 | WHITESPACE@[225; 238) | ||
277 | IDENT@[238; 253) "merge_use_trees" | ||
278 | TOKEN_TREE@[253; 284) | ||
279 | L_PAREN@[253; 254) | ||
280 | IDENT@[254; 269) "parse_use_trees" | ||
281 | EXCL@[269; 270) | ||
282 | TOKEN_TREE@[270; 283) | ||
283 | L_PAREN@[270; 271) | ||
284 | DOLLAR@[271; 272) | ||
285 | TOKEN_TREE@[272; 281) | ||
286 | L_PAREN@[272; 273) | ||
287 | DOLLAR@[273; 274) | ||
288 | IDENT@[274; 279) "input" | ||
289 | COMMA@[279; 280) | ||
290 | R_PAREN@[280; 281) | ||
291 | STAR@[281; 282) | ||
292 | R_PAREN@[282; 283) | ||
293 | R_PAREN@[283; 284) | ||
294 | COMMA@[284; 285) | ||
295 | WHITESPACE@[285; 298) | ||
296 | IDENT@[298; 313) "parse_use_trees" | ||
297 | EXCL@[313; 314) | ||
298 | TOKEN_TREE@[314; 328) | ||
299 | L_PAREN@[314; 315) | ||
300 | DOLLAR@[315; 316) | ||
301 | TOKEN_TREE@[316; 326) | ||
302 | L_PAREN@[316; 317) | ||
303 | DOLLAR@[317; 318) | ||
304 | IDENT@[318; 324) "output" | ||
305 | COMMA@[324; 325) | ||
306 | R_PAREN@[325; 326) | ||
307 | STAR@[326; 327) | ||
308 | R_PAREN@[327; 328) | ||
309 | COMMA@[328; 329) | ||
310 | WHITESPACE@[329; 338) | ||
311 | R_PAREN@[338; 339) | ||
312 | SEMI@[339; 340) | ||
313 | WHITESPACE@[340; 345) | ||
314 | R_CURLY@[345; 346) | ||
315 | WHITESPACE@[346; 347) | ||
316 | R_CURLY@[347; 348) | ||
317 | WHITESPACE@[348; 349) | ||