From b5021411a84822cb3f1e3aeffad9550dd15bdeb6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 16 Sep 2018 12:54:24 +0300 Subject: rename all things --- crates/libsyntax2/src/grammar/items/use_item.rs | 68 ------------------------- 1 file changed, 68 deletions(-) delete mode 100644 crates/libsyntax2/src/grammar/items/use_item.rs (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 deleted file mode 100644 index 1ee4349fd..000000000 --- a/crates/libsyntax2/src/grammar/items/use_item.rs +++ /dev/null @@ -1,68 +0,0 @@ -use super::*; - -pub(super) fn use_item(p: &mut Parser) { - assert!(p.at(USE_KW)); - p.bump(); - use_tree(p); - p.expect(SEMI); -} - -fn use_tree(p: &mut Parser) { - let la = p.nth(1); - let m = p.start(); - match (p.current(), la) { - (STAR, _) => p.bump(), - (COLONCOLON, STAR) => { - p.bump(); - p.bump(); - } - (L_CURLY, _) | (COLONCOLON, L_CURLY) => { - if p.at(COLONCOLON) { - p.bump(); - } - use_tree_list(p); - } - _ if paths::is_path_start(p) => { - paths::use_path(p); - match p.current() { - AS_KW => { - opt_alias(p); - } - COLONCOLON => { - p.bump(); - match p.current() { - STAR => { - p.bump(); - } - L_CURLY => use_tree_list(p), - _ => { - // is this unreachable? - p.error("expected `{` or `*`"); - } - } - } - _ => (), - } - } - _ => { - m.abandon(p); - p.err_and_bump("expected one of `*`, `::`, `{`, `self`, `super`, `indent`"); - return; - } - } - m.complete(p, USE_TREE); -} - -pub(crate) 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); - if !p.at(R_CURLY) { - p.expect(COMMA); - } - } - p.expect(R_CURLY); - m.complete(p, USE_TREE_LIST); -} -- cgit v1.2.3