Load is file relative not module relative
This commit is contained in:
@@ -742,8 +742,9 @@ register_ast_file(Token *pos, String absolute_file_path, Ast_Module *module, B32
|
||||
if(!file){
|
||||
log_trace("%Q :: Registering file: %Q\n", module->absolute_file_path, absolute_file_path);
|
||||
AST_NEW(File, FILE, 0, 0);
|
||||
file = result;
|
||||
file->absolute_file_path = absolute_file_path;
|
||||
file = result;
|
||||
file->absolute_file_path = absolute_file_path;
|
||||
file->absolute_base_folder = string_copy(pctx->perm, string_chop_last_slash(file->absolute_file_path));
|
||||
file->module = module;
|
||||
file->parent_scope = 0;
|
||||
file->file = file; // @warning: self referential!
|
||||
@@ -777,7 +778,7 @@ function Ast_File *
|
||||
parse_load(B32 global_implicit_load){
|
||||
Token *file = token_expect(TK_StringLit);
|
||||
Intern_String filename = preprocess_filename(file);
|
||||
String absolute_path = string_fmt(pctx->perm, "%Q/%Q", pctx->currently_parsed_file->module->absolute_base_folder, filename);
|
||||
String absolute_path = string_fmt(pctx->perm, "%Q/%Q", pctx->currently_parsed_file->absolute_base_folder, filename);
|
||||
Ast_File *result = register_ast_file(file, absolute_path, pctx->currently_parsed_file->module, global_implicit_load);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user