aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
Commit message (Collapse)AuthorAgeFilesLines
* Remove dat FIXMEVeetaha2020-02-181-1/+0
|
* Merge #3026bors[bot]2020-02-1855-642/+450
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
| * ra_syntax: fix reparsing merging errors, also now reparse_token() reports errorsVeetaha2020-02-181-7/+50
| |
| * ra_syntax: migrate test data to 0-length text-range of SyntaxError when ↵Veetaha2020-02-1746-242/+242
| | | | | | | | constructed from TextUnit
| * ra_syntax: remove message() method and use only Display trait in SyntaxError ↵Veetaha2020-02-172-4/+1
| | | | | | | | as per matklad
| * ra_syntax: change module-level documentation for syntax_error to "see X" as ↵Veetaha2020-02-171-1/+1
| | | | | | | | per matklad
| * ra_syntax: followup fix for making SyntaxError::range() to return by valueVeetaha2020-02-171-1/+1
| |
| * ra_syntax: SyntaxError::range() now returns by valueVeetaha2020-02-173-11/+5
| |
| * ra_syntax: moved reexport declaration after imports as per matkladVeetaha2020-02-171-1/+2
| |
| * ra_syntax: Apply Aleksei Kladov suggestion about TextRange of TextUnitVeetaha2020-02-171-1/+1
| | | | | | Co-Authored-By: Aleksey Kladov <[email protected]>
| * Change semmantical analyzis to tree validation as per @matkladVeetaha2020-02-171-1/+1
| | | | | | Co-Authored-By: Aleksey Kladov <[email protected]>
| * ra_syntax: reshape SyntaxError for the sake of removing redundancyVeetaha2020-02-1754-629/+402
| |
* | Rename the binary to rust-analyzerAleksey Kladov2020-02-181-1/+1
|/
* Init implementation of structural search replaceMikhail Modin2020-02-141-1/+1
|
* Run cargo testHan Mertens2020-02-121-0/+26
|
* Run cargo xtask codegenHan Mertens2020-02-121-0/+1
|
* Fix the trailing whitespace testKirill Bulatov2020-02-121-4/+1
|
* Introduce AttrKindKirill Bulatov2020-02-122-6/+15
|
* Do not add imports before inner attributesKirill Bulatov2020-02-121-0/+9
|
* Merge #3062bors[bot]2020-02-113-2/+43
|\ | | | | | | | | | | | | | | | | | | 3062: Implement slice pattern AST > HIR lowering r=jplatte a=jplatte WIP. The necessary changes for parsing are implemented, but actual inference is not yet. Just wanted to upload what I've got so far so it doesn't get duplicated :) Will fix #3043 Co-authored-by: Jonas Platte <[email protected]>
| * Implement slice pattern AST > HIR loweringJonas Platte2020-02-113-2/+43
| |
* | Address review commentsMatthew Jasper2020-02-102-7/+58
| |
* | Update tests for or-patternsMatthew Jasper2020-02-094-60/+184
| |
* | Add or- and parenthesized-patternsMatthew Jasper2020-02-091-6/+75
| |
* | Some README fixes/cleanupsFlorian Diebold2020-02-091-1/+1
| | | | | | | | Make capitalization more consistent and fix some typos.
* | Rename add import assistKirill Bulatov2020-02-071-1/+1
|/
* Merge #3047bors[bot]2020-02-074-11/+11
|\ | | | | | | | | | | | | | | | | | | | | | | 3047: Update async unsafe fn ordering in parser r=matklad a=kiljacken As of rust-lang/rust#61319 the correct order for functions that are both unsafe and async is: `async unsafe fn` and not `unsafe async fn`. This commit updates the parser tests to reflect this, and corrects parsing behavior to accept the correct ordering. Fixes #3025 Co-authored-by: Emil Lauridsen <[email protected]>
| * Update async unsafe fn ordering.Emil Lauridsen2020-02-074-11/+11
| | | | | | | | | | | | | | | | | | | | As of rust-lang/rust#61319 the correct order for functions that are both unsafe and async is: `async unsafe fn` and not `unsafe async fn`. This commit updates the parser tests to reflect this, and corrects parsing behavior to accept the correct ordering. Fixes #3025
* | Merge #3040bors[bot]2020-02-0714-200/+608
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3040: Rework value parameter parsing r=matklad a=tobz1000 Fixes #2847. - `Fn__(...)` parameters with idents/patterns no longer parse - Trait function parameters with arbitrary patterns parse - Trait function parameters without idents/patterns no longer parse - `fn(...)` parameters no longer parse with patterns other than a single ident __Question__: The pre-existing test `param_list_opt_patterns` has been kept as-is, although the name no longer makes sense (it's testing `Fn__(...)` params, which aren't allowed patterns any more). What would be best to do about this? Co-authored-by: Toby Dimmick <[email protected]>
| * | Closure params testToby Dimmick2020-02-062-0/+73
| | |
| * | Rework value parameter parsingToby Dimmick2020-02-0612-200/+535
| | | | | | | | | | | | | | | | | | | | | - `Fn__(...)` parameters with idents/patterns no longer parse - Trait function parameters with arbitrary patterns parse - Trait function parameters without idents/patterns no longer parse - `fn(...)` parameters no longer parse with patterns other than a single ident
* | | Cleanup early return assistAleksey Kladov2020-02-071-8/+21
| | |
* | | Generalize invert_if to just always workAleksey Kladov2020-02-071-1/+5
| |/ |/|
* | A tiny bit more consistent APIAleksey Kladov2020-02-061-1/+1
|/
* Refactor if-let -> match assist to use ast::makeAleksey Kladov2020-02-052-3/+25
|
* Make sure that newly created nodes are the root of the treeAleksey Kladov2020-02-041-2/+11
|
* ra_syntax: added tests for tokenization errorsVeetaha2020-02-03150-49/+427
|
* ra_syntax: add backticks around tokens specimenVeetaha2020-02-031-12/+23
|
* ra_syntax: removed unnecessary init statement from reparsing testsVeetaha2020-02-031-3/+0
|
* ra_syntax: rename first_token() -> lex_first_token()Veetaha2020-02-031-3/+3
|
* ra_syntax: fixed a typo in doc commentVeetaha2020-02-031-2/+4
|
* ra_syntax: refactored the lexer design as per @matklad and @kiljacken PR reviewVeetaha2020-02-037-173/+193
|
* ra_syntax: remove backticks from TokenizeError message since that is not ↵Veetaha2020-02-031-9/+9
| | | | Markdown ;(
* add better docs for tokenize errorsVeetaha2020-02-031-2/+2
|
* ra_syntax: moved ParsedToken derive attribute under the doc commentVeetaha2020-02-031-1/+1
|
* ra_syntax: fixed doc commentVeetaha2020-02-031-1/+1
|
* Reimplemented lexer with vectors instead of iteratorsVeetaha2020-02-038-187/+241
|
* ra_syntax: changed added diagnostics information returned from tokenize() ↵Veetaha2020-02-034-74/+237
| | | | (implemented with iterators)
* Fixed a typoVeetaha2020-01-221-1/+1
|
* Fixed a typoVeetaha2020-01-221-1/+1
|