Boost logo

Boost Users :

From: David McKelvie (david_at_[hidden])
Date: 2005-03-25 07:45:54


John Maddock wrote:

>> That's basically what it does, but when the first potential match is found
>> it "accidentally" ends up computing the length of the whole sequence, I'm
>> testing the patch below now, all being well it should be in cvs shortly.

Thank you for looking at this issue.
I tried your patch and it worked on the regex

  "(aaa)|(bbb)|(.)|(\n)"

But I suspect it isnt the whole story, as I have the same 'seeking to end' problem
with the more realistic tokeniser regex

     "(aaa)|([a-zA-Z][a-zA-Z0-9_-]*)|(.)|(\n)"

where I'm looking for the longest identifier, but want 'aaa' treated as a keyword
provided it isnt followed by other alphanums.

In the foo4.cc file I sent, I changed

  expression.assign("(aaa)|([a-zA-Z][a-zA-Z0-9_-]*)|(.)|(\n)", sflag);

and

MyCharIter& MyCharIter::operator--(){ // prefix --X
  cout << "NT: --X called bp=" << bp << " c= '" << s[bp] <<"'" << endl;
  --bp;
  return *this;
}

as this function is now needed.

I also wondered if the fact that match_continuous is set is relevant
since all (toplevel) matches will start at the same place.

   David McKelvie


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