Daily update on 20250302-043034 by Nitload Youmu.

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-02 04:30:34 +08:00
parent b4b90da372
commit d12bbbd873
18 changed files with 257 additions and 68 deletions
@@ -42,7 +42,7 @@ namespace StgSharp.Script.Express
private ExpBaseNode _left;
private ExpBaseNode _right;
private ExpTypeSource _returnType;
private ExpInstantiableElementBase _returnType;
public ExpBinaryOperatorNode( string name ) : base( name, null! ) { }
@@ -66,7 +66,7 @@ namespace StgSharp.Script.Express
public override ExpBaseNode Right => _right;
public override IExpElementSource EqualityTypeConvert => _returnType;
public override ExpInstantiableElementBase EqualityTypeConvert => _returnType;
public static ExpBinaryOperatorNode Add(
ExpBaseNode left,
@@ -87,6 +87,23 @@ namespace StgSharp.Script.Express
};
}
public static ExpBinaryOperatorNode Assign(
ExpBaseNode left,
ExpBaseNode right )
{
if( left.EqualityTypeConvert != right.EqualityTypeConvert ) {
throw new ExpInvalidTypeException(
left.EqualityTypeConvert.Name,
right.EqualityTypeConvert.Name );
}
return new ExpBinaryOperatorNode( ExpCompile.KeyWord.Assignment )
{
_returnType = ExpTypeSource.,
_nodeFlag = ExpNodeFlag.Operator_Binary | left._nodeFlag,
CodeConvertTemplate = "{0} & {1}",
};
}
public static ExpBinaryOperatorNode Div(
ExpBaseNode left,
ExpBaseNode right )