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
+6 -10
View File
@@ -45,8 +45,7 @@ namespace StgSharp.Script.Express
private Dictionary<string, ExpElementInstanceBase> _constants;
private IScriptSourceProvider _sourceProvider;
public ExpConstantCollectionSource(
IScriptSourceProvider sourceProvider )
public ExpConstantCollectionSource( IScriptSourceProvider sourceProvider )
{
_sourceProvider = sourceProvider;
_constants = new Dictionary<string, ExpElementInstanceBase>(
@@ -59,7 +58,7 @@ namespace StgSharp.Script.Express
public override string Name
{
get => ExpressCompile.KeyWord.Constant;
get => ExpressCompile.Keyword.Constant;
}
public override void Analyse()
@@ -75,24 +74,21 @@ namespace StgSharp.Script.Express
if( _constants.Count == 0 ) {
return null!;
}
if( _constants.TryGetValue( str,
out ExpElementInstanceBase? token ) ) {
if( _constants.TryGetValue( str, out ExpElementInstanceBase? token ) ) {
return token;
}
return null!;
}
public bool TryGetConstant(
string name,
out ExpElementInstanceBase instance )
public bool TryGetConstant( string name, out ExpElementInstanceBase 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 ExpElementInstanceBase? node ) )
{
memberNode = node;
return true;
}