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.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/users/tazjin/rlox/src/bytecode/mod.rs b/users/tazjin/rlox/src/bytecode/mod.rs
index 34ceaf28bfa4..362d8bb1252f 100644
--- a/users/tazjin/rlox/src/bytecode/mod.rs
+++ b/users/tazjin/rlox/src/bytecode/mod.rs
@@ -3,6 +3,7 @@
 //! https://craftinginterpreters.com/chunks-of-bytecode.html
 
 mod chunk;
+mod compiler;
 mod errors;
 mod opcode;
 mod value;
@@ -20,7 +21,7 @@ impl crate::Lox for Interpreter {
     }
 
     fn interpret(&mut self, code: String) -> Result<Self::Value, Vec<Self::Error>> {
-        let chunk: Chunk = Default::default();
+        let chunk = compiler::compile(&code)?;
         vm::interpret(chunk).map_err(|e| vec![e])
     }
 }