make AsyncEmbeddedScript instruction tracing possible without debug build
This commit is contained in:
@@ -192,6 +192,8 @@ class AsyncEmbeddedScript {
|
|||||||
return [for (label => ip in labels) label => () -> skipToInstruction(ip)];
|
return [for (label => ip in labels) label => () -> skipToInstruction(ip)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public var printCurrentInstruction = true;
|
||||||
|
|
||||||
#if macro
|
#if macro
|
||||||
public static function build(dslHaxelib:String, dslFile:String, scriptFile:String):Array<Field> {
|
public static function build(dslHaxelib:String, dslFile:String, scriptFile:String):Array<Field> {
|
||||||
// trace('AsyncEmbeddedScript.build $dslHaxelib $dslFile $scriptFile');
|
// trace('AsyncEmbeddedScript.build $dslHaxelib $dslFile $scriptFile');
|
||||||
@@ -288,10 +290,8 @@ class AsyncEmbeddedScript {
|
|||||||
var expr = Kiss.readerExpToHaxeExpr(nextExp, k);
|
var expr = Kiss.readerExpToHaxeExpr(nextExp, k);
|
||||||
if (Kiss.isEmpty(expr))
|
if (Kiss.isEmpty(expr))
|
||||||
return;
|
return;
|
||||||
#if debug
|
expr = macro { if (printCurrentInstruction) Prelude.print($v{exprString}); $expr; };
|
||||||
expr = macro { Prelude.print($v{exprString}); $expr; };
|
|
||||||
expr = expr.expr.withMacroPosOf(nextExp);
|
expr = expr.expr.withMacroPosOf(nextExp);
|
||||||
#end
|
|
||||||
if (expr != null) {
|
if (expr != null) {
|
||||||
var c = macro function(self, cc) {
|
var c = macro function(self, cc) {
|
||||||
$expr;
|
$expr;
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ class DSLScript extends EmbeddedScript {}
|
|||||||
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScript.dsl"))
|
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScript.dsl"))
|
||||||
class AsyncDSLScript extends AsyncEmbeddedScript {}
|
class AsyncDSLScript extends AsyncEmbeddedScript {}
|
||||||
|
|
||||||
|
// One of these two classes will reuse instructions from the cache, but
|
||||||
|
// I can't guarantee which one compiles first:
|
||||||
|
|
||||||
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScriptThatWillCache.dsl"))
|
@:build(kiss.AsyncEmbeddedScript.build("", "DSL.kiss", "AsyncDSLScriptThatWillCache.dsl"))
|
||||||
class AsyncDSLScriptThatWillCache extends AsyncEmbeddedScript {}
|
class AsyncDSLScriptThatWillCache extends AsyncEmbeddedScript {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user