aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src
Commit message (Collapse)AuthorAgeFilesLines
* Add expr, pat, ty and macro_stmtsEdwin Cheng2019-04-183-10/+58
|
* Add MacroItems and MacroStmts in grammer.ronEdwin Cheng2019-04-183-0/+14
|
* Add `item` matcher in mbeEdwin Cheng2019-04-182-0/+9
|
* Add mbe stmt matcherEdwin Cheng2019-04-173-72/+91
|
* Merge #1138bors[bot]2019-04-146-23/+168
|\ | | | | | | | | | | | | | | | | | | | | 1138: Add L_DOLLAR and R_DOLLAR r=matklad a=edwin0cheng As discussion in issue https://github.com/rust-analyzer/rust-analyzer/issues/1132 and PR #1125 , this PR add 2 `Syntax::Kind` : `L_DOLLAR` and `R_DOLLAR` for representing `Delimiter::None` in mbe and proc_marco. By design, It should not affect the final syntax tree, and will be discard in `TreeSink`. My original idea is handling these 2 tokens case by case, but i found that they will appear in every place in the parser (imagine `tt` matcher). So this PR only handle it in `Parser::do_bump` and `Parser::start`, although It will not fix the `expr` matcher executing order problem in original idea. Co-authored-by: Edwin Cheng <[email protected]>
| * Fix bug and add expr , pat , ty matcherEdwin Cheng2019-04-145-30/+159
| |
| * Remove skip Delimiter::None and handle DollarsEdwin Cheng2019-04-121-0/+12
| |
| * Add L_DOLLAR and R_DOLLAREdwin Cheng2019-04-111-0/+4
| |
* | migrate to untyped rowanAleksey Kladov2019-04-092-0/+36
|/
* Merge #1105bors[bot]2019-04-082-0/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1105: [WIP] Implement ra_mbe meta variables support r=matklad a=edwin0cheng This PR implements the following meta variable support in `ra_mba` crate (issue #720): - [x] `path` - [ ] `expr` - [ ] `ty` - [ ] `pat` - [ ] `stmt` - [ ] `block` - [ ] `meta` - [ ] `item` *Implementation Details* In the macro expanding lhs phase, if we see a meta variable type, we try to create a `tt:TokenTree` from the remaining input. And then we use a special set of `ra_parser` to parse it to `SyntaxNode`. Co-authored-by: Edwin Cheng <[email protected]>
| * Add TtCursorTokenSource and TtCursorTokenSinkEdwin Cheng2019-04-062-0/+12
| |
* | Parse and infer tuple indicesrobojumper2019-04-061-1/+12
|/
* Parse unsafe async / const unsafe fns properlyrobojumper2019-04-031-6/+17
|
* Merge #1082bors[bot]2019-04-011-0/+1
|\ | | | | | | | | | | | | | | 1082: Async block in argument position r=matklad a=andreytkachenko Fixes case when async block appears in argument position Co-authored-by: Andrey Tkachenko <[email protected]>
| * Async block in argument positionAndrey Tkachenko2019-04-011-0/+1
| |
* | Merge #1081bors[bot]2019-04-012-3/+13
|\ \ | |/ |/| | | | | | | | | | | | | | | 1081: Async closure syntax r=matklad a=robojumper Fixes #1080. Also fixes an error introduced by #1072 where something like `async move "foo"` in expression position would trigger the assertion in `block_expr`. Co-authored-by: robojumper <[email protected]>
| * Async closure syntaxrobojumper2019-03-312-3/+13
| |
* | switch to new rowanAleksey Kladov2019-04-012-7/+7
|/
* Add WherePred to allow predicate access in WhereClauseVille Penttinen2019-03-311-1/+1
| | | | | This also unifies parsing of WHERE_PRED bounds, now Lifetime bounds will also be parsed using TYPE_BOUND_LIST
* Merge #1072bors[bot]2019-03-312-3/+3
|\ | | | | | | | | | | | | | | 1072: recognize async move blocks r=matklad a=memoryruins closes #1053 Co-authored-by: memoryruins <[email protected]>
| * recognize async movememoryruins2019-03-282-3/+3
| |
* | Change parsing bounds in path_typesVille Penttinen2019-03-312-11/+40
| | | | | | | | | | | | | | | | Now bounds inside a path are parsed as DYN_TRAIT_TYPE, previously they would be parsed as `PATH_TYPE` followed by `TYPE_BOUND_LIST`. Basically this means `Box<T + 'f>` is now parsed almost the same as `Box<dyn T + 'f>` with the exception of not having the `dyn` keyword.
* | Move parsing a single TYPE_BOUND to a separate functionVille Penttinen2019-03-301-19/+26
| |
* | Add new TYPE_BOUND_LIST and TYPE_BOUND syntax kindsVille Penttinen2019-03-303-2/+14
| | | | | | | | | | | | These are now used when parsing type bounds. In addition parsing paths inside a bound now does not recursively parse paths, rather they are treated as separate bounds, separated by +.
* | Fix parsing <= in type_argsVille Penttinen2019-03-302-0/+2
|/
* Add extern_crate_self to ra_parser.memoryruins2019-03-281-0/+4
|
* Support references in higher-ranked trait boundsVille Penttinen2019-03-241-0/+3
| | | | Fixes #1020
* replace todo with fixmeAleksey Kladov2019-03-235-7/+7
|
* Replace `contract_child` to a less ad-hoc APIpcpthm2019-03-192-40/+37
|
* Mark non-code block as textpcpthm2019-03-191-1/+1
|
* Error about attributes onpcpthm2019-03-191-12/+23
| | | | unallowed types of expression statement
* Allow attributes on top level expressionpcpthm2019-03-194-35/+79
| | | | | | A top level expression is either - a expression statement or - the last expression in a block
* Merge #991bors[bot]2019-03-186-71/+61
|\ | | | | | | | | | | | | | | | | | | | | | | 991: Use Marker argument for item parsers r=matklad a=pcpthm Before doing this for expressions, I found that the pattern (Marker argument) should be applied to the item parsers because visiblity and modifiers are parsed in a separate function. Fixed some parser bugs: - Fix pub_expr: `pub 42;` was allowed. - Fix incorrect parsing of crate::path: incorrectly parsed as `crate` as a visibility. Co-authored-by: pcpthm <[email protected]>
| * Use Marker argument for item parserspcpthm2019-03-186-71/+61
| | | | | | | | | | - Fix pub_expr - Fix incorrect parsing of crate::path
* | Merge #987bors[bot]2019-03-182-84/+70
|\| | | | | | | | | | | | | | | | | | | | | | | 987: Refactor maybe_item to use Marker argument r=pcpthm a=pcpthm As suggested at <https://github.com/rust-analyzer/rust-analyzer/pull/980#issuecomment-473659745>. For expression paring functions, changing signature - from `fn(&mut Parser) -> Option<CompletedMarker>` to `fn(&mut Parser, Marker) -> Result<CompletedMarker, Marker>` - from `fn(&mut Parser) -> CompletedMarker` to `fn(&mut Parser, Marker) -> CompletedMarker` is my plan. Co-authored-by: pcpthm <[email protected]>
| * Apply stylistic changes suggestedpcpthm2019-03-182-17/+14
| |
| * Refactor maybe_item to use Marker argumentpcpthm2019-03-172-86/+75
| |
* | Merge #983bors[bot]2019-03-171-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 983: support remainder assignment operator r=matklad a=JeanMertz `%=` was returning errors for me, turns out it wasn't added as a valid assignment operation. I'm not sure what the best location would be to add a test for this. Please let me know and I'll add one. Co-authored-by: Jean Mertz <[email protected]>
| * | support remainder assignment operatorJean Mertz2019-03-171-0/+1
| | |
* | | Fix parse tree of attribute on match armpcpthm2019-03-171-15/+15
| |/ |/|
* | Merge #985bors[bot]2019-03-171-57/+56
|\ \ | | | | | | | | | | | | | | | | | | | | | 985: simplify parsing blocks a bit r=pcpthm a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | simplify parsing blocks a bitAleksey Kladov2019-03-171-57/+56
| |/
* / Allow attribute on struct literal fieldpcpthm2019-03-171-1/+6
|/
* Allow MINUS at the start of a pattern.Michael Chesser2019-03-141-1/+1
|
* Add test for async blockCaio2019-03-101-1/+2
|
* Add async keywordCaio2019-03-093-1/+18
|
* Introduce pattern_list to parse pipe separated patternsVille Penttinen2019-03-052-10/+18
| | | | | pattern_list comes in two variants, one uses the default PAT_RECOVERY_SET as the recovery set, while other allows the user to provide a recovery set.
* Add support for parsing multiple if and while-let patternsVille Penttinen2019-03-041-0/+10
|
* allow `mut ident` patterns in trait methodsAleksey Kladov2019-03-041-1/+2
| | | | closes #928
* allow aliases in underscoresAleksey Kladov2019-03-042-1/+4
| | | | | | | | this helps with use foo::Trait as _; syntax