mirror of
https://github.com/Ed94/gencpp.git
synced 2025-07-31 09:26:58 -07:00
Introduced the general context struct for gencpp
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user