Convert UnencloseTransformer to Kotlin

master
Graham 5 years ago
parent fc34f18e92
commit ba66c47799
  1. 15
      deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.java
  2. 14
      deob-ast/src/main/java/dev/openrs2/deob/ast/transform/UnencloseTransformer.kt

@ -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());
});
}
}

@ -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())
}
}
}
Loading…
Cancel
Save