Make parse_arg_id more readable
This commit is contained in:
parent
092d2dc7b2
commit
404a880bd4
@ -2328,16 +2328,22 @@ FMT_CONSTEXPR const Char* parse_arg_id(const Char* begin, const Char* end,
|
||||
IDHandler&& handler) {
|
||||
FMT_ASSERT(begin != end, "");
|
||||
Char c = *begin;
|
||||
if (c == '}' || c == ':') return handler(), begin;
|
||||
if (c == '}' || c == ':') {
|
||||
handler();
|
||||
return begin;
|
||||
}
|
||||
if (c >= '0' && c <= '9') {
|
||||
int index = parse_nonnegative_int(begin, end, handler);
|
||||
if (begin == end || (*begin != '}' && *begin != ':'))
|
||||
return handler.on_error("invalid format string"), begin;
|
||||
handler(index);
|
||||
handler.on_error("invalid format string");
|
||||
else
|
||||
handler(index);
|
||||
return begin;
|
||||
}
|
||||
if (!is_name_start(c)) {
|
||||
handler.on_error("invalid format string");
|
||||
return begin;
|
||||
}
|
||||
if (!is_name_start(c))
|
||||
return handler.on_error("invalid format string"), begin;
|
||||
auto it = begin;
|
||||
do {
|
||||
++it;
|
||||
|
Loading…
Reference in New Issue
Block a user