mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 18:50:50 +00:00
highlighting refactored
This commit is contained in:
@@ -19,15 +19,14 @@ package com.jpexs.decompiler.graph;
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.HilightedTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightData;
|
||||
import com.jpexs.decompiler.graph.model.BinaryOp;
|
||||
import com.jpexs.decompiler.graph.model.LocalData;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -59,7 +58,7 @@ public abstract class GraphTargetItem implements Serializable {
|
||||
public List<GraphSourceItemPos> moreSrc = new ArrayList<>();
|
||||
public GraphPart firstPart;
|
||||
public GraphTargetItem value;
|
||||
protected Map<String, String> srcData = new HashMap<>();
|
||||
protected HighlightData srcData = new HighlightData();
|
||||
|
||||
public GraphPart getFirstPart() {
|
||||
if (value == null) {
|
||||
@@ -120,7 +119,7 @@ public abstract class GraphTargetItem implements Serializable {
|
||||
public abstract GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException;
|
||||
|
||||
public String toString(LocalData localData) throws InterruptedException {
|
||||
HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
toString(writer, localData);
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.graph;
|
||||
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.graph.model.LocalData;
|
||||
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
|
||||
import java.util.ArrayList;
|
||||
@@ -72,13 +73,13 @@ public class TypeItem extends GraphTargetItem {
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
if (localData.fullyQualifiedNames.contains(fullTypeName)) {
|
||||
writer.hilightSpecial(IdentifiersDeobfuscation.printNamespace(localData.constantsAvm2 != null, fullTypeName), "typename", fullTypeName);
|
||||
writer.hilightSpecial(IdentifiersDeobfuscation.printNamespace(localData.constantsAvm2 != null, fullTypeName), HighlightSpecialType.TYPE_NAME, fullTypeName);
|
||||
} else {
|
||||
String simpleName = fullTypeName;
|
||||
if (simpleName.contains(".")) {
|
||||
simpleName = simpleName.substring(simpleName.lastIndexOf('.') + 1);
|
||||
}
|
||||
writer.hilightSpecial(IdentifiersDeobfuscation.printNamespace(localData.constantsAvm2 != null, simpleName), "typename", fullTypeName);
|
||||
writer.hilightSpecial(IdentifiersDeobfuscation.printNamespace(localData.constantsAvm2 != null, simpleName), HighlightSpecialType.TYPE_NAME, fullTypeName);
|
||||
}
|
||||
|
||||
return writer;
|
||||
|
||||
Reference in New Issue
Block a user