private ushort GetEqualityArgumentOP(ushort normalOpcode)
{
// The opccode of global references and parameter references as part of equality checks is 0, unless the first argument of the comparison is a call.
// Find the last generated equality function name.
for(int i = _expressions.Count -1; i >= 0; i--)
{
if(_expressions[i].Type == ScriptExpressionType.Expression
&& _expressions[i].ReturnType == _opcodes.GetTypeInfo("function_name").Opcode
&& _expressions[i - 1].Type == ScriptExpressionType.Group)
{
var funcInfo = _opcodes.GetFunctionInfo(_expressions[i].Opcode);
if (funcInfo.Group == "Equality" || funcInfo.Group == "Inequality")
{
if(i == _expressions.Count - 1)
{
return 0;
}
else if(_expressions[i + 1].Type != ScriptExpressionType.Expression)
{
return normalOpcode;
}
return 0;
}
}
}
return 0;
}