Enum rubble_templates_core::ast::SyntaxNode [−][src]
pub enum SyntaxNode { NamedNode { identifier: String, starts_at: Position, children: Vec<SyntaxNode>, }, AnonymousNode { starts_at: Position, children: Vec<SyntaxNode>, }, }
Expand description
Represents a node in an AST
Used to represent a template code for further evaluation.
Example:
(plus 1 2)
can be represented as:
AnonymousNode {
starts_at: 0,
children: vec![
NamedNode {
identifier: "plus".to_string(),
starts_at: 1,
children: vec![
NamedNode {
identifier: "1".to_string(),
starts_at: 6,
children: vec![],
},
NamedNode {
identifier: "2".to_string(),
starts_at: 8,
children: vec![],
},
],
},
]
};
Variants
Show fields
Fields of NamedNode
Show fields
Fields of AnonymousNode
starts_at: Position
children: Vec<SyntaxNode>
Implementations
pub fn with_identifier(
self,
new_identifier: &str,
identifier_starts_at: Position
) -> SyntaxNode
[src]Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for SyntaxNode
impl Send for SyntaxNode
impl Sync for SyntaxNode
impl Unpin for SyntaxNode
impl UnwindSafe for SyntaxNode
Blanket Implementations
Mutably borrows from an owned value. Read more