began to remove usage of code specific types member procs

This commit is contained in:
2024-12-02 04:12:09 -05:00
parent 5b0079fb0c
commit 16b8a3a164
7 changed files with 168 additions and 137 deletions

View File

@ -163,13 +163,35 @@ Code& Code::operator ++()
#pragma endregion Code
inline
void CodeClass::add_interface( CodeType type )
void append( CodeBody self, Code other )
{
CodeType possible_slot = ast->ParentType;
GEN_ASSERT(other.ast != nullptr);
if (is_body(other)) {
append( self, cast(CodeBody, other) );
return;
}
append( rcast(AST*, self.ast), other.ast );
}
inline
void append( CodeBody self, CodeBody body )
{
for ( Code entry : body ) {
append( self, entry );
}
}
inline
void add_interface( CodeClass self, CodeType type )
{
GEN_ASSERT(self.ast !=nullptr);
CodeType possible_slot = self->ParentType;
if ( possible_slot.ast )
{
// Were adding an interface to parent type, so we need to make sure the parent type is public.
ast->ParentAccess = AccessSpec_Public;
self->ParentAccess = AccessSpec_Public;
// If your planning on adding a proper parent,
// then you'll need to move this over to ParentType->next and update ParentAccess accordingly.
}