mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Handle cast of function bind
This commit is contained in:
parent
4ecd7861d6
commit
578e513196
1 changed files with 9 additions and 1 deletions
|
@ -1978,10 +1978,18 @@ BfExpression* BfReducer::CreateExpression(BfAstNode* node, CreateExprFlags creat
|
|||
endNode = mVisitorPos.Get(endNodeIdx);
|
||||
if (auto endToken = BfNodeDynCast<BfTokenNode>(endNode))
|
||||
{
|
||||
bool isLambda = false;
|
||||
if (endToken->GetToken() == BfToken_FatArrow)
|
||||
{
|
||||
return CreateLambdaBindExpression(NULL, tokenNode);
|
||||
isLambda = true;
|
||||
if (auto innerToken = BfNodeDynCast<BfTokenNode>(mVisitorPos.GetNext()))
|
||||
{
|
||||
// Specifically we're looking for a (function ...) cast, but any token here means it's not a lambda
|
||||
isLambda = false;
|
||||
}
|
||||
}
|
||||
if (isLambda)
|
||||
return CreateLambdaBindExpression(NULL, tokenNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue