Issue #45 Unicode character cannot save

Code formatting
This commit is contained in:
Jindra Pet��k
2013-03-30 16:43:26 +01:00
parent d3bd9b641d
commit be106cc34b
772 changed files with 84378 additions and 84353 deletions
@@ -23,91 +23,91 @@ import java.util.List;
public class FunctionTreeItem extends TreeItem {
public List<GraphTargetItem> actions;
public List<String> constants;
public String functionName;
public List<String> paramNames;
public GraphTargetItem calculatedFunctionName;
private int regStart;
public List<GraphTargetItem> actions;
public List<String> constants;
public String functionName;
public List<String> paramNames;
public GraphTargetItem calculatedFunctionName;
private int regStart;
public FunctionTreeItem(GraphSourceItem instruction, String functionName, List<String> paramNames, List<GraphTargetItem> actions, List<String> constants, int regStart) {
super(instruction, PRECEDENCE_PRIMARY);
this.actions = actions;
this.constants = constants;
this.functionName = functionName;
this.paramNames = paramNames;
this.regStart = regStart;
}
public FunctionTreeItem(GraphSourceItem instruction, String functionName, List<String> paramNames, List<GraphTargetItem> actions, List<String> constants, int regStart) {
super(instruction, PRECEDENCE_PRIMARY);
this.actions = actions;
this.constants = constants;
this.functionName = functionName;
this.paramNames = paramNames;
this.regStart = regStart;
}
@Override
public String toString(ConstantPool constants) {
if (true) {
//return "<func>";
}
String ret = hilight("function");
if (calculatedFunctionName != null) {
ret += " " + calculatedFunctionName.toStringNoQuotes(constants);
} else if (!functionName.equals("")) {
ret += " " + functionName;
}
ret += hilight("(");
for (int p = 0; p < paramNames.size(); p++) {
if (p > 0) {
ret += hilight(", ");
}
String pname = paramNames.get(p);
if (pname == null || pname.equals("")) {
pname = "register" + (regStart + p);
}
ret += hilight(pname);
}
ret += hilight(")") + "\r\n{\r\n" + Graph.graphToString(actions, constants) + "}";
return ret;
}
@Override
public String toString(ConstantPool constants) {
if (true) {
//return "<func>";
}
String ret = hilight("function");
if (calculatedFunctionName != null) {
ret += " " + calculatedFunctionName.toStringNoQuotes(constants);
} else if (!functionName.equals("")) {
ret += " " + functionName;
}
ret += hilight("(");
for (int p = 0; p < paramNames.size(); p++) {
if (p > 0) {
ret += hilight(", ");
}
String pname = paramNames.get(p);
if (pname == null || pname.equals("")) {
pname = "register" + (regStart + p);
}
ret += hilight(pname);
}
ret += hilight(")") + "\r\n{\r\n" + Graph.graphToString(actions, constants) + "}";
return ret;
}
@Override
public List<com.jpexs.decompiler.flash.graph.GraphSourceItemPos> getNeededSources() {
List<com.jpexs.decompiler.flash.graph.GraphSourceItemPos> ret = super.getNeededSources();
for (GraphTargetItem ti : actions) {
ret.addAll(ti.getNeededSources());
}
return ret;
}
@Override
public List<com.jpexs.decompiler.flash.graph.GraphSourceItemPos> getNeededSources() {
List<com.jpexs.decompiler.flash.graph.GraphSourceItemPos> ret = super.getNeededSources();
for (GraphTargetItem ti : actions) {
ret.addAll(ti.getNeededSources());
}
return ret;
}
@Override
public boolean needsSemicolon() {
return false;
}
@Override
public boolean needsSemicolon() {
return false;
}
@Override
public boolean isCompileTime() {
for (GraphTargetItem a : actions) {
if (!a.isCompileTime()) {
return false;
}
}
return true;
}
@Override
public boolean isCompileTime() {
for (GraphTargetItem a : actions) {
if (!a.isCompileTime()) {
return false;
}
}
return true;
}
@Override
public boolean toBoolean() {
if (!actions.isEmpty()) {
if (actions.get(actions.size() - 1) instanceof ReturnTreeItem) {
ReturnTreeItem r = (ReturnTreeItem) actions.get(actions.size() - 1);
return r.value.toBoolean();
}
}
return false;
}
@Override
public boolean toBoolean() {
if (!actions.isEmpty()) {
if (actions.get(actions.size() - 1) instanceof ReturnTreeItem) {
ReturnTreeItem r = (ReturnTreeItem) actions.get(actions.size() - 1);
return r.value.toBoolean();
}
}
return false;
}
@Override
public double toNumber() {
if (!actions.isEmpty()) {
if (actions.get(actions.size() - 1) instanceof ReturnTreeItem) {
ReturnTreeItem r = (ReturnTreeItem) actions.get(actions.size() - 1);
return r.value.toNumber();
}
}
return 0;
}
@Override
public double toNumber() {
if (!actions.isEmpty()) {
if (actions.get(actions.size() - 1) instanceof ReturnTreeItem) {
ReturnTreeItem r = (ReturnTreeItem) actions.get(actions.size() - 1);
return r.value.toNumber();
}
}
return 0;
}
}