diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-03-05 18:25:57 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | 81b6004928015ced29b0b949e35753977aa17606 (patch) | |
tree | 410690c0ddc59b61bb471fe6cea0dcc71e133745 /include/ast.h | |
parent | f41317b598e59eefaa912f0d49fe2b1817573d88 (diff) |
Add ast resolving using multiple threads
Fix issue where not all files are parsed
Diffstat (limited to 'include/ast.h')
-rw-r--r-- | include/ast.h | 8 |
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 |