mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-28 15:28:35 +00:00
Complete scan_handler
This commit is contained in:
parent
138a64bfb1
commit
f5ca178c12
13
test/scan.h
13
test/scan.h
@ -546,9 +546,9 @@ struct arg_scanner {
|
|||||||
iterator end;
|
iterator end;
|
||||||
const format_specs<>& specs;
|
const format_specs<>& specs;
|
||||||
|
|
||||||
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
|
template <typename T>
|
||||||
auto operator()(T) -> iterator {
|
auto operator()(T&&) -> iterator {
|
||||||
// TODO
|
// TODO: implement
|
||||||
return begin;
|
return begin;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -589,8 +589,7 @@ struct scan_handler : error_handler {
|
|||||||
scan_arg arg = scan_ctx_.arg(arg_id);
|
scan_arg arg = scan_ctx_.arg(arg_id);
|
||||||
auto it = scan_ctx_.begin(), end = scan_ctx_.end();
|
auto it = scan_ctx_.begin(), end = scan_ctx_.end();
|
||||||
while (it != end && is_whitespace(*it)) ++it;
|
while (it != end && is_whitespace(*it)) ++it;
|
||||||
arg.visit(default_arg_scanner{it, end});
|
scan_ctx_.advance_to(arg.visit(default_arg_scanner{it, end}));
|
||||||
scan_ctx_.advance_to(it);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto on_format_specs(int arg_id, const char* begin, const char* end) -> const
|
auto on_format_specs(int arg_id, const char* begin, const char* end) -> const
|
||||||
@ -602,9 +601,7 @@ struct scan_handler : error_handler {
|
|||||||
begin = parse_scan_specs(begin, end, specs, arg.type());
|
begin = parse_scan_specs(begin, end, specs, arg.type());
|
||||||
if (begin == end || *begin != '}') on_error("missing '}' in format string");
|
if (begin == end || *begin != '}') on_error("missing '}' in format string");
|
||||||
auto s = arg_scanner{scan_ctx_.begin(), scan_ctx_.end(), specs};
|
auto s = arg_scanner{scan_ctx_.begin(), scan_ctx_.end(), specs};
|
||||||
// TODO: scan argument according to specs
|
scan_ctx_.advance_to(arg.visit(s));
|
||||||
(void)s;
|
|
||||||
// context.advance_to(visit_format_arg(s, arg));
|
|
||||||
return begin;
|
return begin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user