summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/source/procyon
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cuchaz/enigma/source/procyon')
-rw-r--r--src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java b/src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java
index db90ffa..62e7c10 100644
--- a/src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java
+++ b/src/main/java/cuchaz/enigma/source/procyon/index/TokenFactory.java
@@ -17,6 +17,11 @@ public class TokenFactory {
17 String name = node instanceof Identifier ? ((Identifier) node).getName() : ""; 17 String name = node instanceof Identifier ? ((Identifier) node).getName() : "";
18 Region region = node.getRegion(); 18 Region region = node.getRegion();
19 19
20 if (region.getBeginLine() == 0) {
21 System.err.println("Got bad region from Procyon for node " + node);
22 return null;
23 }
24
20 int start = index.getPosition(region.getBeginLine(), region.getBeginColumn()); 25 int start = index.getPosition(region.getBeginLine(), region.getBeginColumn());
21 int end = index.getPosition(region.getEndLine(), region.getEndColumn()); 26 int end = index.getPosition(region.getEndLine(), region.getEndColumn());
22 String text = index.getSource().substring(start, end); 27 String text = index.getSource().substring(start, end);