CORE_Static

This commit is contained in:
Krzosa Karol
2022-10-11 13:04:35 +02:00
parent e37bf8b1bc
commit 2c53693754
21 changed files with 446 additions and 447 deletions

View File

@@ -1,5 +1,5 @@
function void
CORE_Static void
lex_init(Arena *token_string_arena, Arena *map_allocator, Lexer *l){
l->arena = token_string_arena;
l->tokens = array_make<Token>(token_string_arena, 4096*4);
@@ -74,7 +74,7 @@ op_info_table[19].op = l->intern("!"_s);
}
function void
CORE_Static void
parse_init(Parse_Ctx *ctx, Arena *perm_allocator){
pctx = ctx;
ctx->perm = perm_allocator;
@@ -97,7 +97,7 @@ parse_init(Parse_Ctx *ctx, Arena *perm_allocator){
}
function void
CORE_Static void
begin_compilation(){
init_ctx_time_begin = os_time();
Parse_Ctx *ctx = arena_push_type(&pernament_arena, Parse_Ctx, AF_ZeroMemory);
@@ -105,13 +105,13 @@ begin_compilation(){
init_ctx_time_end = os_time();
}
function void
CORE_Static void
destroy_compiler(){
arena_clear(pctx->perm);
arena_clear(&pctx->stage_arena);
}
function void
CORE_Static void
insert_builtin_type_into_scope(Ast_Scope *p, String name, Ast_Type *type){
Intern_String string = pctx->intern(name);
Ast_Decl *decl = ast_type(0, string, type);
@@ -124,7 +124,7 @@ insert_builtin_type_into_scope(Ast_Scope *p, String name, Ast_Type *type){
global F64 parsing_time_begin;
global F64 parsing_time_end;
function void
CORE_Static void
parse_all_modules(){
parsing_time_begin = os_time();
@@ -146,7 +146,7 @@ parse_all_modules(){
parsing_time_end = os_time();
}
function Ast_Module *
CORE_Static Ast_Module *
add_module(Token *pos, Intern_String filename, B32 command_line_module){
Scratch scratch;
String absolute_file_path = {};
@@ -204,7 +204,7 @@ add_module(Token *pos, Intern_String filename, B32 command_line_module){
return result;
}
function void
CORE_Static void
resolve_everything_in_module(Ast_Module *module){
if(module->state == MODULE_RESOLVED) return;
resolving_time_begin = os_time();
@@ -222,7 +222,7 @@ resolve_everything_in_module(Ast_Module *module){
resolving_time_end = os_time();
}
function String
CORE_Static String
compile_file_to_string(String filename){
total_time = os_time();
begin_compilation();
@@ -300,7 +300,7 @@ const U32 COMPILE_PRINT_ALLOCATOR_STATS_BEFORE_DESTROY = 0x2;
const U32 COMPILE_AND_RUN = 0x4;
const U32 COMPILE_TESTING = 0x8;
function void
CORE_Static void
compile_file(String filename, U32 compile_flags = COMPILE_NULL){
if(is_flag_set(compile_flags, COMPILE_AND_RUN)){
log_info_no_nl("%Q - ", filename);