Search in sources :

Example 11 with GrUnaryExpression

use of org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrUnaryExpression in project intellij-community by JetBrains.

the class BoolUtils method getNegated.

private static GrExpression getNegated(@NotNull GrExpression exp) {
    final GrUnaryExpression prefixExp = (GrUnaryExpression) exp;
    final GrExpression operand = prefixExp.getOperand();
    return (GrExpression) PsiUtil.skipParentheses(operand, false);
}
Also used : GrUnaryExpression(org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrUnaryExpression) GrExpression(org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression)

Aggregations

GrUnaryExpression (org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrUnaryExpression)11 IElementType (com.intellij.psi.tree.IElementType)7 GrExpression (org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression)6 PsiElement (com.intellij.psi.PsiElement)4 Nullable (org.jetbrains.annotations.Nullable)2 GroovyPsiElementFactory (org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory)2 GrStatement (org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement)2 GrParenthesizedExpression (org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrParenthesizedExpression)2 ASTNode (com.intellij.lang.ASTNode)1 TextRange (com.intellij.openapi.util.TextRange)1 PsiErrorElement (com.intellij.psi.PsiErrorElement)1 CommonCodeStyleSettings (com.intellij.psi.codeStyle.CommonCodeStyleSettings)1 IncorrectOperationException (com.intellij.util.IncorrectOperationException)1 GroovyCodeStyleSettings (org.jetbrains.plugins.groovy.codeStyle.GroovyCodeStyleSettings)1 ClosureBodyBlock (org.jetbrains.plugins.groovy.formatter.blocks.ClosureBodyBlock)1 GroovyPsiElement (org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement)1 GrIfStatement (org.jetbrains.plugins.groovy.lang.psi.api.statements.GrIfStatement)1 GrConditionalExpression (org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrConditionalExpression)1 GrNewExpression (org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrNewExpression)1 GrReferenceExpression (org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression)1