diff options
| author | 2019-11-08 17:24:41 -0600 | |
|---|---|---|
| committer | 2019-11-08 23:24:41 +0000 | |
| commit | b49e7eeb75837faeafb938a739cd2fa82594bcea (patch) | |
| tree | 2c1b726c16556f78c660f4e044f9f2e5f0a88b45 /src/main/java/cuchaz/enigma/analysis/SourceIndex.java | |
| parent | Add stats generation (#177) (diff) | |
| download | enigma-fork-b49e7eeb75837faeafb938a739cd2fa82594bcea.tar.gz enigma-fork-b49e7eeb75837faeafb938a739cd2fa82594bcea.tar.xz enigma-fork-b49e7eeb75837faeafb938a739cd2fa82594bcea.zip | |
Tweak runemoro's stats generator to be compatible with multiple services (#178)
* Tweak runemoro's stats generator to be compatible with multiple services
Signed-off-by: liach <liach@users.noreply.github.com>
* Names can have $ in java
Signed-off-by: liach <liach@users.noreply.github.com>
Diffstat (limited to 'src/main/java/cuchaz/enigma/analysis/SourceIndex.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/SourceIndex.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/SourceIndex.java b/src/main/java/cuchaz/enigma/analysis/SourceIndex.java index ed12ce3..a800f43 100644 --- a/src/main/java/cuchaz/enigma/analysis/SourceIndex.java +++ b/src/main/java/cuchaz/enigma/analysis/SourceIndex.java | |||
| @@ -16,7 +16,11 @@ import com.google.common.collect.Lists; | |||
| 16 | import com.google.common.collect.Maps; | 16 | import com.google.common.collect.Maps; |
| 17 | import com.google.common.collect.Multimap; | 17 | import com.google.common.collect.Multimap; |
| 18 | import com.strobel.decompiler.languages.Region; | 18 | import com.strobel.decompiler.languages.Region; |
| 19 | import com.strobel.decompiler.languages.java.ast.*; | 19 | import com.strobel.decompiler.languages.java.ast.AstNode; |
| 20 | import com.strobel.decompiler.languages.java.ast.CompilationUnit; | ||
| 21 | import com.strobel.decompiler.languages.java.ast.ConstructorDeclaration; | ||
| 22 | import com.strobel.decompiler.languages.java.ast.Identifier; | ||
| 23 | import com.strobel.decompiler.languages.java.ast.TypeDeclaration; | ||
| 20 | import cuchaz.enigma.gui.SourceRemapper; | 24 | import cuchaz.enigma.gui.SourceRemapper; |
| 21 | import cuchaz.enigma.translation.mapping.EntryResolver; | 25 | import cuchaz.enigma.translation.mapping.EntryResolver; |
| 22 | import cuchaz.enigma.translation.mapping.ResolutionStrategy; | 26 | import cuchaz.enigma.translation.mapping.ResolutionStrategy; |
| @@ -133,12 +137,12 @@ public class SourceIndex { | |||
| 133 | // DEBUG | 137 | // DEBUG |
| 134 | // System.out.println( String.format( "%s \"%s\" region: %s", node.getNodeType(), name, region ) ); | 138 | // System.out.println( String.format( "%s \"%s\" region: %s", node.getNodeType(), name, region ) ); |
| 135 | 139 | ||
| 136 | // if the token has a $ in it, something's wrong. Ignore this token | 140 | // Tokens can have $ in name, even for top-level classes |
| 137 | if (name.lastIndexOf('$') >= 0 && this.ignoreBadTokens) { | 141 | //if (name.lastIndexOf('$') >= 0 && this.ignoreBadTokens) { |
| 138 | // DEBUG | 142 | // // DEBUG |
| 139 | System.err.println(String.format("WARNING: %s \"%s\" is probably a bad token. It was ignored", node.getNodeType(), name)); | 143 | // System.err.println(String.format("WARNING: %s \"%s\" is probably a bad token. It was ignored", node.getNodeType(), name)); |
| 140 | return null; | 144 | // return null; |
| 141 | } | 145 | //} |
| 142 | 146 | ||
| 143 | return token; | 147 | return token; |
| 144 | } | 148 | } |