From 6932bea67766ac5c110d728677d32588906d3553 Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Sun, 1 Sep 2024 17:24:23 +0300 Subject: [PATCH] refactor: remove unused class --- .../topchetoeu/jscript/compilation/Path.java | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/java/me/topchetoeu/jscript/compilation/Path.java diff --git a/src/java/me/topchetoeu/jscript/compilation/Path.java b/src/java/me/topchetoeu/jscript/compilation/Path.java deleted file mode 100644 index 9d5f897..0000000 --- a/src/java/me/topchetoeu/jscript/compilation/Path.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.topchetoeu.jscript.compilation; - -import java.util.function.Predicate; - -public class Path { - public final Path parent; - public final Node node; - - public Path getParent(Predicate> predicate) { - for (Path it = this; it != null; it = it.parent) { - if (predicate.test(it)) return it; - } - - return null; - } - - public Path getParent(Class type, Predicate> predicate) { - for (Path it = this; it != null; it = it.parent) { - if (type.isInstance(it.node) && predicate.test(it)) return it; - } - - return null; - } - - public Path(Path parent, Node node) { - this.parent = parent; - this.node = node; - } -}