about summary refs log tree commit diff
path: root/boot/catboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'boot/catboot.c')
-rw-r--r--boot/catboot.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/boot/catboot.c b/boot/catboot.c
index 8fdad41..bf06abc 100644
--- a/boot/catboot.c
+++ b/boot/catboot.c
@@ -152,11 +152,18 @@ debug_transpile_pass(struct Source_File source_file)
         return parser_result;
     }
 
+    struct Unit unit = { 0 };
+    lower_tree(&tree, source_file, &unit);
+    if (unit.had_error) {
+        log_error("lowering finished with errors\n");
+        return 1;
+    }
+
     struct Transpile_Output output = transpile_output_from_file(stdout);
 
     struct Transpiler transpiler;
     transpiler_new(&transpiler, output);
-    return transpiler_catskill_to_c(&transpiler, &tree);
+    return transpile_unit(&transpiler, &unit);
 }
 
 enum Command_Result
@@ -283,10 +290,17 @@ default_command(struct Command_Arguments* arguments)
         return COMMAND_FAIL;
     }
 
+    struct Unit unit = { 0 };
+    lower_tree(&tree, source_file, &unit);
+    if (unit.had_error) {
+        log_error("lowering finished with errors\n");
+        return COMMAND_FAIL;
+    }
+
     struct Transpiler transpiler;
     transpiler_new(&transpiler, transpile_output_from_string());
 
-    if (transpiler_catskill_to_c(&transpiler, &tree) != 0) {
+    if (transpile_unit(&transpiler, &unit) != 0) {
         log_error("transpiler finished with errors\n");
         return COMMAND_FAIL;
     }