x3 bug? It cannot synthesize attribute of type boost::iterator_range in a sequence parser
wanghan02 <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
In a simple parser test http://coliru.stacked-crooked.com/a/5b3bde9736c9fc43
<http://coliru.stacked-crooked.com/a/5b3bde9736c9fc43>
std::string str("x123x");
boost::iterator_range<boost::range_iterator<decltype(str)>::type>
attr;
if( x3::parse( boost::begin(str), boost::end(str), *x3::lit('x') >>
x3::raw[+x3::digit] >> x3::lit('x')*, attr ) ) {
std::cout<<"Match! attr = "<<attr<<std::endl;
} else {
std::cout<<"Not match!"<<std::endl;
}
The highlighted code is supposed to synthesize an attribute of type
boost::iterator_range<Iterator>. But it cannot compile. If we remove
either of the two x3::lit('x'), it compiles.
--
View this message in context: http://boost.2283326.n4.nabble.com/x3-bug-It-cannot-synthesize-attribute-of-type-boost-iterator-range-in-a-sequence-parser-tp4692826.html
Sent from the spirit-general mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot