pub struct AstNode {
pub node_type: AstNodeType,
pub line: usize,
pub column: usize,
}Expand description
AST node with source location
Fields§
§node_type: AstNodeType§line: usize§column: usizeImplementations§
Source§impl AstNode
impl AstNode
Sourcepub fn new(node_type: AstNodeType, line: usize, column: usize) -> Self
pub fn new(node_type: AstNodeType, line: usize, column: usize) -> Self
Create a new AST node
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Check if this is a function node
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Check if this is a literal node
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AstNode
impl RefUnwindSafe for AstNode
impl Send for AstNode
impl Sync for AstNode
impl Unpin for AstNode
impl UnwindSafe for AstNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more