allow aliases in underscores
this helps with use foo::Trait as _; syntax
This commit is contained in:
parent
dc8bcc1e42
commit
0a19f4f1b4
@ -129,7 +129,9 @@ fn opt_alias(p: &mut Parser) {
|
||||
if p.at(AS_KW) {
|
||||
let m = p.start();
|
||||
p.bump();
|
||||
if !p.eat(UNDERSCORE) {
|
||||
name(p);
|
||||
}
|
||||
m.complete(p, ALIAS);
|
||||
}
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ fn use_tree(p: &mut Parser) {
|
||||
// yet::another::path,
|
||||
// running::out::of::synonyms::for_::different::*
|
||||
// };
|
||||
// use Trait as _;
|
||||
opt_alias(p);
|
||||
}
|
||||
COLONCOLON => {
|
||||
|
@ -5,3 +5,4 @@
|
||||
yet::another::path,
|
||||
running::out::of::synonyms::for_::different::*
|
||||
};
|
||||
use Trait as _;
|
||||
|
@ -1,4 +1,4 @@
|
||||
SOURCE_FILE@[0; 182)
|
||||
SOURCE_FILE@[0; 198)
|
||||
USE_ITEM@[0; 28)
|
||||
USE_KW@[0; 3)
|
||||
WHITESPACE@[3; 4)
|
||||
@ -121,3 +121,18 @@ SOURCE_FILE@[0; 182)
|
||||
R_CURLY@[179; 180)
|
||||
SEMI@[180; 181)
|
||||
WHITESPACE@[181; 182)
|
||||
USE_ITEM@[182; 197)
|
||||
USE_KW@[182; 185)
|
||||
WHITESPACE@[185; 186)
|
||||
USE_TREE@[186; 196)
|
||||
PATH@[186; 191)
|
||||
PATH_SEGMENT@[186; 191)
|
||||
NAME_REF@[186; 191)
|
||||
IDENT@[186; 191) "Trait"
|
||||
WHITESPACE@[191; 192)
|
||||
ALIAS@[192; 196)
|
||||
AS_KW@[192; 194)
|
||||
WHITESPACE@[194; 195)
|
||||
UNDERSCORE@[195; 196)
|
||||
SEMI@[196; 197)
|
||||
WHITESPACE@[197; 198)
|
||||
|
Loading…
Reference in New Issue
Block a user