aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar
Commit message (Collapse)AuthorAgeFilesLines
* Parse trait aliasesEmil Lauridsen2020-01-091-0/+10
|
* Improve const generics parsingMichael Chesser2020-01-062-2/+13
| | | | | - Handle const generics type args - Fix issue with const generic as first parameter in trait impl
* 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-221-0/+11
|\ \ | |/ |/| | | | | | | | | | | | | | | | | 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-221-0/+11
| | | | | | | | | | 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-211-0/+28
| |
* | Fix parser for macro call in pattern positionEdwin Cheng2019-12-201-1/+1
|/
* Touch up TokenSet a bitAleksey Kladov2019-12-191-1/+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-252-12/+21
| | | | | | | | | | 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.
* 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-141-17/+17
|
* 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
| |
* | Added test for check doc strings in crates.Alexander Andreev2019-09-3014-0/+28
|/ | | | #1856
* Support loop as argumentkjeremy2019-09-201-0/+1
|
* Simplify match armkjeremy2019-09-201-2/+1
|
* Merge #1884bors[bot]2019-09-201-2/+12
|\ | | | | | | | | | | | | | | 1884: Add indexing to record_field_pat r=matklad a=kjeremy Fixes #1870 Co-authored-by: kjeremy <[email protected]>
| * Apply suggestionkjeremy2019-09-201-3/+2
| |
| * Add indexing to record_field_patkjeremy2019-09-201-2/+13
| |
* | fix infinite loop in the parserAleksey Kladov2019-09-201-7/+11
|/ | | | closes #1866
* Merge #1881bors[bot]2019-09-201-1/+1
|\ | | | | | | | | | | | | | | 1881: don't confuse macro with != r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * don't confuse macro with !=Aleksey Kladov2019-09-201-1/+1
| | | | | | | | closes #1871
* | Replace usages of bump_any with bumpkjeremy2019-09-1913-80/+80
|/
* Merge #1848bors[bot]2019-09-151-10/+42
|\ | | | | | | | | | | | | | | | | | | | | | | 1848: Parse `..` as a full pattern r=matklad a=ecstatic-morse Resolves #1479. This PR implements [RFC 2707](https://github.com/rust-lang/rfcs/pull/2707) in the parser. It introduces a new `DotDotPat` AST node modeled on `PlaceholderPat` and changes the parsing of tuple and slice patterns to conform to the RFC. Notably, this PR does *not* change the resulting AST when `..` appears in a struct pattern (e.g. `Struct { a, b: c, .. }`). I *think* this is the behavior mandated by RFC 2707, but someone should confirm this. Co-authored-by: Dylan MacKenzie <[email protected]>
| * Parse `..` as a proper patternDylan MacKenzie2019-09-151-10/+42
| |
* | Allow an underscore as the identifier in `const` itemsDylan MacKenzie2019-09-152-2/+11
|/
* cleanup dollar handling in expressionsAleksey Kladov2019-09-102-40/+34
|
* WIP: switch to fully decomposed tokens internallyAleksey Kladov2019-09-107-140/+160
|
* rename bump -> bump_anyAleksey Kladov2019-09-0914-109/+109
|
* tiny simplificationAleksey Kladov2019-09-093-4/+7
|
* better error recovery for use treesAleksey Kladov2019-09-052-2/+5
|
* always wrap block into an expressionAleksey Kladov2019-09-022-2/+7
|
* cleanupAleksey Kladov2019-09-023-3/+3
|
* Handle `Struct { box i }` syntaxDylan MacKenzie2019-08-241-0/+3
| | | | | | Named structs can have `box` patterns that will bind to their fields. This is similar to the behavior of the `ref` and `mut` fields, but is at least a little bit surprising.
* Centralize `box` pattern tests in `patterns.rs`Dylan MacKenzie2019-08-242-7/+0
|
* Parse `BoxPat`Dylan MacKenzie2019-08-241-19/+32
|
* rename struct -> record, pos -> tupleAleksey Kladov2019-08-234-32/+32
|