Ticket #6291: disctinct_patch.patch
File disctinct_patch.patch, 2.2 KB (added by , 10 years ago) |
---|
-
boost/spirit/repository/home/qi/directive/distinct.hpp
64 64 : spirit::qi::unary_parser<distinct_parser<Subject, Tail, Modifier> > 65 65 { 66 66 template <typename Context, typename Iterator> 67 struct attribute 68 : traits::attribute_of<Subject, Context, Iterator>69 {};67 struct attribute : traits::attribute_of<Subject, Context, Iterator> 68 { 69 }; 70 70 71 71 distinct_parser(Subject const& subject, Tail const& tail) 72 72 : subject(subject), tail(tail) {} … … 137 137 struct has_semantic_action< 138 138 repository::qi::distinct_parser<Subject, Tail, Modifier> > 139 139 : unary_has_semantic_action<Subject> {}; 140 141 template <typename Subject, typename Tail, typename Modifier, 142 typename Attribute ,typename Context, typename Iterator> 143 struct handles_container< repository::qi::distinct_parser<Subject, Tail, Modifier> 144 , Attribute, Context, Iterator> 145 : handles_container<Subject, Attribute, Context, Iterator> {}; 140 146 }}} 141 147 142 148 #endif -
libs/spirit/repository/test/qi/distinct.cpp
96 96 BOOST_TEST(!test("descriptionident", r, space)); 97 97 } 98 98 99 { 100 using namespace boost::spirit::ascii; 101 namespace repo=boost::spirit::repository; 102 boost::spirit::qi::rule<const char*, std::string(), space_type> string_keyword; 103 string_keyword %= '+' >> (repo::qi::distinct("0-9a-zA-Z_")[string("ALPHA")] | 104 repo::qi::distinct("0-9a-zA-Z_")[string("BETA")]); 105 106 std::string r1; 107 BOOST_TEST(test_attr("+ BETA",string_keyword,r1,space)); 108 BOOST_TEST(r1.compare("BETA")==0); 109 BOOST_TEST(!test_attr("+ BETAA",string_keyword,r1,space)); 110 111 } 99 112 return boost::report_errors(); 100 113 } 101 114