This commit is contained in:
Nitload
2025-08-25 09:50:30 +08:00
parent bd0e31e922
commit 1359ff4ecc
1630 changed files with 738486 additions and 2399 deletions
@@ -44,16 +44,14 @@ using System.Xml.Schema;
using ExpKeyword = StgSharp.Script.Express.ExpressCompile.Keyword;
namespace StgSharp.Model.Step
namespace StgSharp.Modeling.Step
{
internal partial class StepExpSyntaxAnalyzer
{
private static Regex _entityTypeCheckPattern = GetEntityTypeCheckPattern();
private StepDependencyDetector _dependencyDetector = new StepDependencyDetector();
[GeneratedRegex( @"^[A-Z0-9_]+$", RegexOptions.Singleline )]
[GeneratedRegex( @"^[A-Z_]+$", RegexOptions.Singleline )]
private static partial Regex GetEntityTypeCheckPattern();
private bool IsSeparatorMatch( Token leftSeparator, Token rightSeparator )
@@ -149,16 +147,10 @@ namespace StgSharp.Model.Step
goto case 1;
case 1:
_cache.PopOperand( out _, out ExpSyntaxNode? statement );
if( t.Value == ";" )
{
StepEntityDefineSequence sequence = new StepEntityDefineSequence(
statement, _dependencyDetector.ExportAllDependencies() );
StepEntityInitStatements.Enqueue( sequence );
} else
{
_cache.StatementsInDepth.Push( statement );
_cache.StatementsInDepth.Push( statement );
if( t.Value == ";" ) {
StepEntityInitStatements.Enqueue( statement );
}
return true;
default:
ExpInvalidSyntaxException.ThrowNoOperator( t );
@@ -221,12 +213,6 @@ namespace StgSharp.Model.Step
{
switch( t.Value )
{
case "$":
_cache.PushOperand( StepEntityInstanceNode.RegisterNull( t ) );
return true;
case "*":
_cache.PushOperand( StepEntityInstanceNode.RegisterRuntimeInference( t ) );
return true;
case ExpKeyword.E:
_cache.PushOperand( new ExpRealNumberNode( t, MathF.E, true ) );
return true;
@@ -260,15 +246,8 @@ namespace StgSharp.Model.Step
private bool TryParseFunction( Token t )
{
if( _entityTypeCheckPattern.IsMatch( t.Value ) )
{
if( _cache.PeekOperator().Flag == TokenFlag.Member )
{
Token op = _cache.PopOperator();
ConvertAndPushOneOperator( op );
}
if( _entityTypeCheckPattern.IsMatch( t.Value ) ) {
_cache.PushOperator( t );
return true;
}
return false;
}
@@ -277,11 +256,7 @@ namespace StgSharp.Model.Step
{
if( t.Value[ 0 ] == '#' )
{
StepEntityInstanceNode node = StepEntityInstanceNode.Register( t );
if( t.Column != 0 ) {
_dependencyDetector.AddDependency( node );
}
_cache.PushOperand( node );
_cache.PushOperand( StepEntityInstanceNode.Register( t ) );
return true;
}
return false;