diff options
author | Aleksey Kladov <[email protected]> | 2018-08-26 17:04:44 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-26 17:04:44 +0100 |
commit | 9b69c7df194d5f9081698745ed20414d7c7c2f1c (patch) | |
tree | 23e4c98b4acea9bb73f03ba57b46f4b7d5dd3903 /crates/libsyntax2/tests | |
parent | 71722c047f96cb754c958c52591ca53f2a9c4d3c (diff) |
fix curly braces parsing
Diffstat (limited to 'crates/libsyntax2/tests')
-rw-r--r-- | crates/libsyntax2/tests/data/parser/err/0018_incomplete_fn.rs | 8 | ||||
-rw-r--r-- | crates/libsyntax2/tests/data/parser/err/0018_incomplete_fn.txt | 179 |
2 files changed, 187 insertions, 0 deletions
diff --git a/crates/libsyntax2/tests/data/parser/err/0018_incomplete_fn.rs b/crates/libsyntax2/tests/data/parser/err/0018_incomplete_fn.rs new file mode 100644 index 000000000..fe604006c --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0018_incomplete_fn.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | impl FnScopes { | ||
2 | fn new_scope(&) -> ScopeId { | ||
3 | let res = self.scopes.len(); | ||
4 | self.scopes.push(ScopeData { parent: None, entries: vec![] }) | ||
5 | } | ||
6 | |||
7 | fn set_parent | ||
8 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/err/0018_incomplete_fn.txt b/crates/libsyntax2/tests/data/parser/err/0018_incomplete_fn.txt new file mode 100644 index 000000000..3f3a7784b --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/err/0018_incomplete_fn.txt | |||
@@ -0,0 +1,179 @@ | |||
1 | ROOT@[0; 183) | ||
2 | IMPL_ITEM@[0; 182) | ||
3 | IMPL_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | PATH_TYPE@[5; 13) | ||
6 | PATH@[5; 13) | ||
7 | PATH_SEGMENT@[5; 13) | ||
8 | NAME_REF@[5; 13) | ||
9 | IDENT@[5; 13) "FnScopes" | ||
10 | WHITESPACE@[13; 14) | ||
11 | ITEM_LIST@[14; 182) | ||
12 | L_CURLY@[14; 15) | ||
13 | WHITESPACE@[15; 20) | ||
14 | FN_DEF@[20; 181) | ||
15 | FN_KW@[20; 22) | ||
16 | WHITESPACE@[22; 23) | ||
17 | NAME@[23; 32) | ||
18 | IDENT@[23; 32) "new_scope" | ||
19 | PARAM_LIST@[32; 181) | ||
20 | L_PAREN@[32; 33) | ||
21 | PARAM@[33; 38) | ||
22 | REF_PAT@[33; 35) | ||
23 | AMP@[33; 34) | ||
24 | err: `expected pattern` | ||
25 | ERROR@[34; 35) | ||
26 | R_PAREN@[34; 35) | ||
27 | err: `expected COLON` | ||
28 | WHITESPACE@[35; 36) | ||
29 | err: `expected type` | ||
30 | ERROR@[36; 38) | ||
31 | THIN_ARROW@[36; 38) | ||
32 | err: `expected COMMA` | ||
33 | WHITESPACE@[38; 39) | ||
34 | PARAM@[39; 169) | ||
35 | STRUCT_PAT@[39; 161) | ||
36 | PATH@[39; 46) | ||
37 | PATH_SEGMENT@[39; 46) | ||
38 | NAME_REF@[39; 46) | ||
39 | IDENT@[39; 46) "ScopeId" | ||
40 | WHITESPACE@[46; 47) | ||
41 | FIELD_PAT_LIST@[47; 161) | ||
42 | L_CURLY@[47; 48) | ||
43 | WHITESPACE@[48; 57) | ||
44 | err: `expected a name` | ||
45 | BIND_PAT@[57; 60) | ||
46 | ERROR@[57; 60) | ||
47 | LET_KW@[57; 60) | ||
48 | err: `expected COMMA` | ||
49 | WHITESPACE@[60; 61) | ||
50 | BIND_PAT@[61; 64) | ||
51 | NAME@[61; 64) | ||
52 | IDENT@[61; 64) "res" | ||
53 | err: `expected COMMA` | ||
54 | WHITESPACE@[64; 65) | ||
55 | err: `expected a name` | ||
56 | BIND_PAT@[65; 66) | ||
57 | ERROR@[65; 66) | ||
58 | EQ@[65; 66) | ||
59 | err: `expected COMMA` | ||
60 | WHITESPACE@[66; 67) | ||
61 | err: `expected a name` | ||
62 | BIND_PAT@[67; 71) | ||
63 | ERROR@[67; 71) | ||
64 | SELF_KW@[67; 71) | ||
65 | err: `expected COMMA` | ||
66 | err: `expected a name` | ||
67 | BIND_PAT@[71; 72) | ||
68 | ERROR@[71; 72) | ||
69 | DOT@[71; 72) | ||
70 | err: `expected COMMA` | ||
71 | BIND_PAT@[72; 78) | ||
72 | NAME@[72; 78) | ||
73 | IDENT@[72; 78) "scopes" | ||
74 | err: `expected COMMA` | ||
75 | err: `expected a name` | ||
76 | BIND_PAT@[78; 79) | ||
77 | ERROR@[78; 79) | ||
78 | DOT@[78; 79) | ||
79 | err: `expected COMMA` | ||
80 | BIND_PAT@[79; 82) | ||
81 | NAME@[79; 82) | ||
82 | IDENT@[79; 82) "len" | ||
83 | err: `expected COMMA` | ||
84 | err: `expected a name` | ||
85 | BIND_PAT@[82; 83) | ||
86 | ERROR@[82; 83) | ||
87 | L_PAREN@[82; 83) | ||
88 | err: `expected COMMA` | ||
89 | err: `expected a name` | ||
90 | BIND_PAT@[83; 84) | ||
91 | ERROR@[83; 84) | ||
92 | R_PAREN@[83; 84) | ||
93 | err: `expected COMMA` | ||
94 | err: `expected a name` | ||
95 | BIND_PAT@[84; 85) | ||
96 | ERROR@[84; 85) | ||
97 | SEMI@[84; 85) | ||
98 | err: `expected COMMA` | ||
99 | WHITESPACE@[85; 94) | ||
100 | err: `expected a name` | ||
101 | BIND_PAT@[94; 98) | ||
102 | ERROR@[94; 98) | ||
103 | SELF_KW@[94; 98) | ||
104 | err: `expected COMMA` | ||
105 | err: `expected a name` | ||
106 | BIND_PAT@[98; 99) | ||
107 | ERROR@[98; 99) | ||
108 | DOT@[98; 99) | ||
109 | err: `expected COMMA` | ||
110 | BIND_PAT@[99; 105) | ||
111 | NAME@[99; 105) | ||
112 | IDENT@[99; 105) "scopes" | ||
113 | err: `expected COMMA` | ||
114 | err: `expected a name` | ||
115 | BIND_PAT@[105; 106) | ||
116 | ERROR@[105; 106) | ||
117 | DOT@[105; 106) | ||
118 | err: `expected COMMA` | ||
119 | BIND_PAT@[106; 110) | ||
120 | NAME@[106; 110) | ||
121 | IDENT@[106; 110) "push" | ||
122 | err: `expected COMMA` | ||
123 | err: `expected a name` | ||
124 | BIND_PAT@[110; 111) | ||
125 | ERROR@[110; 111) | ||
126 | L_PAREN@[110; 111) | ||
127 | err: `expected COMMA` | ||
128 | BIND_PAT@[111; 120) | ||
129 | NAME@[111; 120) | ||
130 | IDENT@[111; 120) "ScopeData" | ||
131 | err: `expected COMMA` | ||
132 | WHITESPACE@[120; 121) | ||
133 | err: `expected ident` | ||
134 | ERROR@[121; 154) | ||
135 | L_CURLY@[121; 122) | ||
136 | WHITESPACE@[122; 123) | ||
137 | IDENT@[123; 129) "parent" | ||
138 | COLON@[129; 130) | ||
139 | WHITESPACE@[130; 131) | ||
140 | IDENT@[131; 135) "None" | ||
141 | COMMA@[135; 136) | ||
142 | WHITESPACE@[136; 137) | ||
143 | IDENT@[137; 144) "entries" | ||
144 | COLON@[144; 145) | ||
145 | WHITESPACE@[145; 146) | ||
146 | IDENT@[146; 149) "vec" | ||
147 | EXCL@[149; 150) | ||
148 | L_BRACK@[150; 151) | ||
149 | R_BRACK@[151; 152) | ||
150 | WHITESPACE@[152; 153) | ||
151 | R_CURLY@[153; 154) | ||
152 | err: `expected COMMA` | ||
153 | err: `expected a name` | ||
154 | BIND_PAT@[154; 155) | ||
155 | ERROR@[154; 155) | ||
156 | R_PAREN@[154; 155) | ||
157 | WHITESPACE@[155; 160) | ||
158 | R_CURLY@[160; 161) | ||
159 | err: `expected COLON` | ||
160 | WHITESPACE@[161; 167) | ||
161 | FN_POINTER_TYPE@[167; 169) | ||
162 | FN_KW@[167; 169) | ||
163 | err: `expected parameters` | ||
164 | err: `expected COMMA` | ||
165 | WHITESPACE@[169; 170) | ||
166 | PARAM@[170; 181) | ||
167 | BIND_PAT@[170; 180) | ||
168 | NAME@[170; 180) | ||
169 | IDENT@[170; 180) "set_parent" | ||
170 | err: `expected COLON` | ||
171 | WHITESPACE@[180; 181) | ||
172 | err: `expected type` | ||
173 | err: `expected COMMA` | ||
174 | err: `expected value parameter` | ||
175 | err: `expected R_PAREN` | ||
176 | err: `expected a block` | ||
177 | ERROR@[181; 181) | ||
178 | R_CURLY@[181; 182) | ||
179 | WHITESPACE@[182; 183) | ||