From 406de22ee5cd74dc6f67743bad4710415bb50c41 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 28 Jan 2023 18:32:58 +0100 Subject: Remove method call syntax kind --- src/syntax/node.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/syntax/node.rs') diff --git a/src/syntax/node.rs b/src/syntax/node.rs index ed000788..049275ed 100644 --- a/src/syntax/node.rs +++ b/src/syntax/node.rs @@ -681,11 +681,6 @@ impl<'a> LinkedNode<'a> { self.parent.as_deref() } - /// Get the kind of this node's parent. - pub fn parent_kind(&self) -> Option { - Some(self.parent()?.node.kind()) - } - /// Get the first previous non-trivia sibling node. pub fn prev_sibling(&self) -> Option { let parent = self.parent()?; @@ -713,6 +708,21 @@ impl<'a> LinkedNode<'a> { Some(next) } } + + /// Get the kind of this node's parent. + pub fn parent_kind(&self) -> Option { + Some(self.parent()?.node.kind()) + } + + /// Get the kind of this node's first previous non-trivia sibling. + pub fn prev_sibling_kind(&self) -> Option { + Some(self.prev_sibling()?.node.kind()) + } + + /// Get the kind of this node's next non-trivia sibling. + pub fn next_sibling_kind(&self) -> Option { + Some(self.next_sibling()?.node.kind()) + } } /// Access to leafs. -- cgit v1.2.3