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
+6 -7
View File
@@ -42,14 +42,13 @@ namespace StgSharp.Script.Express
public sealed class ExpConstantCollectionSource : ExpImmutableElement
{
private Dictionary<string, ExpElementInstanceBase> _constants;
private Dictionary<string, ExpElementInstance> _constants;
private IScriptSourceProvider _sourceProvider;
public ExpConstantCollectionSource( IScriptSourceProvider sourceProvider )
{
_sourceProvider = sourceProvider;
_constants = new Dictionary<string, ExpElementInstanceBase>(
ExpressCompile.Multiplexer );
_constants = new Dictionary<string, ExpElementInstance>( ExpressCompile.Multiplexer );
}
public override ExpElementType ElementType => ExpElementType.Const;
@@ -74,20 +73,20 @@ namespace StgSharp.Script.Express
if( _constants.Count == 0 ) {
return null!;
}
if( _constants.TryGetValue( str, out ExpElementInstanceBase? token ) ) {
if( _constants.TryGetValue( str, out ExpElementInstance? token ) ) {
return token;
}
return null!;
}
public bool TryGetConstant( string name, out ExpElementInstanceBase instance )
public bool TryGetConstant( string name, out ExpElementInstance instance )
{
return _constants.TryGetValue( name, out instance );
}
public override bool TryGetMember( string name, out ExpNode memberNode )
{
if( _constants.TryGetValue( name, out ExpElementInstanceBase? node ) )
if( _constants.TryGetValue( name, out ExpElementInstance? node ) )
{
memberNode = node;
return true;
@@ -96,7 +95,7 @@ namespace StgSharp.Script.Express
return false;
}
internal void AddConstant( string name, ExpElementInstanceBase value )
internal void AddConstant( string name, ExpElementInstance value )
{
_constants.Add( name, value );
}