aboutsummaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/ast.c b/src/ast.c
index 719d48e..2802c3b 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -7,18 +7,9 @@ Ast ast_none() {
return ast;
}
-void ast_deinit(Ast *ast) {
- /* TODO: Cleanup the different types of ast */
- (void)ast;
-}
-
-void funcdecl_init(FunctionDecl *self) {
+int funcdecl_init(FunctionDecl *self, ScopedAllocator *allocator) {
self->name = create_buffer_view_null();
- buffer_init(&self->body);
-}
-
-void funcdecl_deinit(FunctionDecl *self) {
- buffer_deinit(&self->body);
+ return buffer_init(&self->body, allocator, sizeof(Ast) * 4);
}
int funcdecl_add_to_body(FunctionDecl *self, Ast ast) {
@@ -34,8 +25,4 @@ void lhsexpr_init(LhsExpr *self, int isConst, BufferView var_name) {
self->isConst = isConst;
self->var_name = var_name;
self->rhs_expr = ast_none();
-}
-
-void lhsexpr_deinit(LhsExpr *self) {
- ast_deinit(&self->rhs_expr);
} \ No newline at end of file