1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Inline anonymous type declarations

This commit is contained in:
Brian Fiete 2025-01-02 11:42:33 -08:00
parent f609062c2a
commit 958fc30310
20 changed files with 600 additions and 48 deletions

View file

@ -236,6 +236,11 @@ void BfStructuralVisitor::Visit(BfTypeReference* typeRef)
Visit(typeRef->ToBase());
}
void BfStructuralVisitor::Visit(BfInlineTypeReference* typeRef)
{
Visit(typeRef->ToBase());
}
void BfStructuralVisitor::Visit(BfNamedTypeReference* typeRef)
{
Visit(typeRef->ToBase());
@ -1233,14 +1238,21 @@ void BfBlock::SetSize(int wantSize)
//////////////////////////////////////////////////////////////////////////
bool BfTypeDeclaration::IsAnonymous()
{
return (mAnonymousName != NULL);
}
//////////////////////////////////////////////////////////////////////////
bool BfTypeReference::IsNamedTypeReference()
{
return IsA<BfNamedTypeReference>() || IsA<BfDirectStrTypeReference>();
return IsA<BfNamedTypeReference>() || IsA<BfDirectStrTypeReference>() || IsA<BfInlineTypeReference>();
}
bool BfTypeReference::IsTypeDefTypeReference()
{
return IsA<BfNamedTypeReference>() || IsA<BfDirectStrTypeReference>() || IsA<BfDirectTypeDefReference>();
return IsA<BfNamedTypeReference>() || IsA<BfDirectStrTypeReference>() || IsA<BfInlineTypeReference>() || IsA<BfDirectTypeDefReference>();
}
String BfTypeReference::ToCleanAttributeString()
@ -1657,6 +1669,11 @@ bool Beefy::BfTokenIsKeyword(BfToken token)
return (token >= BfToken_Abstract) && (token <= BfToken_Yield);
}
bool Beefy::BfTokenIsTypeDecl(BfToken token)
{
return (token == BfToken_Struct) || (token == BfToken_Class) || (token == BfToken_Interface) || (token == BfToken_Enum);
}
BfBinaryOp Beefy::BfAssignOpToBinaryOp(BfAssignmentOp assignmentOp)
{
switch (assignmentOp)