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

Allow '...' varargs in delegate and function types

This commit is contained in:
Brian Fiete 2021-02-02 07:08:55 -08:00
parent 7e139f5d7c
commit b916273a97
5 changed files with 95 additions and 19 deletions

View file

@ -9262,12 +9262,22 @@ bool BfReducer::ParseMethod(BfMethodDeclaration* methodDeclaration, SizedArrayIm
methodDeclaration->mOpenParen = tokenNode;
MoveNode(methodDeclaration->mOpenParen, methodDeclaration);
if (auto nextToken = BfNodeDynCast<BfTokenNode>(mVisitorPos.GetNext()))
bool isFunction = false;
bool isDelegate = false;
if ((mCurTypeDecl->mTypeNode != NULL) && (mCurTypeDecl->mTypeNode->GetToken() == BfToken_Function))
isFunction = true;
else if ((mCurTypeDecl->mTypeNode != NULL) && (mCurTypeDecl->mTypeNode->GetToken() == BfToken_Delegate))
isDelegate = true;
if ((!isFunction) && (!isDelegate))
{
if (nextToken->mToken == BfToken_This)
if (auto nextToken = BfNodeDynCast<BfTokenNode>(mVisitorPos.GetNext()))
{
MEMBER_SET(methodDeclaration, mThisToken, nextToken);
mVisitorPos.MoveNext();
if (nextToken->mToken == BfToken_This)
{
MEMBER_SET(methodDeclaration, mThisToken, nextToken);
mVisitorPos.MoveNext();
}
}
}