diff options
Diffstat (limited to 'src/bytecode/main.c')
-rw-r--r-- | src/bytecode/main.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bytecode/main.c b/src/bytecode/main.c index ca1f441..9a81aaa 100644 --- a/src/bytecode/main.c +++ b/src/bytecode/main.c | |||
@@ -4,8 +4,13 @@ | |||
4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
5 | #include <string.h> | 5 | #include <string.h> |
6 | 6 | ||
7 | #include "vm.h" | 7 | // |
8 | // Config. | ||
9 | // | ||
10 | |||
11 | // #define DEBUG_TRACE_EXECUTION | ||
8 | 12 | ||
13 | #include "vm.h" | ||
9 | #include "ops.h" | 14 | #include "ops.h" |
10 | #include "debug.h" | 15 | #include "debug.h" |
11 | #include "errors.c" | 16 | #include "errors.c" |
@@ -39,8 +44,10 @@ process_source(const StringView *source) { | |||
39 | add_code(vm.chunk, const_idx, 1, 1); | 44 | add_code(vm.chunk, const_idx, 1, 1); |
40 | add_code(vm.chunk, OP_RETURN, 1, 1); | 45 | add_code(vm.chunk, OP_RETURN, 1, 1); |
41 | 46 | ||
42 | // Disassemble the chunk. | 47 | vm_interpret(vm); |
43 | disassemble_chunk(vm.chunk, "test chunk"); | 48 | if (errors_n != 0) { |
49 | disassemble_chunk(vm.chunk, "test chunk"); | ||
50 | } | ||
44 | 51 | ||
45 | array_free(tokens); | 52 | array_free(tokens); |
46 | } | 53 | } |