diff options
| author | Ben Winston | 2023-05-20 22:54:07 -0400 |
|---|---|---|
| committer | Ben Winston | 2023-05-20 22:54:07 -0400 |
| commit | 2ad2be250a68e907b308b120b934edcbfc99ae6e (patch) | |
| tree | 54cd9308286cb4a368a8f7eb11ad9011c74ac58a /main.d | |
| parent | 38dc63a67879a42f208b5642a8590e1192e8e2e5 (diff) | |
block scope and local variables (not really working)
Diffstat (limited to 'main.d')
| -rw-r--r-- | main.d | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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(); |
