Pre-skip ignores whitespace at the start of the expression.
Contrasting:
Live On Coliru
#include <boost/spirit/include/qi.hpp>
namespace qi = boost::spirit::qi;
static std::string const input = " 42j";
int main() {
auto run_test = [](auto p) {
auto f = input.begin(), l = input.end();
int i;
return qi::phrase_parse(f, l, p, qi::space, i)
? std::to_string(i)
: "unparsed";
};
std::cout << "no_skip: " << run_test(qi::no_skip[ qi::int_ >> 'j' ]) << "\n";
std::cout << "lexeme: " << run_test(qi::lexeme[ qi::int_ >> 'j' ]) << "\n";
}
Prints:
no_skip: unparsed
lexeme: 42
As you can see lexeme
will silently eat the leading white space. That's the pre-skip.