diff options
| author | hachem <im@hachem.wtf> | 2026-09-19 13:47:08 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-19 13:47:08 +0200 |
| commit | d0ca03c84bcad3dc42fd173b0baf3a15e9b52f9b (patch) | |
| tree | 89fa494129849e23b1d760466e87ef6046cbfcb4 /ast.c | |
| parent | a79c97e04562b171780a24cba2cb1a71acfa4bbb (diff) | |
feat: add conditionals
Diffstat (limited to 'ast.c')
| -rw-r--r-- | ast.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -45,6 +45,16 @@ struct Node* node_binary(enum NodeKind kind, struct Node* first, struct Node* se return node; } +struct Node* node_ternary(enum NodeKind kind, struct Node* first, struct Node* second, + struct Node* third) +{ + struct Node* node = node_new(kind); + node->first = first; + node->second = second; + node->third = third; + return node; +} + struct Node* node_append(struct Node* list, struct Node* node) { struct Node* last = list; @@ -63,6 +73,7 @@ void node_free(struct Node* node) return; node_free(node->first); node_free(node->second); + node_free(node->third); node_free(node->next); free(node); } |
