boolean (PsiElement element1, PsiElement element2) { if (element1 == null && isLeftLooseMatching()) { return true; } if (element2 == null && isRightLooseMatching()) { return true; } if (element1 == null || element2 == null) { return element1 == element2; } PsiElement e = element1.getFirstChild(); PsiElement e2 = element2.getFirstChild(); return (e == null && isLeftLooseMatching()) || (e2 == null && isRightLooseMatching()) || matchInAnyOrder(new FilteringNodeIterator(SiblingNodeIterator.create(e), getNodeFilter()), new FilteringNodeIterator(SiblingNodeIterator.create(e2), getNodeFilter())); }