di 0.1.0
Loading...
Searching...
No Matches
parse_unchecked.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace di::parser {
9namespace detail {
10 template<typename T>
11 struct ParseUncheckedFunction {
12 template<concepts::IntoParserContext U, typename Context = meta::AsParserContext<U>>
13 requires(concepts::Parsable<T, Context>)
14 constexpr auto operator()(U&& input) const {
15 auto context = into_parser_context(util::forward<U>(input));
16 auto parser = sequence(create_parser<T>(context), eof());
17 auto result = parser.parse(context);
18 DI_ASSERT(result);
19 return *util::move(result);
20 }
21 };
22}
23
24template<typename T>
25constexpr inline auto parse_unchecked = detail::ParseUncheckedFunction<T> {};
26}
27
28namespace di {
30}
#define DI_ASSERT(...)
Definition assert_bool.h:7
Definition code_point_parser.h:10
constexpr auto create_parser
Definition create_parser.h:55
constexpr auto into_parser_context
Definition into_parser_context.h:21
constexpr auto eof
Definition eof_parser.h:27
constexpr auto parse_unchecked
Definition parse_unchecked.h:25
constexpr auto sequence
Definition sequence.h:71
Definition any_storable.h:9