about summary refs log tree commit diff
path: root/boot/catboot.c
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-05-04 22:48:14 +0200
committerMel <mel@rnrd.eu>2026-05-04 22:48:14 +0200
commit9be09491a6548cd9512541b856f399dc295f8737 (patch)
tree51210af9167f6521bc80c2526533312e85a9dcad /boot/catboot.c
parent7233ae62b43ae1274ffcb53eb1a62fc91ba540e7 (diff)
downloadcatskill-9be09491a6548cd9512541b856f399dc295f8737.tar.zst
catskill-9be09491a6548cd9512541b856f399dc295f8737.zip
Remove previous source tree-based transpiler, wire in lowering pass
Signed-off-by: Mel <mel@rnrd.eu>
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;
     }