diff --git a/ast.cpp b/ast.cpp index 17634c4..82a345b 100644 --- a/ast.cpp +++ b/ast.cpp @@ -200,8 +200,7 @@ enum Ast_Decl_State{ }; struct Ast_Scope: Ast{ - Array implicit_imports; - Array implicit_loads; + Array implicit_imports; Array decls; Array stmts; @@ -526,7 +525,6 @@ ast_module(Intern_String filename){ result->module = result; result->file = result; result->all_loaded_files = {pctx->heap}; - result->implicit_loads = {pctx->heap}; result->implicit_imports = {pctx->heap}; result->decls = {pctx->heap}; return result; diff --git a/globals.kl b/globals.kl index fce427e..c0cefe1 100644 --- a/globals.kl +++ b/globals.kl @@ -1,6 +1,7 @@ lambdas :: #load "lambdas.kl" Memory :: #load "enums.kl" #import "order1.kl" +order :: #import "order1.kl" @@ -8,6 +9,8 @@ test_load :: () new_types :: #load "new_types.kl" new_types.basic_type_assignment() arena__: order2.Arena + Arena_ :: order.order2.Arena + arena___: Arena_ //----------------------------------------------------------------------------- // Function types //----------------------------------------------------------------------------- diff --git a/lambdas.kl b/lambdas.kl index 29c9598..f9dbcfa 100644 --- a/lambdas.kl +++ b/lambdas.kl @@ -1,6 +1,7 @@ Test :: struct len: S64 + test: Test member := test.len diff --git a/parsing.cpp b/parsing.cpp index a631504..e797013 100644 --- a/parsing.cpp +++ b/parsing.cpp @@ -599,14 +599,13 @@ register_ast_file(Intern_String filename, Ast_Module *module, B32 global_implici file->module = module; file->file = file; // @warning: self referential! file->decls = {pctx->heap}; - file->implicit_loads = {pctx->heap}; file->implicit_imports = {pctx->heap}; file->module->all_loaded_files.add(file); } if(global_implicit_load) { file->global_implicit_load = true; - module->implicit_loads.add(file); + module->implicit_imports.add(file); } return file; diff --git a/typechecking.cpp b/typechecking.cpp index 9a59077..1f25275 100644 --- a/typechecking.cpp +++ b/typechecking.cpp @@ -320,11 +320,6 @@ _search_for_decl(Ast_Scope *scope, Intern_String name){ } } - For(scope->implicit_loads){ - Ast_Decl *result = _search_for_decl(it, name); - if(result) return result; - } - For(scope->implicit_imports){ Ast_Decl *result = _search_for_decl(it, name); if(result) return result; @@ -909,7 +904,8 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_context){ function void resolve_decl(Ast_Decl *ast){ - if(ast->state == DECL_RESOLVED) return; + if(ast->state == DECL_RESOLVED) + return; else if(ast->state == DECL_RESOLVING){ compiler_error(ast->pos, "Cyclic dependency of %s", ast->name.str); return; @@ -965,11 +961,7 @@ resolve_decl(Ast_Decl *ast){ BREAK(); } - case AST_MODULE_NAMESPACE: - CASE(FILE_NAMESPACE, File_Namespace){ - unused(node); - BREAK(); - } + case AST_MODULE_NAMESPACE: CASE(FILE_NAMESPACE, File_Namespace){unused(node);BREAK();} CASE(ENUM, Decl){ Ast_Type *type_of_enum = resolve_typespec(node->typespec, AST_CAN_BE_NULL);