feat(tazjin/rlox): Bootstrap VM for Lox bytecode
Change-Id: I479e20bf2087e5c4aa20e31b364c57ed0d961bcf Reviewed-on: https://cl.tvl.fyi/c/depot/+/2416 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
b1d0e22b1f
commit
7fb93fb490
7 changed files with 89 additions and 25 deletions
|
@ -3,8 +3,10 @@
|
|||
//! https://craftinginterpreters.com/chunks-of-bytecode.html
|
||||
|
||||
mod chunk;
|
||||
mod errors;
|
||||
mod opcode;
|
||||
mod value;
|
||||
mod vm;
|
||||
|
||||
use chunk::Chunk;
|
||||
use opcode::OpCode;
|
||||
|
@ -16,5 +18,5 @@ pub fn main() {
|
|||
chunk.add_op(OpCode::OpConstant(constant), 1);
|
||||
chunk.add_op(OpCode::OpReturn, 1);
|
||||
|
||||
chunk::disassemble(&chunk, "test chunk");
|
||||
vm::interpret(chunk).expect("it should work");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue