KissInterp

This commit is contained in:
2021-05-18 17:39:11 -06:00
parent 010b171c24
commit 89f30882cd
4 changed files with 19 additions and 0 deletions

View File

@@ -18,6 +18,9 @@ using kiss.Helpers;
using kiss.Kiss;
using StringTools;
/**
* Compile-time helper functions for Kiss. Don't import or reference these at runtime.
*/
class Helpers {
public static function macroPos(exp:ReaderExp) {
var kissPos = exp.pos;

View File

@@ -0,0 +1,14 @@
package kiss;
import hscript.Interp;
class KissInterp extends Interp {
// TODO standardize this with KissConfig.prepareInterp
function new() {
super();
variables.set("Prelude", Prelude);
variables.set("Lambda", Lambda);
variables.set("Std", Std);
}
}

View File

@@ -301,6 +301,7 @@ class Prelude {
kissProcess = new Process("haxelib", ["run", "kiss", "--hscript"]);
kissProcess.stdin.writeString('${kissStr.replace("\n", " ")}\n');
try {
var output = kissProcess.stdout.readLine();
if (output.startsWith(">>> ")) {

View File

@@ -210,6 +210,7 @@
(registerCommand "Run a keyboard shortcut command" runKeyboardShortcut)
(registerCommand "Evaluate and print a Kiss expression" evalAndPrint))
// TODO standardize this with KissInterp
(defun :Void prepareInterp []
(interp.variables.set "kiss"
(object