From 7edab6ae6b4c5d0c411e88f10e923b91dca31de3 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Aug 2018 19:27:30 +0300 Subject: nodes for blocks --- crates/libsyntax2/src/grammar/items/use_item.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/libsyntax2/src/grammar/items/use_item.rs') 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) { if p.at(COLONCOLON) { p.bump(); } - nested_trees(p); + use_tree_list(p); } _ if paths::is_path_start(p) => { paths::use_path(p); @@ -34,7 +34,7 @@ fn use_tree(p: &mut Parser) { STAR => { p.bump(); } - L_CURLY => nested_trees(p), + L_CURLY => use_tree_list(p), _ => { // is this unreachable? p.error("expected `{` or `*`"); @@ -53,8 +53,9 @@ fn use_tree(p: &mut Parser) { m.complete(p, USE_TREE); } -fn nested_trees(p: &mut Parser) { +fn use_tree_list(p: &mut Parser) { assert!(p.at(L_CURLY)); + let m = p.start(); p.bump(); while !p.at(EOF) && !p.at(R_CURLY) { use_tree(p); @@ -63,4 +64,5 @@ fn nested_trees(p: &mut Parser) { } } p.expect(R_CURLY); + m.complete(p, USE_TREE_LIST); } -- cgit v1.2.3