Trait lang_util::NodeContent
source · [−]pub trait NodeContent: Debug + Clone + PartialEq + Sized {
fn into_node<T>(self) -> Node<T>
where
T: From<Self> + NodeContent,
{ ... }
fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self> { ... }
}
Expand description
Trait for AST node contents.
All nodes which will be stored in a Node need to implement this.
Provided Methods
fn into_node<T>(self) -> Node<T> where
T: From<Self> + NodeContent,
fn into_node<T>(self) -> Node<T> where
T: From<Self> + NodeContent,
Convert the contents into a node
fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
Add span information to a syntax node