From 6ee9ae283af0b895c553952b39582136fd90d08e Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Tue, 14 Oct 2025 16:43:31 +0200 Subject: [PATCH] Extend reproducer for github issue 279 --- test/github_issues.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/github_issues.cpp b/test/github_issues.cpp index f64beccb..83ae4c1b 100644 --- a/test/github_issues.cpp +++ b/test/github_issues.cpp @@ -361,6 +361,22 @@ void github_issue_279() BOOST_TEST(!condition.has_value()); } +void github_issue_279_2() +{ + namespace bp = boost::parser; + + constexpr auto condition_clause = bp::lit(U"while") > + bp::lit(U"someexpression") >> bp::attr(true); + + constexpr auto do_statement_reverse = + -condition_clause > bp::lexeme[bp::lit(U"do") >> &bp::ws] > bp::eol; + + auto const result = bp::parse( + U"do\n", do_statement_reverse, bp::blank, bp::trace::off); + BOOST_TEST(result); + std::optional const & condition = result.value(); + BOOST_TEST(!condition.has_value()); +} int main() { @@ -374,5 +390,6 @@ int main() github_issue_223(); github_issue_248(); github_issue_279(); + github_issue_279_2(); return boost::report_errors(); }