7 #include "arg_router/parsing/parsing.hpp"
8 #include "arg_router/policy/multi_stage_value.hpp"
37 constexpr
static auto priority = std::size_t{760};
49 [[nodiscard]] constexpr
static std::string_view
token_end_marker() noexcept {
return S::get(); }
63 template <
typename ProcessedTarget,
typename... Parents>
68 [[maybe_unused]]
const Parents&... parents)
const
70 static_assert((
sizeof...(Parents) >= 1),
71 "At least one parent needed for token_end_marker_t");
73 using owner_type = boost::mp11::mp_first<std::tuple<Parents...>>;
75 constexpr
auto has_count = traits::has_minimum_count_method_v<owner_type> &&
76 traits::has_maximum_count_method_v<owner_type>;
77 static_assert(has_count,
"Token end marker can only be used in variable list length nodes");
79 if constexpr (has_count) {
80 static_assert((owner_type::minimum_count() != owner_type::maximum_count()) &&
81 !policy::has_multi_stage_value_v<owner_type>,
82 "Token end marker can only be used in variable list length nodes");
87 const auto it = std::find_if(tokens.
begin() + (owner_type::is_named ? 1 : 0),
89 [](
auto&& token) { return token.name == token_end_marker(); });
98 "Token end markers must not be an empty string");
100 "Token end markers cannot contain whitespace");
107 template <
typename S>
110 template <
typename S>
111 struct is_policy<token_end_marker_t<S>> : std::true_type {
void transfer(iterator it)
iterator erase(iterator it)
constexpr static auto priority
parsing::pre_parse_result pre_parse_phase(parsing::dynamic_token_adapter &tokens, [[maybe_unused]] utility::compile_time_optional< ProcessedTarget > processed_target, [[maybe_unused]] parsing::parse_target &target, [[maybe_unused]] const Parents &... parents) const
constexpr token_end_marker_t([[maybe_unused]] S str={}) noexcept
constexpr static std::string_view token_end_marker() noexcept
constexpr auto token_end_marker
constexpr bool contains_whitespace(std::string_view str) noexcept
constexpr std::size_t count(std::string_view str) noexcept