mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
通过Emit优化Script脚本的解释执行;出于后期更新的方向,暂时隐藏表达式节点、条件表达式节点、全局数据节点;流程图转c#代码新增对于Script脚本的支持,Script脚本现在可以原生导出为C#代码。
This commit is contained in:
@@ -12,8 +12,6 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Serein.Script
|
||||
{
|
||||
|
||||
|
||||
|
||||
public class SereinScript
|
||||
{
|
||||
@@ -83,15 +81,15 @@ namespace Serein.Script
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 转换为c#代码
|
||||
/// 转换为 C# 代码,并且附带方法信息
|
||||
/// </summary>
|
||||
/// <param name="script">脚本</param>
|
||||
/// <param name="argTypes">挂载的变量</param>
|
||||
/// <returns></returns>
|
||||
public string ConvertCSharpCode(string mehtodName, Dictionary<string, Type>? argTypes = null)
|
||||
public SereinScriptMethodInfo? ConvertCSharpCode(string mehtodName, Dictionary<string, Type>? argTypes = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(mehtodName)) return string.Empty;
|
||||
if (programNode is null) return string.Empty;
|
||||
if (string.IsNullOrWhiteSpace(mehtodName)) return null;
|
||||
if (programNode is null) return null;
|
||||
SereinScriptToCsharpScript tool = new SereinScriptToCsharpScript(TypeAnalysis);
|
||||
return tool.CompileToCSharp(mehtodName, programNode, argTypes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user