diff options
Diffstat (limited to 'src/ast.c')
-rw-r--r-- | src/ast.c | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -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 |