From 9be09491a6548cd9512541b856f399dc295f8737 Mon Sep 17 00:00:00 2001 From: Mel Date: Mon, 4 May 2026 22:48:14 +0200 Subject: Remove previous source tree-based transpiler, wire in lowering pass Signed-off-by: Mel --- boot/catboot.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'boot/catboot.c') 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; } -- cgit 1.4.1