hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ast.c b/ast.c
index ed694f9..58cbaf5 100644
--- a/ast.c
+++ b/ast.c
@@ -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);
}