From 00cdde2c5218020b8f6ec751042a436aeef923c7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 17 Oct 2018 19:52:25 +0300 Subject: Update rowan --- crates/ra_syntax/src/algo/mod.rs | 2 +- crates/ra_syntax/src/algo/walk.rs | 28 ---------------------------- 2 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 crates/ra_syntax/src/algo/walk.rs (limited to 'crates/ra_syntax/src/algo') diff --git a/crates/ra_syntax/src/algo/mod.rs b/crates/ra_syntax/src/algo/mod.rs index b4896c482..9d2014bc7 100644 --- a/crates/ra_syntax/src/algo/mod.rs +++ b/crates/ra_syntax/src/algo/mod.rs @@ -1,5 +1,5 @@ pub mod visit; -pub mod walk; +// pub mod walk; use crate::{ text_utils::{contains_offset_nonstrict, is_subrange}, diff --git a/crates/ra_syntax/src/algo/walk.rs b/crates/ra_syntax/src/algo/walk.rs deleted file mode 100644 index 9afa86401..000000000 --- a/crates/ra_syntax/src/algo/walk.rs +++ /dev/null @@ -1,28 +0,0 @@ -use crate::{algo::generate, SyntaxNodeRef}; - -#[derive(Debug, Copy, Clone)] -pub enum WalkEvent<'a> { - Enter(SyntaxNodeRef<'a>), - Exit(SyntaxNodeRef<'a>), -} - -pub fn walk<'a>(root: SyntaxNodeRef<'a>) -> impl Iterator> { - generate(Some(WalkEvent::Enter(root)), move |pos| { - let next = match *pos { - WalkEvent::Enter(node) => match node.first_child() { - Some(child) => WalkEvent::Enter(child), - None => WalkEvent::Exit(node), - }, - WalkEvent::Exit(node) => { - if node == root { - return None; - } - match node.next_sibling() { - Some(sibling) => WalkEvent::Enter(sibling), - None => WalkEvent::Exit(node.parent().unwrap()), - } - } - }; - Some(next) - }) -} -- cgit v1.2.3