Boost logo

Boost Users :

Subject: Re: [Boost-users] [spirit] qi::raw and skip parsers
From: Juraj Ivanèiæ (juraj.ivancic_at_[hidden])
Date: 2010-11-25 07:10:46


On 25.11.2010 12:50, Joel de Guzman wrote:
> On 11/25/2010 7:19 PM, Juraj Ivanèiæ wrote:
>> I got unexpected results when I introduced qi::raw[] inside qi expressions. It seems that
>> under certain circumstances qi::raw[] inhibits skip parser and thus fails to parse valid
>> input. Furthermore, parse error only occurs if expression is stored in a rule - if
>> expression is used directly as an argument to qi::parse everything works. Example attached.
>>
>> Is this a bug?
>> If not - could someone kindly explain the rationale for this behavior.
>
> You need to give the rule the skip parser to use, otherwise
> it will inhibit skip parsing. try:
>
> qi::rule<std::string::const_iterator, std::string(), qi::space_type> rule( expr );

D'oh. Makes perfect sense. Thank you.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net