Function overload check cleanup. Added if statement to parsing.
This commit is contained in:
12
AST.jai
12
AST.jai
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user