aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_parser/src/grammar.rs4
-rw-r--r--crates/ra_parser/src/grammar/items/use_item.rs1
-rw-r--r--crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.rs1
-rw-r--r--crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.txt17
4 files changed, 21 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_syntax/tests/data/parser/inline/ok/0043_use_alias.rs b/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.rs
index 544caa020..9be50f877 100644
--- a/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.rs
+++ b/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.rs
@@ -5,3 +5,4 @@ use some::{
5 yet::another::path, 5 yet::another::path,
6 running::out::of::synonyms::for_::different::* 6 running::out::of::synonyms::for_::different::*
7}; 7};
8use Trait as _;
diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.txt
index 8ef0ecbc6..0c8dec81d 100644
--- a/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.txt
@@ -1,4 +1,4 @@
1SOURCE_FILE@[0; 182) 1SOURCE_FILE@[0; 198)
2 USE_ITEM@[0; 28) 2 USE_ITEM@[0; 28)
3 USE_KW@[0; 3) 3 USE_KW@[0; 3)
4 WHITESPACE@[3; 4) 4 WHITESPACE@[3; 4)
@@ -121,3 +121,18 @@ SOURCE_FILE@[0; 182)
121 R_CURLY@[179; 180) 121 R_CURLY@[179; 180)
122 SEMI@[180; 181) 122 SEMI@[180; 181)
123 WHITESPACE@[181; 182) 123 WHITESPACE@[181; 182)
124 USE_ITEM@[182; 197)
125 USE_KW@[182; 185)
126 WHITESPACE@[185; 186)
127 USE_TREE@[186; 196)
128 PATH@[186; 191)
129 PATH_SEGMENT@[186; 191)
130 NAME_REF@[186; 191)
131 IDENT@[186; 191) "Trait"
132 WHITESPACE@[191; 192)
133 ALIAS@[192; 196)
134 AS_KW@[192; 194)
135 WHITESPACE@[194; 195)
136 UNDERSCORE@[195; 196)
137 SEMI@[196; 197)
138 WHITESPACE@[197; 198)