4 #ifndef LEXY_DSL_ERROR_HPP_INCLUDED
5 #define LEXY_DSL_ERROR_HPP_INCLUDED
13 template <
typename Tag,
typename Rule>
16 template <
typename NextParser>
19 template <
typename Context,
typename Reader,
typename... Args>
22 auto begin = reader.position();
23 auto end = reader.position();
24 if constexpr (!std::is_same_v<Rule, void>)
27 parser.try_parse(reader);
36 template <
typename Reader>
48 template <
typename Tag>
54 template <
typename Branch,
typename Error>
57 template <
typename NextParser>
60 template <
typename Context,
typename Reader,
typename... Args>
65 if (branch.try_parse(context.control_block, reader))
66 return branch.template finish<NextParser>(context, reader,
LEXY_FWD(args)...);
67 branch.cancel(context);
78 template <
typename Reader>
82 template <
typename Branch>
85 template <
typename Tag>
88 template <
typename Rule>
91 auto err = lexyd::error<Tag>(rule);
92 return _must<Branch, decltype(err)>{};
96 template <
typename Tag>
102 template <
typename Branch>
105 static_assert(lexy::is_branch_rule<Branch>);
106 static_assert(!lexy::is_unconditional_branch_rule<Branch>);
111 #endif // LEXY_DSL_ERROR_HPP_INCLUDED