Skip to content

Commit

Permalink
Complete scan_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut authored and happymonkey1 committed Apr 6, 2024
1 parent b2413f9 commit d145976
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,9 @@ struct arg_scanner {
iterator end;
const format_specs<>& specs;

template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
auto operator()(T) -> iterator {
// TODO
template <typename T>
auto operator()(T&&) -> iterator {
// TODO: implement
return begin;
}
};
Expand Down Expand Up @@ -589,8 +589,7 @@ struct scan_handler : error_handler {
scan_arg arg = scan_ctx_.arg(arg_id);
auto it = scan_ctx_.begin(), end = scan_ctx_.end();
while (it != end && is_whitespace(*it)) ++it;
arg.visit(default_arg_scanner{it, end});
scan_ctx_.advance_to(it);
scan_ctx_.advance_to(arg.visit(default_arg_scanner{it, end}));
}

auto on_format_specs(int arg_id, const char* begin, const char* end) -> const
Expand All @@ -602,9 +601,7 @@ struct scan_handler : error_handler {
begin = parse_scan_specs(begin, end, specs, arg.type());
if (begin == end || *begin != '}') on_error("missing '}' in format string");
auto s = arg_scanner{scan_ctx_.begin(), scan_ctx_.end(), specs};
// TODO: scan argument according to specs
(void)s;
// context.advance_to(visit_format_arg(s, arg));
scan_ctx_.advance_to(arg.visit(s));
return begin;
}

Expand Down

0 comments on commit d145976

Please sign in to comment.