Skip to main content

tishlang_bytecode/
lib.rs

1//! Bytecode compiler for Tish.
2//! Compiles AST to stack-based bytecode for VM execution.
3
4mod chunk;
5mod compiler;
6mod encoding;
7mod opcode;
8mod peephole;
9mod serialize;
10
11pub const NO_REST_PARAM: u16 = 0xFFFF;
12
13pub use chunk::{Chunk, Constant};
14pub use compiler::{
15    compile, compile_for_repl, compile_for_repl_unoptimized, compile_unoptimized, CompileError,
16};
17pub use encoding::{binop_to_u8, compound_op_to_u8, u8_to_binop, u8_to_unaryop, unaryop_to_u8};
18pub use opcode::Opcode;
19pub use serialize::{deserialize, serialize};