Daily update on 20250304-070522 by Nitload Youmu. Additional Message : None

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-04 07:05:23 +08:00
parent 825e68853c
commit 5d4f516a28
40 changed files with 299 additions and 233 deletions
@@ -58,7 +58,7 @@ namespace StgSharp.Script.Express
public override IExpElementSource EqualityTypeConvert => _operand.EqualityTypeConvert;
public static ExpUnaryOperatorNode UnaryNotNegation( ExpNode operand )
public static ExpUnaryOperatorNode UnaryNegation( ExpNode operand )
{
if( !operand.IsNumber ) {
throw new ExpInvalidTypeException(
@@ -73,5 +73,19 @@ namespace StgSharp.Script.Express
};
}
public static ExpUnaryOperatorNode UnaryNot( ExpNode operand )
{
if( ( operand._nodeFlag | ( ExpNodeFlag.BuiltinType_Logic | ExpNodeFlag.BuiltinType_Logic ) ) ==
0 ) {
throw new ExpInvalidTypeException(
"Bool or Logic", operand.EqualityTypeConvert.Name );
}
return new ExpUnaryOperatorNode( ExpCompile.KeyWord.NOT )
{
_nodeFlag = ExpNodeFlag.Operator_Unary | ExpNodeFlag.BuiltinType_Logic,
CodeConvertTemplate = "! {0}",
};
}
}
}