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

Function github_issue_279

test/github_issues.cpp:424–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424void github_issue_279()
425{
426 namespace bp = boost::parser;
427
428 {
429 constexpr auto condition_clause =
430 bp::lit(U"while") > bp::lit(U"someexpression") >> bp::attr(true);
431
432 constexpr auto do_statement =
433 bp::lexeme[bp::lit(U"do") >> &bp::ws] > -condition_clause > bp::eol;
434
435 auto const result =
436 bp::parse(U"do\n", do_statement, bp::blank, bp::trace::off);
437 BOOST_TEST(result);
438 std::optional<bool> const & condition = result.value();
439 BOOST_TEST(!condition.has_value());
440 }
441
442 {
443 constexpr auto condition_clause =
444 bp::lit(U"while") > bp::lit(U"someexpression") >> bp::attr(true);
445
446 constexpr auto do_statement_reverse =
447 -condition_clause > bp::lexeme[bp::lit(U"do") >> &bp::ws] > bp::eol;
448
449 auto const result =
450 bp::parse(U"do\n", do_statement_reverse, bp::blank, bp::trace::off);
451 BOOST_TEST(result);
452 std::optional<bool> const & condition = result.value();
453 BOOST_TEST(!condition.has_value());
454 }
455}
456
457namespace github_issue_285_ {
458 namespace bp = boost::parser;

Callers 1

mainFunction · 0.85

Calls 4

litFunction · 0.85
attrFunction · 0.85
parseFunction · 0.50
valueMethod · 0.45

Tested by

no test coverage detected