diff options
Diffstat (limited to 'crates/libsyntax2/tests/data/parser/err')
-rw-r--r-- | crates/libsyntax2/tests/data/parser/err/0022_bad_exprs.rs | 3 | ||||
-rw-r--r-- | crates/libsyntax2/tests/data/parser/err/0022_bad_exprs.txt | 189 |
2 files changed, 192 insertions, 0 deletions
diff --git a/crates/libsyntax2/tests/data/parser/err/0022_bad_exprs.rs b/crates/libsyntax2/tests/data/parser/err/0022_bad_exprs.rs new file mode 100644 index 000000000..cd2d493a1 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0022_bad_exprs.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn a() { [1, 2, @, struct, let] } | ||
2 | fn b() { foo(1, 2, @, impl, let) } | ||
3 | fn c() { foo.bar(1, 2, @, ], trait, let) } | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0022_bad_exprs.txt b/crates/libsyntax2/tests/data/parser/err/0022_bad_exprs.txt new file mode 100644 index 000000000..287e56ac4 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0022_bad_exprs.txt | |||
@@ -0,0 +1,189 @@ | |||
1 | ROOT@[0; 112) | ||
2 | FN_DEF@[0; 33) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 4) | ||
6 | IDENT@[3; 4) "a" | ||
7 | PARAM_LIST@[4; 6) | ||
8 | L_PAREN@[4; 5) | ||
9 | R_PAREN@[5; 6) | ||
10 | WHITESPACE@[6; 7) | ||
11 | BLOCK@[7; 33) | ||
12 | L_CURLY@[7; 8) | ||
13 | WHITESPACE@[8; 9) | ||
14 | EXPR_STMT@[9; 15) | ||
15 | ARRAY_EXPR@[9; 15) | ||
16 | L_BRACK@[9; 10) | ||
17 | LITERAL@[10; 11) | ||
18 | INT_NUMBER@[10; 11) "1" | ||
19 | COMMA@[11; 12) | ||
20 | WHITESPACE@[12; 13) | ||
21 | LITERAL@[13; 14) | ||
22 | INT_NUMBER@[13; 14) "2" | ||
23 | COMMA@[14; 15) | ||
24 | err: `expected expression` | ||
25 | err: `expected R_BRACK` | ||
26 | err: `expected SEMI` | ||
27 | WHITESPACE@[15; 16) | ||
28 | err: `expected expression` | ||
29 | EXPR_STMT@[16; 17) | ||
30 | ERROR@[16; 17) | ||
31 | AT@[16; 17) | ||
32 | err: `expected SEMI` | ||
33 | err: `expected expression` | ||
34 | EXPR_STMT@[17; 18) | ||
35 | ERROR@[17; 18) | ||
36 | COMMA@[17; 18) | ||
37 | err: `expected SEMI` | ||
38 | WHITESPACE@[18; 19) | ||
39 | STRUCT_DEF@[19; 26) | ||
40 | STRUCT_KW@[19; 25) | ||
41 | err: `expected a name` | ||
42 | ERROR@[25; 26) | ||
43 | COMMA@[25; 26) | ||
44 | err: `expected `;`, `{`, or `(`` | ||
45 | WHITESPACE@[26; 27) | ||
46 | LET_STMT@[27; 31) | ||
47 | LET_KW@[27; 30) | ||
48 | err: `expected pattern` | ||
49 | ERROR@[30; 31) | ||
50 | R_BRACK@[30; 31) | ||
51 | err: `expected SEMI` | ||
52 | WHITESPACE@[31; 32) | ||
53 | R_CURLY@[32; 33) | ||
54 | WHITESPACE@[33; 34) | ||
55 | FN_DEF@[34; 68) | ||
56 | FN_KW@[34; 36) | ||
57 | WHITESPACE@[36; 37) | ||
58 | NAME@[37; 38) | ||
59 | IDENT@[37; 38) "b" | ||
60 | PARAM_LIST@[38; 40) | ||
61 | L_PAREN@[38; 39) | ||
62 | R_PAREN@[39; 40) | ||
63 | WHITESPACE@[40; 41) | ||
64 | BLOCK@[41; 68) | ||
65 | L_CURLY@[41; 42) | ||
66 | WHITESPACE@[42; 43) | ||
67 | EXPR_STMT@[43; 52) | ||
68 | CALL_EXPR@[43; 52) | ||
69 | PATH_EXPR@[43; 46) | ||
70 | PATH@[43; 46) | ||
71 | PATH_SEGMENT@[43; 46) | ||
72 | NAME_REF@[43; 46) | ||
73 | IDENT@[43; 46) "foo" | ||
74 | ARG_LIST@[46; 52) | ||
75 | L_PAREN@[46; 47) | ||
76 | LITERAL@[47; 48) | ||
77 | INT_NUMBER@[47; 48) "1" | ||
78 | COMMA@[48; 49) | ||
79 | WHITESPACE@[49; 50) | ||
80 | LITERAL@[50; 51) | ||
81 | INT_NUMBER@[50; 51) "2" | ||
82 | COMMA@[51; 52) | ||
83 | err: `expected expression` | ||
84 | err: `expected SEMI` | ||
85 | WHITESPACE@[52; 53) | ||
86 | err: `expected expression` | ||
87 | EXPR_STMT@[53; 54) | ||
88 | ERROR@[53; 54) | ||
89 | AT@[53; 54) | ||
90 | err: `expected SEMI` | ||
91 | err: `expected expression` | ||
92 | EXPR_STMT@[54; 55) | ||
93 | ERROR@[54; 55) | ||
94 | COMMA@[54; 55) | ||
95 | err: `expected SEMI` | ||
96 | WHITESPACE@[55; 56) | ||
97 | IMPL_ITEM@[56; 60) | ||
98 | IMPL_KW@[56; 60) | ||
99 | err: `expected type` | ||
100 | err: `expected `{`` | ||
101 | err: `expected expression` | ||
102 | EXPR_STMT@[60; 61) | ||
103 | ERROR@[60; 61) | ||
104 | COMMA@[60; 61) | ||
105 | err: `expected SEMI` | ||
106 | WHITESPACE@[61; 62) | ||
107 | LET_STMT@[62; 65) | ||
108 | LET_KW@[62; 65) | ||
109 | err: `expected pattern` | ||
110 | err: `expected SEMI` | ||
111 | err: `expected expression` | ||
112 | ERROR@[65; 66) | ||
113 | R_PAREN@[65; 66) | ||
114 | WHITESPACE@[66; 67) | ||
115 | R_CURLY@[67; 68) | ||
116 | WHITESPACE@[68; 69) | ||
117 | FN_DEF@[69; 111) | ||
118 | FN_KW@[69; 71) | ||
119 | WHITESPACE@[71; 72) | ||
120 | NAME@[72; 73) | ||
121 | IDENT@[72; 73) "c" | ||
122 | PARAM_LIST@[73; 75) | ||
123 | L_PAREN@[73; 74) | ||
124 | R_PAREN@[74; 75) | ||
125 | WHITESPACE@[75; 76) | ||
126 | BLOCK@[76; 111) | ||
127 | L_CURLY@[76; 77) | ||
128 | WHITESPACE@[77; 78) | ||
129 | EXPR_STMT@[78; 91) | ||
130 | METHOD_CALL_EXPR@[78; 91) | ||
131 | PATH_EXPR@[78; 81) | ||
132 | PATH@[78; 81) | ||
133 | PATH_SEGMENT@[78; 81) | ||
134 | NAME_REF@[78; 81) | ||
135 | IDENT@[78; 81) "foo" | ||
136 | DOT@[81; 82) | ||
137 | NAME_REF@[82; 85) | ||
138 | IDENT@[82; 85) "bar" | ||
139 | ARG_LIST@[85; 91) | ||
140 | L_PAREN@[85; 86) | ||
141 | LITERAL@[86; 87) | ||
142 | INT_NUMBER@[86; 87) "1" | ||
143 | COMMA@[87; 88) | ||
144 | WHITESPACE@[88; 89) | ||
145 | LITERAL@[89; 90) | ||
146 | INT_NUMBER@[89; 90) "2" | ||
147 | COMMA@[90; 91) | ||
148 | err: `expected expression` | ||
149 | err: `expected SEMI` | ||
150 | WHITESPACE@[91; 92) | ||
151 | err: `expected expression` | ||
152 | EXPR_STMT@[92; 93) | ||
153 | ERROR@[92; 93) | ||
154 | AT@[92; 93) | ||
155 | err: `expected SEMI` | ||
156 | err: `expected expression` | ||
157 | EXPR_STMT@[93; 94) | ||
158 | ERROR@[93; 94) | ||
159 | COMMA@[93; 94) | ||
160 | err: `expected SEMI` | ||
161 | WHITESPACE@[94; 95) | ||
162 | err: `expected expression` | ||
163 | EXPR_STMT@[95; 96) | ||
164 | ERROR@[95; 96) | ||
165 | R_BRACK@[95; 96) | ||
166 | err: `expected SEMI` | ||
167 | err: `expected expression` | ||
168 | EXPR_STMT@[96; 97) | ||
169 | ERROR@[96; 97) | ||
170 | COMMA@[96; 97) | ||
171 | err: `expected SEMI` | ||
172 | WHITESPACE@[97; 98) | ||
173 | TRAIT_DEF@[98; 104) | ||
174 | TRAIT_KW@[98; 103) | ||
175 | err: `expected a name` | ||
176 | ERROR@[103; 104) | ||
177 | COMMA@[103; 104) | ||
178 | err: `expected `{`` | ||
179 | WHITESPACE@[104; 105) | ||
180 | LET_STMT@[105; 108) | ||
181 | LET_KW@[105; 108) | ||
182 | err: `expected pattern` | ||
183 | err: `expected SEMI` | ||
184 | err: `expected expression` | ||
185 | ERROR@[108; 109) | ||
186 | R_PAREN@[108; 109) | ||
187 | WHITESPACE@[109; 110) | ||
188 | R_CURLY@[110; 111) | ||
189 | WHITESPACE@[111; 112) | ||