mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-01 19:02:13 +00:00
Add #+feature global-context
This allows to use of `context` in the global scope on a per file basis.
This commit is contained in:
@@ -1855,7 +1855,12 @@ gb_internal void check_entity_decl(CheckerContext *ctx, Entity *e, DeclInfo *d,
|
||||
|
||||
auto prev_flags = c.scope->flags;
|
||||
defer (c.scope->flags = prev_flags);
|
||||
c.scope->flags &= ~ScopeFlag_ContextDefined;
|
||||
|
||||
if (check_feature_flags(ctx, d->decl_node) & OptInFeatureFlag_GlobalContext) {
|
||||
c.scope->flags |= ScopeFlag_ContextDefined;
|
||||
} else {
|
||||
c.scope->flags &= ~ScopeFlag_ContextDefined;
|
||||
}
|
||||
|
||||
|
||||
e->parent_proc_decl = c.curr_proc_decl;
|
||||
|
||||
Reference in New Issue
Block a user