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

Added 'using' fields

This commit is contained in:
Brian Fiete 2022-07-10 07:50:08 -04:00
parent ff229f385d
commit 450d541292
13 changed files with 850 additions and 253 deletions

View file

@ -6570,23 +6570,23 @@ BfAstNode* BfReducer::ReadTypeMember(BfTokenNode* tokenNode, bool declStarted, i
handled = true;
}
// if (token == BfToken_Using)
// {
// if ((fieldDecl->mConstSpecifier != NULL) && (fieldDecl->mConstSpecifier->mToken == BfToken_Const))
// {
// Fail("Const cannot be used with 'using' specified", tokenNode);
// }
// else if (fieldDecl->mConstSpecifier != NULL)
// {
// Fail("Using already specified", tokenNode);
// }
//
// auto usingSpecifier = mAlloc->Alloc<BfUsingSpecifierNode>();
// ReplaceNode(tokenNode, usingSpecifier);
// MEMBER_SET(usingSpecifier, mUsingToken, tokenNode);
// MEMBER_SET(fieldDecl, mConstSpecifier, usingSpecifier);
// handled = true;
// }
if (token == BfToken_Using)
{
if ((fieldDecl->mConstSpecifier != NULL) && (fieldDecl->mConstSpecifier->mToken == BfToken_Const))
{
Fail("Const cannot be used with 'using' specified", tokenNode);
}
else if (fieldDecl->mConstSpecifier != NULL)
{
Fail("Using already specified", tokenNode);
}
auto usingSpecifier = mAlloc->Alloc<BfUsingSpecifierNode>();
ReplaceNode(tokenNode, usingSpecifier);
MEMBER_SET(usingSpecifier, mUsingToken, tokenNode);
MEMBER_SET(fieldDecl, mConstSpecifier, usingSpecifier);
handled = true;
}
if (token == BfToken_ReadOnly)
{