Function overload check cleanup. Added if statement to parsing.

This commit is contained in:
2025-01-12 22:15:02 +01:00
parent ec31046d30
commit 85b23f90e5
12 changed files with 540 additions and 3 deletions

12
AST.jai
View File

@@ -20,6 +20,7 @@ AST_Kind :: enum {
// Operator;
Call;
Struct;
If;
CBuffer;
FieldList;
ArgList;
@@ -226,6 +227,14 @@ print_return_node :: (node : *AST_Node, indentation : int, builder : *String_Bui
append(builder, ")");
}
pretty_print_if :: (node : *AST_Node, indentation : int, builder : *String_Builder) {
append(builder, "(if ");
pretty_print_children(node, 0, builder);
append(builder, ")");
}
print_expression_statement :: (node : *AST_Node, indentation : int, builder : *String_Builder) {
indent(builder, indentation);
@@ -239,6 +248,9 @@ pretty_print_node :: (node : *AST_Node, indentation : int, builder : *String_Bui
case .Return; {
print_return_node(node, indentation, builder);
}
case .If; {
pretty_print_if(node, indentation, builder);
}
case .Struct;
case .ArgList; {
pretty_print_arglist(node, indentation + 2, builder);