Attach better position info to embeddedscript commands

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

View File

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