Skip to content

Commit 6ee9ae2

Browse files
author
Andreas Buhr
committed
Extend reproducer for github issue 279
1 parent d873d7e commit 6ee9ae2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/github_issues.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,22 @@ void github_issue_279()
361361
BOOST_TEST(!condition.has_value());
362362
}
363363

364+
void github_issue_279_2()
365+
{
366+
namespace bp = boost::parser;
367+
368+
constexpr auto condition_clause = bp::lit(U"while") >
369+
bp::lit(U"someexpression") >> bp::attr(true);
370+
371+
constexpr auto do_statement_reverse =
372+
-condition_clause > bp::lexeme[bp::lit(U"do") >> &bp::ws] > bp::eol;
373+
374+
auto const result = bp::parse(
375+
U"do\n", do_statement_reverse, bp::blank, bp::trace::off);
376+
BOOST_TEST(result);
377+
std::optional<bool> const & condition = result.value();
378+
BOOST_TEST(!condition.has_value());
379+
}
364380

365381
int main()
366382
{
@@ -374,5 +390,6 @@ int main()
374390
github_issue_223();
375391
github_issue_248();
376392
github_issue_279();
393+
github_issue_279_2();
377394
return boost::report_errors();
378395
}

0 commit comments

Comments
 (0)