Getting absolute paths, Ast_Files now compare absolute paths

This commit is contained in:
Krzosa Karol
2022-06-27 09:39:24 +02:00
parent 02ec291ad0
commit 3af20536fc
4 changed files with 28 additions and 16 deletions

View File

@@ -200,6 +200,10 @@ struct Parse_Ctx:Lexer{
Ast_Scope *currently_parsed_scope;
Ast_File *currently_parsed_file;
Array<String> module_folders;
String module_folder;
String exe_folder;
S64 indent;
String_Builder gen;
String_Builder helper_builder;
@@ -261,6 +265,16 @@ parse_init(Parse_Ctx *ctx, Allocator *perm_allocator, Allocator *heap_allocator)
arena_init(&ctx->stage_arena, "Compiler stage arena"_s);
lex_init(ctx->perm, ctx->heap, ctx);
init_type();
// Init paths
ctx->exe_folder = os_get_exe_dir(ctx->perm);
ctx->module_folders = {ctx->heap};
String main_module = string_fmt(ctx->perm, "%Q/modules", ctx->exe_folder);
ctx->module_folders.add(main_module);
}