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

Fixed double-semicolon requirement on field dtors with compound stmt

This commit is contained in:
Brian Fiete 2021-07-21 14:05:51 -07:00
parent 85a2a089f4
commit 288b99cc3c

View file

@ -5777,11 +5777,17 @@ BfFieldDeclaration* BfReducer::CreateFieldDeclaration(BfTokenNode* tokenNode, Bf
return fieldDeclaration;
}
bool hasSemicolon = false;
auto fieldDtor = CreateFieldDtorDeclaration(fieldDeclaration);
if (fieldDtor != NULL)
{
fieldDeclaration->mFieldDtor = fieldDtor;
if (fieldDtor->mBody != NULL)
hasSemicolon = !fieldDtor->mBody->IsMissingSemicolon();
}
if (ExpectTokenAfter(fieldDeclaration, BfToken_Semicolon, BfToken_Comma) != NULL)
if ((!hasSemicolon) && (ExpectTokenAfter(fieldDeclaration, BfToken_Semicolon, BfToken_Comma) != NULL))
{
// This gets taken later
mVisitorPos.mReadPos--;