| 3806 | } |
| 3807 | |
| 3808 | auto on_format_specs(int id, const Char* begin, const Char* end) |
| 3809 | -> const Char* { |
| 3810 | auto arg = ctx.arg(id); |
| 3811 | if (!arg) report_error("argument not found"); |
| 3812 | // Not using a visitor for custom types gives better codegen. |
| 3813 | if (arg.format_custom(begin, parse_ctx, ctx)) return parse_ctx.begin(); |
| 3814 | |
| 3815 | auto specs = dynamic_format_specs<Char>(); |
| 3816 | begin = parse_format_specs(begin, end, specs, parse_ctx, arg.type()); |
| 3817 | if (specs.dynamic()) { |
| 3818 | handle_dynamic_spec(specs.dynamic_width(), specs.width, specs.width_ref, |
| 3819 | ctx); |
| 3820 | handle_dynamic_spec(specs.dynamic_precision(), specs.precision, |
| 3821 | specs.precision_ref, ctx); |
| 3822 | } |
| 3823 | |
| 3824 | arg.visit(arg_formatter<Char>{ctx.out(), specs, ctx.locale()}); |
| 3825 | return begin; |
| 3826 | } |
| 3827 | |
| 3828 | FMT_NORETURN void on_error(const char* message) { report_error(message); } |
| 3829 | }; |
no test coverage detected