Change the decl searching api while figuring out how to implement

function overloading
This commit is contained in:
Krzosa Karol
2022-09-29 12:04:21 +02:00
parent a7524a0071
commit 5f11a11f0f
9 changed files with 113 additions and 53 deletions

View File

@@ -123,6 +123,7 @@ add_module(Token *pos, Intern_String filename, B32 command_line_module){
Ast_Module *result = ast_new(Ast_Module, AST_MODULE, pos, 0);
result->absolute_file_path = string_copy(pctx->perm, absolute_file_path);
result->absolute_base_folder = string_copy(pctx->perm, absolute_base_folder);
result->debug_name = string_skip_to_last_slash(result->absolute_file_path);
// log_info("Adding module: %Q\n", filename);
result->module = result; // @warning: self referential
result->file = result; // @warning: self referential
@@ -170,7 +171,7 @@ compile_file_to_string(String filename){
// @note: language stuff needs to be declared before type_info data
// so we mark where it ends
pctx->base_language_ordered_decl_len = pctx->ordered_decls.len;
Ast_Decl *any_decl = search_for_decl(module, pctx->intern("Any"_s));
Ast_Decl *any_decl = search_for_single_decl(module, pctx->intern("Any"_s));
assert(any_decl->type == type_type);
type_any = any_decl->type_val;
}