| 429 | } |
| 430 | |
| 431 | FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* { |
| 432 | auto it = ctx.begin(); |
| 433 | auto end = ctx.end(); |
| 434 | detail::maybe_set_debug_format(underlying_, true); |
| 435 | if (it == end) return underlying_.parse(ctx); |
| 436 | |
| 437 | switch (detail::to_ascii(*it)) { |
| 438 | case 'n': |
| 439 | set_brackets({}, {}); |
| 440 | ++it; |
| 441 | break; |
| 442 | case '?': |
| 443 | is_debug = true; |
| 444 | set_brackets({}, {}); |
| 445 | ++it; |
| 446 | if (it == end || *it != 's') report_error("invalid format specifier"); |
| 447 | FMT_FALLTHROUGH; |
| 448 | case 's': |
| 449 | if (!std::is_same<T, Char>::value) |
| 450 | report_error("invalid format specifier"); |
| 451 | if (!is_debug) { |
| 452 | set_brackets(detail::string_literal<Char, '"'>{}, |
| 453 | detail::string_literal<Char, '"'>{}); |
| 454 | set_separator({}); |
| 455 | detail::maybe_set_debug_format(underlying_, false); |
| 456 | } |
| 457 | ++it; |
| 458 | return it; |
| 459 | } |
| 460 | |
| 461 | if (it != end && *it != '}') { |
| 462 | if (*it != ':') report_error("invalid format specifier"); |
| 463 | detail::maybe_set_debug_format(underlying_, false); |
| 464 | ++it; |
| 465 | } |
| 466 | |
| 467 | ctx.advance_to(it); |
| 468 | return underlying_.parse(ctx); |
| 469 | } |
| 470 | |
| 471 | template <typename R, typename FormatContext> |
| 472 | FMT_CONSTEXPR auto format(R&& range, FormatContext& ctx) const |
no test coverage detected