diff options
Diffstat (limited to 'ast.c')
| -rw-r--r-- | ast.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -79,6 +79,14 @@ struct Node* node_named(enum NodeKind kind, const struct Name* name, struct Node return node; } +struct Node* node_block(enum NodeKind kind, struct Node* first, struct Node* body) +{ + struct Node* node = node_new(kind); + node->first = first; + node->body = body; + return node; +} + struct Node* node_append(struct Node* list, struct Node* node) { struct Node* last = list; @@ -98,6 +106,7 @@ void node_free(struct Node* node) node_free(node->first); node_free(node->second); node_free(node->third); + node_free(node->body); node_free(node->next); free(node); } |
