11 template<
typename Parser,
typename Fun>
14 template<
typename P,
typename F>
18 template<concepts::ParserContext Context,
typename Value = meta::ParserValue<Context, Parser>>
20 constexpr auto parse(Context& context)
const {
23 return m_parser.parse(context).and_then([&] {
24 return m_function(context) |
if_error([&](
auto&&) {
25 context.advance(begin_save);
29 return m_parser.parse(context).and_then([&](Value&& value) {
30 return m_function(context, util::forward<Value>(value)) |
if_error([&](
auto&&) {
31 context.advance(begin_save);
43 template<concepts::DecayConstructible Parser, concepts::DecayConstructible Fun>
53template<concepts::DecayConstructible Parser, concepts::DecayConstructible Fun>
Definition parser_base.h:5
constexpr auto parse(Context &context) const
Definition and_then.h:20
constexpr AndThenParser(InPlace, P &&parser, F &&function)
Definition and_then.h:15
Definition operations.h:114
constexpr auto begin
Definition begin.h:44
Definition zstring_parser.h:10
Definition zstring_parser.h:9
constexpr auto and_then
Definition and_then.h:51
constexpr auto if_error
Definition if_error.h:28
constexpr auto in_place
Definition in_place.h:8
constexpr auto operator()(Parser &&parser, Fun &&function) const
Definition and_then.h:44