| 2471 | |
| 2472 | template <typename Char, typename Handler> |
| 2473 | FMT_CONSTEXPR const Char* parse_precision(const Char* begin, const Char* end, |
| 2474 | Handler&& handler) { |
| 2475 | ++begin; |
| 2476 | auto c = begin != end ? *begin : Char(); |
| 2477 | if ('0' <= c && c <= '9') { |
| 2478 | handler.on_precision(parse_nonnegative_int(begin, end, handler)); |
| 2479 | } else if (c == '{') { |
| 2480 | ++begin; |
| 2481 | if (begin != end) { |
| 2482 | begin = |
| 2483 | parse_arg_id(begin, end, precision_adapter<Handler, Char>(handler)); |
| 2484 | } |
| 2485 | if (begin == end || *begin++ != '}') |
| 2486 | return handler.on_error("invalid format string"), begin; |
| 2487 | } else { |
| 2488 | return handler.on_error("missing precision specifier"), begin; |
| 2489 | } |
| 2490 | handler.end_precision(); |
| 2491 | return begin; |
| 2492 | } |
| 2493 | |
| 2494 | // Parses standard format specifiers and sends notifications about parsed |
| 2495 | // components to handler. |
no test coverage detected