aboutsummaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ast.c b/src/ast.c
index 993cf95..1db114a 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -12,11 +12,6 @@ int funcdecl_init(FunctionDecl *self, ScopedAllocator *allocator) {
return buffer_init(&self->body, allocator);
}
-int funcdecl_add_to_body(FunctionDecl *self, Ast ast) {
- return_if_error(buffer_append(&self->body, &ast, sizeof(ast)));
- return BUFFER_OK;
-}
-
int funccall_init(FunctionCall *self, BufferView name, ScopedAllocator *allocator) {
self->name = name;
return buffer_init(&self->args, allocator);
@@ -49,4 +44,13 @@ void binop_init(Binop *self) {
self->rhs = ast_none();
self->type = BINOP_ADD;
self->grouped = bool_false;
+}
+
+int scope_init(Scope *self, ScopedAllocator *allocator) {
+ return buffer_init(&self->ast_objects, allocator);
+}
+
+void scope_resolve(Scope *self) {
+ /* TODO: Implement. Also use longjmp to jump back to compiler on error */
+ (void)self;
} \ No newline at end of file