diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/analysis')
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/SourceIndexBehaviorVisitor.java | 5 | ||||
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/SourceIndexClassVisitor.java | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/SourceIndexBehaviorVisitor.java b/src/main/java/cuchaz/enigma/analysis/SourceIndexBehaviorVisitor.java index 68ca87e..1b61916 100644 --- a/src/main/java/cuchaz/enigma/analysis/SourceIndexBehaviorVisitor.java +++ b/src/main/java/cuchaz/enigma/analysis/SourceIndexBehaviorVisitor.java | |||
| @@ -26,7 +26,6 @@ import java.util.HashMap; | |||
| 26 | import java.util.Map; | 26 | import java.util.Map; |
| 27 | 27 | ||
| 28 | public class SourceIndexBehaviorVisitor extends SourceIndexVisitor { | 28 | public class SourceIndexBehaviorVisitor extends SourceIndexVisitor { |
| 29 | |||
| 30 | private BehaviorEntry behaviorEntry; | 29 | private BehaviorEntry behaviorEntry; |
| 31 | 30 | ||
| 32 | // TODO: Really fix Procyon index problem with inner classes | 31 | // TODO: Really fix Procyon index problem with inner classes |
| @@ -35,9 +34,9 @@ public class SourceIndexBehaviorVisitor extends SourceIndexVisitor { | |||
| 35 | private Multimap<String, Identifier> unmatchedIdentifier = HashMultimap.create(); | 34 | private Multimap<String, Identifier> unmatchedIdentifier = HashMultimap.create(); |
| 36 | private Map<String, Entry> identifierEntryCache = new HashMap<>(); | 35 | private Map<String, Entry> identifierEntryCache = new HashMap<>(); |
| 37 | 36 | ||
| 38 | public SourceIndexBehaviorVisitor(BehaviorEntry behaviorEntry) { | 37 | public SourceIndexBehaviorVisitor(BehaviorEntry behaviorEntry, boolean isEnum) { |
| 39 | this.behaviorEntry = behaviorEntry; | 38 | this.behaviorEntry = behaviorEntry; |
| 40 | this.argumentPosition = 0; | 39 | this.argumentPosition = isEnum ? 2 : 0; |
| 41 | this.localsPosition = 0; | 40 | this.localsPosition = 0; |
| 42 | } | 41 | } |
| 43 | 42 | ||
diff --git a/src/main/java/cuchaz/enigma/analysis/SourceIndexClassVisitor.java b/src/main/java/cuchaz/enigma/analysis/SourceIndexClassVisitor.java index 1148216..b13415d 100644 --- a/src/main/java/cuchaz/enigma/analysis/SourceIndexClassVisitor.java +++ b/src/main/java/cuchaz/enigma/analysis/SourceIndexClassVisitor.java | |||
| @@ -22,6 +22,7 @@ import cuchaz.enigma.mapping.*; | |||
| 22 | public class SourceIndexClassVisitor extends SourceIndexVisitor { | 22 | public class SourceIndexClassVisitor extends SourceIndexVisitor { |
| 23 | 23 | ||
| 24 | private ClassEntry classEntry; | 24 | private ClassEntry classEntry; |
| 25 | private boolean isEnum; | ||
| 25 | 26 | ||
| 26 | public SourceIndexClassVisitor(ClassEntry classEntry) { | 27 | public SourceIndexClassVisitor(ClassEntry classEntry) { |
| 27 | this.classEntry = classEntry; | 28 | this.classEntry = classEntry; |
| @@ -65,7 +66,7 @@ public class SourceIndexClassVisitor extends SourceIndexVisitor { | |||
| 65 | } | 66 | } |
| 66 | } | 67 | } |
| 67 | index.addDeclaration(tokenNode, behaviorEntry); | 68 | index.addDeclaration(tokenNode, behaviorEntry); |
| 68 | return node.acceptVisitor(new SourceIndexBehaviorVisitor(behaviorEntry), index); | 69 | return node.acceptVisitor(new SourceIndexBehaviorVisitor(behaviorEntry, false), index); |
| 69 | } | 70 | } |
| 70 | 71 | ||
| 71 | @Override | 72 | @Override |
| @@ -73,7 +74,7 @@ public class SourceIndexClassVisitor extends SourceIndexVisitor { | |||
| 73 | MethodDefinition def = node.getUserData(Keys.METHOD_DEFINITION); | 74 | MethodDefinition def = node.getUserData(Keys.METHOD_DEFINITION); |
| 74 | ConstructorEntry constructorEntry = ProcyonEntryFactory.getConstructorEntry(def); | 75 | ConstructorEntry constructorEntry = ProcyonEntryFactory.getConstructorEntry(def); |
| 75 | index.addDeclaration(node.getNameToken(), constructorEntry); | 76 | index.addDeclaration(node.getNameToken(), constructorEntry); |
| 76 | return node.acceptVisitor(new SourceIndexBehaviorVisitor(constructorEntry), index); | 77 | return node.acceptVisitor(new SourceIndexBehaviorVisitor(constructorEntry, isEnum), index); |
| 77 | } | 78 | } |
| 78 | 79 | ||
| 79 | @Override | 80 | @Override |
| @@ -93,7 +94,7 @@ public class SourceIndexClassVisitor extends SourceIndexVisitor { | |||
| 93 | FieldDefinition def = node.getUserData(Keys.FIELD_DEFINITION); | 94 | FieldDefinition def = node.getUserData(Keys.FIELD_DEFINITION); |
| 94 | FieldEntry fieldEntry = ProcyonEntryFactory.getFieldEntry(def); | 95 | FieldEntry fieldEntry = ProcyonEntryFactory.getFieldEntry(def); |
| 95 | index.addDeclaration(node.getNameToken(), fieldEntry); | 96 | index.addDeclaration(node.getNameToken(), fieldEntry); |
| 96 | 97 | this.isEnum = true; | |
| 97 | return recurse(node, index); | 98 | return recurse(node, index); |
| 98 | } | 99 | } |
| 99 | } | 100 | } |