muScript: fix closure decompile
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2023-03-12 22:22:07 +01:00
parent 0048a439fa
commit ca3c897693
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 6 additions and 4 deletions

View File

@ -61,13 +61,15 @@ public class Closure extends DynamicExpr {
@Override
public void decompile(ExprWriter writer) throws IOException {
writer.append("{ ");
writer.append("{");
boolean first = true;
for (int i = 0; i < boundArgs.size(); i++) {
writer.appendLiteral(boundArgs.get(i));
if (!first) writer.append(",");
first = false;
writer.append(' ').appendLiteral(boundArgs.get(i));
if (i == boundArgs.size() - 1 && variadic) writer.append("...");
writer.append(' ');
}
writer.append("->").increaseIndent();
writer.append(" ->").increaseIndent();
for (Expr<?> expr : stream().toList()) {
writer.append("\n");
expr.decompile(writer);