aboutsummaryrefslogtreecommitdiff
path: root/main.d
diff options
context:
space:
mode:
authorBen Winston2023-05-21 20:26:59 -0400
committerBen Winston2023-05-21 20:26:59 -0400
commit8e1f84b1369909745859777d07a5e8e74b5df334 (patch)
tree460f42755407e9ddf1b3e6dfabea6a09b3d1585d /main.d
parenta26bfccdc52ab50a83b8f8d170c9e1a3be0164a5 (diff)
move disassembly into compiler, preparing for functions
Diffstat (limited to 'main.d')
-rw-r--r--main.d11
1 files changed, 1 insertions, 10 deletions
diff --git a/main.d b/main.d
index 526b79a..c497283 100644
--- a/main.d
+++ b/main.d
@@ -28,18 +28,9 @@ void repl() {
Parser parser = new Parser(input);
- Compiler compiler = new Compiler(FunctionType.SCRIPT, &parser);
+ Compiler compiler = new Compiler(ObjType.SCRIPT, &parser);
Function func = compiler.compile();
- int cnt = 0;
- writeln("== disassembly ==");
- while(true) {
- if (cnt >= func.chunk.code.length) {
- break;
- }
- cnt = disassemble(func.chunk, cnt);
- }
-
VM vm = new VM(func);
vm.run();