Fixed some error handling for invalid if statements. Started if codegen.

This commit is contained in:
2025-01-18 22:22:16 +01:00
parent b4d119230b
commit 45ea54cf93
23 changed files with 344 additions and 11 deletions

View File

@@ -149,7 +149,12 @@ Children_Print_Flags :: enum_flags {
}
pretty_print_block :: (node : *AST_Node, indentation : int, builder : *String_Builder, skip_indent := false) {
pretty_print_children(node, indentation, builder, flags = .NewLine | .Dont_Skip_Indent_On_First);
if node.children.count == 0 {
indent(builder, indentation);
append(builder, "()");
} else {
pretty_print_children(node, indentation, builder, flags = .NewLine | .Dont_Skip_Indent_On_First);
}
}
pretty_print_children :: (parent : *AST_Node, indentation : int, builder : *String_Builder, flags : Children_Print_Flags = .Separator, skip_indent := false) {