Scripting updates, some refactors..

Made a package release script.

Did refactors based on some design considerations
Still need to make some major decisions...
This commit is contained in:
2023-08-09 18:47:59 -04:00
parent 5aff89262b
commit aa928ff446
46 changed files with 371 additions and 312 deletions

View File

@ -33,7 +33,7 @@ Code gen_SOA( CodeStruct struct_def, s32 num_entries = 0 )
if ( struct_mem->Type == ECode::Variable )
{
CodeType var_type = struct_mem.cast<CodeVar>()->ValueType;
StrC num_entries_str = to_StrC( str_fmt_buf( "%d", num_entries ) );
StrC num_entries_str = to_str( str_fmt_buf( "%d", num_entries ) );
CodeVar entry_arr = { nullptr };
if ( ! num_entries)
@ -124,7 +124,7 @@ void check_SOA()
soa_test.print( parse_using( code(
using u16 = unsigned short;
)));
soa_test.print( def_include( txt_StrC("gen.hpp")));
soa_test.print( def_include( txt("gen.hpp")));
soa_test.print( def_using_namespace( name(gen) ) );
soa_test.print( gen_SOA(

View File

@ -255,7 +255,7 @@ u32 gen_array_file()
gen_array_file;
gen_array_file.open( "array.Parsed.gen.hpp" );
Code include_gen = def_include( txt_StrC("gen.hpp") );
Code include_gen = def_include( txt("gen.hpp") );
gen_array_file.print( include_gen );
gen_array_file.print( def_using_namespace( name(gen)));

View File

@ -169,7 +169,7 @@ u32 gen_buffer_file()
gen_buffer_file;
gen_buffer_file.open( "buffer.Parsed.gen.hpp" );
gen_buffer_file.print( def_include( txt_StrC("gen.hpp")) );
gen_buffer_file.print( def_include( txt("gen.hpp")) );
gen_buffer_file.print( def_using_namespace( name(gen)));
gen_buffer_file.print( gen__buffer_base() );

View File

@ -320,9 +320,9 @@ u32 gen_hashtable_file()
gen_hashtable_file;
gen_hashtable_file.open( "hashtable.Parsed.gen.hpp" );
gen_hashtable_file.print( def_include( txt_StrC("gen.hpp")) );
gen_hashtable_file.print( def_include( txt_StrC("Array.Parsed.hpp")) );
gen_hashtable_file.print( def_include( txt_StrC("array.Parsed.gen.hpp")) );
gen_hashtable_file.print( def_include( txt("gen.hpp")) );
gen_hashtable_file.print( def_include( txt("Array.Parsed.hpp")) );
gen_hashtable_file.print( def_include( txt("array.Parsed.gen.hpp")) );
gen_hashtable_file.print( def_using_namespace( name(gen)));

View File

@ -22,7 +22,7 @@ Code gen__ring( StrC type )
name = get_cached_string({ name_len, name_str });
};
StrC buffer_name = to_StrC( str_fmt_buf( "Buffer_%s", type.Ptr ));
StrC buffer_name = to_str( str_fmt_buf( "Buffer_%s", type.Ptr ));
Code ring = parse_struct( token_fmt( "RingName", (StrC)name, "type", type, "BufferName", buffer_name,
stringize(
@ -138,8 +138,8 @@ u32 gen_ring_file()
gen_ring_file;
gen_ring_file.open( "ring.Parsed.gen.hpp" );
gen_ring_file.print( def_include( txt_StrC("gen.hpp")) );
gen_ring_file.print( def_include( txt_StrC("buffer.Parsed.gen.hpp")) );
gen_ring_file.print( def_include( txt("gen.hpp")) );
gen_ring_file.print( def_include( txt("buffer.Parsed.gen.hpp")) );
// gen_ring_file.print( gen__ring_base() );
gen_ring_file.print( def_using_namespace( name(gen)));

View File

@ -14,7 +14,7 @@ u32 gen_sanity()
gen_sanity_file;
gen_sanity_file.open("./sanity.Parsed.gen.hpp");
gen_sanity_file.print( def_comment( txt_StrC(
gen_sanity_file.print( def_comment( txt(
"The following will show a series of base cases for the gen parsed api.\n"
)));
@ -40,7 +40,7 @@ u32 gen_sanity()
{};
));
empty_body->Body.append( def_comment( txt_StrC("Empty class body") ) );
empty_body->Body.append( def_comment( txt("Empty class body") ) );
gen_sanity_file.print(fwd);
gen_sanity_file.print(empty_body);
@ -76,7 +76,7 @@ u32 gen_sanity()
// External Linkage
{
CodeComment empty_comment = def_comment( txt_StrC("Empty external linkage") );
CodeComment empty_comment = def_comment( txt("Empty external linkage") );
CodeExtern c_extern = parse_extern_link( code(
extern "C"
@ -122,7 +122,7 @@ u32 gen_sanity()
}
));
def->Body.append( def_comment( txt_StrC("Empty function body") ) );
def->Body.append( def_comment( txt("Empty function body") ) );
gen_sanity_file.print(fwd);
gen_sanity_file.print(def);
@ -138,7 +138,7 @@ u32 gen_sanity()
}
));
def->Body.append( def_comment( txt_StrC("Empty namespace body") ) );
def->Body.append( def_comment( txt("Empty namespace body") ) );
gen_sanity_file.print(def);
}
@ -205,7 +205,7 @@ u32 gen_sanity()
}
));
def->Body.append( def_comment( txt_StrC("Empty function body") ) );
def->Body.append( def_comment( txt("Empty function body") ) );
gen_sanity_file.print(fwd);
gen_sanity_file.print(def);
@ -241,7 +241,7 @@ u32 gen_sanity()
{};
));
empty_body->Body.append( def_comment( txt_StrC("Empty struct body") ) );
empty_body->Body.append( def_comment( txt("Empty struct body") ) );
gen_sanity_file.print(fwd);
gen_sanity_file.print(empty_body);
@ -257,7 +257,7 @@ u32 gen_sanity()
};
));
empty->Body.append( def_comment( txt_StrC("Empty union body") ) );
empty->Body.append( def_comment( txt("Empty union body") ) );
gen_sanity_file.print( parse_typedef( code( typedef unsigned short u16; )) );
gen_sanity_file.print( parse_typedef( code( typedef unsigned long u32; )) );
@ -334,7 +334,7 @@ u32 gen_sanity()
gen_sanity_file.print_fmt("\n");
gen_sanity_file.print( def_comment( txt_StrC(
gen_sanity_file.print( def_comment( txt(
"End of base case tests\n"
)));

View File

@ -43,7 +43,7 @@ int gen_main()
using u16 = unsigned short;
)));
soa_test.print( def_include( txt_StrC("gen.hpp")));
soa_test.print( def_include( txt("gen.hpp")));
soa_test.print( def_using_namespace( name(gen) ) );

