aboutsummaryrefslogtreecommitdiff
path: root/include/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ast.h')
-rw-r--r--include/ast.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/ast.h b/include/ast.h
index 29a0b64..7911a59 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -15,6 +15,7 @@ typedef struct String String;
typedef struct Variable Variable;
typedef struct Number Number;
typedef struct Binop Binop;
+typedef struct Scope Scope;
typedef union {
FunctionDecl *func_decl;
@@ -89,15 +90,20 @@ struct Binop {
bool grouped;
};
+struct Scope {
+ Buffer ast_objects;
+};
+
Ast ast_none();
CHECK_RESULT int funcdecl_init(FunctionDecl *self, ScopedAllocator *allocator);
-CHECK_RESULT int funcdecl_add_to_body(FunctionDecl *self, Ast ast);
CHECK_RESULT int funccall_init(FunctionCall *self, BufferView name, ScopedAllocator *allocator);
void lhsexpr_init(LhsExpr *self, int isConst, BufferView var_name);
void import_init(Import *self, BufferView path);
CHECK_RESULT int string_init(String *self, BufferView str);
void number_init(Number *self, i64 value, bool is_integer);
void binop_init(Binop *self);
+CHECK_RESULT int scope_init(Scope *self, ScopedAllocator *allocator);
+void scope_resolve(Scope *self);
#endif