GrStatement (PsiElement child, boolean forward) { while (child != null && !(child instanceof GrStatement)) { final IElementType type = child.getNode().getElementType(); if (type != GroovyTokenTypes.mSEMI && !(type == TokenType.WHITE_SPACE && !child.getText().contains("\n"))) return null; child = forward ? child.getNextSibling() : child.getPrevSibling(); } return (GrStatement)child; }