mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-03 07:31:41 +01:00
Simplify format string parsing
This commit is contained in:
@@ -523,9 +523,10 @@ TEST(format_test, constexpr_parse_arg_id) {
|
||||
template <size_t N> constexpr auto parse_test_specs(const char (&s)[N]) {
|
||||
auto ctx = fmt::detail::compile_parse_context<char>(fmt::string_view(s, N),
|
||||
43, nullptr);
|
||||
auto result = fmt::detail::parse_format_specs(s, s + N - 1, ctx,
|
||||
fmt::detail::type::float_type);
|
||||
return result.specs;
|
||||
auto specs = fmt::detail::dynamic_format_specs<>();
|
||||
fmt::detail::parse_format_specs(s, s + N - 1, specs, ctx,
|
||||
fmt::detail::type::float_type);
|
||||
return specs;
|
||||
}
|
||||
|
||||
TEST(core_test, constexpr_parse_format_specs) {
|
||||
|
||||
@@ -518,11 +518,10 @@ template <class charT> struct formatter<std::complex<double>, charT> {
|
||||
public:
|
||||
FMT_CONSTEXPR typename basic_format_parse_context<charT>::iterator parse(
|
||||
basic_format_parse_context<charT>& ctx) {
|
||||
auto result = parse_format_specs(ctx.begin(), ctx.end(), ctx,
|
||||
detail::type::string_type);
|
||||
specs_ = result.specs;
|
||||
auto end = parse_format_specs(ctx.begin(), ctx.end(), specs_, ctx,
|
||||
detail::type::string_type);
|
||||
detail::parse_float_type_spec(specs_, detail::error_handler());
|
||||
return result.end;
|
||||
return end;
|
||||
}
|
||||
|
||||
template <class FormatContext>
|
||||
|
||||
Reference in New Issue
Block a user