From d0ca03c84bcad3dc42fd173b0baf3a15e9b52f9b Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 19 Sep 2026 13:47:08 +0200 Subject: feat: add conditionals --- ast.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ast.h') diff --git a/ast.h b/ast.h index c25e118..d993c2e 100644 --- a/ast.h +++ b/ast.h @@ -9,6 +9,7 @@ enum NodeKind TYPE_SIZE, TYPE_REMOVE_CV, TYPE_ARRAY, + TYPE_CONDITIONAL, TYPE_DECLTYPE, VALUE_DIFFERENCE, VALUE_SUM, @@ -17,6 +18,12 @@ enum NodeKind VALUE_EXTENT, VALUE_TUPLE_SIZE, VALUE_INTEGRAL_CONSTANT, + VALUE_CONDITIONAL, + COND_TRUE, + COND_FALSE, + COND_IS_SAME, + COND_EQUAL, + COND_LESS, STMT_EMIT }; @@ -27,6 +34,7 @@ struct Node char character; struct Node* first; struct Node* second; + struct Node* third; struct Node* next; }; @@ -34,6 +42,8 @@ struct Node* node_leaf(enum NodeKind kind); struct Node* node_char(char character); struct Node* node_unary(enum NodeKind kind, struct Node* first); struct Node* node_binary(enum NodeKind kind, struct Node* first, struct Node* second); +struct Node* node_ternary(enum NodeKind kind, struct Node* first, struct Node* second, + struct Node* third); struct Node* node_append(struct Node* list, struct Node* node); void node_free(struct Node* node); -- cgit v1.3