mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixes for large strings, multiple 'opposite' operators
This commit is contained in:
parent
1346e241db
commit
f266fe69d1
8 changed files with 110 additions and 34 deletions
|
@ -16492,8 +16492,8 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
|
|||
if (checkType == NULL)
|
||||
break;
|
||||
|
||||
bool foundExactMatch = false;
|
||||
BfOperatorDef* oppositeOperatorDef = NULL;
|
||||
bool foundExactMatch = false;
|
||||
Array<BfMethodDef*> oppositeOperatorDefs;
|
||||
|
||||
for (auto operatorDef : checkType->mTypeDef->mOperators)
|
||||
{
|
||||
|
@ -16502,7 +16502,7 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
|
|||
allowOp = true;
|
||||
|
||||
if (allowOp)
|
||||
{
|
||||
{
|
||||
foundOp = true;
|
||||
if (methodMatcher.CheckMethod(checkType, operatorDef, false))
|
||||
{
|
||||
|
@ -16512,14 +16512,17 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
|
|||
}
|
||||
}
|
||||
else if (operatorDef->mOperatorDeclaration->mBinOp == oppositeBinaryOp)
|
||||
oppositeOperatorDef = operatorDef;
|
||||
oppositeOperatorDefs.Add(operatorDef);
|
||||
}
|
||||
|
||||
if (((methodMatcher.mBestMethodDef == NULL) || (!foundExactMatch)) && (oppositeOperatorDef != NULL))
|
||||
if (((methodMatcher.mBestMethodDef == NULL) || (!foundExactMatch)) && (!oppositeOperatorDefs.IsEmpty()))
|
||||
{
|
||||
foundOp = true;
|
||||
if (methodMatcher.CheckMethod(checkType, oppositeOperatorDef, false))
|
||||
methodMatcher.mSelfType = entry.mSrcType;
|
||||
for (auto oppositeOperatorDef : oppositeOperatorDefs)
|
||||
{
|
||||
if (methodMatcher.CheckMethod(checkType, oppositeOperatorDef, false))
|
||||
methodMatcher.mSelfType = entry.mSrcType;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (methodMatcher.mBestMethodDef != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue