yoshman more like poo poo (like + sub for more)

This commit is contained in:
lunarcleint
2022-12-31 15:10:39 -07:00
parent c953825216
commit 16d686afbf
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
1874
1875
+7 -2
View File
@@ -21,7 +21,12 @@ class HScript extends Script {
interp.staticVariables = Script.staticVariables;
interp.allowStaticVariables = interp.allowPublicVariables = true;
interp.variables.set("trace", this.trace);
interp.variables.set("trace", Reflect.makeVarArgs((args) -> {
var v:String = Std.string(args.shift());
for (a in args) v += ", " + Std.string(a);
this.trace(v);
}));
try {
expr = parser.parseString(code, fileName);
} catch(e:Error) {
@@ -93,7 +98,7 @@ class HScript extends Script {
var posInfo = interp.posInfos();
Logs.traceColored([
Logs.logText('${fileName}:${posInfo.lineNumber}: ', GREEN),
Logs.logText(Std.string(v))
Logs.logText(Std.isOfType(v, String) ? v : Std.string(v))
], TRACE);
}