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:
parent
7e139f5d7c
commit
b916273a97
5 changed files with 95 additions and 19 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue