diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-18 12:57:26 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-18 12:57:26 +0000 |
commit | c447fe9bc06006a7080da782cf67d739c91b534c (patch) | |
tree | 45cbc9578b24437da3eedc6a234784be22b1f38c /crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt | |
parent | 742459c8fe08e359ae380e3e1dc0d059c0b4f871 (diff) | |
parent | 053ccf4121797e4e559e3225d46d3f23cb1ad70b (diff) |
Merge #3026
3026: ra_syntax: reshape SyntaxError for the sake of removing redundancy r=matklad a=Veetaha
Followup of #2911, also puts some crosses to the todo list of #223.
**AHTUNG!** A big part of the diff of this PR are test data files changes.
Simplified `SyntaxError` that was `SyntaxError { kind: { /* big enum */ }, location: Location }` to `SyntaxError(String, TextRange)`. I am not sure whether the tuple struct here is best fit, I am inclined to add names to the fields, because I already provide getters `SyntaxError::message()`, `SyntaxError::range()`.
I also removed `Location` altogether ...
This is currently WIP, because the following is not done:
- [ ] ~~Add tests to `test_data` dir for unescape errors *// I don't know where to put these errors in particular, because they are out of the scope of the lexer and parser. However, I have an idea in mind that we move all validators we have right now to parsing stage, but this is up to discussion...*~~ **[UPD]** I came to a conclusion that tree validation logic, which unescape errors are a part of, should be rethought of, we currently have no tests and no place to put tests for tree validations. So I'd like to extract potential redesign (maybe move of tree validation to ra_parser) and adding tests for this into a separate task.
Co-authored-by: Veetaha <[email protected]>
Co-authored-by: Veetaha <[email protected]>
Diffstat (limited to 'crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt')
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt index 0a93e11a5..c5c8a29ba 100644 --- a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt +++ b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt | |||
@@ -290,32 +290,32 @@ SOURCE_FILE@[0; 240) | |||
290 | WHITESPACE@[237; 238) "\n" | 290 | WHITESPACE@[237; 238) "\n" |
291 | R_CURLY@[238; 239) "}" | 291 | R_CURLY@[238; 239) "}" |
292 | WHITESPACE@[239; 240) "\n" | 292 | WHITESPACE@[239; 240) "\n" |
293 | error 88: expected COMMA | 293 | error [88; 88): expected COMMA |
294 | error 88: expected R_ANGLE | 294 | error [88; 88): expected R_ANGLE |
295 | error 121: expected SEMI | 295 | error [121; 121): expected SEMI |
296 | error 121: expected expression | 296 | error [121; 121): expected expression |
297 | error 140: expected type | 297 | error [140; 140): expected type |
298 | error 141: expected R_PAREN | 298 | error [141; 141): expected R_PAREN |
299 | error 141: expected COMMA | 299 | error [141; 141): expected COMMA |
300 | error 141: expected R_ANGLE | 300 | error [141; 141): expected R_ANGLE |
301 | error 141: expected SEMI | 301 | error [141; 141): expected SEMI |
302 | error 146: expected SEMI | 302 | error [146; 146): expected SEMI |
303 | error 146: expected expression | 303 | error [146; 146): expected expression |
304 | error 147: expected SEMI | 304 | error [147; 147): expected SEMI |
305 | error 148: expected expression | 305 | error [148; 148): expected expression |
306 | error 149: expected SEMI | 306 | error [149; 149): expected SEMI |
307 | error 154: expected pattern | 307 | error [154; 154): expected pattern |
308 | error 155: expected IN_KW | 308 | error [155; 155): expected IN_KW |
309 | error 155: expected expression | 309 | error [155; 155): expected expression |
310 | error 157: expected a block | 310 | error [157; 157): expected a block |
311 | error 165: expected expression | 311 | error [165; 165): expected expression |
312 | error 168: expected expression | 312 | error [168; 168): expected expression |
313 | error 179: expected expression | 313 | error [179; 179): expected expression |
314 | error 180: expected COMMA | 314 | error [180; 180): expected COMMA |
315 | error 180: expected expression | 315 | error [180; 180): expected expression |
316 | error 180: expected R_PAREN | 316 | error [180; 180): expected R_PAREN |
317 | error 180: expected SEMI | 317 | error [180; 180): expected SEMI |
318 | error 215: expected COMMA | 318 | error [215; 215): expected COMMA |
319 | error 215: expected R_ANGLE | 319 | error [215; 215): expected R_ANGLE |
320 | error 235: expected SEMI | 320 | error [235; 235): expected SEMI |
321 | error 235: expected expression | 321 | error [235; 235): expected expression |