Daily update on 20250410-000303 by Nitload Youmu. Additional Message : adding support to type operation, to operate

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-04-10 00:03:03 +08:00
parent 7b7b5ee475
commit a4b2e9a805
7 changed files with 521 additions and 2 deletions
@@ -89,6 +89,23 @@ namespace StgSharp.Script.Express
};
}
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 );
}
return new ExpBinaryOperatorNode( source, left, right )
{
_returnType = metaref.SourceRef,
_nodeFlag = ExpNodeFlag.Operator_Binary,
/*
* 0. instance to convert
* 1. target type
*/
CodeConvertTemplate = @"({0} as {1})"
};
}
public static ExpBinaryOperatorNode Div( Token source, ExpNode left, ExpNode right )
{
if( !left.IsNumber && !right.IsNumber ) {