in debug, AsyncEmbeddedScript traces the kiss expression of each command before running it

This commit is contained in:
2021-11-01 19:30:11 -04:00
parent 7127b0b39c
commit c8498e86fe

View File

@@ -62,8 +62,13 @@ class AsyncEmbeddedScript {
scriptFile = Path.join([loadingDirectory, scriptFile]);
k.fieldList = [];
Reader.readAndProcess(Stream.fromFile(scriptFile), k, (nextExp) -> {
var exprString = Reader.toString(nextExp.def);
var expr = Kiss.readerExpToHaxeExpr(nextExp, k);
#if debug
expr = macro { trace($v{exprString}); $expr; };
#end
if (expr != null) {
commandList.push(macro function(self, cc) {
$expr;