aboutsummaryrefslogtreecommitdiff
path: root/include/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ast.h')
-rw-r--r--include/ast.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/ast.h b/include/ast.h
index 56795cd..eaf2352 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -79,7 +79,7 @@ struct Scope {
};
struct FileScopeReference {
- Scope *scope;
+ Parser *parser;
Buffer canonical_path;
};
@@ -113,9 +113,6 @@ struct LhsExpr {
Variable type;
Ast *rhs_expr;
/*
- A mutex is only available if the LhsExpr is public, because other threads (files)
- can access it. It's used to prevent usage of unresolved data and also to decide which
- thread has responsibility of resolving data.
TODO: Find a better way to store this. This most likely will use too much memory.
*/
amal_mutex *mutex;
@@ -136,6 +133,7 @@ struct Number {
f64 floating;
} value;
bool is_integer;
+ BufferView code_ref;
};
struct Binop {
@@ -149,6 +147,7 @@ struct Binop {
typedef struct {
jmp_buf env;
Parser *parser;
+ amal_compiler *compiler;
Scope *scope;
} AstCompilerContext;
@@ -162,7 +161,7 @@ void structfield_init(StructField *self, BufferView name, BufferView type_name);
CHECK_RESULT int lhsexpr_init(LhsExpr *self, bool is_pub, bool is_const, BufferView var_name, ScopedAllocator *allocator);
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 number_init(Number *self, i64 value, bool is_integer, BufferView code_ref);
void variable_init(Variable *self, BufferView name);
void binop_init(Binop *self);