pub enum ExprNode {
Literal(Kind),
Variable(String),
BinaryOp {
left: Box<ExprNode>,
op: BinOp,
right: Box<ExprNode>,
},
UnaryOp {
op: UnOp,
operand: Box<ExprNode>,
},
Comparison {
left: Box<ExprNode>,
op: CmpOp,
right: Box<ExprNode>,
},
Logical {
left: Box<ExprNode>,
op: LogicOp,
right: Box<ExprNode>,
},
FnCall {
name: String,
args: Vec<ExprNode>,
},
Conditional {
cond: Box<ExprNode>,
then_expr: Box<ExprNode>,
else_expr: Box<ExprNode>,
},
}Expand description
Expression AST node.
Variants§
Literal(Kind)
A literal value: 72, "hello", true, null.
Variable(String)
A variable reference: $tagName.
BinaryOp
Binary arithmetic: left op right.
UnaryOp
Unary operation: op operand.
Comparison
Comparison: left op right.
Logical
Logical connective: left op right.
FnCall
Function call: name(args...).
Conditional
Conditional: if cond then then_expr else else_expr.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExprNode
impl RefUnwindSafe for ExprNode
impl Send for ExprNode
impl Sync for ExprNode
impl Unpin for ExprNode
impl UnsafeUnpin for ExprNode
impl UnwindSafe for ExprNode
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