Daily update on 20250328-131548 by Nitload Youmu. Additional Message : IF branch can be full functionally compiled. Next will be CASE_OF branch

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-28 13:15:48 +08:00
parent 36b6ad5a52
commit 17a226c206
18 changed files with 1069 additions and 74 deletions
@@ -43,24 +43,39 @@ namespace StgSharp.Script.Express
private ExpNode _rule;
private ExpNode _trueOpBegin ;
public ExpIfNode( Token source, ExpNode rule, ExpNode trueOpBegin )
: base( source )
{
_rule = rule;
_trueOpBegin = trueOpBegin;
CodeConvertTemplate = ExpressCompile.PoolString(
"""
if ( {0} )
{
{1}
}
""" );
}
public ExpIfNode(
Token source,
ExpSchema context,
ExpNode rule,
ExpNode rootOperationIfTrue,
ExpNode rootOperationIfFalse )
Token source,
ExpNode rule,
ExpNode rootOperationIfTrue,
ExpNode rootOperationIfFalse )
: base( source )
{
_rule = rule;
_trueOpBegin = rootOperationIfFalse;
_falseOpBegin = rootOperationIfFalse;
CodeConvertTemplate = """
if( {0} ) {
CodeConvertTemplate = ExpressCompile.PoolString(
"""
if( {0} )
{
{1}
} else {
{2}
}
""";
""" );
}
public override ExpNode Left => _trueOpBegin;