Daily update on 20250305-052510 by Nitload Youmu. Additional Message : message

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-05 05:25:11 +08:00
parent 5d4f516a28
commit c5777f4bfe
8 changed files with 171 additions and 69 deletions
@@ -58,7 +58,7 @@ namespace StgSharp.Script.Express
public override IExpElementSource EqualityTypeConvert => _operand.EqualityTypeConvert;
public static ExpUnaryOperatorNode UnaryNegation( ExpNode operand )
public static ExpUnaryOperatorNode UnaryMinus( ExpNode operand )
{
if( !operand.IsNumber ) {
throw new ExpInvalidTypeException(
@@ -87,5 +87,20 @@ namespace StgSharp.Script.Express
};
}
public static ExpUnaryOperatorNode UnaryPlus( ExpNode operand )
{
if( !operand.IsNumber ) {
throw new ExpInvalidTypeException(
"Number", operand.EqualityTypeConvert.Name );
}
bool isFloat =
( operand._nodeFlag | ExpNodeFlag.BuiltinType_Float ) == 0;
return new ExpUnaryOperatorNode( ExpCompile.KeyWord.SUB )
{
_nodeFlag = ExpNodeFlag.Operator_Unary | ExpNodeFlag.BuiltinType_Number,
CodeConvertTemplate = "+ {0}",
};
}
}
}