mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 13:18:47 +00:00
Extract nested trees
This commit is contained in:
parent
645a1b5d73
commit
13c6a34354
1 changed files with 7 additions and 8 deletions
|
@ -192,9 +192,7 @@ fn use_item(p: &mut Parser) {
|
|||
if p.at(COLONCOLON) {
|
||||
p.bump();
|
||||
}
|
||||
p.curly_block(|p| {
|
||||
comma_list(p, EOF, use_tree);
|
||||
});
|
||||
nested_trees(p);
|
||||
}
|
||||
_ if paths::is_path_start(p) => {
|
||||
paths::use_path(p);
|
||||
|
@ -208,11 +206,7 @@ fn use_item(p: &mut Parser) {
|
|||
STAR => {
|
||||
p.bump();
|
||||
}
|
||||
L_CURLY => {
|
||||
p.curly_block(|p| {
|
||||
comma_list(p, EOF, use_tree);
|
||||
});
|
||||
}
|
||||
L_CURLY => nested_trees(p),
|
||||
_ => {
|
||||
// is this unreachable?
|
||||
p.error()
|
||||
|
@ -232,6 +226,11 @@ fn use_item(p: &mut Parser) {
|
|||
m.complete(p, USE_TREE);
|
||||
return true;
|
||||
}
|
||||
|
||||
fn nested_trees(p: &mut Parser) {
|
||||
assert!(p.at(L_CURLY));
|
||||
p.curly_block(|p| comma_list(p, EOF, use_tree));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue