Add error messages when file not found + error position

This commit is contained in:
Krzosa Karol
2022-06-18 09:58:48 +02:00
parent 3ba8bd08fb
commit 499faac256
5 changed files with 19 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ struct Ast_File_Namespace;
struct Ast_File;
struct Ast_Module;
struct Ast_Type;
function Ast_Module *ast_module(Intern_String filename);
function Ast_Module *ast_module(Token *pos, Intern_String filename);
function void insert_builtin_types_into_scope(Ast_Scope *p);
enum Token_Kind{
@@ -246,7 +246,7 @@ 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);
ctx->builtins = ast_module(ctx->intern("builtins"_s));
ctx->builtins = ast_module(0, ctx->intern("builtins"_s));
insert_builtin_types_into_scope((Ast_Scope *)ctx->builtins);
init_type();