New mechanism for embedded DSLs

This commit is contained in:
2020-12-08 21:24:54 -07:00
parent 1e928e495d
commit f0bbb644b8
6 changed files with 156 additions and 4 deletions

3
src/test/cases/DSL.kiss Normal file
View 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")}])|#)

View File

@@ -0,0 +1,2 @@
goop
gloop

View 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 {}