Go to the documentation of this file.
4 #ifndef LEXY_DSL_POSITION_HPP_INCLUDED
5 #define LEXY_DSL_POSITION_HPP_INCLUDED
13 template <
typename NextParser>
16 template <
typename Context,
typename Reader,
typename... Args>
19 auto pos = reader.position();
26 template <
typename Rule>
29 template <
typename Reader>
34 template <
typename ControlBlock>
35 constexpr
auto try_parse(
const ControlBlock* cb,
const Reader& reader)
37 return rule.try_parse(cb, reader);
40 template <
typename Context>
41 constexpr
void cancel(Context& context)
46 template <
typename NextParser,
typename Context,
typename... Args>
49 auto pos = reader.position();
51 return rule.template finish<NextParser>(context, reader,
LEXY_FWD(args)..., pos);
55 template <
typename NextParser>
58 template <
typename Context,
typename Reader,
typename... Args>
61 auto pos = reader.position();
71 template <
typename Rule>
82 #endif // LEXY_DSL_POSITION_HPP_INCLUDED
constexpr auto position
Produces an iterator to the current reader position without parsing anything.
lexy::branch_parser_for< Rule, Reader > rule
typename BranchRule::template bp< Reader > branch_parser_for
constexpr auto try_parse(const ControlBlock *cb, const Reader &reader)
constexpr auto parse(const Input &input, const ErrorCallback &callback)
Parses the production into a value, invoking the callback on error.
LEXY_PARSER_FUNC auto finish(Context &context, Reader &reader, Args &&... args)
static LEXY_PARSER_FUNC bool parse(Context &context, Reader &reader, Args &&... args)
constexpr void cancel(Context &context)
constexpr auto operator()(Rule) const
static LEXY_PARSER_FUNC bool parse(Context &context, Reader &reader, Args &&... args)
decltype(_copy_base_impl< Rule >()) _copy_base