GiveQuoteOrText %= Quoted | qi::attr("Text!");
If the object is more involved you can use qi::eps
:
rule = qi::eps[qi::_val = phx::construct<MyObject>(args)]
It is in each case just a succeeding rule without parsing anything, so the iterator doesn't move. If you want it to move you need to parse the respective part and use qi::omit
to block the attributes (if there are any).