mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-28 17:30:45 +00:00
indent open, indent close fixed
This commit is contained in:
@@ -1375,7 +1375,7 @@ public class AVM2Code implements Serializable {
|
||||
list.remove(lastPos);
|
||||
}
|
||||
|
||||
s = Graph.graphToString(list, hilighted, constants, localRegNames, fullyQualifiedNames);
|
||||
s = Graph.graphToString(list, hilighted, true, constants, localRegNames, fullyQualifiedNames);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,12 @@ public class NewObjectAVM2Item extends AVM2Item {
|
||||
if (pairs.size() < 2) {
|
||||
return hilight("{", highlight) + params + hilight("}", highlight);
|
||||
}
|
||||
return "\r\n" + Graph.INDENTOPEN + "\r\n" + hilight("{", highlight) + "\r\n" + params + "\r\n" + hilight("}", highlight) + "\r\n" + Graph.INDENTCLOSE + "\r\n";
|
||||
String ret = "\r\n" + Graph.INDENTOPEN + "\r\n";
|
||||
ret += hilight("{", highlight) + "\r\n";
|
||||
ret += Graph.INDENTOPEN + "\r\n";
|
||||
ret += params + "\r\n";
|
||||
ret += Graph.INDENTCLOSE + "\r\n";
|
||||
ret += hilight("}", highlight) + "\r\n" + Graph.INDENTCLOSE + "\r\n";
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.abc.avm2.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.graph.Graph;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -44,10 +45,12 @@ public class WithAVM2Item extends AVM2Item {
|
||||
public String toString(boolean highlight, ConstantPool constants, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
|
||||
String ret;
|
||||
ret = hilight("with(", highlight) + scope.toString(highlight, constants, localRegNames, fullyQualifiedNames) + hilight(")", highlight) + "\r\n" + hilight("{", highlight) + "\r\n";
|
||||
ret += Graph.INDENTOPEN + "\r\n";
|
||||
/*for (GraphTargetItem ti : items) {
|
||||
ret += ti.toString(constants, localRegNames, fullyQualifiedNames) + "\r\n";
|
||||
}
|
||||
ret += hilight("}", highlight);*/
|
||||
}*/
|
||||
ret += Graph.INDENTCLOSE + "\r\n";
|
||||
ret += hilight("}", highlight);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.InAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.SetTypeAVM2Item;
|
||||
import com.jpexs.decompiler.graph.Block;
|
||||
import com.jpexs.decompiler.graph.Graph;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.Loop;
|
||||
@@ -71,11 +72,13 @@ public class ForEachInAVM2Item extends LoopItem implements Block {
|
||||
String ret = "";
|
||||
ret += hilight("loop" + loop.id + ":", highlight) + "\r\n";
|
||||
ret += hilight("for each (", highlight) + expression.toString(highlight, localData) + hilight(")", highlight) + "\r\n" + hilight("{", highlight) + "\r\n";
|
||||
ret += Graph.INDENTOPEN + "\r\n";
|
||||
for (GraphTargetItem ti : commands) {
|
||||
if (!ti.isEmpty()) {
|
||||
ret += ti.toStringSemicoloned(highlight, localData) + "\r\n";
|
||||
}
|
||||
}
|
||||
ret += Graph.INDENTCLOSE + "\r\n";
|
||||
ret += hilight("}", highlight) + "\r\n";
|
||||
ret += hilight(":loop" + loop.id, highlight);
|
||||
return ret;
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.InAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.SetTypeAVM2Item;
|
||||
import com.jpexs.decompiler.graph.Block;
|
||||
import com.jpexs.decompiler.graph.Graph;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.Loop;
|
||||
@@ -71,11 +72,13 @@ public class ForInAVM2Item extends LoopItem implements Block {
|
||||
String ret = "";
|
||||
ret += hilight("loop" + loop.id + ":", highlight) + "\r\n";
|
||||
ret += hilight("for (", highlight) + expression.toString(highlight, localData) + hilight(")", highlight) + "\r\n" + hilight("{", highlight) + "\r\n";
|
||||
ret += Graph.INDENTOPEN + "\r\n";
|
||||
for (GraphTargetItem ti : commands) {
|
||||
if (!ti.isEmpty()) {
|
||||
ret += ti.toStringSemicoloned(highlight, localData) + "\r\n";
|
||||
}
|
||||
}
|
||||
ret += Graph.INDENTCLOSE + "\r\n";
|
||||
ret += hilight("}", highlight) + "\r\n";
|
||||
ret += hilight(":loop" + loop.id, highlight);
|
||||
return ret;
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item;
|
||||
import com.jpexs.decompiler.flash.abc.types.ABCException;
|
||||
import com.jpexs.decompiler.graph.Block;
|
||||
import com.jpexs.decompiler.graph.Graph;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.model.ContinueItem;
|
||||
import com.jpexs.helpers.Helper;
|
||||
@@ -55,29 +56,35 @@ public class TryAVM2Item extends AVM2Item implements Block {
|
||||
public String toString(boolean highlight, ConstantPool constants, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames) {
|
||||
String ret = "";
|
||||
ret += hilight("try", highlight) + "\r\n" + hilight("{", highlight) + "\r\n";
|
||||
ret += Graph.INDENTOPEN + "\r\n";
|
||||
for (GraphTargetItem ti : tryCommands) {
|
||||
if (!ti.isEmpty()) {
|
||||
ret += ti.toStringSemicoloned(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n";
|
||||
}
|
||||
}
|
||||
ret += Graph.INDENTCLOSE + "\r\n";
|
||||
ret += hilight("}", highlight);
|
||||
for (int e = 0; e < catchExceptions.size(); e++) {
|
||||
ret += "\r\n" + hilight("catch(" + catchExceptions.get(e).getVarName(constants, fullyQualifiedNames) + ":" + catchExceptions.get(e).getTypeName(constants, fullyQualifiedNames) + ")", highlight) + "\r\n" + hilight("{", highlight) + "\r\n";
|
||||
ret += Graph.INDENTOPEN + "\r\n";
|
||||
List<GraphTargetItem> commands = catchCommands.get(e);
|
||||
for (GraphTargetItem ti : commands) {
|
||||
if (!ti.isEmpty()) {
|
||||
ret += ti.toStringSemicoloned(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n";
|
||||
}
|
||||
}
|
||||
ret += Graph.INDENTCLOSE + "\r\n";
|
||||
ret += hilight("}", highlight);
|
||||
}
|
||||
if (finallyCommands.size() > 0) {
|
||||
ret += "\r\n" + hilight("finally", highlight) + "\r\n" + hilight("{", highlight) + "\r\n";
|
||||
ret += Graph.INDENTOPEN + "\r\n";
|
||||
for (GraphTargetItem ti : finallyCommands) {
|
||||
if (!ti.isEmpty()) {
|
||||
ret += ti.toStringSemicoloned(highlight, Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n";
|
||||
}
|
||||
}
|
||||
ret += Graph.INDENTCLOSE + "\r\n";
|
||||
ret += hilight("}", highlight);
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user