Getting rid of globals

This commit is contained in:
Krzosa Karol
2023-01-01 14:17:37 +01:00
parent c238e5ba46
commit 647958b72d
9 changed files with 62 additions and 52 deletions

View File

@@ -1,5 +1,6 @@
/*
@! Separate out the codegen stage cause that can change
@! Change type of Stage allocator
@! Look into stage allocator and perhaps
use it more often to reduce scenarios
@@ -68,8 +69,6 @@ struct Core_Ctx{
String working_folder;
List<Token *> files_to_link;
S64 indent;
String_Builder gen;
String_Builder helper_builder;
F64 generating_time_begin;
@@ -82,6 +81,22 @@ struct Core_Ctx{
F64 parsing_time_begin;
F64 parsing_time_end;
bool color_codes_enabled;
// Codegen stage mostly
S64 indent;
String_Builder gen;
// Codegen stage configurables
bool emit_line_directives;
bool emit_type_info;
String symbol_prefix;
bool single_header_library_mode;
String single_header_library_name;
Token same_scope_token;
Token null_token;
Intern_String intern(String string){
assert(string.len > 0);
return intern_string(&interns, string);