| 338 | } // unnamed namespace |
| 339 | |
| 340 | int findCommaOrEnd(QStringView str, int pos, QChar validEnd) |
| 341 | { |
| 342 | const auto size = str.size(); |
| 343 | Q_ASSERT(pos >= 0 && pos <= size); |
| 344 | |
| 345 | for (; pos < size; ++pos) { |
| 346 | switch (str[pos].unicode()) { |
| 347 | // Take into account brackets of all types, not just the validEnd type, to skip ',' within them. |
| 348 | case '<': |
| 349 | if (!isOperator(str, pos)) { |
| 350 | pos = findClosingAngleBracket(str, pos); |
| 351 | } |
| 352 | break; |
| 353 | case '(': |
| 354 | case '[': |
| 355 | case '{': |
| 356 | pos = findClosingNonAngleBracket(str, pos); |
| 357 | break; |
| 358 | case ',': |
| 359 | return pos; |
| 360 | default: |
| 361 | if (str[pos] == validEnd && !(str[pos] == QLatin1Char('>') && isOperatorOrArrowOperator(str, pos))) { |
| 362 | return pos; |
| 363 | } |
| 364 | pos = trySkipStringOrCharLiteralOrComment(str, pos); |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | return size; |
| 369 | } |
| 370 | |
| 371 | // NOTE: keep in sync with QString overload below |
| 372 | QByteArray formatComment(const QByteArray& comment) |
no test coverage detected