writeBinaryFile

This commit is contained in:
Timerix 2025-02-04 13:31:19 +05:00
parent fe6d690251
commit 53ca7e1b49

View File

@ -60,10 +60,15 @@ str Compiler_constructTokenStr(Compiler* cmp, Token t){
return s; return s;
} }
static bool compileFile(Compiler* cmp, FILE* f){ static bool writeBinaryFile(Compiler* cmp, FILE* f){
returnErrorIf_auto(cmp->state != CompilerState_Parsing); returnErrorIf_auto(cmp->state != CompilerState_Parsing);
cmp->state = CompilerState_Compiling; cmp->state = CompilerState_Compiling;
for(u32 i = 0; i < cmp->ast.sections.len; i++){
Section* sec = &cmp->ast.sections.data[i];
}
return true; return true;
} }
@ -146,7 +151,7 @@ bool Compiler_compile(Compiler* cmp, cstr source_file_name, cstr out_file_name,
if(debug_log) if(debug_log)
printf("==================================[compiling]==================================\n"); printf("==================================[compiling]==================================\n");
success = compileFile(cmp, f); success = writeBinaryFile(cmp, f);
fclose(f); fclose(f);
if(success){ if(success){
cmp->state = CompilerState_Success; cmp->state = CompilerState_Success;