pub enum Statement {
IntLiteral(i64),
FloatLiteral(f64),
BoolLiteral(bool),
StringLiteral(Vec<u8>),
Symbol(String),
WordCall {
name: String,
span: Option<Span>,
},
If {
then_branch: Vec<Statement>,
else_branch: Option<Vec<Statement>>,
span: Option<Span>,
},
Quotation {
id: usize,
body: Vec<Statement>,
span: Option<QuotationSpan>,
},
Match {
arms: Vec<MatchArm>,
span: Option<Span>,
},
}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(Vec<u8>)
String literal: pushes a byte-clean string onto the stack.
The payload is Vec<u8> because Seq strings are arbitrary byte
sequences (\xNN escapes produce literal bytes, embedded NULs are
legal). Most literals happen to be UTF-8 text; the type stays
general so binary-protocol authors can write magic numbers,
alignment NULs, and IEEE-754 byte patterns inline.
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