pub enum Statement {
IntLiteral(i64),
FloatLiteral(f64),
BoolLiteral(bool),
StringLiteral(String),
Symbol(String),
WordCall {
name: String,
span: Option<Span>,
},
If {
then_branch: Vec<Statement>,
else_branch: Option<Vec<Statement>>,
},
Quotation {
id: usize,
body: Vec<Statement>,
span: Option<QuotationSpan>,
},
Match {
arms: Vec<MatchArm>,
},
}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
Symbol(String)
Symbol literal: pushes symbol onto stack Syntax: :foo, :some-name, :ok Used for dynamic variant construction and SON. Note: Symbols are not currently interned (future optimization).
WordCall
Word call: calls another word or built-in Contains the word name and optional source span for precise diagnostics
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. The span field records the source location for LSP hover support.
Match
Match expression: pattern matching on union types
Pops a union value from the stack and dispatches to the appropriate arm based on the variant tag.
Example:
match
Get -> send-response
Increment -> do-increment send-response
Report -> aggregate-add
end