Example #1
0
 @Nullable
 public static GrExpression stripParentheses(@Nullable GrExpression expression) {
   GrExpression parenthesized = expression;
   while (parenthesized instanceof GrParenthesizedExpression) {
     final GrParenthesizedExpression parenthesizedExpression =
         (GrParenthesizedExpression) parenthesized;
     parenthesized = parenthesizedExpression.getOperand();
   }
   return parenthesized;
 }
 @Override
 public void visitParenthesizedExpression(GrParenthesizedExpression expression) {
   final PsiElement parent = expression.getParent();
   if (parent instanceof GroovyPsiElement) {
     ((GroovyPsiElement) parent).accept(this);
   } else {
     parent.accept(new GroovyPsiElementVisitor(this));
   }
 }
 @Override
 public void visitParenthesizedExpression(GrParenthesizedExpression expression) {
   final GrExpression operand = expression.getOperand();
   if (operand != null) operand.accept(this);
 }