[−][src]Trait full_moon::node::Node
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>
The start position of a node. None if can't be determined
fn end_position(&self) -> Option<Position>
The end position of a node. None if it can't be determined
fn similar(&self, other: &Self) -> bool
Whether another node of the same type is the same as this one semantically, ignoring position
Provided methods
fn range(&self) -> Option<(Position, Position)>
The full range of a node, if it has both start and end positions
fn surrounding_ignore_tokens<'ast, 'b>(
&self,
ast: &'b Ast<'ast>
) -> Option<(Vec<&'b Token<'ast>>, Vec<&'b Token<'ast>>)>
&self,
ast: &'b Ast<'ast>
) -> Option<(Vec<&'b Token<'ast>>, Vec<&'b Token<'ast>>)>
The tokens surrounding a node that are ignored and not accessible through the node's own accessors. Use this if you want to get surrounding comments or whitespace. Return value is None if a token doesn't have both a start and end position. Otherwise, it is a tuple of two token vectors, first being the preceding and the second being the following.