Iros
 
Loading...
Searching...
No Matches
match_one_or_more.h
Go to the documentation of this file.
1#pragma once
2
5#include "di/meta/relation.h"
13
14namespace di::parser {
15namespace detail {
17 template<concepts::Predicate<c32> Pred>
19 constexpr auto operator()(Pred&& predicate) const {
20 return match_zero_or_more(util::forward<Pred>(predicate))
21 << []<concepts::ParserContext Context, typename View>(
22 Context& context, View view) -> meta::ParserContextResult<View, Context> {
23 if (container::empty(view)) {
24 return Unexpected(context.make_error());
25 }
26 return view;
27 };
28 }
29 };
30}
31
33}
Definition view.h:35
Definition unexpected.h:14
Definition parser_context.h:12
constexpr auto empty
Definition empty.h:45
vocab::Expected< T, meta::ParserContextError< Context > > ParserContextResult
Definition parser_context_result.h:8
Definition zstring_parser.h:10
Definition zstring_parser.h:9
constexpr auto match_one_or_more
Definition match_one_or_more.h:32
constexpr auto match_zero_or_more
Definition match_zero_or_more.h:48
Definition match_one_or_more.h:16