Commit c3588b9
authored
Collect and display all detected errors in an input document (#76)
Until now we have just exited on detecting the first parsing or
validation error, but the forthcoming language server will need to know
where all the problems are. So the next step in maturing the parser is
collecting more than a single error at a time when checking the validity
of a document.
The Parser state object is updated to include a Vec<ParsingError> that
the parser (and subparsers) can contribute to.
Finally, when reporting errors we deduplicate, with more specific
messages overriding enclosing general ones. This is an admittedly rare
occurrence, as usually fail-fast short-circuiting will cause a single
error to propagate, but in the event nesting results in multiple errors
at the same site we trim it down to a single message.File tree
10 files changed
+847
-299
lines changed- src
- parsing
- problem
- tests
- broken
- parsing
10 files changed
+847
-299
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
170 | 179 | | |
171 | 180 | | |
172 | 181 | | |
| 182 | + | |
173 | 183 | | |
174 | 184 | | |
175 | 185 | | |
| |||
205 | 215 | | |
206 | 216 | | |
207 | 217 | | |
| 218 | + | |
208 | 219 | | |
209 | 220 | | |
210 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
211 | 235 | | |
212 | | - | |
213 | | - | |
| 236 | + | |
| 237 | + | |
214 | 238 | | |
215 | 239 | | |
216 | 240 | | |
| |||
251 | 275 | | |
252 | 276 | | |
253 | 277 | | |
| 278 | + | |
254 | 279 | | |
255 | 280 | | |
256 | | - | |
| 281 | + | |
257 | 282 | | |
258 | 283 | | |
259 | 284 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
264 | 299 | | |
265 | 300 | | |
266 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
0 commit comments