2017-07-18 54 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); 
相關問題