mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed issue where we allowed multiple semicolons at end of if statements
This commit is contained in:
parent
76cb117e1f
commit
2c30afbfcf
4 changed files with 31 additions and 8 deletions
|
@ -738,6 +738,16 @@ bool BfAstNode::IsMissingSemicolon()
|
|||
{
|
||||
if (auto deferStmt = BfNodeDynCast<BfDeferStatement>(this))
|
||||
return BfNodeDynCastExact<BfBlock>(deferStmt->mTargetNode) == NULL;
|
||||
if (auto stmt = BfNodeDynCast<BfCompoundStatement>(this))
|
||||
{
|
||||
if (auto repeatStmt = BfNodeDynCast<BfRepeatStatement>(this))
|
||||
{
|
||||
if (repeatStmt->mWhileToken == NULL)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
if (auto stmt = BfNodeDynCast<BfStatement>(this))
|
||||
return stmt->mTrailingSemicolon == NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue