| 477 | } |
| 478 | |
| 479 | void github_issue_285() |
| 480 | { |
| 481 | using namespace github_issue_285_; |
| 482 | namespace bp = boost::parser; |
| 483 | |
| 484 | constexpr auto prolog = bp::lit(U"prolog") >> bp::eol; |
| 485 | |
| 486 | constexpr auto epilog = |
| 487 | bp::no_case[bp::lexeme[bp::lit(U"epi") >> bp::lit(U"log")]] >> bp::eol; |
| 488 | |
| 489 | constexpr auto full_parser = prolog >> content >> epilog; |
| 490 | |
| 491 | std::string teststring = |
| 492 | "prolog\n" |
| 493 | "content\n" |
| 494 | "epilog\n"; |
| 495 | |
| 496 | // "content" produces a shared_ptr with the result. |
| 497 | // The "epilog" parser must not delete the result. |
| 498 | |
| 499 | auto const result = bp::parse(teststring, full_parser, bp::blank); |
| 500 | BOOST_TEST(result); |
| 501 | BOOST_TEST(result.value().get() != nullptr); |
| 502 | } |
| 503 | |
| 504 | void github_pr_290() |
| 505 | { |