AsyncEmbeddedScript cache hscript version of instruction

This commit is contained in:
2023-07-18 06:30:18 -06:00
parent 560bbc54a9
commit 763c36dcc9

View File

@@ -14,6 +14,7 @@ using tink.MacroApi;
#end
import kiss.Kiss;
using kiss.Kiss;
import kiss.ReaderExp;
import kiss.Prelude;
import kiss.cloner.Cloner;
@@ -337,8 +338,10 @@ class AsyncEmbeddedScript {
$expr;
};
// If the expression didn't change the KissState when macroExpanding, it can be cached
if (!stateChanged)
if (!stateChanged) {
var expr = Kiss.readerExpToHaxeExpr(nextExp, k.forHScript());
cache[cacheKey] = expr.toString();
}
commandList.push(c.expr.withMacroPosOf(nextExp));
}