From 81f5fcf6dc84667bc0abcd18cb9b26bf67912d74 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 25 Aug 2019 16:56:10 +0100 Subject: [PATCH] Remove EnclosedExpr support from functions that no longer require it --- .../src/main/java/dev/openrs2/deob/ast/util/ExprUtils.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/deob-ast/src/main/java/dev/openrs2/deob/ast/util/ExprUtils.java b/deob-ast/src/main/java/dev/openrs2/deob/ast/util/ExprUtils.java index 6307a957..adc4ae83 100644 --- a/deob-ast/src/main/java/dev/openrs2/deob/ast/util/ExprUtils.java +++ b/deob-ast/src/main/java/dev/openrs2/deob/ast/util/ExprUtils.java @@ -32,7 +32,6 @@ public final class ExprUtils { } } - // TODO(gpe): need to be careful about operator precedence/EnclosedExpr public static Expression not(Expression expr) { if (expr.isUnaryExpr()) { var unary = expr.asUnaryExpr(); @@ -65,8 +64,6 @@ public final class ExprUtils { } } else if (expr.isBooleanLiteralExpr()) { return new BooleanLiteralExpr(!expr.asBooleanLiteralExpr().getValue()); - } else if (expr.isEnclosedExpr()) { - return not(expr.asEnclosedExpr().getInner()); } return new UnaryExpr(expr.clone(), UnaryExpr.Operator.LOGICAL_COMPLEMENT); } @@ -92,8 +89,6 @@ public final class ExprUtils { public static boolean hasSideEffects(Expression expr) { if (expr.isLiteralExpr() || expr.isNameExpr() | expr.isFieldAccessExpr()) { return false; - } else if (expr.isEnclosedExpr()) { - return hasSideEffects(expr.asEnclosedExpr().getInner()); } else if (expr.isUnaryExpr()) { return hasSideEffects(expr.asUnaryExpr().getExpression()); } else if (expr.isBinaryExpr()) {