Issue #45 Unicode character cannot save

Code formatting
This commit is contained in:
Jindra Petk
2013-03-30 16:43:26 +01:00
parent d3bd9b641d
commit be106cc34b
772 changed files with 84378 additions and 84353 deletions

View File

@@ -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;
}
}