aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser
Commit message (Collapse)AuthorAgeFilesLines
* Add or- and parenthesized-patternsMatthew Jasper2020-02-094-14/+62
|
* Rename add import assistKirill Bulatov2020-02-071-1/+1
|
* Merge #3047bors[bot]2020-02-071-9/+9
|\ | | | | | | | | | | | | | | | | | | | | | | 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-071-9/+9
| | | | | | | | | | | | | | | | | | | | 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
* | PR tweaksToby Dimmick2020-02-073-21/+18
| |
* | Closure params testToby Dimmick2020-02-061-0/+4
| |
* | rustfmtToby Dimmick2020-02-061-2/+2
| |
* | Rework value parameter parsingToby Dimmick2020-02-065-55/+73
|/ | | | | | | - `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: remove code duplication and token reevaluation from ↵Veetaha2020-01-221-2/+2
| | | | ast::Literal::kind()
* Nest attrs into exprs in function argsAleksey Kladov2020-01-171-4/+1
|
* Extract expr_with_attrsAleksey Kladov2020-01-172-13/+22
|
* Merge pull request #2813 from jyn514/arg_attributesAleksey Kladov2020-01-171-0/+5
|\ | | | | Allow attributes before function arguments
| * move inline function closer to relevant codeJoshua Nelson2020-01-171-4/+4
| | | | | | | | also updates generated inline tests
| * shrink inline tesJoshua Nelson2020-01-161-9/+3
| |
| * Allow attributes before function argumentsJoshua Nelson2020-01-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge #2865bors[bot]2020-01-171-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | 2865: fix(mixed): fixed a couple of typos and added a todo r=kjeremy a=Veetaha Fixed a couple of typos and added a todo while studying the codebase. Co-authored-by: Veetaha <[email protected]>
| * | fix(ra_parser.typo): amend 'format language' to 'formal language'Veetaha2020-01-151-1/+1
| |/
* | Minimize testAleksey Kladov2020-01-161-13/+3
| |
* | Simplify array parsingAleksey Kladov2020-01-162-48/+31
| |
* | fix formatingEdwin Cheng2020-01-161-1/+1
| |
* | Fix array element attribute positionEdwin Cheng2020-01-163-8/+32
|/
* Parse trait aliasesEmil Lauridsen2020-01-091-0/+10
|
* Improve const generics parsingMichael Chesser2020-01-063-2/+14
| | | | | - Handle const generics type args - Fix issue with const generic as first parameter in trait impl
* Switch ast declaration from ron to a macroAleksey Kladov2020-01-031-135/+135
|
* Merge #2642bors[bot]2019-12-221-1/+1
|\ | | | | | | | | | | | | | | 2642: Use name instead of ident in parser for macro 2.0 syntax r=matklad a=edwin0cheng Co-authored-by: Edwin Cheng <[email protected]>
| * Use name instead of ident for macro 2.0 sytnaxEdwin Cheng2019-12-221-1/+1
| |
* | Merge #2641bors[bot]2019-12-222-0/+12
|\ \ | |/ |/| | | | | | | | | | | | | | | | | 2641: Parse const generics r=matklad a=roblabla Adds very primitive support for parsing const generics (`const IDENT: TY`) so that rust-analyzer stops complaining about the syntax being invalid. Fixes #1574 Fixes #2281 Co-authored-by: roblabla <[email protected]>
| * Parse const genericsroblabla2019-12-222-0/+12
| | | | | | | | | | Fixes #1574 Fixes #2281
* | Add macro keyword to ITEM_RECOVERY_SETEdwin Cheng2019-12-211-1/+1
| |
* | Add macro 2.0 support in parserEdwin Cheng2019-12-212-1/+35
| |
* | Fix parser for macro call in pattern positionEdwin Cheng2019-12-201-1/+1
|/
* Touch up TokenSet a bitAleksey Kladov2019-12-194-8/+6
|
* Refactor macro testsAleksey Kladov2019-12-191-0/+1
|
* Fix parsing of interpolated expressionsAleksey Kladov2019-12-191-0/+1
|
* Improve recovery for incomplete lambdasAleksey Kladov2019-12-171-1/+6
|
* Fix hir for ast::UnionDefAleksey Kladov2019-11-251-1/+1
|
* Introduce dedicated AST node for unionAleksey Kladov2019-11-253-12/+22
| | | | | | | | | | Although structs and unions have the same syntax and differ only in the keyword, re-using the single syntax node for both of them leads to confusion in practice, and propagates further down the hir in an upleasent way. Moreover, static and consts also share syntax, but we use different nodes for them.
* Disable doctestsAleksey Kladov2019-11-171-0/+3
|
* Move inclusive range check to validationGeoffry Song2019-11-151-3/+0
|
* Fix parsing of "postfix" range expressions.Geoffry Song2019-11-151-30/+24
| | | | | | | | | | Right now they are handled in `postfix_dot_expr`, but that doesn't allow it to correctly handle precedence. Integrate it more tightly with the Pratt parser instead. Also includes a drive-by fix for parsing `match .. {}`. Fixes #2242.
* Simplify parsingAleksey Kladov2019-11-142-19/+19
|
* cargo xtask format with 1.39kjeremy2019-11-071-3/+3
|
* fix parsing of for loops inside expressionsAleksey Kladov2019-10-281-1/+2
| | | | closes #2051
* Merge #1951bors[bot]2019-10-081-1/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | 1951: Lower the precedence of the `as` operator. r=matklad a=goffrie Previously, the `as` operator was being parsed like a postfix expression, and therefore being given the highest possible precedence. That caused it to bind more tightly than prefix operators, which it should not. Instead, parse it somewhat like a normal binary expression with some special-casing. Fixes #1851. Co-authored-by: Geoffry Song <[email protected]>
| * Move tests aroundGeoffry Song2019-10-061-6/+5
| |
| * Lower the precedence of the `as` operator.Geoffry Song2019-10-031-2/+12
| | | | | | | | | | | | | | Previously, the `as` operator was being parsed like a postfix expression, and therefore being given the highest possible precedence. That caused it to bind more tightly than prefix operators, which it should not. Instead, parse it somewhat like a normal binary expression with some special-casing.
* | Fix parsing of block expressions in "forbid_structs" contexts.Geoffry Song2019-10-032-10/+25
|/ | | | | | Forbidding block expressions entirely is too strict; instead, we should only forbid them in contexts where we are parsing an optional RHS (i.e. the RHS of a range expression).
* Merge branch 'master' into feature/issue/1856Alexander Andreev2019-09-301-2/+17
|\ | | | | | | | | # Conflicts: # crates/ra_assists/src/ast_editor.rs
| * FixesuHOOCCOOHu2019-09-301-10/+8
| |
| * Parse correct AttrInputuHOOCCOOHu2019-09-301-2/+19
| |