4 #ifndef LEXY_DSL_PEEK_HPP_INCLUDED
5 #define LEXY_DSL_PEEK_HPP_INCLUDED
17 return "peek failure";
33 template <
typename Rule,
typename Tag>
36 template <
typename Reader>
39 typename Reader::iterator
begin;
40 typename Reader::marker
end;
42 constexpr
bool try_parse(
const void*, Reader reader)
47 begin = reader.position();
48 auto result = parser.try_parse(reader);
54 template <
typename Context>
55 constexpr
void cancel(Context& context)
60 template <
typename NextParser,
typename Context,
typename... Args>
68 template <
typename NextParser>
71 template <
typename Context,
typename Reader,
typename... Args>
75 if (!impl.try_parse(context.control_block, reader))
90 template <
typename Error>
94 template <
typename Rule,
typename Tag>
97 template <
typename Reader>
101 typename Reader::marker
end;
108 begin = reader.position();
109 auto result = !parser.try_parse(reader);
115 template <
typename Context>
121 template <
typename NextParser,
typename Context,
typename... Args>
129 template <
typename NextParser>
132 template <
typename Context,
typename Reader,
typename... Args>
136 if (!impl.try_parse(context.control_block, reader))
148 reader.reset(impl.end);
159 template <
typename Error>
165 template <
typename Rule>
172 template <
typename Rule>
179 #endif // LEXY_DSL_PEEK_HPP_INCLUDED