mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 01:11:24 +00:00
using stringbuilder for generating the AS source
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.graph.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.helpers.HilightedTextWriter;
|
||||
import com.jpexs.decompiler.graph.Block;
|
||||
import com.jpexs.decompiler.graph.Graph;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -37,21 +38,20 @@ public class UniversalLoopItem extends LoopItem implements Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(boolean highlight, List<Object> localData) {
|
||||
String ret = "";
|
||||
ret += hilight("loop" + loop.id + ":", highlight) + "\r\n";
|
||||
ret += hilight("while(true)", highlight);
|
||||
ret += "\r\n" + hilight("{", highlight) + "\r\n";
|
||||
ret += Graph.INDENTOPEN + "\r\n";
|
||||
public HilightedTextWriter toString(HilightedTextWriter writer, List<Object> localData) {
|
||||
hilight("loop" + loop.id + ":", writer).appendNewLine();
|
||||
hilight("while(true)", writer).appendNewLine();
|
||||
hilight("{", writer).appendNewLine();
|
||||
hilight(Graph.INDENTOPEN, writer).appendNewLine();
|
||||
for (GraphTargetItem ti : commands) {
|
||||
if (!ti.isEmpty()) {
|
||||
ret += ti.toStringSemicoloned(highlight, localData) + "\r\n";
|
||||
ti.toStringSemicoloned(writer, localData).appendNewLine();
|
||||
}
|
||||
}
|
||||
ret += Graph.INDENTCLOSE + "\r\n";
|
||||
ret += hilight("}", highlight) + "\r\n";
|
||||
ret += hilight(":loop" + loop.id, highlight);
|
||||
return ret;
|
||||
hilight(Graph.INDENTCLOSE, writer).appendNewLine();
|
||||
hilight("}", writer).appendNewLine();
|
||||
hilight(":loop" + loop.id, writer);
|
||||
return writer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user