private boolean checkSameOccurrencesConstraint(@NotNull MatchContext context) {
    if (totalMatchedOccurs == -1) {
      totalMatchedOccurs = matchedOccurs;
      return true;
    }
    MatchResult result = context.hasResult() ? context.getResult().getChild(name) : null;
    if (result == null && context.getPreviousResult() != null) {
      result = context.getPreviousResult().getChild(name);
    }
    return result == null || result.size() == matchedOccurs || target;
  }
private boolean checkSameOccurrencesConstraint(@NotNull MatchContext context)