mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-30 19:01:02 -07:00
Fixes for typedef serialization of functions..
Also fix for HashTable<>::rehash_fast not having finished implemenation... The typedef fix is a sort of hack (like how parsing the rest of the language feels like tbh...). I might make a def_typedef_fn to make it clearer how to define function typedefs using the upfront interface.
This commit is contained in:
@ -1221,7 +1221,6 @@ CodeTypedef def_typedef( StrC name, Code type, CodeAttributes attributes, Module
|
||||
{
|
||||
using namespace ECode;
|
||||
|
||||
name_check( def_typedef, name );
|
||||
null_check( def_typedef, type );
|
||||
|
||||
switch ( type->Type )
|
||||
@ -1260,12 +1259,28 @@ CodeTypedef def_typedef( StrC name, Code type, CodeAttributes attributes, Module
|
||||
|
||||
CodeTypedef
|
||||
result = (CodeTypedef) make_code();
|
||||
result->Name = get_cached_string( name );
|
||||
result->Type = ECode::Typedef;
|
||||
result->ModuleFlags = mflags;
|
||||
|
||||
result->UnderlyingType = type;
|
||||
|
||||
if ( name.Len <= 0 )
|
||||
{
|
||||
if (type->Type != Untyped)
|
||||
{
|
||||
log_failure( "gen::def_typedef: name was empty and type was not untyped (indicating its a function typedef) - %s", type.debug_str() );
|
||||
return CodeInvalid;
|
||||
}
|
||||
|
||||
result->Name = get_cached_string( type->Name );
|
||||
result->IsFunction = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
result->Name = get_cached_string( name );
|
||||
result->IsFunction = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user