diff options
author | Aleksey Kladov <[email protected]> | 2018-09-08 08:35:05 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-09-08 08:35:05 +0100 |
commit | febbc9acdd0166530499b9b129ee703fcbfbe978 (patch) | |
tree | f49923418511ad87d6ab28e286a0c7261e14ccbe /crates/libsyntax2/tests/data/parser/err | |
parent | a0a347eac941e93165c5b2728010bfbcb6ae9549 (diff) |
Don't get stuck in tuple exprs
Diffstat (limited to 'crates/libsyntax2/tests/data/parser/err')
-rw-r--r-- | crates/libsyntax2/tests/data/parser/err/0024_many_type_parens.rs | 7 | ||||
-rw-r--r-- | crates/libsyntax2/tests/data/parser/err/0024_many_type_parens.txt | 310 |
2 files changed, 317 insertions, 0 deletions
diff --git a/crates/libsyntax2/tests/data/parser/err/0024_many_type_parens.rs b/crates/libsyntax2/tests/data/parser/err/0024_many_type_parens.rs new file mode 100644 index 000000000..6c2e95c02 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0024_many_type_parens.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn f<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {} | ||
2 | |||
3 | fn main() { | ||
4 | let _: Box<(Copy) + (?Sized) + (for<'a> Trait<'a>)>; | ||
5 | let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>; | ||
6 | let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>; | ||
7 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0024_many_type_parens.txt b/crates/libsyntax2/tests/data/parser/err/0024_many_type_parens.txt new file mode 100644 index 000000000..195c12e08 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0024_many_type_parens.txt | |||
@@ -0,0 +1,310 @@ | |||
1 | ROOT@[0; 240) | ||
2 | FN_DEF@[0; 53) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "f" | ||
7 | TYPE_PARAM_LIST@[4; 48) | ||
8 | L_ANGLE@[4; 5) | ||
9 | TYPE_PARAM@[5; 47) | ||
10 | NAME@[5; 6) | ||
11 | IDENT@[5; 6) "T" | ||
12 | COLON@[6; 7) | ||
13 | WHITESPACE@[7; 8) | ||
14 | L_PAREN@[8; 9) | ||
15 | PATH_TYPE@[9; 13) | ||
16 | PATH@[9; 13) | ||
17 | PATH_SEGMENT@[9; 13) | ||
18 | NAME_REF@[9; 13) | ||
19 | IDENT@[9; 13) "Copy" | ||
20 | R_PAREN@[13; 14) | ||
21 | WHITESPACE@[14; 15) | ||
22 | PLUS@[15; 16) | ||
23 | WHITESPACE@[16; 17) | ||
24 | L_PAREN@[17; 18) | ||
25 | QUESTION@[18; 19) | ||
26 | PATH_TYPE@[19; 24) | ||
27 | PATH@[19; 24) | ||
28 | PATH_SEGMENT@[19; 24) | ||
29 | NAME_REF@[19; 24) | ||
30 | IDENT@[19; 24) "Sized" | ||
31 | R_PAREN@[24; 25) | ||
32 | WHITESPACE@[25; 26) | ||
33 | PLUS@[26; 27) | ||
34 | WHITESPACE@[27; 28) | ||
35 | L_PAREN@[28; 29) | ||
36 | FOR_TYPE@[29; 46) | ||
37 | FOR_KW@[29; 32) | ||
38 | TYPE_PARAM_LIST@[32; 36) | ||
39 | L_ANGLE@[32; 33) | ||
40 | LIFETIME_PARAM@[33; 35) | ||
41 | LIFETIME@[33; 35) "'a" | ||
42 | R_ANGLE@[35; 36) | ||
43 | WHITESPACE@[36; 37) | ||
44 | PATH_TYPE@[37; 46) | ||
45 | PATH@[37; 46) | ||
46 | PATH_SEGMENT@[37; 46) | ||
47 | NAME_REF@[37; 42) | ||
48 | IDENT@[37; 42) "Trait" | ||
49 | TYPE_ARG_LIST@[42; 46) | ||
50 | L_ANGLE@[42; 43) | ||
51 | LIFETIME_ARG@[43; 45) | ||
52 | LIFETIME@[43; 45) "'a" | ||
53 | R_ANGLE@[45; 46) | ||
54 | R_PAREN@[46; 47) | ||
55 | R_ANGLE@[47; 48) | ||
56 | PARAM_LIST@[48; 50) | ||
57 | L_PAREN@[48; 49) | ||
58 | R_PAREN@[49; 50) | ||
59 | WHITESPACE@[50; 51) | ||
60 | BLOCK@[51; 53) | ||
61 | L_CURLY@[51; 52) | ||
62 | R_CURLY@[52; 53) | ||
63 | WHITESPACE@[53; 55) | ||
64 | FN_DEF@[55; 239) | ||
65 | FN_KW@[55; 57) | ||
66 | WHITESPACE@[57; 58) | ||
67 | NAME@[58; 62) | ||
68 | IDENT@[58; 62) "main" | ||
69 | PARAM_LIST@[62; 64) | ||
70 | L_PAREN@[62; 63) | ||
71 | R_PAREN@[63; 64) | ||
72 | WHITESPACE@[64; 65) | ||
73 | BLOCK@[65; 239) | ||
74 | L_CURLY@[65; 66) | ||
75 | WHITESPACE@[66; 71) | ||
76 | LET_STMT@[71; 121) | ||
77 | LET_KW@[71; 74) | ||
78 | WHITESPACE@[74; 75) | ||
79 | PLACEHOLDER_PAT@[75; 76) | ||
80 | UNDERSCORE@[75; 76) | ||
81 | COLON@[76; 77) | ||
82 | WHITESPACE@[77; 78) | ||
83 | PATH_TYPE@[78; 121) | ||
84 | PATH@[78; 88) | ||
85 | PATH_SEGMENT@[78; 88) | ||
86 | NAME_REF@[78; 81) | ||
87 | IDENT@[78; 81) "Box" | ||
88 | TYPE_ARG_LIST@[81; 88) | ||
89 | L_ANGLE@[81; 82) | ||
90 | TYPE_ARG@[82; 88) | ||
91 | PAREN_TYPE@[82; 88) | ||
92 | L_PAREN@[82; 83) | ||
93 | PATH_TYPE@[83; 87) | ||
94 | PATH@[83; 87) | ||
95 | PATH_SEGMENT@[83; 87) | ||
96 | NAME_REF@[83; 87) | ||
97 | IDENT@[83; 87) "Copy" | ||
98 | R_PAREN@[87; 88) | ||
99 | err: `expected COMMA` | ||
100 | err: `expected R_ANGLE` | ||
101 | WHITESPACE@[88; 89) | ||
102 | PLUS@[89; 90) | ||
103 | WHITESPACE@[90; 91) | ||
104 | L_PAREN@[91; 92) | ||
105 | QUESTION@[92; 93) | ||
106 | PATH_TYPE@[93; 98) | ||
107 | PATH@[93; 98) | ||
108 | PATH_SEGMENT@[93; 98) | ||
109 | NAME_REF@[93; 98) | ||
110 | IDENT@[93; 98) "Sized" | ||
111 | R_PAREN@[98; 99) | ||
112 | WHITESPACE@[99; 100) | ||
113 | PLUS@[100; 101) | ||
114 | WHITESPACE@[101; 102) | ||
115 | L_PAREN@[102; 103) | ||
116 | FOR_TYPE@[103; 120) | ||
117 | FOR_KW@[103; 106) | ||
118 | TYPE_PARAM_LIST@[106; 110) | ||
119 | L_ANGLE@[106; 107) | ||
120 | LIFETIME_PARAM@[107; 109) | ||
121 | LIFETIME@[107; 109) "'a" | ||
122 | R_ANGLE@[109; 110) | ||
123 | WHITESPACE@[110; 111) | ||
124 | PATH_TYPE@[111; 120) | ||
125 | PATH@[111; 120) | ||
126 | PATH_SEGMENT@[111; 120) | ||
127 | NAME_REF@[111; 116) | ||
128 | IDENT@[111; 116) "Trait" | ||
129 | TYPE_ARG_LIST@[116; 120) | ||
130 | L_ANGLE@[116; 117) | ||
131 | LIFETIME_ARG@[117; 119) | ||
132 | LIFETIME@[117; 119) "'a" | ||
133 | R_ANGLE@[119; 120) | ||
134 | R_PAREN@[120; 121) | ||
135 | err: `expected SEMI` | ||
136 | err: `expected expression` | ||
137 | EXPR_STMT@[121; 123) | ||
138 | ERROR@[121; 122) | ||
139 | R_ANGLE@[121; 122) | ||
140 | SEMI@[122; 123) | ||
141 | WHITESPACE@[123; 128) | ||
142 | LET_STMT@[128; 141) | ||
143 | LET_KW@[128; 131) | ||
144 | WHITESPACE@[131; 132) | ||
145 | PLACEHOLDER_PAT@[132; 133) | ||
146 | UNDERSCORE@[132; 133) | ||
147 | COLON@[133; 134) | ||
148 | WHITESPACE@[134; 135) | ||
149 | PATH_TYPE@[135; 141) | ||
150 | PATH@[135; 141) | ||
151 | PATH_SEGMENT@[135; 141) | ||
152 | NAME_REF@[135; 138) | ||
153 | IDENT@[135; 138) "Box" | ||
154 | TYPE_ARG_LIST@[138; 141) | ||
155 | L_ANGLE@[138; 139) | ||
156 | TYPE_ARG@[139; 141) | ||
157 | PAREN_TYPE@[139; 141) | ||
158 | L_PAREN@[139; 140) | ||
159 | err: `expected type` | ||
160 | ERROR@[140; 141) | ||
161 | QUESTION@[140; 141) | ||
162 | err: `expected R_PAREN` | ||
163 | err: `expected COMMA` | ||
164 | err: `expected R_ANGLE` | ||
165 | err: `expected SEMI` | ||
166 | EXPR_STMT@[141; 146) | ||
167 | PATH_EXPR@[141; 146) | ||
168 | PATH@[141; 146) | ||
169 | PATH_SEGMENT@[141; 146) | ||
170 | NAME_REF@[141; 146) | ||
171 | IDENT@[141; 146) "Sized" | ||
172 | err: `expected SEMI` | ||
173 | err: `expected expression` | ||
174 | EXPR_STMT@[146; 147) | ||
175 | ERROR@[146; 147) | ||
176 | R_PAREN@[146; 147) | ||
177 | err: `expected SEMI` | ||
178 | WHITESPACE@[147; 148) | ||
179 | err: `expected expression` | ||
180 | EXPR_STMT@[148; 149) | ||
181 | ERROR@[148; 149) | ||
182 | PLUS@[148; 149) | ||
183 | err: `expected SEMI` | ||
184 | WHITESPACE@[149; 150) | ||
185 | EXPR_STMT@[150; 151) | ||
186 | PAREN_EXPR@[150; 151) | ||
187 | L_PAREN@[150; 151) | ||
188 | err: `expected expression` | ||
189 | err: `expected R_PAREN` | ||
190 | err: `expected SEMI` | ||
191 | EXPR_STMT@[151; 157) | ||
192 | FOR_EXPR@[151; 157) | ||
193 | FOR_KW@[151; 154) | ||
194 | err: `expected pattern` | ||
195 | ERROR@[154; 155) | ||
196 | L_ANGLE@[154; 155) | ||
197 | err: `expected IN_KW` | ||
198 | err: `expected expression` | ||
199 | ERROR@[155; 157) | ||
200 | LIFETIME@[155; 157) "'a" | ||
201 | err: `expected a block` | ||
202 | err: `expected expression` | ||
203 | EXPR_STMT@[157; 158) | ||
204 | ERROR@[157; 158) | ||
205 | R_ANGLE@[157; 158) | ||
206 | err: `expected SEMI` | ||
207 | WHITESPACE@[158; 159) | ||
208 | EXPR_STMT@[159; 180) | ||
209 | BIN_EXPR@[159; 180) | ||
210 | BIN_EXPR@[159; 178) | ||
211 | BIN_EXPR@[159; 169) | ||
212 | BIN_EXPR@[159; 167) | ||
213 | PATH_EXPR@[159; 164) | ||
214 | PATH@[159; 164) | ||
215 | PATH_SEGMENT@[159; 164) | ||
216 | NAME_REF@[159; 164) | ||
217 | IDENT@[159; 164) "Trait" | ||
218 | L_ANGLE@[164; 165) | ||
219 | err: `expected expression` | ||
220 | ERROR@[165; 167) | ||
221 | LIFETIME@[165; 167) "'a" | ||
222 | R_ANGLE@[167; 168) | ||
223 | err: `expected expression` | ||
224 | ERROR@[168; 169) | ||
225 | R_PAREN@[168; 169) | ||
226 | WHITESPACE@[169; 170) | ||
227 | PLUS@[170; 171) | ||
228 | WHITESPACE@[171; 172) | ||
229 | PAREN_EXPR@[172; 178) | ||
230 | L_PAREN@[172; 173) | ||
231 | PATH_EXPR@[173; 177) | ||
232 | PATH@[173; 177) | ||
233 | PATH_SEGMENT@[173; 177) | ||
234 | NAME_REF@[173; 177) | ||
235 | IDENT@[173; 177) "Copy" | ||
236 | R_PAREN@[177; 178) | ||
237 | R_ANGLE@[178; 179) | ||
238 | err: `expected expression` | ||
239 | ERROR@[179; 180) | ||
240 | SEMI@[179; 180) | ||
241 | err: `expected SEMI` | ||
242 | WHITESPACE@[180; 185) | ||
243 | LET_STMT@[185; 235) | ||
244 | LET_KW@[185; 188) | ||
245 | WHITESPACE@[188; 189) | ||
246 | PLACEHOLDER_PAT@[189; 190) | ||
247 | UNDERSCORE@[189; 190) | ||
248 | COLON@[190; 191) | ||
249 | WHITESPACE@[191; 192) | ||
250 | PATH_TYPE@[192; 235) | ||
251 | PATH@[192; 215) | ||
252 | PATH_SEGMENT@[192; 215) | ||
253 | NAME_REF@[192; 195) | ||
254 | IDENT@[192; 195) "Box" | ||
255 | TYPE_ARG_LIST@[195; 215) | ||
256 | L_ANGLE@[195; 196) | ||
257 | TYPE_ARG@[196; 215) | ||
258 | PAREN_TYPE@[196; 215) | ||
259 | L_PAREN@[196; 197) | ||
260 | FOR_TYPE@[197; 214) | ||
261 | FOR_KW@[197; 200) | ||
262 | TYPE_PARAM_LIST@[200; 204) | ||
263 | L_ANGLE@[200; 201) | ||
264 | LIFETIME_PARAM@[201; 203) | ||
265 | LIFETIME@[201; 203) "'a" | ||
266 | R_ANGLE@[203; 204) | ||
267 | WHITESPACE@[204; 205) | ||
268 | PATH_TYPE@[205; 214) | ||
269 | PATH@[205; 214) | ||
270 | PATH_SEGMENT@[205; 214) | ||
271 | NAME_REF@[205; 210) | ||
272 | IDENT@[205; 210) "Trait" | ||
273 | TYPE_ARG_LIST@[210; 214) | ||
274 | L_ANGLE@[210; 211) | ||
275 | LIFETIME_ARG@[211; 213) | ||
276 | LIFETIME@[211; 213) "'a" | ||
277 | R_ANGLE@[213; 214) | ||
278 | R_PAREN@[214; 215) | ||
279 | err: `expected COMMA` | ||
280 | err: `expected R_ANGLE` | ||
281 | WHITESPACE@[215; 216) | ||
282 | PLUS@[216; 217) | ||
283 | WHITESPACE@[217; 218) | ||
284 | L_PAREN@[218; 219) | ||
285 | PATH_TYPE@[219; 223) | ||
286 | PATH@[219; 223) | ||
287 | PATH_SEGMENT@[219; 223) | ||
288 | NAME_REF@[219; 223) | ||
289 | IDENT@[219; 223) "Copy" | ||
290 | R_PAREN@[223; 224) | ||
291 | WHITESPACE@[224; 225) | ||
292 | PLUS@[225; 226) | ||
293 | WHITESPACE@[226; 227) | ||
294 | L_PAREN@[227; 228) | ||
295 | QUESTION@[228; 229) | ||
296 | PATH_TYPE@[229; 234) | ||
297 | PATH@[229; 234) | ||
298 | PATH_SEGMENT@[229; 234) | ||
299 | NAME_REF@[229; 234) | ||
300 | IDENT@[229; 234) "Sized" | ||
301 | R_PAREN@[234; 235) | ||
302 | err: `expected SEMI` | ||
303 | err: `expected expression` | ||
304 | EXPR_STMT@[235; 237) | ||
305 | ERROR@[235; 236) | ||
306 | R_ANGLE@[235; 236) | ||
307 | SEMI@[236; 237) | ||
308 | WHITESPACE@[237; 238) | ||
309 | R_CURLY@[238; 239) | ||
310 | WHITESPACE@[239; 240) | ||