From b510cefd6246774b86eab0e133980b356b33ce1b Mon Sep 17 00:00:00 2001 From: Nop Assistant Date: Mon, 23 Sep 2024 14:33:26 +0000 Subject: [PATCH] chore: deploy docs of project Nop Entropy via GitHub Actions --- projects/nop-entropy/docs/dev-guide/xlang/xpl/index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/nop-entropy/docs/dev-guide/xlang/xpl/index.html b/projects/nop-entropy/docs/dev-guide/xlang/xpl/index.html index 321b595..d89054a 100644 --- a/projects/nop-entropy/docs/dev-guide/xlang/xpl/index.html +++ b/projects/nop-entropy/docs/dev-guide/xlang/xpl/index.html @@ -1312,6 +1312,12 @@

<c:script lang="groovy">
代码
</c:script>
+

XLang平台内置了lang=java支持, 通过args指定从上下文中获取哪些变量,在脚本代码中可以直接访问这些变量。

+
<c:unit>
<c:script>
let x = 1;
let y = 2;
</c:script>

<c:script lang="java" args="x:int,y:int" returnType="int">
return x + y;
</c:script>
</c:unit>
+ +

可以通过ScriptCompilerRegistry注册更多的脚本引擎支持。脚本引擎接口如下:

+
public interface IScriptCompiler {
IEvalFunction compile(SourceLocation loc, String text,
List<? extends IFunctionArgument> args, IGenericType returnType,
IXLangCompileScope scope);
}
+

编译期