New mechanism for embedded DSLs
This commit is contained in:
3
src/test/cases/DSL.kiss
Normal file
3
src/test/cases/DSL.kiss
Normal file
@@ -0,0 +1,3 @@
|
||||
// TODO make a better position reification scheme here
|
||||
(defreadermacro "goop" [stream] #|ReaderExp.CallExp({pos: {file: "bleh", line: 1, column: 1, absoluteChar: 1}, def: ReaderExp.Symbol("Assert.isTrue")}, [{pos: {file: "bleh", line: 1, column: 1, absoluteChar: 1}, def: ReaderExp.Symbol("true")}])|#)
|
||||
(defreadermacro "gloop" [stream] #|ReaderExp.CallExp({pos: {file: "bleh", line: 1, column: 1, absoluteChar: 1}, def: ReaderExp.Symbol("Assert.isFalse")}, [{pos: {file: "bleh", line: 1, column: 1, absoluteChar: 1}, def: ReaderExp.Symbol("false")}])|#)
|
2
src/test/cases/DSLScript.dsl
Normal file
2
src/test/cases/DSLScript.dsl
Normal file
@@ -0,0 +1,2 @@
|
||||
goop
|
||||
gloop
|
15
src/test/cases/DSLTestCase.hx
Normal file
15
src/test/cases/DSLTestCase.hx
Normal file
@@ -0,0 +1,15 @@
|
||||
package test.cases;
|
||||
|
||||
import utest.Test;
|
||||
import utest.Assert;
|
||||
import kiss.EmbeddedScript;
|
||||
import kiss.Prelude;
|
||||
|
||||
class DSLTestCase extends Test {
|
||||
function testScript() {
|
||||
new DSLScript().run();
|
||||
}
|
||||
}
|
||||
|
||||
@:build(kiss.EmbeddedScript.build("kiss/src/test/cases/DSL.kiss", "kiss/src/test/cases/DSLScript.dsl"))
|
||||
class DSLScript extends EmbeddedScript {}
|
Reference in New Issue
Block a user