From a16e6395dda5bdbdaa5780d845b91c794869b240 Mon Sep 17 00:00:00 2001 From: dgelessus <dgelessus@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:26:39 +0200 Subject: [PATCH] Remove no longer used slurp parameter of Parser.checkResult This was apparently only ever used by our B parser, and that usage was removed in 2017: hhu-stups/probparsers@9a5299c0b865e511e5b4cb22722fe1bab0164cdf --- src/main/java/org/sablecc/sablecc/parser/Parser.java | 7 +------ src/main/resources/org/sablecc/sablecc/parser.txt | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/sablecc/sablecc/parser/Parser.java b/src/main/java/org/sablecc/sablecc/parser/Parser.java index 2357f1d..2744574 100644 --- a/src/main/java/org/sablecc/sablecc/parser/Parser.java +++ b/src/main/java/org/sablecc/sablecc/parser/Parser.java @@ -45,11 +45,6 @@ public class Parser implements IParser public Map<PositionedNode, SourcecodeRange> getMapping() { return this.mapping; } protected void checkResult(Object elementToCheck) { - checkResult(elementToCheck, false); - } - - - protected void checkResult(Object elementToCheck, boolean slurp) { // nodes with no tokens or sub nodes at all may exist if (this.firstPopped == null) { return; @@ -73,7 +68,7 @@ public class Parser implements IParser final PositionedNode node = (PositionedNode) elementToCheck; - if (!this.getMapping().containsKey(node) || slurp ) { + if (!this.getMapping().containsKey(node)) { // dealing with a one-token element if (this.lastPopped == null) { this.lastPopped = this.firstPopped; diff --git a/src/main/resources/org/sablecc/sablecc/parser.txt b/src/main/resources/org/sablecc/sablecc/parser.txt index 218852d..9070058 100644 --- a/src/main/resources/org/sablecc/sablecc/parser.txt +++ b/src/main/resources/org/sablecc/sablecc/parser.txt @@ -53,11 +53,6 @@ public class Parser implements IParser public Map<PositionedNode, SourcecodeRange> getMapping() { return this.mapping; } protected void checkResult(Object elementToCheck) { - checkResult(elementToCheck, false); - } - - - protected void checkResult(Object elementToCheck, boolean slurp) { // nodes with no tokens or sub nodes at all may exist if (this.firstPopped == null) { return; @@ -81,7 +76,7 @@ public class Parser implements IParser final PositionedNode node = (PositionedNode) elementToCheck; - if (!this.getMapping().containsKey(node) || slurp ) { + if (!this.getMapping().containsKey(node)) { // dealing with a one-token element if (this.lastPopped == null) { this.lastPopped = this.firstPopped; -- GitLab