private static boolean isAfterErrorElement(@NotNull ASTNode currNode) {
    ASTNode prev = currNode.getTreePrev();
    while (prev != null && (prev instanceof PsiWhiteSpace || prev.getTextLength() == 0)) {
      if (prev instanceof PsiErrorElement) return true;
      prev = prev.getTreePrev();
    }
    return false;
  }
private static boolean isAfterErrorElement(@NotNull ASTNode currNode)