Go to the documentation of this file.
4 #ifndef LEXY_DSL_TIMES_HPP_INCLUDED
5 #define LEXY_DSL_TIMES_HPP_INCLUDED
12 template <std::
size_t N,
typename Rule,
typename Sep>
15 template <std::
size_t I = N>
20 if constexpr (std::is_same_v<Sep, void>)
23 return Rule{} +
typename Sep::trailing_rule{};
27 if constexpr (std::is_same_v<Sep, void>)
34 template <
typename NextParser>
39 template <std::
size_t N,
typename Rule>
47 template <std::
size_t N,
typename Rule,
typename Sep>
51 static_assert(lexy::is_separator<Sep>);
55 template <
typename Rule>
58 return times<2>(rule);
60 template <
typename Rule,
typename Sep>
63 return times<2>(rule,
sep);
67 #endif // LEXY_DSL_TIMES_HPP_INCLUDED
constexpr auto sep(Branch)
Defines a separator for a list.
constexpr auto twice(Rule rule)
lexy::parser_for< decltype(_repeated_rule()), NextParser > p
static constexpr auto _repeated_rule()
typename Rule::template p< NextParser > parser_for
constexpr auto times(Rule)
Repeats the rule N times in sequence.