From 81b6004928015ced29b0b949e35753977aa17606 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 5 Mar 2019 18:25:57 +0100 Subject: Add ast resolving using multiple threads Fix issue where not all files are parsed --- include/ast.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/ast.h') 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 -- cgit v1.2.3