aboutsummaryrefslogtreecommitdiff
path: root/main.d
diff options
context:
space:
mode:
Diffstat (limited to 'main.d')
-rw-r--r--main.d9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.d b/main.d
index 678bfb0..526b79a 100644
--- a/main.d
+++ b/main.d
@@ -31,6 +31,15 @@ void repl() {
Compiler compiler = new Compiler(FunctionType.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();