1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-18 16:10:26 +02:00

Fixed IsMissingSemicolon and IsExpression for defers

This commit is contained in:
Brian Fiete 2022-05-27 07:56:56 -07:00
parent e3b3089623
commit 23d8e8993b

View file

@ -767,7 +767,10 @@ BfAstNode* Beefy::BfNodeToNonTemporary(BfAstNode* node)
bool BfAstNode::IsMissingSemicolon() bool BfAstNode::IsMissingSemicolon()
{ {
if (auto deferStmt = BfNodeDynCast<BfDeferStatement>(this)) if (auto deferStmt = BfNodeDynCast<BfDeferStatement>(this))
return BfNodeDynCastExact<BfBlock>(deferStmt->mTargetNode) == NULL; {
if (BfNodeIsExact<BfBlock>(deferStmt->mTargetNode))
return false;
}
if (auto stmt = BfNodeDynCast<BfCompoundStatement>(this)) if (auto stmt = BfNodeDynCast<BfCompoundStatement>(this))
{ {
if (auto repeatStmt = BfNodeDynCast<BfRepeatStatement>(this)) if (auto repeatStmt = BfNodeDynCast<BfRepeatStatement>(this))
@ -790,7 +793,10 @@ bool BfAstNode::IsMissingSemicolon()
bool BfAstNode::IsExpression() bool BfAstNode::IsExpression()
{ {
if (auto deferStmt = BfNodeDynCast<BfDeferStatement>(this)) if (auto deferStmt = BfNodeDynCast<BfDeferStatement>(this))
return BfNodeDynCastExact<BfBlock>(deferStmt->mTargetNode) == NULL; {
if (BfNodeIsExact<BfBlock>(deferStmt->mTargetNode))
return false;
}
if (auto block = BfNodeDynCast<BfBlock>(this)) if (auto block = BfNodeDynCast<BfBlock>(this))
{ {
if (block->mChildArr.mSize == 0) if (block->mChildArr.mSize == 0)