aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ast.h2
-rw-r--r--include/parser.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/include/ast.h b/include/ast.h
index eaf2352..580ca24 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -76,6 +76,8 @@ struct Scope {
Buffer/*<Ast*>*/ ast_objects;
HashMap/*(key=BufferView, value=Ast<LhsExpr>*)*/ named_objects;
Scope *parent;
+ /* Is null unless the scope is a file scope, in which case this is the parser that owns the scope */
+ Parser *parser;
};
struct FileScopeReference {
diff --git a/include/parser.h b/include/parser.h
index a203b7d..0261800 100644
--- a/include/parser.h
+++ b/include/parser.h
@@ -38,6 +38,7 @@ struct Parser {
StructDecl struct_decl;
LhsExpr file_decl;
Scope *current_scope;
+ bool has_func_parent;
ScopedAllocator *allocator; /* borrowed. Copied from @compiler for faster access to allocator */
amal_compiler *compiler;
bool started;