replace hex tags to comment in export, AS2 highlight fixed

This commit is contained in:
Honfika
2013-10-15 22:24:17 +02:00
parent 3be09601c3
commit 79f2f7cd45
3 changed files with 5 additions and 2 deletions

View File

@@ -305,7 +305,9 @@ public class TagNode {
} else if (exportMode != ExportMode.SOURCE) {
HilightedTextWriter writer = new HilightedTextWriter(false, asm.getActionSourceIndent());
asm.getASMSource(SWF.DEFAULT_VERSION, exportMode, writer, null);
res = asm.getActionSourcePrefix() + writer.toString() + asm.getActionSourceSuffix();
String str = writer.toString();
str = Helper.hexToComments(str);
res = asm.getActionSourcePrefix() + str + asm.getActionSourceSuffix();
} else {
List<Action> as = asm.getActions(SWF.DEFAULT_VERSION);
Action.setActionsAddresses(as, 0, SWF.DEFAULT_VERSION);

View File

@@ -128,6 +128,7 @@ public class ScriptPack {
abc.script_info[scriptIndex].traits.traits[t].convert(null, "", abcList, abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
}
String s = Graph.removeNonRefenrencedLoopLabels(writer.toString());
s = Helper.hexToComments(s);
fos.write(s.getBytes("utf-8"));
}
}

View File

@@ -721,7 +721,7 @@ public class Action implements GraphSourceItem {
* @return HilightedTextWriter with Source code
*/
public static String actionsToSource(List<Action> actions, int version, String path, boolean highlight, int indent) {
HilightedTextWriter writer = new HilightedTextWriter(false, indent);
HilightedTextWriter writer = new HilightedTextWriter(highlight, indent);
Action.actionsToSource(actions, SWF.DEFAULT_VERSION, ""/*FIXME*/, writer);
String s = Graph.removeNonRefenrencedLoopLabels(writer.toString());
return s;