aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src
Commit message (Collapse)AuthorAgeFilesLines
...
* [#1083] Try block syntax: fix testsAndrey Tkachenko2019-06-061-7/+7
|
* [#1083] Try block syntaxAndrey Tkachenko2019-06-062-1/+24
|
* Fix clippy::if_same_then_elseAlan Du2019-06-041-0/+1
|
* Fix clippy::match_boolAlan Du2019-06-041-4/+2
|
* Merge #1328bors[bot]2019-05-272-42/+69
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1328: Change TokenSource to iteration based r=matklad a=edwin0cheng This PR change the `TokenSource` trait from random access to be an iteration based trait: ```rust /// `TokenSource` abstracts the source of the tokens parser operates one. /// /// Hopefully this will allow us to treat text and token trees in the same way! pub trait TokenSource { fn current(&self) -> Token; /// Lookahead n token fn lookahead_nth(&self, n: usize) -> Token; /// bump cursor to next token fn bump(&mut self); /// Is the current token a specified keyword? fn is_keyword(&self, kw: &str) -> bool; } /// `TokenCursor` abstracts the cursor of `TokenSource` operates one. #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub struct Token { /// What is the current token? pub kind: SyntaxKind, /// Is the current token joined to the next one (`> >` vs `>>`). pub is_jointed_to_next: bool, } ``` Note that the refactoring based on this new trait will be separated to incoming PRs Co-authored-by: Edwin Cheng <[email protected]>
| * Change TokenSource to iteration basedEdwin Cheng2019-05-252-42/+69
| |
* | reformatAleksey Kladov2019-05-234-8/+8
|/
* apply T! macro where it is possibleSergey Parilin2019-05-1517-458/+457
|
* fixed macro for bracketsSergey Parilin2019-05-152-3/+3
|
* Implemented T! macro for syntax kindsSergey Parilin2019-05-134-0/+111
|
* Skip Dollars when bump raw tokenEdwin Cheng2019-05-011-1/+9
|
* Add macro pat parsingEdwin Cheng2019-04-301-1/+10
|
* Refactor parser handle mult-char punct internallyEdwin Cheng2019-04-282-5/+61
|
* Simplifykjeremy2019-04-261-6/+6
|
* Fix more bugsEdwin Cheng2019-04-251-1/+16
|
* Add `...` parsing for fn pointer typeEdwin Cheng2019-04-232-2/+3
|
* Add vis matcherEdwin Cheng2019-04-192-1/+8
|
* add block matcherEdwin Cheng2019-04-192-0/+31
|
* Add block matcherEdwin Cheng2019-04-192-0/+9
|
* 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