Expand description
Bytecode compiler for Tish. Compiles AST to stack-based bytecode for VM execution.
Structs§
- Chunk
- A bytecode chunk: instructions and associated data.
- Compile
Error
Enums§
Constants§
Functions§
- binop_
to_ u8 - Encode BinOp for bytecode operand. Used by compiler.
- compile
- Compile a Tish program to bytecode (with peephole optimizations).
- compile_
for_ repl - Compile for REPL: last expression statement leaves its value on the stack (no Pop, no trailing Null).
- compile_
for_ repl_ unoptimized - Compile for REPL without peephole optimizations.
- compile_
unoptimized - Compile without peephole optimizations (for –no-optimize).
- compound_
op_ to_ u8 - Encode CompoundOp for bytecode (same numeric subset as BinOp: Add,Sub,Mul,Div,Mod).
- deserialize
- Deserialize a chunk from bytes.
- serialize
- Serialize a chunk to bytes (includes nested chunks for functions).
- u8_
to_ binop - Decode bytecode operand to BinOp. Used by VM.
- u8_
to_ unaryop - Decode bytecode operand to UnaryOp. Used by VM.
- unaryop_
to_ u8 - Encode UnaryOp for bytecode operand. Used by compiler.