Daily update on 20250411-013955 by Nitload Youmu. Additional Message : none

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-04-11 01:39:55 +08:00
parent a4b2e9a805
commit 2692495dc8
11 changed files with 225 additions and 12 deletions
@@ -28,6 +28,8 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using Microsoft.CodeAnalysis.CSharp;
using System;
using System.Collections.Generic;
using System.Data.Common;
@@ -89,10 +91,40 @@ namespace StgSharp.Script.Express
};
}
public static ExpBinaryOperatorNode ConvertElement( Token source, ExpNode left, ExpNode right )
public static ExpBinaryOperatorNode CompareInstanceEqual(
Token source,
ExpNode left,
ExpNode right )
{
return new ExpBinaryOperatorNode( source, left, right )
{
_returnType = ExpressCompile.ExpBool,
_nodeFlag = ExpNodeFlag.BuiltinType_Boolean | ExpNodeFlag.Operator_Binary,
CodeConvertTemplate = "!ReferenceEquals({0}, {1})",
};
}
public static ExpBinaryOperatorNode CompareInstanceNotEqual(
Token nsource,
ExpNode left,
ExpNode right )
{
return new ExpBinaryOperatorNode( nsource, left, right )
{
_returnType = ExpressCompile.ExpBool,
_nodeFlag = ExpNodeFlag.BuiltinType_Boolean | ExpNodeFlag.Operator_Binary,
CodeConvertTemplate = "ReferenceEquals({0}, {1})",
};
}
public static ExpBinaryOperatorNode ConvertElement(
Token source,
ExpNode left,
ExpNode right )
{
if( right is not ExpMetaRefNode metaref ) {
throw new ExpInvalidTypeException( "<source of element>", right.EqualityTypeConvert.Name );
throw new ExpInvalidTypeException(
"<source of element>", right.EqualityTypeConvert.Name );
}
return new ExpBinaryOperatorNode( source, left, right )
{