Daily update on 20250323-151439 by Nitload Youmu. Additional Message : none

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-23 15:14:39 +08:00
parent 528d0c5462
commit 148b0fed4a
29 changed files with 313 additions and 178 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ namespace StgSharp.Script.Express
{
_sourceProvider = sourceProvider;
_constants = new Dictionary<string, ExpElementInstanceBase>(
ExpCompile.Multiplexer );
ExpressCompile.Multiplexer );
}
public override ExpElementType ElementType => ExpElementType.Const;
@@ -59,7 +59,7 @@ namespace StgSharp.Script.Express
public override string Name
{
get => ExpCompile.KeyWord.Constant;
get => ExpressCompile.KeyWord.Constant;
}
public override void Analyse()
@@ -48,6 +48,18 @@ namespace StgSharp.Script.Express
_transmitter = transmitter;
}
public Dictionary<string, ExpElementInstanceBase> FuncParams
{
get;
init;
} = new Dictionary<string, ExpElementInstanceBase>();
public Dictionary<string, ExpElementInstanceBase> LocalVariables
{
get;
init;
} = new Dictionary<string, ExpElementInstanceBase>();
public override ExpElementType ElementType => ExpElementType.Function;
public override IScriptSourceProvider SourceProvider => _transmitter;
@@ -77,6 +89,16 @@ namespace StgSharp.Script.Express
public override bool TryGetMember( string name, out ExpNode memberNode )
{
if( FuncParams.TryGetValue(
name, out ExpElementInstanceBase? param ) ) {
memberNode = param;
return true;
}
if( LocalVariables.TryGetValue(
name, out ExpElementInstanceBase? variable ) ) {
memberNode = variable;
return true;
}
memberNode = ExpNode.Empty;
return false;
}