| 1 | /*============================================================================= |
|---|---|
| 2 | Copyright (c) 2011 Bryce Lelbach |
| 3 | |
| 4 | Use, modification and distribution is subject to the Boost Software |
| 5 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 6 | http://www.boost.org/LICENSE_1_0.txt) |
| 7 | =============================================================================*/ |
| 8 | #include <boost/spirit/include/qi_repeat.hpp> |
| 9 | |
| 10 | #include <boost/spirit/include/qi_operator.hpp> |
| 11 | #include <boost/spirit/include/qi_char.hpp> |
| 12 | #include <boost/phoenix/core.hpp> |
| 13 | |
| 14 | #include "test.hpp" |
| 15 | |
| 16 | int |
| 17 | main() |
| 18 | { |
| 19 | using spirit_test::test_attr; |
| 20 | using boost::spirit::qi::repeat; |
| 21 | using boost::spirit::qi::char_; |
| 22 | using boost::phoenix::ref; |
| 23 | |
| 24 | int n = 5; |
| 25 | std::string s = ""; |
| 26 | |
| 27 | // this was broken by the addition of handles_container, due to incorrect |
| 28 | // dispatching of lazy parsers/directives/terminals in pass_container |
| 29 | BOOST_TEST(test_attr("foobar", char_ >> repeat(ref(n))[char_], s)); |
| 30 | |
| 31 | BOOST_TEST_EQ(s, "foobar"); |
| 32 | |
| 33 | return boost::report_errors(); |
| 34 | } |
| 35 | |
| 36 |
