I've just started using Spirit X3 and I have a little question related with my first test. Do you know why this function is returning "false"?
bool parse()
{
std::string rc = "a 6 literal 8";
auto iter_begin = rc.begin();
auto iter_end = rc.end();
bool bOK= phrase_parse( iter_begin, iter_end,
// ----- start parser -----
alpha >> *alnum >> "literal" >> *alnum
// ----- end parser -----
, space);
return bOK && iter_begin == iter_end;
}
I've seen the problem is related with how I write the grammar. If I replace it with this one, it returns "true"
alpha >> -alnum >> "literal" >> *alnum
I'm using the Spirit version included in Boost 1.61.0.
Thanks in advance,
Sen