pub enum MathOp {
Show 18 variants
PushConst(Value),
Load {
name: String,
},
LoadConstRef {
alias: String,
name: String,
keys: Vec<String>,
},
LoadEnv(String),
LoadKeyPath {
base: String,
keys: Vec<String>,
},
Call {
name: String,
arity: usize,
},
Inspect {
name: String,
},
Neg,
Add,
Sub,
Mul,
Div,
Lt,
Le,
Gt,
Ge,
Eq,
Ne,
}Expand description
Flat stack-machine op for expression-local arithmetic/comparison.
Lowering folds constant subtrees to Expr::Literal and compiles dynamic
arithmetic/comparison subtrees to post-order Vec<MathOp> so the runtime
executes a single instruction loop instead of recursive Box walking.
Call covers value-semantics functions only (INT, FLOAT, GLOB,
LOAD_TOML, LOAD_JSON); INSPECT($var) uses Inspect to preserve the
variable identifier (pre-evaluating to Value would lose the name).
Variants§
PushConst(Value)
Load
LoadConstRef
LoadEnv(String)
LoadKeyPath
Call
Inspect
Neg
Add
Sub
Mul
Div
Lt
Le
Gt
Ge
Eq
Ne
Trait Implementations§
impl StructuralPartialEq for MathOp
Auto Trait Implementations§
impl Forget for MathOp
impl Freeze for MathOpwhere
&'static TypeDescriptor: Freeze,
*mut (): Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
impl Move for MathOp
impl RefUnwindSafe for MathOp
impl Send for MathOp
impl Sync for MathOp
impl Unpin for MathOp
impl UnsafeUnpin for MathOpwhere
&'static TypeDescriptor: UnsafeUnpin,
*mut (): UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for MathOp
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