diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-04 13:40:34 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-04 13:40:34 +0000 |
commit | 11e0851dcfddfe2337bb2d404d716dbd8e4c11d7 (patch) | |
tree | 5129bcf4ac18ef5a8b012a61c5b806620df1732e /crates/ra_parser | |
parent | dc8bcc1e42b573a8c315dd42a43c0fc4d5bfa8f8 (diff) | |
parent | 0a19f4f1b4a12bd50032249be4c9298284c08e3c (diff) |
Merge #927
927: allow aliases in underscores r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_parser')
-rw-r--r-- | crates/ra_parser/src/grammar.rs | 4 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/items/use_item.rs | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index f94702e97..c9941fe93 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs | |||
@@ -129,7 +129,9 @@ fn opt_alias(p: &mut Parser) { | |||
129 | if p.at(AS_KW) { | 129 | if p.at(AS_KW) { |
130 | let m = p.start(); | 130 | let m = p.start(); |
131 | p.bump(); | 131 | p.bump(); |
132 | name(p); | 132 | if !p.eat(UNDERSCORE) { |
133 | name(p); | ||
134 | } | ||
133 | m.complete(p, ALIAS); | 135 | m.complete(p, ALIAS); |
134 | } | 136 | } |
135 | } | 137 | } |
diff --git a/crates/ra_parser/src/grammar/items/use_item.rs b/crates/ra_parser/src/grammar/items/use_item.rs index 5111d37eb..b36612726 100644 --- a/crates/ra_parser/src/grammar/items/use_item.rs +++ b/crates/ra_parser/src/grammar/items/use_item.rs | |||
@@ -76,6 +76,7 @@ fn use_tree(p: &mut Parser) { | |||
76 | // yet::another::path, | 76 | // yet::another::path, |
77 | // running::out::of::synonyms::for_::different::* | 77 | // running::out::of::synonyms::for_::different::* |
78 | // }; | 78 | // }; |
79 | // use Trait as _; | ||
79 | opt_alias(p); | 80 | opt_alias(p); |
80 | } | 81 | } |
81 | COLONCOLON => { | 82 | COLONCOLON => { |