extern code use args, not readLine()
This commit is contained in:
@@ -190,7 +190,7 @@ class CompilerTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return an expression for a lambda that calls new Process() that runs the target-specific file
|
// return an expression for a lambda that calls new Process() that runs the target-specific file
|
||||||
var callingCode = 'function (?inputLines:Array<String>) { return kiss.Prelude.assertProcess("$command", [haxe.io.Path.join(["${args.outputFolder}", "$mainClassName.$scriptExt"])], inputLines); }';
|
var callingCode = 'function (?inputLines:Array<String>) { return kiss.Prelude.assertProcess("$command", [haxe.io.Path.join(["${args.outputFolder}", "$mainClassName.$scriptExt"])].concat(inputLines)); }';
|
||||||
#if test
|
#if test
|
||||||
trace(callingCode);
|
trace(callingCode);
|
||||||
#end
|
#end
|
||||||
|
@@ -856,21 +856,23 @@ class Macros {
|
|||||||
bindingList[idx + 1] = untypedName;
|
bindingList[idx + 1] = untypedName;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
stringifyExpList.push(b.the(b.symbol("String"), b.callSymbol("tink.Json.stringify", [b.the(b.symbol(type), bindingList[idx + 1])])));
|
stringifyExpList.push(b.the(b.symbol("String"), b.callSymbol("tink.Json.stringify", [b.the(b.symbol(type), bindingList[idx + 1])])));
|
||||||
parseBindingList.push(bindingList[idx]);
|
parseBindingList.push(bindingList[idx]);
|
||||||
parseBindingList.push(b.callSymbol("tink.Json.parse", [b.callField("readLine", b.callSymbol("Sys.stdin", []), [])]));
|
parseBindingList.push(b.callSymbol("tink.Json.parse", [b.callField("shift", b.symbol("__args__"), [])]));
|
||||||
idx += 2;
|
idx += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
var externExps = [
|
var externExps = [
|
||||||
b.print(
|
b.let([b.symbol("__args__"), b.callSymbol("Sys.args", [])],
|
||||||
|
[b.print(
|
||||||
b.callSymbol("tink.Json.stringify", [
|
b.callSymbol("tink.Json.stringify", [
|
||||||
b.the(bodyType, if (bindingList.length > 0) {
|
b.the(bodyType, if (bindingList.length > 0) {
|
||||||
b.let(parseBindingList, exps);
|
b.let(parseBindingList, exps);
|
||||||
} else {
|
} else {
|
||||||
b.begin(exps);
|
b.begin(exps);
|
||||||
})
|
})
|
||||||
]))
|
]))])
|
||||||
];
|
];
|
||||||
b.the(
|
b.the(
|
||||||
bodyType,
|
bodyType,
|
||||||
|
Reference in New Issue
Block a user