diff options
Diffstat (limited to 'crates/ra_parser/src')
-rw-r--r-- | crates/ra_parser/src/grammar.rs | 4 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/items/use_item.rs | 1 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/params.rs | 3 |
3 files changed, 6 insertions, 2 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 => { |
diff --git a/crates/ra_parser/src/grammar/params.rs b/crates/ra_parser/src/grammar/params.rs index a70f067f9..d027578b6 100644 --- a/crates/ra_parser/src/grammar/params.rs +++ b/crates/ra_parser/src/grammar/params.rs | |||
@@ -83,9 +83,10 @@ fn value_parameter(p: &mut Parser, flavor: Flavor) { | |||
83 | 83 | ||
84 | // test trait_fn_placeholder_parameter | 84 | // test trait_fn_placeholder_parameter |
85 | // trait Foo { | 85 | // trait Foo { |
86 | // fn bar(_: u64); | 86 | // fn bar(_: u64, mut x: i32); |
87 | // } | 87 | // } |
88 | if (la0 == IDENT || la0 == UNDERSCORE) && la1 == COLON | 88 | if (la0 == IDENT || la0 == UNDERSCORE) && la1 == COLON |
89 | || la0 == MUT_KW && la1 == IDENT && la2 == COLON | ||
89 | || la0 == AMP && la1 == IDENT && la2 == COLON | 90 | || la0 == AMP && la1 == IDENT && la2 == COLON |
90 | || la0 == AMP && la1 == MUT_KW && la2 == IDENT && la3 == COLON | 91 | || la0 == AMP && la1 == MUT_KW && la2 == IDENT && la3 == COLON |
91 | { | 92 | { |