aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar/items/use_item.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/grammar/items/use_item.rs')
-rw-r--r--crates/libsyntax2/src/grammar/items/use_item.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/libsyntax2/src/grammar/items/use_item.rs b/crates/libsyntax2/src/grammar/items/use_item.rs
index 3da40a629..2fbf2234a 100644
--- a/crates/libsyntax2/src/grammar/items/use_item.rs
+++ b/crates/libsyntax2/src/grammar/items/use_item.rs
@@ -20,7 +20,7 @@ fn use_tree(p: &mut Parser) {
20 if p.at(COLONCOLON) { 20 if p.at(COLONCOLON) {
21 p.bump(); 21 p.bump();
22 } 22 }
23 nested_trees(p); 23 use_tree_list(p);
24 } 24 }
25 _ if paths::is_path_start(p) => { 25 _ if paths::is_path_start(p) => {
26 paths::use_path(p); 26 paths::use_path(p);
@@ -34,7 +34,7 @@ fn use_tree(p: &mut Parser) {
34 STAR => { 34 STAR => {
35 p.bump(); 35 p.bump();
36 } 36 }
37 L_CURLY => nested_trees(p), 37 L_CURLY => use_tree_list(p),
38 _ => { 38 _ => {
39 // is this unreachable? 39 // is this unreachable?
40 p.error("expected `{` or `*`"); 40 p.error("expected `{` or `*`");
@@ -53,8 +53,9 @@ fn use_tree(p: &mut Parser) {
53 m.complete(p, USE_TREE); 53 m.complete(p, USE_TREE);
54} 54}
55 55
56fn nested_trees(p: &mut Parser) { 56fn use_tree_list(p: &mut Parser) {
57 assert!(p.at(L_CURLY)); 57 assert!(p.at(L_CURLY));
58 let m = p.start();
58 p.bump(); 59 p.bump();
59 while !p.at(EOF) && !p.at(R_CURLY) { 60 while !p.at(EOF) && !p.at(R_CURLY) {
60 use_tree(p); 61 use_tree(p);
@@ -63,4 +64,5 @@ fn nested_trees(p: &mut Parser) {
63 } 64 }
64 } 65 }
65 p.expect(R_CURLY); 66 p.expect(R_CURLY);
67 m.complete(p, USE_TREE_LIST);
66} 68}