mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-28 12:45:35 +00:00
@@ -21,51 +21,51 @@ import java.util.List;
|
||||
|
||||
public class WhileItem extends LoopItem implements Block {
|
||||
|
||||
public GraphTargetItem expression;
|
||||
public List<GraphTargetItem> commands;
|
||||
public GraphTargetItem expression;
|
||||
public List<GraphTargetItem> commands;
|
||||
|
||||
@Override
|
||||
public List<List<GraphTargetItem>> getSubs() {
|
||||
List<List<GraphTargetItem>> ret = new ArrayList<List<GraphTargetItem>>();
|
||||
ret.add(commands);
|
||||
return ret;
|
||||
}
|
||||
@Override
|
||||
public List<List<GraphTargetItem>> getSubs() {
|
||||
List<List<GraphTargetItem>> ret = new ArrayList<List<GraphTargetItem>>();
|
||||
ret.add(commands);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public WhileItem(GraphSourceItem src, Loop loop, GraphTargetItem expression, List<GraphTargetItem> commands) {
|
||||
super(src, loop);
|
||||
this.expression = expression;
|
||||
this.commands = commands;
|
||||
}
|
||||
public WhileItem(GraphSourceItem src, Loop loop, GraphTargetItem expression, List<GraphTargetItem> commands) {
|
||||
super(src, loop);
|
||||
this.expression = expression;
|
||||
this.commands = commands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(List localData) {
|
||||
String ret = "";
|
||||
ret += "loop" + loop.id + ":\r\n";
|
||||
ret += hilight("while(") + (expression == null ? "null" : expression.toString(localData)) + hilight(")") + "\r\n{\r\n";
|
||||
for (GraphTargetItem ti : commands) {
|
||||
ret += ti.toStringSemicoloned(localData) + "\r\n";
|
||||
}
|
||||
ret += hilight("}") + "\r\n";
|
||||
ret += ":loop" + loop.id;
|
||||
return ret;
|
||||
}
|
||||
@Override
|
||||
public String toString(List localData) {
|
||||
String ret = "";
|
||||
ret += "loop" + loop.id + ":\r\n";
|
||||
ret += hilight("while(") + (expression == null ? "null" : expression.toString(localData)) + hilight(")") + "\r\n{\r\n";
|
||||
for (GraphTargetItem ti : commands) {
|
||||
ret += ti.toStringSemicoloned(localData) + "\r\n";
|
||||
}
|
||||
ret += hilight("}") + "\r\n";
|
||||
ret += ":loop" + loop.id;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ContinueItem> getContinues() {
|
||||
List<ContinueItem> ret = new ArrayList<ContinueItem>();
|
||||
for (GraphTargetItem ti : commands) {
|
||||
if (ti instanceof ContinueItem) {
|
||||
ret.add((ContinueItem) ti);
|
||||
}
|
||||
if (ti instanceof Block) {
|
||||
ret.addAll(((Block) ti).getContinues());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@Override
|
||||
public List<ContinueItem> getContinues() {
|
||||
List<ContinueItem> ret = new ArrayList<ContinueItem>();
|
||||
for (GraphTargetItem ti : commands) {
|
||||
if (ti instanceof ContinueItem) {
|
||||
ret.add((ContinueItem) ti);
|
||||
}
|
||||
if (ti instanceof Block) {
|
||||
ret.addAll(((Block) ti).getContinues());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsSemicolon() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean needsSemicolon() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user