Go to the documentation of this file.
4 #ifndef LEXY_DSL_COMBINATION_HPP_INCLUDED
5 #define LEXY_DSL_COMBINATION_HPP_INCLUDED
20 return "combination duplicate";
27 template <
typename Sink>
41 template <std::
size_t Idx>
44 template <
typename NextParser>
47 template <
typename Context,
typename Reader,
typename Sink,
typename... Args>
52 if constexpr (
sizeof...(Args) > 0)
63 template <
typename DuplicateError,
typename ElseRule,
typename... R>
66 template <std::size_t... Idx>
69 if constexpr (std::is_void_v<ElseRule>)
76 template <
typename NextParser>
79 template <
typename Context,
typename Reader,
typename... Args>
82 constexpr
auto N =
sizeof...(R);
84 auto sink = context.value_callback().sink();
91 auto begin = reader.position();
121 template <
typename Tag>
124 template <
typename Tag>
130 template <
typename... R>
134 static_assert((!lexy::is_unconditional_branch_rule<R> && ...),
135 "combination() does not support unconditional branches");
141 template <
typename... R>
145 static_assert((!lexy::is_unconditional_branch_rule<R> && ...),
146 "partial_combination() does not support unconditional branches");
152 #endif // LEXY_DSL_COMBINATION_HPP_INCLUDED
make_index_sequence< sizeof...(T)> index_sequence_for
static auto _comb_choice_(lexy::_detail::index_sequence< Idx... >)
std::conditional_t< std::is_void_v< T >, Fallback, T > type_or
#define LEXY_REQUIRE_BRANCH_RULE(Rule, Name)
constexpr auto count
Sink that counts all arguments.
constexpr auto parse(const Input &input, const ErrorCallback &callback)
Parses the production into a value, invoking the callback on error.
static constexpr _comb< Tag, ElseRule, R... > duplicate_error
decltype(_comb_choice_(lexy::_detail::index_sequence_for< R... >{})) _comb_choice
static constexpr _comb< DuplicateError, _err< Tag, void >, R... > missing_error
constexpr auto begin(const C &c) -> decltype(c.begin())
A parser that does not support any arguments.
constexpr auto partial_combination(R...)
constexpr auto break_
Exits a loop().
static LEXY_PARSER_FUNC bool parse(Context &, Reader &, _comb_control< Sink > &ctrl, Args &&... args)
constexpr auto combination(R...)
static LEXY_PARSER_FUNC bool parse(Context &context, Reader &reader, Args &&... args)
static LEXY_PARSER_FUNC auto parse(Context &context, Reader &reader, Sink &sink, Args &&... args)
typename Rule::template p< NextParser > parser_for
static LEXY_CONSTEVAL auto name()