pub enum Expr {
Number(f64),
Band(usize),
Variable(String),
Binary {
left: Box<Expr>,
op: BinaryOp,
right: Box<Expr>,
ty: Type,
},
Unary {
op: UnaryOp,
expr: Box<Expr>,
ty: Type,
},
Call {
name: String,
args: Vec<Expr>,
ty: Type,
},
Conditional {
condition: Box<Expr>,
then_expr: Box<Expr>,
else_expr: Box<Expr>,
ty: Type,
},
Block {
statements: Vec<Statement>,
result: Option<Box<Expr>>,
ty: Type,
},
ForLoop {
var: String,
start: Box<Expr>,
end: Box<Expr>,
body: Box<Expr>,
ty: Type,
},
}Expand description
Expression node
Variants§
Number(f64)
Number literal
Band(usize)
Band reference (e.g., B1, B2)
Variable(String)
Variable reference
Binary
Binary operation
Unary
Unary operation
Call
Function call
Conditional
Conditional expression: if cond then expr1 else expr2
Block
Block expression: { stmts; expr }
ForLoop
For loop (for optimization/unrolling)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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