aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 60122b9..618d325 100644
--- a/src/main.c
+++ b/src/main.c
@@ -176,6 +176,10 @@ process_file(Str path) {
176 // The parser stores the root nodes as a stack. 176 // The parser stores the root nodes as a stack.
177 Node *root = parser.nodes[i]; 177 Node *root = parser.nodes[i];
178 res = compile_expr(&chunk, root); 178 res = compile_expr(&chunk, root);
179 if (res.type == COMP_ERR) {
180 eprintln("compilation error...");
181 exit(EXIT_FAILURE);
182 }
179 } 183 }
180 sz res_reg = 0; 184 sz res_reg = 0;
181 switch (res.type) { 185 switch (res.type) {
@@ -215,8 +219,10 @@ process_file(Str path) {
215 // println("VM REGISTERS BEFORE:\n%{Mem}", 219 // println("VM REGISTERS BEFORE:\n%{Mem}",
216 // &(Array){.mem = (u8 *)&vm.regs, sizeof(vm.regs)}); 220 // &(Array){.mem = (u8 *)&vm.regs, sizeof(vm.regs)});
217 vm_run(&vm); 221 vm_run(&vm);
218 // println("VM REGISTERS AFTER:\n%{Mem}", 222 println("VM REGISTERS AFTER:\n%{Mem}",
219 // &(Array){.mem = (u8 *)&vm.regs, sizeof(vm.regs)}); 223 &(Array){.mem = (u8 *)&vm.regs, sizeof(vm.regs)});
224 println("VM MEMORY AFTER:\n%{Mem}",
225 &(Array){.mem = (u8 *)&vm.stack, sizeof(vm.stack)});
220 226
221#if DEBUG == 1 227#if DEBUG == 1
222 println("Space used: %{Arena}", &lexer_arena); 228 println("Space used: %{Arena}", &lexer_arena);