View File

@ -17,7 +17,7 @@ void check_sanity()
CodeType t_int_dupe = def_type( name(int) );
if ( t_int_dupe->Name != t_int->Name )
fatal("check_sanity: String caching failed!");
GEN_FATAL("check_sanity: String caching failed!");
// Purposefully uses an excessive amount of memory to make sure the the memory backend doesn't break.

View File

@ -336,7 +336,7 @@ u32 gen_array_file()
gen_array_file;
gen_array_file.open( "array.Upfront.gen.hpp" );
CodeInclude include_gen = def_include( txt_StrC("gen.hpp") );
CodeInclude include_gen = def_include( txt("gen.hpp") );
gen_array_file.print( include_gen );
gen_array_file.print( def_using_namespace( name(gen)));

View File

@ -239,7 +239,7 @@ u32 gen_buffer_file()
gen_buffer_file;
gen_buffer_file.open( "buffer.Upfront.gen.hpp" );
gen_buffer_file.print( def_include( txt_StrC("gen.hpp")) );
gen_buffer_file.print( def_include( txt("gen.hpp")) );
gen_buffer_file.print( def_using_namespace( name(gen)) );
gen_buffer_file.print( gen__buffer_base() );

View File

@ -447,9 +447,9 @@ u32 gen_hashtable_file()
gen_hashtable_file;
gen_hashtable_file.open( "hashtable.Upfront.gen.hpp" );
gen_hashtable_file.print( def_include( txt_StrC("gen.hpp")) );
gen_hashtable_file.print( def_include( txt_StrC("Array.Upfront.hpp")) );
gen_hashtable_file.print( def_include( txt_StrC("array.Upfront.gen.hpp")) );
gen_hashtable_file.print( def_include( txt("gen.hpp")) );
gen_hashtable_file.print( def_include( txt("Array.Upfront.hpp")) );
gen_hashtable_file.print( def_include( txt("array.Upfront.gen.hpp")) );
gen_hashtable_file.print( def_using_namespace( name(gen)));

