[Boost-bugs] [Boost C++ Libraries] #7371: boost::spirit::classic::char_parser<DerivedT>::parse is incrementing the scanner's first iterator directly instead of using the provided iterator_policy

Subject: [Boost-bugs] [Boost C++ Libraries] #7371: boost::spirit::classic::char_parser<DerivedT>::parse is incrementing the scanner's first iterator directly instead of using the provided iterator_policy
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-13 10:28:17


#7371: boost::spirit::classic::char_parser<DerivedT>::parse is incrementing the
scanner's first iterator directly instead of using the provided
iterator_policy
----------------------------------------+-----------------------------------
 Reporter: mhilferink@… | Owner: djowel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
  Version: Boost 1.51.0 | Severity: Problem
 Keywords: scanner iterator_policy |
----------------------------------------+-----------------------------------
 In boost\spirit\home\classic\core\primitives\primitives.hpp

 boost::spirit::classic::char_parser<DerivedT>::parse
 is defined to increment the scanner's first iterator directly instead of
 using the provided iterator_policy.

 I'm using a scanner with an iterator that doesn't have a ++ operator and
 provided an iteration policy with redefined advance, get, and at_end
 methods.

 This works fine if the following patch is implemented
 in boost\spirit\home\classic\core\primitives\primitives.hpp:


 {{{
   if (!scan.at_end())
   {
       value_t ch = *scan;
       if (this->derived().test(ch))
       {
           iterator_t save(scan.first);
 - ++scan.first;
 + ++scan;
           return scan.create_match(1, ch, save, scan.first);
       }
   }

 }}}

 This patch forwards the increment request to
 scanner_policies<streamer_policy>::advance to let it do its thing with
 scan.first


 I've seen this (and corrected it locally) at least in boost.sprit from
 boost version 1.40.0 and 1.51.0

 Can somebody with RW access to boost.spirit implement this? Or tell me I
 should adapt my iterator objects directly.

 I'm new to GIT and not a spirit developer, but I can try to make a git
 pull request if that is the way to send-in change requests.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7371>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC