refactor: remove unused class

This commit is contained in:
TopchetoEU 2024-09-01 17:24:23 +03:00
parent acfdf23586
commit 672c6b2ad7
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -1,29 +0,0 @@
package me.topchetoeu.jscript.compilation;
import java.util.function.Predicate;
public class Path<T extends Node> {
public final Path<?> parent;
public final Node node;
public Path<?> getParent(Predicate<Path<?>> predicate) {
for (Path<?> it = this; it != null; it = it.parent) {
if (predicate.test(it)) return it;
}
return null;
}
public Path<?> getParent(Class<? extends Node> type, Predicate<Path<?>> 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;
}
}