From ba66c47799d9b58ce65a3ff9c7545e5e04f3710d Mon Sep 17 00:00:00 2001 From: Graham Date: Thu, 26 Dec 2019 19:02:20 +0000 Subject: [PATCH] Convert UnencloseTransformer to Kotlin --- .../deob/ast/transform/UnencloseTransformer.java | 15 --------------- .../deob/ast/transform/UnencloseTransformer.kt | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.java create mode 100644 deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.kt diff --git a/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.java b/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.java deleted file mode 100644 index 06962030c5..0000000000 --- a/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.openrs2.deob.ast.transform; - -import com.github.javaparser.ast.CompilationUnit; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.expr.EnclosedExpr; -import dev.openrs2.deob.ast.util.NodeUtils; - -public final class UnencloseTransformer extends Transformer { - @Override - public void transform(CompilationUnit unit) { - NodeUtils.walk(unit, Node.TreeTraversal.POSTORDER, EnclosedExpr.class, expr -> { - expr.replace(expr.getInner().clone()); - }); - } -} diff --git a/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.kt b/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.kt new file mode 100644 index 0000000000..820fe6819f --- /dev/null +++ b/deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.kt @@ -0,0 +1,14 @@ +package dev.openrs2.deob.ast.transform + +import com.github.javaparser.ast.CompilationUnit +import com.github.javaparser.ast.Node +import com.github.javaparser.ast.expr.EnclosedExpr +import dev.openrs2.deob.ast.util.NodeUtils + +class UnencloseTransformer : Transformer() { + override fun transform(unit: CompilationUnit) { + NodeUtils.walk(unit, Node.TreeTraversal.POSTORDER, EnclosedExpr::class.java) { expr -> + expr.replace(expr.inner.clone()) + } + } +}