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

Improved ambiguous (a*b, c*d) tuple parse

This commit is contained in:
Brian Fiete 2022-06-24 09:25:43 -07:00
parent 7063959762
commit 48635c1939
5 changed files with 93 additions and 12 deletions

View file

@ -1598,14 +1598,6 @@ BfExpression* BfReducer::CreateExpression(BfAstNode* node, CreateExprFlags creat
if (isTuple)
isLocalVariable = true;
}
else if (endingToken == BfToken_Star)
{
// Check spacing for "a* b" to determine if it's a pointer definition or a multiply
auto beforeStarNode = mVisitorPos.Get(outEndNode - 2);
if ((endingTokenNode->GetSrcStart() == beforeStarNode->GetSrcEnd()) &&
(identifierNode->GetSrcStart() > endingTokenNode->GetSrcEnd()))
isLocalVariable = true;
}
else if ((endingToken != BfToken_Star) && (endingToken != BfToken_Question))
isLocalVariable = true;
}