about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/mod.rs')
-rw-r--r--users/tazjin/rlox/src/bytecode/mod.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/users/tazjin/rlox/src/bytecode/mod.rs b/users/tazjin/rlox/src/bytecode/mod.rs
index 412e73106ead..a58f610417fd 100644
--- a/users/tazjin/rlox/src/bytecode/mod.rs
+++ b/users/tazjin/rlox/src/bytecode/mod.rs
@@ -2,6 +2,19 @@
 //!
 //! https://craftinginterpreters.com/chunks-of-bytecode.html
 
+mod chunk;
+mod opcode;
+mod value;
+
+use chunk::Chunk;
+use opcode::OpCode;
+
 pub fn main() {
-    unimplemented!()
+    let mut chunk: Chunk = Default::default();
+
+    let constant = chunk.add_constant(1.2);
+    chunk.add_op(OpCode::OpConstant(constant));
+    chunk.add_op(OpCode::OpReturn);
+
+    chunk::disassemble(&chunk, "test chunk");
 }