JetPsiMatcher: reimplement using visitor, add structural type matching

This commit is contained in:
Alexey Sedunov
2013-04-30 16:45:52 +04:00
parent 4ee59e351b
commit d2f3dd1629
103 changed files with 741 additions and 169 deletions
@@ -55,7 +55,7 @@ public class WhenUtils {
if (lastCandidate == null) {
lastCandidate = currCandidate;
}
else if (!JetPsiMatcher.checkExpressionMatch(lastCandidate, currCandidate)) return null;
else if (!JetPsiMatcher.checkElementMatch(lastCandidate, currCandidate)) return null;
}
}
@@ -75,7 +75,7 @@ public class WhenUtils {
JetWhenExpression nestedWhenExpression = (JetWhenExpression) elseBranch;
return JetPsiUtil.checkWhenExpressionHasSingleElse(nestedWhenExpression) &&
JetPsiMatcher.checkExpressionMatch(subject, nestedWhenExpression.getSubjectExpression());
JetPsiMatcher.checkElementMatch(subject, nestedWhenExpression.getSubjectExpression());
}
public static boolean checkIntroduceWhenSubject(@NotNull JetWhenExpression whenExpression) {