id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 12085,(a - b) === (!b >> a) does not hold in X3,mikhail.strelnikov@…,Joel de Guzman,"Following program checks that two grammars (GRAMMAR1 and GRAMMAR2) are giving the same result for x3 and qi. They don't. GRAMMAR1 is (!b >> a), GRAMMAR2 is (a - b). When x3 is used (USE_X3==1) output is: 1 d[[BR]] 1 abcd[[BR]] When qi is used (USE_X3==0) output is: 1 abcd[[BR]] 1 abcd[[BR]] {{{ #define USE_X3 1 #if USE_X3 == 1 #include #else #include #endif #include #include #include #define GRAMMAR1 !lexeme[keywords >> !(alnum | '_')] >> lexeme[(alpha | '_') >> *(alnum | '_')] #define GRAMMAR2 lexeme[(alpha | '_') >> *(alnum | '_')] - lexeme[keywords >> !(alnum | '_')] int main() { std::string str = ""abcd""; auto end = str.end(); #if USE_X3 == 1 { using namespace boost::spirit::x3; symbols<> keywords({""k1"", ""k2"", ""k3""}); { std::string v; auto begin = str.begin(); bool full = boost::spirit::x3::parse(begin, end, GRAMMAR1, v) && begin == end; std::cout << full << "" "" << v << std::endl; } { std::string v; auto begin = str.begin(); bool full = boost::spirit::x3::parse(begin, end, GRAMMAR2, v) && begin == end; std::cout << full << "" "" << v << std::endl; } } #else { using namespace boost::spirit::qi; symbols<> keywords; keywords = ""k1"", ""k2"", ""k3""; { std::string v; auto begin = str.begin(); bool full = boost::spirit::qi::parse(begin, end, GRAMMAR1, v) && begin == end; std::cout << full << "" "" << v << std::endl; } { std::string v; auto begin = str.begin(); bool full = boost::spirit::qi::parse(begin, end, GRAMMAR2, v) && begin == end; std::cout << full << "" "" << v << std::endl; } } #endif } }}} ",Bugs,closed,To Be Determined,spirit,Boost 1.61.0,Problem,fixed,,