Core: Change lookup rules, 2x speedup

This commit is contained in:
Krzosa Karol
2023-04-20 22:29:31 +02:00
parent 7c69537283
commit fb3800a43a
5 changed files with 42 additions and 29 deletions

View File

@@ -420,7 +420,10 @@ GetTypeInfo :: (type: Type): *Type_Info
}
{
Ast_Scope *scope = ast_decl_scope(&pctx->null_token, pctx->perm, get(&module->all_loaded_files, 0));
Ast_File *file = get(&module->all_loaded_files, 0);
Ast_Scope *scope = ast_decl_scope(&pctx->null_token, pctx->perm, file);
scope->parent_scope = file;
scope->module = module;
Ast_Decl *decl = ast_namespace(&pctx->null_token, scope, pctx->intern("Const"_s));
decl->state = DECL_RESOLVED;