docs: public static int parseDollarQuotes(final char[] query, int offset) {
      if (offset + 1 < query.length
          && (offset == 0 || !isIdentifierContChar(query[offset - 1]))) {
        int endIdx = -1;
        if (query[offset + 1] == '$') {
          endIdx = offset + 1;
        } else if (isDollarQuoteStartChar(query[offset + 1])) {
          for (int d = offset + 2; d < query.length; ++d) {
            if (query[d] == '$') {
              endIdx = d;
              break;
            } else if (!isDollarQuoteContChar(query[d])) {
              break;
            }
          }
        }
        if (endIdx > 0) {
          // found; note: tag includes start and end $ character
          int tagIdx = offset;
          int tagLen = endIdx - offset + 1;
          offset = endIdx; // loop continues at endIdx + 1
          for (++offset; offset < query.length; ++offset) {
            if (query[offset] == '$'
                && subArraysEqual(query, tagIdx, offset, tagLen)) {
              offset += tagLen - 1;
              break;
            }
          }
        }
      }
      return offset;
    }