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

Added an error with a missing comma inside an initializer expr

This commit is contained in:
Brian Fiete 2023-03-14 07:19:21 -07:00
parent 723010fd9d
commit b6219ce80f

View file

@ -7568,14 +7568,20 @@ BfInitializerExpression* BfReducer::TryCreateInitializerExpression(BfAstNode* ta
bool foundComma = false;
node = mVisitorPos.GetCurrent();
if (auto tokenNode = BfNodeDynCast<BfTokenNode>(node))
if (node != NULL)
{
if (tokenNode->mToken == BfToken_Comma)
if (auto tokenNode = BfNodeDynCast<BfTokenNode>(node))
{
foundComma = true;
commas.Add(tokenNode);
isDone = !mVisitorPos.MoveNext();
if (tokenNode->mToken == BfToken_Comma)
{
foundComma = true;
commas.Add(tokenNode);
isDone = !mVisitorPos.MoveNext();
}
}
if (!foundComma)
Fail("Expected ','", node);
}
}
}