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

Method call_impl

include/boost/parser/parser.hpp:4477–4604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4475 typename Indices,
4476 typename Merged>
4477 void call_impl(
4478 Iter & first,
4479 Sentinel last,
4480 Context const & context,
4481 SkipParser const & skip,
4482 detail::flags flags,
4483 bool & success,
4484 Attribute & retval,
4485 Indices const & indices,
4486 Merged const & merged) const
4487 {
4488 using detail::merge_wrap;
4489 using detail::merge_kind;
4490
4491 static_assert(
4492 detail::is_tuple<Attribute>{} || std::is_aggregate_v<Attribute>,
4493 "");
4494
4495 auto use_parser = [&first,
4496 last,
4497 &context,
4498 &skip,
4499 flags_ = flags,
4500 &success,
4501 &retval](auto const &
4502 parser_index_merged_and_backtrack) {
4503 if (!success) // Someone earlier already failed...
4504 return;
4505 auto flags = flags_;
4506 using namespace literals;
4507 detail::skip(first, last, skip, flags);
4508
4509 auto const & parser =
4510 parser::get(parser_index_merged_and_backtrack, 0_c);
4511 auto merge_kind_t_ =
4512 parser::get(parser_index_merged_and_backtrack, 2_c);
4513 constexpr bool was_merged_into_adjacent_container =
4514 decltype(merge_kind_t_)::kind == merge_kind::merged;
4515 constexpr bool is_in_a_group =
4516 decltype(merge_kind_t_)::kind == merge_kind::group;
4517 bool const can_backtrack =
4518 parser::get(parser_index_merged_and_backtrack, 3_c);
4519
4520 if (!detail::gen_attrs(flags)) {
4521 parser.call(first, last, context, skip, flags, success);
4522 if (!success && !can_backtrack) {
4523 std::stringstream oss;
4524 detail::print_parser(context, parser, oss);
4525 throw parse_error<Iter>(first, oss.str());
4526 }
4527 return;
4528 }
4529
4530 auto const tuple_idx =
4531 parser::get(parser_index_merged_and_backtrack, 1_c);
4532 auto const tuple_size = detail::tuple_or_struct_size(retval);
4533 static_assert(
4534 decltype(tuple_idx)::value < decltype(tuple_size)::value,

Callers

nothing calls this directly

Calls 9

print_parserFunction · 0.85
tuple_or_struct_sizeFunction · 0.85
assignFunction · 0.85
move_backFunction · 0.85
zipFunction · 0.85
applyFunction · 0.85
getFunction · 0.70
callMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected