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

Slurping for Parenthesis

parent 8e800176
No related branches found
No related tags found
No related merge requests found
......@@ -55,8 +55,12 @@ public class Parser implements IParser
private Map<PositionedNode, SourcecodeRange> mapping = new HashMap<PositionedNode, SourcecodeRange>();
public Map<PositionedNode, SourcecodeRange> getMapping() { return this.mapping; }
@SuppressWarnings("unchecked")
private void checkResult(Object elementToCheck) {
checkResult(elementToCheck, false);
}
@SuppressWarnings("unchecked")
private void checkResult(Object elementToCheck, boolean slurp) {
// nodes with no tokens or sub nodes at all may exist
if (this.firstPopped == null) {
return;
......@@ -85,7 +89,7 @@ public class Parser implements IParser
+ elementToCheck);
}
if (!this.getMapping().containsKey(elementToCheck)) {
if (!this.getMapping().containsKey(elementToCheck) || slurp ) {
final PositionedNode node = (PositionedNode) elementToCheck;
// dealing with a one-token element
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment