diff options
| author | Mel <mel@rnrd.eu> | 2025-06-30 02:53:10 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-06-30 02:53:10 +0200 |
| commit | 1e2b456f08a5d00c8cbe290fb7974818e8f17b46 (patch) | |
| tree | 5c267daec7df47ca790f96cb951e04dfbaeb6dc5 /boot/tree.c | |
| parent | b16cf0fc98940554ef0febfe443ef690618d5083 (diff) | |
| download | catskill-1e2b456f08a5d00c8cbe290fb7974818e8f17b46.tar.zst catskill-1e2b456f08a5d00c8cbe290fb7974818e8f17b46.zip | |
Re-format FOR_EACH macros as control structures
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/tree.c')
| -rw-r--r-- | boot/tree.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/boot/tree.c b/boot/tree.c index 1fcaa62..2dcfdd2 100644 --- a/boot/tree.c +++ b/boot/tree.c @@ -595,8 +595,7 @@ type_node_print(const struct Type_Node* type_node) break; case TYPE_NODE_TUPLE: { printf("tuple"); - FOR_EACH(struct Type_Node*, current, type_node->value.tuple.head) - { + FOR_EACH (struct Type_Node*, current, type_node->value.tuple.head) { printf(" "); type_node_print(current); } @@ -615,8 +614,7 @@ type_node_print(const struct Type_Node* type_node) } case TYPE_NODE_STRUCTURE: { printf("structure"); - FOR_EACH(struct Type_Node*, current, type_node->value.structure.fields) - { + FOR_EACH (struct Type_Node*, current, type_node->value.structure.fields) { printf(" (field %s) ", current->value_name.data); type_node_print(current); } @@ -624,8 +622,7 @@ type_node_print(const struct Type_Node* type_node) } case TYPE_NODE_VARIANT: { printf("variant"); - FOR_EACH(struct Type_Node*, current, type_node->value.variant.variants) - { + FOR_EACH (struct Type_Node*, current, type_node->value.variant.variants) { if (type_node_is_none(current)) { printf(" (variant %s)", current->value_name.data); } else { @@ -638,8 +635,7 @@ type_node_print(const struct Type_Node* type_node) } case TYPE_NODE_CLASS: printf("class"); - FOR_EACH(struct Type_Node*, current, type_node->value.class.methods) - { + FOR_EACH (struct Type_Node*, current, type_node->value.class.methods) { check(current->type == TYPE_NODE_FUNCTION, "expected class method type node to be a function type"); printf(" (method %s ", current->value_name.data); @@ -811,8 +807,7 @@ expression_new( void function_header_node_print(const struct Function_Header_Node* header) { - FOR_EACH(struct Type_Node*, current, header->parameters_type_and_name) - { + FOR_EACH (struct Type_Node*, current, header->parameters_type_and_name) { if (current != header->parameters_type_and_name) printf(" "); if (!string_is_empty(current->value_name)) @@ -876,8 +871,7 @@ expression_print(const struct Expression* expression) printf("(call/construct "); expression_print(coc->subject); uint i = 0; - FOR_EACH(struct Expression*, argument, coc->arguments) - { + FOR_EACH (struct Expression*, argument, coc->arguments) { struct String name = string_array_at(&coc->argument_names, i++); if (!string_is_empty(name)) { printf(" (named arg '%s' ", name.data); @@ -1062,8 +1056,7 @@ void block_node_print(const struct Block_Node* block) { printf("(block \n"); - FOR_EACH(struct Statement*, statement, block->statements) - { + FOR_EACH (struct Statement*, statement, block->statements) { printf("\t"); statement_print(statement); printf("\n"); @@ -1075,10 +1068,7 @@ void bare_declaration_node_print(const struct Bare_Declaration_Node* declaration) { printf("(declaration "); - STRING_ARRAY_FOR_EACH(i, name, declaration->names) - { - printf("%s ", name.data); - } + STRING_ARRAY_FOR_EACH (i, name, declaration->names) { printf("%s ", name.data); } if (!type_node_is_none(declaration->type)) { type_node_print(declaration->type); printf(" "); @@ -1230,8 +1220,7 @@ struct Tree void tree_print(const struct Tree* tree) { - FOR_EACH(struct Statement*, statement, tree->top_level_statements) - { + FOR_EACH (struct Statement*, statement, tree->top_level_statements) { statement_print(statement); printf("\n"); } |
