Daily update on 20250325-164701 by Nitload Youmu. Additional Message : Lineaar line and multi-linear line compile full function. String literal parsing improve.

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-25 16:47:02 +08:00
parent ffd5825a05
commit 469cb88472
29 changed files with 414 additions and 273 deletions
@@ -39,23 +39,13 @@ namespace StgSharp.Script.Express
public static partial class ExpressCompile
{
public static ExpTypeSource ExpInt
{
get;
private set;
}
public static ExpTypeSource ExpInt { get; private set; }
public static ExpTypeSource ExpReal
{
get;
private set;
}
public static ExpTypeSource ExpReal { get; private set; }
public static ExpTypeSource ExpBool
{
get;
private set;
}
public static ExpTypeSource ExpBool { get; private set; }
public static ExpTypeSource ExpString { get; private set; }
}
}
@@ -59,7 +59,7 @@ namespace StgSharp.Script.Express
return;
}
public override bool TryGetConst( string name, out ExpElementInstanceBase c )
public override bool TryGetConst( string name, out ExpElementInstance c )
{
return ConstDict.TryGetValue( name, out c );
}
@@ -118,11 +118,11 @@ namespace StgSharp.Script.Express
Multiplexer ).ToFrozenDictionary();
ConstDict = new Dictionary<string, ExpElementInstanceBase>( Multiplexer ) {
ConstDict = new Dictionary<string, ExpElementInstance>( Multiplexer ) {
{ PoolString( "PI" ), new ExpRealNumberNode(
new Token( PoolString( "PI" ), -1, -1, TokenFlag.Number ), MathF.PI ) },
new Token( PoolString( "PI" ), -1, -1, TokenFlag.Number ), MathF.PI, true ) },
{ PoolString( "E" ), new ExpRealNumberNode(
new Token( PoolString( "E" ), -1, -1, TokenFlag.Number ), MathF.E ) },
new Token( PoolString( "E" ), -1, -1, TokenFlag.Number ), MathF.E, true ) },
}.ToFrozenDictionary();
}
@@ -47,7 +47,7 @@ namespace StgSharp.Script.Express
private static string[] _operatorsWithLetter;
private static ConcurrentStringHashMultiplexer _multiplexer;
private static FrozenDictionary<string, ExpElementInstanceBase> _builtinConst;
private static FrozenDictionary<string, ExpElementInstance> _builtinConst;
private static FrozenDictionary<string, ExpTypeSource> _builtinType;
private static FrozenDictionary<string, ExpBinaryOperatorNode> _operators;
private static StringPool _compileStringCache,_emptyCache;
@@ -112,6 +112,12 @@ namespace StgSharp.Script.Express
PoolString( Keyword.Boolean ), out ExpTypeSource? _expBool );
ExpBool = _expBool;
ExpSchema_Builtin.Only
.TryGetType(
PoolString( Keyword.Boolean ), out ExpTypeSource? _expString );
ExpString = _expString;
_emptyCache = new StringPool();
/*
foreach( string str in _compileStringCache ) {