Daily update on 20250324-100332 by Nitload Youmu. Additional Message : Single line syntax analyzer ok, gonging on unit test of multi line, func call. Then building branch, loop, area syntax analyzer. Some of descriptors not supported.

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-24 10:03:32 +08:00
parent 148b0fed4a
commit ffd5825a05
52 changed files with 522 additions and 560 deletions
@@ -56,33 +56,36 @@ namespace StgSharp.Script.Express
public abstract class ExpElementInstanceBase : ExpNode
{
protected ExpElementInstanceBase( Token source ) : base( source ) { }
public ExpElementType ElementType
protected ExpElementInstanceBase( Token source )
: base( source )
{
get;
CodeConvertTemplate = source.Value;
}
public ExpElementType ElementType { get; }
public override ExpNode Left => Empty;
public override ExpNode Right => Empty;
public abstract string TypeName
{
get;
}
public abstract string TypeName { get; }
public static ExpElementInstanceBase CreateLiteral( Token t )
{
if( int.TryParse( t.Value, out int _int ) ) {
if( int.TryParse( t.Value, out int _int ) )
{
return new ExpIntNode( t, _int );
} else if( float.TryParse( t.Value, out float _float ) ) {
} else if( float.TryParse( t.Value, out float _float ) )
{
return new ExpRealNumberNode( t, _float );
} else if( bool.TryParse( t.Value, out bool _bool ) ) {
} else if( bool.TryParse( t.Value, out bool _bool ) )
{
return new ExpBoolNode( t, _bool );
} else if( ExpLogic.TryParse( t.Value, out ExpLogic _logic ) ) {
} else if( ExpLogic.TryParse( t.Value, out ExpLogic _logic ) )
{
return new ExpLogicValueNode( t, _logic );
} else {
} else
{
return new ExpStringNode( t, t.Value );
}
}