Browse Source

Improved IsInitializerStatement

Brian Fiete 8 months ago
parent
commit
b922c486ec
1 changed files with 21 additions and 0 deletions
  1. 21 0
      IDEHelper/Compiler/BfReducer.cpp

+ 21 - 0
IDEHelper/Compiler/BfReducer.cpp

@@ -11030,6 +11030,27 @@ bool BfReducer::IsInitializerStatement(int checkIdx)
 			checkIdx = BF_MAX(checkIdx + 1, endNode);
 			continue;
 		}		
+		else if (endNode != -1)
+		{
+			auto nextNode = mVisitorPos.Get(endNode);
+			if (auto tokenNode = BfNodeDynCast<BfTokenNode>(nextNode))
+			{
+				if (tokenNode->mToken == BfToken_LParen)
+				{
+					int checkEndNode = -1;
+					if (IsTypeReference(checkNode, tokenNode->mToken, -1, &checkEndNode, &coundBeExpr))
+					{
+						if (checkEndNode == endNode)
+						{
+							// Is method call
+							return true;
+						}
+					}
+				}
+			}
+
+			
+		}
 
 		nodeCount++;
 		checkIdx++;