pub enum AstNode {
Literal(Value),
Variable(String),
Unary {
op: UnaryOp,
expr: Box<AstNode>,
},
Binary {
op: BinaryOp,
left: Box<AstNode>,
right: Box<AstNode>,
},
Ternary {
cond: Box<AstNode>,
then_expr: Box<AstNode>,
else_expr: Box<AstNode>,
},
FnCall {
name: String,
args: Vec<AstNode>,
},
}Expand description
Parsed GenApi formula represented as an abstract syntax tree.
Variants§
Literal(Value)
Numeric literal.
Variable(String)
Variable lookup resolved at evaluation time.
Unary
Unary operator applied to a sub-expression.
Binary
Binary operator combining two sub-expressions.
Fields
Ternary
Ternary conditional: condition ? then_expr : else_expr.
Fields
FnCall
Function call with arguments.
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 UnsafeUnpin 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