Attach better position info to embeddedscript commands

This commit is contained in:
2023-03-03 12:03:18 -07:00
parent ef51ac0f80
commit c57636714a
2 changed files with 7 additions and 4 deletions

View File

@@ -181,11 +181,13 @@ class AsyncEmbeddedScript {
#if debug
expr = macro { Prelude.print($v{exprString}); $expr; };
expr = expr.expr.withMacroPosOf(nextExp);
#end
if (expr != null) {
commandList.push(macro function(self, cc) {
var c = macro function(self, cc) {
$expr;
});
};
commandList.push(c.expr.withMacroPosOf(nextExp));
}
// This return is essential for type unification of concat() and push() above... ugh.

View File

@@ -71,9 +71,10 @@ class EmbeddedScript {
var expr = Kiss.readerExpToHaxeExpr(nextExp, k);
if (expr != null) {
commandList.push(macro function(self) {
var c = macro function(self) {
$expr;
});
};
commandList.push(c.expr.withMacroPosOf(nextExp));
}
// This return is essential for type unification of concat() and push() above... ugh.