pub enum Statement {
IntLiteral(i64),
FloatLiteral(f64),
BoolLiteral(bool),
StringLiteral(String),
WordCall(String),
If {
then_branch: Vec<Statement>,
else_branch: Option<Vec<Statement>>,
},
Quotation {
id: usize,
body: Vec<Statement>,
},
}Variants§
IntLiteral(i64)
Integer literal: pushes value onto stack
FloatLiteral(f64)
Floating-point literal: pushes IEEE 754 double onto stack
BoolLiteral(bool)
Boolean literal: pushes true/false onto stack
StringLiteral(String)
String literal: pushes string onto stack
WordCall(String)
Word call: calls another word or built-in
If
Conditional: if/else/then
Pops an integer from the stack (0 = zero, non-zero = non-zero) and executes the appropriate branch
Fields
Quotation
Quotation: [ … ]
A block of deferred code (quotation/lambda)
Quotations are first-class values that can be pushed onto the stack
and executed later with combinators like call, times, or while
The id field is used by the typechecker to track the inferred type (Quotation vs Closure) for this quotation. The id is assigned during parsing.
Trait Implementations§
impl StructuralPartialEq for Statement
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
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