diff options
| author | Mel <mel@rnrd.eu> | 2025-06-15 03:23:49 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-06-15 03:23:49 +0200 |
| commit | 59fa9cedffa29420f6a51895b672ba66d112c149 (patch) | |
| tree | 918aeee34a29b61060ba2bf7d426211e1290f65d /boot/tree.c | |
| parent | e262a180fea1a04c047071cad96d53a2f4b233c3 (diff) | |
| download | catskill-59fa9cedffa29420f6a51895b672ba66d112c149.tar.zst catskill-59fa9cedffa29420f6a51895b672ba66d112c149.zip | |
Shift `type` keyword in type declarations to right-hand assign side, for symmetry with function declaration
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/tree.c')
| -rw-r--r-- | boot/tree.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/boot/tree.c b/boot/tree.c index adee06a..e4d0272 100644 --- a/boot/tree.c +++ b/boot/tree.c @@ -671,6 +671,7 @@ enum Expression_Kind EXPRESSION_INCREMENT_DECREMENT, EXPRESSION_FUNCTION, + EXPRESSION_TYPE, }; struct Expression_Integer_Literal @@ -748,6 +749,11 @@ struct Expression_Function struct Block_Node body; }; +struct Expression_Type +{ + struct Type_Node* type; +}; + union Expression_Value { struct Expression_Integer_Literal integer_literal; @@ -763,6 +769,7 @@ union Expression_Value struct Expression_Member member; struct Expression_Increment_Decrement increment_decrement; struct Expression_Function function; + struct Expression_Type type; }; struct Expression @@ -900,6 +907,9 @@ expression_print(const struct Expression* expression) printf(")"); break; } + case EXPRESSION_TYPE: + type_node_print(expression->value.type.type); + break; default: failure("unexpected expression kind passed to `expression_print`"); break; @@ -920,7 +930,6 @@ enum Statement_Kind STATEMENT_BREAK, STATEMENT_CONTINUE, STATEMENT_DEFER, - STATEMENT_TYPE, }; struct Statement_Value_Expression @@ -1006,12 +1015,6 @@ struct Statement_Value_Defer struct Block_Node block; }; -struct Statement_Value_Type -{ - struct Type_Node* type; - struct String name; -}; - union Statement_Value { struct Statement_Value_Expression expression; @@ -1021,7 +1024,6 @@ union Statement_Value struct Statement_Value_Loop loop; struct Statement_Value_Return return_value; struct Statement_Value_Defer defer; - struct Statement_Value_Type type; }; struct Statement @@ -1197,11 +1199,6 @@ statement_print(const struct Statement* statement) printf(")"); break; } - case STATEMENT_TYPE: { - printf("(type name %s) ", statement->value.type.name.data); - type_node_print(statement->value.type.type); - break; - } default: failure("unexpected statement kind passed to `statement_print`"); break; |
