Cleanup iterators

This commit is contained in:
Krzosa Karol
2023-01-01 17:44:27 +01:00
parent d120d05eee
commit d6a5df8d95
9 changed files with 86 additions and 108 deletions

View File

@@ -1,7 +1,6 @@
/*
@! Separate out the codegen stage cause that can change
@! Change type of Stage allocator
@! Look into String_Builders in Core_Ctx
@! Look into stage allocator and perhaps
use it more often to reduce scenarios
@@ -34,8 +33,10 @@ struct Lex_Stream{
struct Core_Ctx{
Allocator *heap;
Push_Arena perm_push_only;
Push_Arena *perm; // Stores: AST, tokens, interns
Scratch_Arena *scratch;
Scratch_Arena *stage_arena;
@@ -98,6 +99,7 @@ struct Core_Ctx{
Token same_scope_token;
Token null_token;
/*#import meta
for i in meta.keywords: print(f'Intern_String keyword_{i.lower()};')
for i in meta.interns: print(f'Intern_String intern_{i.lower()};')
@@ -197,16 +199,12 @@ Ast_Operator_Info op_info_table[20];
Ast_Type *untyped_int = &type__untyped_int;
Ast_Type *untyped_float = &type__untyped_float;
Intern_String intern(String string){
assert(string.len > 0);
return intern_string(&interns, string);
}
};
CORE_Static void init_type();
CORE_Static String compile_to_c_code();
CORE_Static Ast_Module *ast_module(Token *pos, Intern_String filename);
CORE_Static void insert_builtin_types_into_scope(Ast_Scope *p);