KissInterp
This commit is contained in:
@@ -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;
|
||||
|
14
kiss/src/kiss/KissInterp.hx
Normal file
14
kiss/src/kiss/KissInterp.hx
Normal 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);
|
||||
}
|
||||
}
|
@@ -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(">>> ")) {
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user