1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 06:44:10 +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,6 +7568,8 @@ BfInitializerExpression* BfReducer::TryCreateInitializerExpression(BfAstNode* ta
bool foundComma = false; bool foundComma = false;
node = mVisitorPos.GetCurrent(); node = mVisitorPos.GetCurrent();
if (node != NULL)
{
if (auto tokenNode = BfNodeDynCast<BfTokenNode>(node)) if (auto tokenNode = BfNodeDynCast<BfTokenNode>(node))
{ {
if (tokenNode->mToken == BfToken_Comma) if (tokenNode->mToken == BfToken_Comma)
@ -7577,6 +7579,10 @@ BfInitializerExpression* BfReducer::TryCreateInitializerExpression(BfAstNode* ta
isDone = !mVisitorPos.MoveNext(); isDone = !mVisitorPos.MoveNext();
} }
} }
if (!foundComma)
Fail("Expected ','", node);
}
} }
} }