Working on slices, builtin stuff feels wanky, rewrite gen_simple_decl to

generate string
This commit is contained in:
Krzosa Karol
2022-06-14 12:00:48 +02:00
parent f189ca381e
commit 946e4082cc
5 changed files with 159 additions and 64 deletions

View File

@@ -3,6 +3,7 @@ struct Ast_Decl;
struct Ast_File_Namespace;
struct Ast_File;
struct Ast_Module;
struct Ast_Type;
function Ast_Module *ast_module(Intern_String filename);
function void insert_builtin_types_into_scope(Ast_Scope *p);
@@ -221,14 +222,14 @@ lex_init(Allocator *token_string_arena, Allocator *map_allocator, Lexer *l){
function void
parse_init(Parse_Ctx *ctx, Allocator *perm_allocator, Allocator *heap_allocator){
pctx = ctx;
ctx->perm = perm_allocator;
ctx->heap = heap_allocator;
ctx->gen = {ctx->perm};
ctx->ordered_decls = {ctx->heap};
ctx->type_map = {ctx->heap};
ctx->modules = {ctx->heap};
bigint_allocator = ctx->perm;
pctx = ctx;
ctx->perm = perm_allocator;
ctx->heap = heap_allocator;
ctx->gen = {ctx->perm};
ctx->ordered_decls = {ctx->heap};
ctx->type_map = {ctx->heap};
ctx->modules = {ctx->heap};
bigint_allocator = ctx->perm;
lex_init(ctx->perm, ctx->heap, ctx);