Iros
 
Loading...
Searching...
No Matches
match_one.h
Go to the documentation of this file.
1#pragma once
2
3#include "di/meta/relation.h"
9
10namespace di::parser {
11namespace detail {
13 template<concepts::Predicate<c32> Pred>
15 constexpr auto operator()(Pred&& predicate) const {
16 return code_point() << [predicate = auto(util::forward<Pred>(predicate))]<concepts::ParserContext Context>(
18 if (!predicate(code_point)) {
19 return Unexpected(context.make_error());
20 }
21 return code_point;
22 };
23 }
24 };
25}
26
27constexpr inline auto match_one = detail::MatchOneFunction {};
28}
Definition unexpected.h:14
Definition parser_context.h:12
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 code_point
Definition code_point_parser.h:35
constexpr auto match_one
Definition match_one.h:27
char32_t c32
Definition char.h:6
Definition match_one.h:12