MCPcopy Create free account
hub / github.com/boostorg/parser / search_impl

Function search_impl

include/boost/parser/search.hpp:106–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 typename ErrorHandler,
105 typename SkipParser>
106 auto search_impl(
107 R && r,
108 parser_interface<Parser, GlobalState, ErrorHandler> const & parser,
109 parser_interface<SkipParser> const & skip,
110 trace trace_mode)
111 {
112 auto first = text::detail::begin(r);
113 auto const last = text::detail::end(r);
114
115 if (first == last)
116 return BOOST_PARSER_SUBRANGE(first, first);
117
118 auto const search_parser = omit[*(char_ - parser)] >> -raw[parser];
119 if constexpr (std::is_same_v<SkipParser, eps_parser<phony>>) {
120 auto result = parser::prefix_parse(
121 first, last, search_parser, trace_mode);
122 if (*result)
123 return **result;
124 } else {
125 auto result = parser::prefix_parse(
126 first, last, search_parser, skip, trace_mode);
127 if (*result)
128 return **result;
129 }
130
131 return BOOST_PARSER_SUBRANGE(first, first);
132 }
133
134 template<
135 typename R,

Calls 3

prefix_parseFunction · 0.85
beginFunction · 0.70
endFunction · 0.70

Tested by

no test coverage detected