From 8324fad77c83a0b573ce71dd4845331417c81331 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 4 Nov 2003 11:30:44 +0000 Subject: [PATCH] Tidies up new code, fixed one bug. [SVN r20635] --- .../boost/regex/v4/regex_token_iterator.hpp | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/include/boost/regex/v4/regex_token_iterator.hpp b/include/boost/regex/v4/regex_token_iterator.hpp index a5ed5f3d..eb4dc68d 100644 --- a/include/boost/regex/v4/regex_token_iterator.hpp +++ b/include/boost/regex/v4/regex_token_iterator.hpp @@ -44,9 +44,6 @@ namespace boost{ # pragma warning(disable:4700) #endif -// testing -#define TEST_BECKER_INTERFACE - template regex_type; -#ifdef TEST_BECKER_INTERFACE +#if 1 typedef sub_match value_type; #else typedef std::basic_string value_type; @@ -106,7 +103,7 @@ public: if(regex_search(first, end, what, *pre, flags) == true) { N = 0; -#ifdef TEST_BECKER_INTERFACE +#if 1 result = ((subs[N] == -1) ? what.prefix() : what[(int)subs[N]]); #else result = ((subs[N] == -1) ? value_type(what.prefix().str()) : value_type(what[(int)subs[N]].str())); @@ -115,10 +112,10 @@ public: } else if((subs[N] == -1) && (first != end)) { -#ifdef TEST_BECKER_INTERFACE +#if 1 result.first = first; result.second = end; - result.matched = true; + result.matched = (first != end); #else result = value_type(first, end); #endif @@ -145,8 +142,8 @@ public: if(N+1 < (int)subs.size()) { ++N; -#ifdef TEST_BECKER_INTERFACE - result =((subs[N] == -1) ? what.prefix().first : what[subs[N]]); +#if 1 + result =((subs[N] == -1) ? what.prefix() : what[subs[N]]); #else result =((subs[N] == -1) ? value_type(what.prefix().first, what.prefix().second) : value_type(what[subs[N]].first, what[subs[N]].second)); #endif @@ -158,7 +155,7 @@ public: if(regex_search(last_end, end, what, *pre, ((what[0].first == what[0].second) ? flags | regex_constants::match_not_initial_null : flags))) { N =0; -#ifdef TEST_BECKER_INTERFACE +#if 1 result =((subs[N] == -1) ? what.prefix() : what[subs[N]]); #else result =((subs[N] == -1) ? value_type(what.prefix().first, what.prefix().second) : value_type(what[subs[N]].first, what[subs[N]].second)); @@ -168,10 +165,10 @@ public: else if((last_end != end) && (subs[0] == -1)) { N =-1; -#ifdef TEST_BECKER_INTERFACE +#if 1 result.first = last_end; result.second = end; - result.matched = true; + result.matched = (last_end != end); #else result = value_type(last_end, end); #endif @@ -192,7 +189,7 @@ private: typedef shared_ptr pimpl; public: typedef basic_regex regex_type; -#ifdef TEST_BECKER_INTERFACE +#if 1 typedef sub_match value_type; #else typedef std::basic_string value_type; @@ -300,3 +297,4 @@ private: +