2017-07-18 66 views
2

我正在寻找一种解决方案,允许在一个HTML页面中多次运行相同的编译DSL。StaticCompiler - 在一个HTML页面中几次运行相同的应用程序

现在,我使用XMLReader并在运行时使用预处理器更改上下文名称。但是StaticCompiler更强大。

StaticCompiler的问题,我们必须在编译时将上下文名称设置为常量,并且上下文名称将用作类路径,并且不会在运行时编辑而不会破坏所有内容。

是一个静态编译器沙盒应用程序的解决方案?

相关的问题:https://github.com/DoclerLabs/hexMachina/issues/214

回答

0

是与hexmachina 0.28.0支持:https://github.com/DoclerLabs/hexMachina/releases/tag/0.28.0

var code = StaticFlowCompiler.compile(assembler, "context/flow/dsl.flow"); 
code.execute(); 

var clonedCode = code.clone(new ApplicationAssembler()); 
clonedCode.execute(); 

Assert.isInstanceOf(code.locator.instance, MockClassWithoutArgument); 
Assert.isInstanceOf(clonedCode.locator.instance, MockClassWithoutArgument); 

Assert.notEquals(code.locator.instance, clonedCode.locator.instance); 
相关问题