pub trait Node: Sealed {
fn start_position(&self) -> Option<Position>;
fn end_position(&self) -> Option<Position>;
fn similar(&self, other: &Self) -> bool
where
Self: Sized;
fn tokens(&self) -> Tokens<'_>ⓘNotable traits for Tokens<'a>impl<'a> Iterator for Tokens<'a> type Item = &'a TokenReference;
;
fn range(&self) -> Option<(Position, Position)> { ... }
fn surrounding_trivia(&self) -> (Vec<&Token>, Vec<&Token>) { ... }
}
Expand description
Used to represent nodes such as tokens or function definitions
This trait is sealed and cannot be implemented for types outside of full-moon
Required methods
fn start_position(&self) -> Option<Position>
fn start_position(&self) -> Option<Position>
The start position of a node. None if can’t be determined
fn end_position(&self) -> Option<Position>
fn end_position(&self) -> Option<Position>
The end position of a node. None if it can’t be determined
Whether another node of the same type is the same as this one semantically, ignoring position
Provided methods
The full range of a node, if it has both start and end positions