#include #include #include #include #include #include #include #include "test.hpp" using namespace spirit_test; int main() { using boost::spirit::qi::int_; using boost::spirit::qi::rule; using boost::spirit::qi::_1; using boost::spirit::qi::space; using boost::spirit::qi::space_type; using boost::fusion::vector; typedef vector V; typedef rule R; { V val; R r; r %= int_ >> int_; BOOST_TEST((test_attr("1 5", r, val, space) && val == V(1, 5))); } { V val; R r; r %= int_ >> int_[_1]; BOOST_TEST((test_attr("1 5", r, val, space) && val == V(1, 5))); } { V val; R r; r %= (int_ >> int_)[_1]; BOOST_TEST((test_attr("1 5", r, val, space) && val == V(1, 5))); } return boost::report_errors(); }