New approach, new lexer

This commit is contained in:
Krzosa Karol
2022-05-06 10:13:16 +02:00
parent 557dde1936
commit e3b5e9b33a
33 changed files with 3331 additions and 784 deletions

21
file.c Normal file
View File

@@ -0,0 +1,21 @@
global FILE *global_output_file;
global FILE *global_all_files[32];
global U32 global_all_files_count;
#define lex_print(...) fprintf(global_output_file, __VA_ARGS__)
#define lex_new_line() lex_print("\n")
function void
use_write_file(const char *file){
global_output_file = fopen(file, "w");
global_all_files[global_all_files_count++] = global_output_file;
assert_msg(global_output_file, "Failed to open file:%s", file);
}
function void
close_all_files(){
for(U32 i = 0; i < global_all_files_count; i++){
fclose(global_all_files[i]);
}
}