Introduced the general context struct for gencpp

This commit is contained in:
2024-12-13 19:16:52 -05:00
parent 78bcc21130
commit 76ac3a0f93
30 changed files with 831 additions and 852 deletions

View File

@@ -15,7 +15,7 @@ Builder builder_open( char const* path )
return result;
}
result.Buffer = strbuilder_make_reserve( GlobalAllocator, Builder_StrBufferReserve );
result.Buffer = strbuilder_make_reserve( _ctx->Allocator_Temp, _ctx->InitSize_BuilderBuffer );
// log_fmt("$Builder - Opened file: %s\n", result.File.filename );
return result;

View File

@@ -20,7 +20,7 @@ Code scan_file( char const* path )
GEN_FATAL("scan_file: %s is empty", path );
}
StrBuilder str = strbuilder_make_reserve( GlobalAllocator, fsize );
StrBuilder str = strbuilder_make_reserve( _ctx->Allocator_Temp, fsize );
file_read( & file, str, fsize );
strbuilder_get_header(str)->Length = fsize;
@@ -117,7 +117,7 @@ Code scan_file( char const* path )
}
CodeBody parse_file( const char* path ) {
FileContents file = file_read_contents( GlobalAllocator, true, path );
FileContents file = file_read_contents( _ctx->Allocator_Temp, true, path );
Str content = { (char const*)file.data, file.size };
CodeBody code = parse_global_body( content );
log_fmt("\nParsed: %s\n", path);