Simplify parse context

This commit is contained in:
Victor Zverovich
2022-12-24 15:20:24 -08:00
parent 407e7b7b6d
commit d1745084e0
5 changed files with 41 additions and 49 deletions
+2 -2
View File
@@ -402,7 +402,7 @@ void vprintf(buffer<Char>& buf, basic_string_view<Char> format,
// Parse argument index, flags and width.
int arg_index = parse_header(it, end, specs, get_arg);
if (arg_index == 0) parse_ctx.on_error("argument not found");
if (arg_index == 0) throw_format_error("argument not found");
// Parse precision.
if (it != end && *it == '.') {
@@ -504,7 +504,7 @@ void vprintf(buffer<Char>& buf, basic_string_view<Char> format,
}
specs.type = parse_presentation_type(type);
if (specs.type == presentation_type::none)
parse_ctx.on_error("invalid type specifier");
throw_format_error("invalid type specifier");
start = it;