View File

@ -192,8 +192,8 @@ u32 gen_ring_file()
gen_ring_file;
gen_ring_file.open( "ring.Upfront.gen.hpp" );
gen_ring_file.print( def_include( txt_StrC("gen.hpp")) );
gen_ring_file.print( def_include( txt_StrC("buffer.Upfront.gen.hpp")) );
gen_ring_file.print( def_include( txt("gen.hpp")) );
gen_ring_file.print( def_include( txt("buffer.Upfront.gen.hpp")) );
gen_ring_file.print( def_using_namespace( name(gen)));

View File

@ -11,13 +11,13 @@ u32 gen_sanity_upfront()
// Comment
{
CodeComment comment_test = def_comment( txt_StrC("Sanity check: def_comment test") );
CodeComment comment_test = def_comment( txt("Sanity check: def_comment test") );
gen_sanity_file.print(comment_test);
}
gen_sanity_file.print_fmt("\n");
gen_sanity_file.print( def_comment( txt_StrC(
gen_sanity_file.print( def_comment( txt(
"The following will show a series of base cases for the gen api.\n"
)));
@ -26,7 +26,7 @@ u32 gen_sanity_upfront()
CodeClass fwd = def_class( name(TestEmptyClass) );
CodeClass empty_body;
{
CodeComment cmt = def_comment( txt_StrC("Empty class body") );
CodeComment cmt = def_comment( txt("Empty class body") );
CodeBody body = def_class_body( args( cmt ) );
empty_body = def_class( name(TestEmptyClass), body );
@ -74,7 +74,7 @@ u32 gen_sanity_upfront()
// External Linkage
{
CodeBody body = def_extern_link_body( 1
, def_comment( txt_StrC("Empty extern body") )
, def_comment( txt("Empty extern body") )
);
CodeExtern c_extern = def_extern_link( name(C), body );
@ -100,7 +100,7 @@ u32 gen_sanity_upfront()
CodeFn def;
{
CodeBody body = def_function_body( 1
, def_comment( txt_StrC("Empty function body") )
, def_comment( txt("Empty function body") )
);
def = def_function( name(test_function), __, __, body );
@ -114,7 +114,7 @@ u32 gen_sanity_upfront()
// Include
{
CodeInclude include = def_include( txt_StrC("../DummyInclude.hpp") );
CodeInclude include = def_include( txt("../DummyInclude.hpp") );
gen_sanity_file.print(include);
}
@ -142,7 +142,7 @@ u32 gen_sanity_upfront()
CodeNS namespace_def;
{
CodeBody body = def_namespace_body( 1
, def_comment( txt_StrC("Empty namespace body") )
, def_comment( txt("Empty namespace body") )
);
namespace_def = def_namespace( name(TestNamespace), body );
@ -213,7 +213,7 @@ u32 gen_sanity_upfront()
CodeFn def, def2;
{
CodeBody body = def_function_body( 1
, def_comment( txt_StrC("Empty function body") )
, def_comment( txt("Empty function body") )
);
CodeParam params = def_params( args(
@ -259,7 +259,7 @@ u32 gen_sanity_upfront()
CodeClass fwd = def_class( name(TestEmptyStruct) );
CodeClass empty_body;
{
CodeComment cmt = def_comment( txt_StrC("Empty struct body") );
CodeComment cmt = def_comment( txt("Empty struct body") );
CodeBody body = def_class_body( args( cmt ) );
empty_body = def_class( name(TestEmptyStruct), body );
@ -274,7 +274,7 @@ u32 gen_sanity_upfront()
// Union
{
CodeBody body = def_union_body( 1
, def_comment( txt_StrC("Empty union body") )
, def_comment( txt("Empty union body") )
);
CodeUnion def = def_union( name(TestEmptyUnion), body );
@ -312,7 +312,7 @@ u32 gen_sanity_upfront()
CodeTemplate tmpl = def_template( def_param( t_class, name(Type) )
, def_function( name(test_template), def_param( t_Type, name(a) ), __
, def_function_body(1, def_comment( txt_StrC("Empty template function body")))
, def_function_body(1, def_comment( txt("Empty template function body")))
)
);
@ -321,7 +321,7 @@ u32 gen_sanity_upfront()
gen_sanity_file.print_fmt("\n");
gen_sanity_file.print( def_comment( txt_StrC(
gen_sanity_file.print( def_comment( txt(
"End of base case tests.\n"
)));