mirror of
https://github.com/Ed94/gencpp.git
synced 2025-07-02 03:41:03 -07:00
Added a new AST member NextVar
to be used for comma separated variable support.
Interface adding has been adjusted to use ParentType->Next. Using the AST_Class->Next was bad since that breaks the linked list a body AST would have used for traversal.
This commit is contained in:
@ -67,15 +67,21 @@ Code& Code::operator ++()
|
||||
|
||||
void CodeClass::add_interface( CodeType type )
|
||||
{
|
||||
if ( ! ast->Next )
|
||||
CodeType possible_slot = ast->ParentType;
|
||||
if ( possible_slot.ast )
|
||||
{
|
||||
ast->Next = type;
|
||||
ast->Last = ast->Next;
|
||||
return;
|
||||
// Were adding an interface to parent type, so we need to make sure the parent type is public.
|
||||
ast->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.
|
||||
}
|
||||
|
||||
ast->Next->Next = type;
|
||||
ast->Last = ast->Next->Next;
|
||||
while ( possible_slot.ast != nullptr )
|
||||
{
|
||||
possible_slot.ast = (AST_Type*) possible_slot->Next.ast;
|
||||
}
|
||||
|
||||
possible_slot.ast = type.ast;
|
||||
}
|
||||
|
||||
void CodeParam::append( CodeParam other )
|
||||
@ -129,14 +135,21 @@ CodeParam& CodeParam::operator ++()
|
||||
|
||||
void CodeStruct::add_interface( CodeType type )
|
||||
{
|
||||
if ( ! ast->Next )
|
||||
CodeType possible_slot = ast->ParentType;
|
||||
if ( possible_slot.ast )
|
||||
{
|
||||
ast->Next = type;
|
||||
ast->Last = ast->Next;
|
||||
// Were adding an interface to parent type, so we need to make sure the parent type is public.
|
||||
ast->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.
|
||||
}
|
||||
|
||||
ast->Next->Next = type;
|
||||
ast->Last = ast->Next->Next;
|
||||
while ( possible_slot.ast != nullptr )
|
||||
{
|
||||
possible_slot.ast = (AST_Type*) possible_slot->Next.ast;
|
||||
}
|
||||
|
||||
possible_slot.ast = type.ast;
|
||||
}
|
||||
|
||||
CodeBody def_body( CodeT type )
|
||||
|
Reference in New Issue
Block a user