From 827a9242ae7cc266e7fbbd1ca460ece0e1654fa8 Mon Sep 17 00:00:00 2001
From: fengjiayi <12821976+ning_xi@user.noreply.gitee.com>
Date: Thu, 31 Jul 2025 11:21:49 +0800
Subject: [PATCH] =?UTF-8?q?1.=20Script=E9=A1=B9=E7=9B=AE=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E4=BA=86=E6=95=B0=E7=BB=84=E8=A1=A8=E8=BE=BE=E5=BC=8F=E7=9A=84?=
=?UTF-8?q?=E6=94=AF=E6=8C=81=202.=20EmitHelper=E6=B7=BB=E5=8A=A0=E4=BA=86?=
=?UTF-8?q?=E6=95=B0=E7=BB=84=E5=88=9B=E5=BB=BA=E5=A7=94=E6=89=98=E7=9A=84?=
=?UTF-8?q?=E6=9E=84=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Library/FlowNode/DelegateDetails.cs | 31 ++++++---
Library/Utils/EmitHelper.cs | 46 ++++++++++---
Library/Utils/TypeHelper.cs | 49 +++++++++++++-
Serein.Script/Node/ArrayDefintionNode.cs | 27 ++++++++
Serein.Script/SereinScriptInterpreter.cs | 33 +++++++++
Serein.Script/SereinScriptLexer.cs | 2 +-
Serein.Script/SereinScriptParser.cs | 82 +++++++++++++----------
Serein.Script/SereinScriptTypeAnalysis.cs | 41 +++++++++++-
Workbench/App.xaml.cs | 47 -------------
Workbench/Serein.Workbench.csproj | 1 +
10 files changed, 254 insertions(+), 105 deletions(-)
create mode 100644 Serein.Script/Node/ArrayDefintionNode.cs
diff --git a/Library/FlowNode/DelegateDetails.cs b/Library/FlowNode/DelegateDetails.cs
index eb34fbe..23f6049 100644
--- a/Library/FlowNode/DelegateDetails.cs
+++ b/Library/FlowNode/DelegateDetails.cs
@@ -1,10 +1,6 @@
using Serein.Library.Utils;
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Text;
using System.Threading.Tasks;
using static Serein.Library.Utils.EmitHelper;
@@ -54,7 +50,11 @@ namespace Serein.Library
///
/// 集合赋值
///
- CollectionSetter
+ CollectionSetter,
+ ///
+ /// 数组创建
+ ///
+ ArrayCreate,
}
///
@@ -172,6 +172,12 @@ namespace Serein.Library
this.emitType = EmitType.CollectionGetter;
collectionGetter = EmitHelper.CreateCollectionGetter(type);
}
+ else if (emitType == EmitType.ArrayCreate)
+ {
+ Func func = EmitHelper.CreateArrayFactory(type);
+ this.arrayCreatefunc = func;
+ this.emitType = EmitType.ArrayCreate;
+ }
else
{
throw new NotSupportedException("错误的构建类型");
@@ -179,8 +185,8 @@ namespace Serein.Library
}
+
-
private Func