Skip to content
Snippets Groups Projects
Commit 425cb8ff authored by Jens Bendisposto's avatar Jens Bendisposto
Browse files

fix for sourceposition / Empty-Production bug

parent f4c7260b
No related branches found
No related tags found
No related merge requests found
...@@ -98,7 +98,8 @@ public class Parser implements IParser ...@@ -98,7 +98,8 @@ public class Parser implements IParser
} }
final int begin = findBeginPos(this.lastPopped, node); final int begin = findBeginPos(this.lastPopped, node);
final int end = findEndPos(this.firstPopped); int end = findEndPos(this.firstPopped);
if (end == -1) end = begin;
final SourcecodeRange range = new SourcecodeRange(begin, end); final SourcecodeRange range = new SourcecodeRange(begin, end);
this.getMapping().put(node, range); this.getMapping().put(node, range);
...@@ -153,6 +154,8 @@ public class Parser implements IParser ...@@ -153,6 +154,8 @@ public class Parser implements IParser
final PositionedNode node = (PositionedNode) last; final PositionedNode node = (PositionedNode) last;
final SourcecodeRange item = this.getMapping().get(node); final SourcecodeRange item = this.getMapping().get(node);
if (item == null)
return -1;
return item.getEndIndex(); return item.getEndIndex();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment