diff options
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); } |
