Add support for non Specifier enum SuffixSpecs in AST_Fn and parsing (Thanks Unreal)

This commit is contained in:
2025-01-29 01:29:55 -05:00
parent 16fc3fa379
commit ce2be411d7
7 changed files with 34 additions and 3 deletions

View File

@ -589,6 +589,10 @@ void fn_to_strbuilder_def(CodeFn self, StrBuilder* result )
}
}
// This is bodged in for now SOLEY for Unreal's PURE_VIRTUAL functional macro
if ( self->SuffixSpecs )
strbuilder_append_fmt( result, " %SB", code_to_strbuilder(self->SuffixSpecs) );
strbuilder_append_fmt( result, "\n{\n%SB\n}\n", body_to_strbuilder(self->Body) );
}
@ -646,7 +650,12 @@ void fn_to_strbuilder_fwd(CodeFn self, StrBuilder* result )
if ( self->Specs && specifiers_has(self->Specs, Spec_Pure ) >= 0 )
strbuilder_append_str( result, txt(" = 0;") );
else if (self->Body)
// This is bodged in for now SOLEY for Unreal's PURE_VIRTUAL functional macro (I kept it open ended for other jank)
if ( self->SuffixSpecs )
strbuilder_append_fmt( result, " %SB", code_to_strbuilder(self->SuffixSpecs) );
if (self->Body)
strbuilder_append_fmt( result, " = %SB;", body_to_strbuilder(self->Body) );
if ( self->InlineCmt )