| 12 | #include <boost/parser/parser.hpp> |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | namespace bp = boost::parser; |
| 17 | { |
| 18 | auto const parser = |
| 19 | bp::string("FOO") >> -(bp::string("bar") | bp::string("foo")); |
| 20 | |
| 21 | auto result = bp::parse("FOOfoo", parser); |
| 22 | BOOST_TEST(result); |
| 23 | BOOST_TEST(bp::get(*result, bp::llong<0>{}) == std::string("FOO")); |
| 24 | BOOST_TEST(bp::get(*result, bp::llong<1>{}) == std::string("foo")); |
| 25 | } |
| 26 | return boost::report_errors(); |
| 27 | } |