aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/test_data
Commit message (Collapse)AuthorAgeFilesLines
* Update testsAvi Dessauer2020-06-046-0/+109
|
* Parse default unsafe & default constAvi Dessauer2020-06-041-14/+20
|
* Support raw_ref_op's raw reference operatorrobojumper2020-05-282-44/+134
|
* Fix parsing of blocks without `{`Aleksey Kladov2020-05-025-25/+78
|
* Cleanup inline testsAleksey Kladov2020-05-028-30/+59
|
* Update test dataAleksey Kladov2020-05-02178-10580/+10223
|
* Validate uses of self and superJohn Renner2020-05-016-26/+104
|
* Merge #4227bors[bot]2020-04-304-75/+91
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4227: Report invalid, nested, multi-segment crate-paths r=matklad a=djrenren There was a bug in the previous path-validating code that didn't detect multi-segment paths that started with `crate`. ```rust // Successfully reported use foo::{crate}; // BUG: was not being reported use foo::{crate::bar}; ``` This was due to my confusion about path-associativity. That is, the path with no qualifier is the innermost path, not the outermost. I've updated the code with a lot of comments to explain what's going on. This bug was discovered when I found an erroneous `ok` test which I reported here: https://github.com/rust-analyzer/rust-analyzer/issues/4226 This test now fails and has been modified, hopefully in the spirit of the original test, to be correct. Sorry about submitting the bug in the first place! Co-authored-by: John Renner <[email protected]>
| * Report invalid, nested, multi-segment crate-pathsJohn Renner2020-04-304-75/+91
| | | | | | | | | | | | | | | | | | | | Specifically, things like: use foo::{crate::bar}; Are now being caught, when before we only caught: use foo::{crate};
* | Special-case try macro_rulesEdwin Cheng2020-04-302-0/+28
|/
* Special-case try macro to better support 2015 editionAleksey Kladov2020-04-302-0/+36
|
* Validate the location of `crate` in pathsJohn Renner2020-04-292-0/+80
|
* Convert tests to text-sizeAleksey Kladov2020-04-25335-22878/+22878
|
* Align grammar for record patterns and literalsAleksey Kladov2020-04-115-33/+41
| | | | | | The grammar now looks like this [name_ref :] pat
* Make records grammar more orthogonalAleksey Kladov2020-04-113-4/+62
| | | | | | | | | | | | We used name [: expr] grammar before, now it is [name :] expr which makes things simpler
* Rename some tokensAleksey Kladov2020-04-10197-1003/+1003
|
* Parse correctly fn f<T>() where T: Fn() -> u8 + Send {}Luca Barbieri2020-04-092-0/+62
| | | | | We used to parse it as T: Fn() -> (u8 + Send), which is different from the rustc behavior of T: (Fn() -> u8) + Send
* Migrate tests .txt -> .rastveetaha2020-04-06276-0/+0
| | | | | | | | The sytax tree output files now use .rast extension (rust-analyzer syntax tree or rust abstract syntax tree (whatever)). This format has a editors/code/ra_syntax_tree.tmGrammar.json declaration that supplies nice syntax highlighting for .rast files.
* Macro patterns are not confused with expressions.Aleksey Kladov2020-04-031-10/+11
| | | | | | | | | | | We treat macro calls as expressions (there's appropriate Into impl), which causes problem if there's expresison and non-expression macro in the same node (like in the match arm). We fix this problem by nesting macor patterns into another node (the same way we nest path into PathExpr or PathPat). Ideally, we probably should add a similar nesting for macro expressions, but that needs some careful thinking about macros in blocks: `{ am_i_expression!() }`.
* Attach doc-comment to declaration if there are newlines in betweenLeander Tentrup2020-03-312-0/+20
| | | | This commit changes the parser to attach doc-comments to the corresponding declaration in case there are newlines in between the doc-comment and the declaration.
* Fix parsing lambdas with return typeAleksey Kladov2020-03-253-14/+62
| | | | | | | We should eat only a single block, and not whatever larger expression may start with a block. closes #3721
* Support arbitrary discriminantsAleksey Kladov2020-03-202-0/+31
| | | | Closes #3661
* Parse variadics correctlyAleksey Kladov2020-03-135-3/+144
| | | | closes #3571
* Move verbose tests out of lineAleksey Kladov2020-03-138-56/+87
|
* Fix parsing of stement-ish binary expressionsAleksey Kladov2020-03-112-0/+41
| | | | closes #3512
* Rename ast::ImplBlock -> ast::ImplDefAleksey Kladov2020-02-2924-28/+28
|
* Parse attr in rhs of let stmtsEdwin Cheng2020-02-282-7/+35
|
* ra_syntax: migrate test data to 0-length text-range of SyntaxError when ↵Veetaha2020-02-1746-242/+242
| | | | constructed from TextUnit
* ra_syntax: reshape SyntaxError for the sake of removing redundancyVeetaha2020-02-1746-243/+243
|
* Run cargo testHan Mertens2020-02-121-0/+26
|
* Run cargo xtask codegenHan Mertens2020-02-121-0/+1
|
* Address review commentsMatthew Jasper2020-02-102-7/+58
|
* Update tests for or-patternsMatthew Jasper2020-02-094-60/+184
|
* 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
* | 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
* ra_syntax: added tests for tokenization errorsVeetaha2020-02-03148-27/+363
|
* Nest attrs into exprs in function argsAleksey Kladov2020-01-172-28/+22
|
* Extract expr_with_attrsAleksey Kladov2020-01-171-10/+14
|
* Merge pull request #2813 from jyn514/arg_attributesAleksey Kladov2020-01-172-0/+40
|\ | | | | Allow attributes before function arguments
| * move inline function closer to relevant codeJoshua Nelson2020-01-174-115/+40
| | | | | | | | also updates generated inline tests
| * Allow attributes before function argumentsJoshua Nelson2020-01-122-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for function calls of the form: ```rust ( #[attr(...)] 1.2, #[attr_one(...)] #[attr_two(...)] 1.5, ... etc ... ) ``` Closes https://github.com/rust-analyzer/rust-analyzer/issues/2801
* | Minimize testAleksey Kladov2020-01-166-116/+48
| |
* | Simplify array parsingAleksey Kladov2020-01-161-20/+13
| |
* | Merge #2827bors[bot]2020-01-162-28/+28
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 2827: Fix array element attribute position r=matklad a=edwin0cheng This PR fixed a bug which an ATTR node insert in the wrong place in array element. ~~And introduce `precede_next` for allow outer attributes to insert into a parsed `expr`.~~ related #2783 Co-authored-by: Edwin Cheng <[email protected]>
| * | Fix array element attribute positionEdwin Cheng2020-01-162-28/+28
| |/
* / Add a testAleksey Kladov2020-01-151-0/+3980
|/
* Parse trait aliasesEmil Lauridsen2020-01-092-0/+131
|
* Improve const generics parsingMichael Chesser2020-01-064-19/+73
| | | | | - Handle const generics type args - Fix issue with const generic as first parameter in trait impl