Assuming I have the following rule:
identifier %=
lexeme[
char_("a-zA-Z")
>> -(*char_("a-zA-Z_0-9")
>> char_("a-zA-Z0-9"))
]
;
qi::rule<Iterator, std::string(), Skipper> identifier;
and the following input:
// identifier
This_is_a_valid123_Identifier
As the traces show the identifier is parsed properly and the attributes are set but the skipper starts one char after the first character of the string again:
<identifier>
<try>This_is_a_valid123_I</try>
<skip>
<try>This_is_a_valid123_I</try>
<emptylines>
<try>This_is_a_valid123_I</try>
<fail/>
</emptylines>
<comment>
<try>This_is_a_valid123_I</try>
<fail/>
</comment>
<fail/>
</skip>
<success>his_is_a_valid123_Id</success>
<attributes>[[T, h, i, s, _, i, s, _, a, _, v, a, l, i, d, 1, 2, 3, _, I, d, e, n, t, i, f, i, e, r]]</attributes>
</identifier>
<skip>
<try>his_is_a_valid123_Id</try>
<emptylines>
<try>his_is_a_valid123_Id</try>
<fail/>
</emptylines>
<comment>
<try>his_is_a_valid123_Id</try>
<fail/>
</comment>
<fail/>
</skip>
I've already tried to use as_string in the lexeme expression which did not help.