di 0.1.0
Loading...
Searching...
No Matches
eof_parser.h
Go to the documentation of this file.
1#pragma once
2
8
9namespace di::parser {
10namespace detail {
11 class EofParser : public ParserBase<EofParser> {
12 public:
13 template<concepts::ParserContext Context>
14 constexpr auto parse(Context& context) const -> meta::ParserContextResult<void, Context> {
15 if (!container::empty(context)) {
16 return vocab::Unexpected(context.make_error());
17 }
18 return {};
19 }
20 };
21
22 struct EofFunction {
23 constexpr auto operator()() const { return EofParser {}; }
24 };
25}
26
27constexpr inline auto eof = detail::EofFunction {};
28}
constexpr auto empty
Definition empty.h:45
vocab::Expected< T, meta::ParserContextError< Context > > ParserContextResult
Definition parser_context_result.h:8
Definition code_point_parser.h:10
constexpr auto eof
Definition eof_parser.h:27
constexpr auto parse
Definition parse.h:23
Unexpected(E &&) -> Unexpected< meta::UnwrapRefDecay< E > >