aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authorJonas Herzig <me@johni0702.de>2022-05-25 07:31:35 +0200
committerJonas Herzig <me@johni0702.de>2022-05-27 08:46:01 +0200
commit3104e9fdb3c2df7528813e03e4a3e08a3e1a8c2a (patch)
treecceb4d8cba94ff038491c05c72008e932fbc3ea4 /src/main/kotlin
parent1cf68fed94337060df65a832d0c3c3f5588ad7cb (diff)
downloadRemap-3104e9fdb3c2df7528813e03e4a3e08a3e1a8c2a.tar.gz
Remap-3104e9fdb3c2df7528813e03e4a3e08a3e1a8c2a.tar.bz2
Remap-3104e9fdb3c2df7528813e03e4a3e08a3e1a8c2a.zip
Support matching binary expressions with @Pattern
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt b/src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt
index c1809f7..fcba558 100644
--- a/src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt
+++ b/src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt
@@ -89,6 +89,10 @@ internal class PsiPattern(
&& match(pattern.operand, expr.operand)
is PsiParenthesizedExpression -> expr is PsiParenthesizedExpression
&& match(pattern.expression, expr.expression)
+ is PsiBinaryExpression -> expr is PsiBinaryExpression
+ && pattern.operationTokenType == expr.operationTokenType
+ && match(pattern.lOperand, expr.lOperand)
+ && match(pattern.rOperand, expr.rOperand)
is PsiNewExpression -> expr is PsiNewExpression
&& pattern.classReference?.resolve() == expr.classReference?.resolve()
&& match(pattern.qualifier, expr.qualifier)