Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/github_issues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> const & condition = result.value();
BOOST_TEST(!condition.has_value());
}

int main()
{
Expand All @@ -374,5 +390,6 @@ int main()
github_issue_223();
github_issue_248();
github_issue_279();
github_issue_279_2();
return boost::report_errors();
}
Loading