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

Method prepend

include/boost/parser/parser.hpp:6397–6413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6395 template<typename ParserTuple>
6396 template<typename Parser>
6397 constexpr auto or_parser<ParserTuple>::prepend(
6398 parser_interface<Parser> parser) const noexcept
6399 {
6400 // If you're seeing this as a compile- or run-time failure, you've
6401 // tried to put an eps parser at the beginning of an
6402 // alternative-parser, such as "eps | (int_ | double_)". This is not
6403 // what you meant. Since eps always matches any input, "eps | (int_ |
6404 // double_)" is just an awkward spelling for "eps". To fix this this,
6405 // put the eps as the last alternative, so the other alternatives get
6406 // a chance. Possibly, you may have meant to add a condition to the
6407 // eps, like "eps(condition) | (int_ | double_)", which also is
6408 // meaningful, and so is allowed.
6409 BOOST_PARSER_ASSERT(!detail::is_unconditional_eps<Parser>{});
6410 return parser_interface{
6411 or_parser<decltype(detail::hl::prepend(parsers_, parser.parser_))>{
6412 detail::hl::prepend(parsers_, parser.parser_)}};
6413 }
6414
6415 template<typename ParserTuple>
6416 template<typename Parser>

Callers 2

operator|Function · 0.80
operator||Function · 0.80

Calls 2

prependFunction · 0.85
drop_frontFunction · 0.85

Tested by

no test coverage detected