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

Expect semicolon after expression body property

This commit is contained in:
Fusioon 2025-03-09 02:48:39 +01:00
parent 926259e121
commit 865e70d73a
2 changed files with 5 additions and 0 deletions

View file

@ -2839,6 +2839,7 @@ void BfPrinter::Visit(BfPropertyDeclaration* propertyDeclaration)
for (auto method : propertyDeclaration->mMethods) for (auto method : propertyDeclaration->mMethods)
{ {
QueueVisitChild(method->mBody); QueueVisitChild(method->mBody);
QueueVisitChild(method->mEndSemicolon);
} }
} }

View file

@ -7769,6 +7769,10 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, bool declStarted, int dept
{ {
MEMBER_SET(method, mBody, expr); MEMBER_SET(method, mBody, expr);
propertyDeclaration->SetSrcEnd(expr->GetSrcEnd()); propertyDeclaration->SetSrcEnd(expr->GetSrcEnd());
auto endSemicolon = ExpectTokenAfter(expr, BfToken_Semicolon);
if (endSemicolon != NULL)
MEMBER_SET(method, mEndSemicolon, endSemicolon);
} }
methods.Add(method); methods.Add(method);