From 3104e9fdb3c2df7528813e03e4a3e08a3e1a8c2a Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Wed, 25 May 2022 07:31:35 +0200 Subject: Support matching binary expressions with @Pattern --- src/main/kotlin/com/replaymod/gradle/remap/PsiPattern.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/kotlin/com/replaymod') 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) -- cgit