WIP Change to code types [ Broken ]

This commit is contained in:
2023-07-13 23:01:20 -04:00
parent a86d6fa0ee
commit 7a2e20bcdb
12 changed files with 744 additions and 418 deletions

View File

@ -27,14 +27,14 @@ Code gen__array_base()
Code gen__array( StrC type )
{
static Code t_allocator_info = def_type( name(AllocatorInfo) );
static Code v_nullptr = untyped_str( code(nullptr));
static Code v_nullptr = code_str( code(nullptr));
static Code spec_ct_member = def_specifiers( 2, ESpecifier::Constexpr, ESpecifier::Static_Member );
static Code spec_static_inline = def_specifiers( 2, ESpecifier::Static_Member, ESpecifier::Inline );
static Code spec_static = def_specifier( ESpecifier::Static_Member );
static Code using_header = def_using( name(Header), def_type( name(ArrayHeader) ) );
static Code ct_grow_formula = def_variable( t_auto, name(grow_formula), untyped_str( code( & array_grow_formula )), spec_ct_member );
static Code ct_grow_formula = def_variable( t_auto, name(grow_formula), code_str( code( & array_grow_formula )), spec_ct_member );
StrC name;
{
@ -134,7 +134,7 @@ Code gen__array( StrC type )
, def_param( t_alias, name(value) )
);
Code body = untyped_str( code(
Code body = code_str( code(
Header& header = * get_header();
if ( begin < 0 || end >= header.Num )

View File

@ -140,7 +140,7 @@ Code gen__hashtable( StrC type )
char const* tmpl = stringize(
void (*) ( u64 key, <type> value )
);
Code value = untyped_str( token_fmt( "type", (StrC)t_type->to_string(), tmpl ) );
Code value = code_str( token_fmt( "type", (StrC)t_type->to_string(), tmpl ) );
using_map_proc = def_using ( name(MapProc), value);
}
@ -166,7 +166,7 @@ Code gen__hashtable( StrC type )
char const* tmpl = stringize(
void (*) ( u64 key, <type> value )
);
Code value = untyped_str( token_fmt( "type", (StrC)t_type_ptr->to_string(), tmpl ) );
Code value = code_str( token_fmt( "type", (StrC)t_type_ptr->to_string(), tmpl ) );
using_map_mut_proc = def_using ( name(MapMutProc), value);
}

View File

@ -54,7 +54,7 @@ u32 gen_sanity_upfront()
Code fwd = def_enum( name(ETestEnum), NoCode, t_u8 );
Code def;
{
Code body = untyped_str( code(
Code body = code_str( code(
A,
B,
C
@ -160,7 +160,7 @@ u32 gen_sanity_upfront()
Code bitflagtest;
{
Code body = def_enum_body( 1, untyped_str( code(
Code body = def_enum_body( 1, code_str( code(
A = 1 << 0,
B = 1 << 1,
C = 1 << 2
@ -177,7 +177,7 @@ u32 gen_sanity_upfront()
);
op_fwd = def_operator( EOperator::BOr, params, t_bitflag );
op_or = def_operator( EOperator::BOr, params, t_bitflag, untyped_str( code(
op_or = def_operator( EOperator::BOr, params, t_bitflag, code_str( code(
return EBitFlagtest( (u8)a | (u8)b );
)));
}
@ -299,7 +299,7 @@ u32 gen_sanity_upfront()
// Variable
{
Code bss = def_variable( t_u8, name(test_variable) );
Code data = def_variable( t_u8, name(test_variable2), untyped_str( code( 0x12 )) );
Code data = def_variable( t_u8, name(test_variable2), code_str( code( 0x12 )) );
gen_sanity_file.print(bss);
gen_sanity_file.print(data);