diff --git a/eo-parser/src/main/java/org/eolang/parser/Objects.java b/eo-parser/src/main/java/org/eolang/parser/Objects.java index dfe9d1a9fc..cc123898b9 100644 --- a/eo-parser/src/main/java/org/eolang/parser/Objects.java +++ b/eo-parser/src/main/java/org/eolang/parser/Objects.java @@ -89,12 +89,6 @@ interface Objects extends Iterable { */ Objects leave(); - /** - * Remove current object. - * @return Self. - */ - Objects remove(); - /** * Xembly object tree. * @since 0.1 @@ -153,12 +147,6 @@ public Objects leave() { return this; } - @Override - public Objects remove() { - this.dirs.remove(); - return this; - } - @Override public Iterator iterator() { return this.dirs.iterator(); diff --git a/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java b/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java index 2c1d1ef430..a509d8a3cc 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java @@ -39,7 +39,6 @@ import org.eolang.parser.xmir.XmirInfo; import org.xembly.Directive; import org.xembly.Directives; -import org.xembly.Xembler; /** * The PHI-CALCULUS grammar listener for ANTLR4 walker. @@ -183,7 +182,8 @@ public void exitFormation(final PhiParser.FormationContext ctx) { } @Override - public void enterScoped(PhiParser.ScopedContext ctx) { + @SuppressWarnings("PMD.ConfusingTernary") + public void enterScoped(final PhiParser.ScopedContext ctx) { if (ctx.HOME() != null) { this.objects().prop("base", "Q").leave(); } else if (ctx.XI() != null) { @@ -192,7 +192,7 @@ public void enterScoped(PhiParser.ScopedContext ctx) { } @Override - public void exitScoped(PhiParser.ScopedContext ctx) { + public void exitScoped(final PhiParser.ScopedContext ctx) { // Nothing here } @@ -212,6 +212,7 @@ public void exitBindings(final PhiParser.BindingsContext ctx) { } @Override + @SuppressWarnings("PMD.ConfusingTernary") public void enterBinding(final PhiParser.BindingContext ctx) { if (ctx.alphaBinding() != null) { if (ctx.alphaBinding().attribute().VERTEX() != null) { @@ -228,6 +229,7 @@ public void enterBinding(final PhiParser.BindingContext ctx) { } @Override + @SuppressWarnings("PMD.ConfusingTernary") public void exitBinding(final PhiParser.BindingContext ctx) { if (this.objs.size() > this.packages.size()) { if (ctx.alphaBinding() != null) { @@ -235,14 +237,18 @@ public void exitBinding(final PhiParser.BindingContext ctx) { this.attributes.pop(); this.objs.removeLast(); } else { - this.objects().enter().prop(this.properties.peek(), this.attributes.pop()).leave(); + this.objects().enter() + .prop(this.properties.peek(), this.attributes.pop()) + .leave(); } } else if (ctx.emptyBinding() != null) { if (ctx.emptyBinding().attribute().VERTEX() != null) { this.attributes.pop(); this.objs.removeLast(); } else { - this.objects().enter().prop(this.properties.peek(), this.attributes.pop()).leave(); + this.objects().enter() + .prop(this.properties.peek(), this.attributes.pop()) + .leave(); } } } @@ -349,7 +355,6 @@ public void exitApplication(final PhiParser.ApplicationContext ctx) { this.properties.pop(); } - @Override @SuppressWarnings("PMD.ConfusingTernary") public void enterDispatch(final PhiParser.DispatchContext ctx) { @@ -362,12 +367,12 @@ public void exitDispatch(final PhiParser.DispatchContext ctx) { } @Override - public void enterApplicationsOrDispatches(PhiParser.ApplicationsOrDispatchesContext ctx) { + public void enterApplicationsOrDispatches(final PhiParser.ApplicationsOrDispatchesContext ctx) { // Nothing here } @Override - public void exitApplicationsOrDispatches(PhiParser.ApplicationsOrDispatchesContext ctx) { + public void exitApplicationsOrDispatches(final PhiParser.ApplicationsOrDispatchesContext ctx) { // Nothing here } @@ -423,8 +428,10 @@ private static boolean hasLambdaPackage(final PhiParser.BindingsContext ctx) { return ctx.binding() .stream() .anyMatch( - context -> context.lambdaBidning() != null - && context.lambdaBidning().FUNCTION().getText().equals(XePhiListener.LAMBDA_PACKAGE) + context -> context.lambdaBidning() != null && context.lambdaBidning() + .FUNCTION() + .getText() + .equals(XePhiListener.LAMBDA_PACKAGE) ); } }