(follow up to): parse iterator going past end()

Dan Bloomquist via Spirit-general <[email protected]> Sat, 25 Apr 2020 12:58:03 -0700
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
Hi,
I thought I would just do a work around with a simple seek and I ended 
up looking at what the problem was. So in seek with data like "x\n", the 
skipper takes the iterator to the end of the text and then the loop 
increments past end. So I would guess that instead of,(this is from seek):

             for (/**/; current != last; ++current)
             {
                 if (this->subject.parse(current, last, context, 
rcontext, attr))
                 {
                     first = current;
                     return true;
                 }
             }

It should be:

             for (; ; ++current)
             {
                 if (this->subject.parse(current, last, context, 
rcontext, attr))
                 {
                     first = current;
                     return true;
                 }
              if(current == last)
                    break;
             }


_______________________________________________
Spirit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general