KissInterp
This commit is contained in:
@@ -18,6 +18,9 @@ using kiss.Helpers;
|
|||||||
using kiss.Kiss;
|
using kiss.Kiss;
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compile-time helper functions for Kiss. Don't import or reference these at runtime.
|
||||||
|
*/
|
||||||
class Helpers {
|
class Helpers {
|
||||||
public static function macroPos(exp:ReaderExp) {
|
public static function macroPos(exp:ReaderExp) {
|
||||||
var kissPos = exp.pos;
|
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 = new Process("haxelib", ["run", "kiss", "--hscript"]);
|
||||||
|
|
||||||
kissProcess.stdin.writeString('${kissStr.replace("\n", " ")}\n');
|
kissProcess.stdin.writeString('${kissStr.replace("\n", " ")}\n');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var output = kissProcess.stdout.readLine();
|
var output = kissProcess.stdout.readLine();
|
||||||
if (output.startsWith(">>> ")) {
|
if (output.startsWith(">>> ")) {
|
||||||
|
|||||||
@@ -210,6 +210,7 @@
|
|||||||
(registerCommand "Run a keyboard shortcut command" runKeyboardShortcut)
|
(registerCommand "Run a keyboard shortcut command" runKeyboardShortcut)
|
||||||
(registerCommand "Evaluate and print a Kiss expression" evalAndPrint))
|
(registerCommand "Evaluate and print a Kiss expression" evalAndPrint))
|
||||||
|
|
||||||
|
// TODO standardize this with KissInterp
|
||||||
(defun :Void prepareInterp []
|
(defun :Void prepareInterp []
|
||||||
(interp.variables.set "kiss"
|
(interp.variables.set "kiss"
|
||||||
(object
|
(object
|
||||||
|
|||||||
Reference in New Issue
Block a user