Fixed C++ Builder 5 support,

Fixed support for bidirectional iterators,
Fixed enum declaration in states.hpp.


[SVN r18874]
This commit is contained in:
John Maddock
2003-06-27 11:12:47 +00:00
parent 6f9ba7a289
commit 4a851cf958
5 changed files with 12 additions and 9 deletions

View File

@ -35,6 +35,8 @@
// this is harmless for a staic link: // this is harmless for a staic link:
# define _RWSTD_COMPILE_INSTANTIATE # define _RWSTD_COMPILE_INSTANTIATE
# endif # endif
// external templates cause problems for some reason:
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
# endif # endif
# if (__BORLANDC__ <= 0x540) && !defined(BOOST_REGEX_NO_LIB) && !defined(_NO_VCL) # if (__BORLANDC__ <= 0x540) && !defined(BOOST_REGEX_NO_LIB) && !defined(_NO_VCL)
// C++ Builder 4 and earlier, we can't tell whether we should be using // C++ Builder 4 and earlier, we can't tell whether we should be using

View File

@ -271,8 +271,8 @@ void BOOST_REGEX_CALL match_results<RandomAccessIterator, Allocator>::maybe_assi
if(base1 < base2) return; if(base1 < base2) return;
if(base2 < base1) break; if(base2 < base1) break;
len1 = boost::re_detail::distance(p1->first, p1->second); len1 = boost::re_detail::distance((RandomAccessIterator)p1->first, (RandomAccessIterator)p1->second);
len2 = boost::re_detail::distance(p2->first, p2->second); len2 = boost::re_detail::distance((RandomAccessIterator)p2->first, (RandomAccessIterator)p2->second);
if((len1 != len2) || ((p1->matched == false) && (p2->matched == true))) if((len1 != len2) || ((p1->matched == false) && (p2->matched == true)))
break; break;
if((p1->matched == true) && (p2->matched == false)) if((p1->matched == true) && (p2->matched == false))

View File

@ -531,7 +531,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_char_repea
if(::boost::is_random_access_iterator<BidiIterator>::value) if(::boost::is_random_access_iterator<BidiIterator>::value)
{ {
BidiIterator end = position; BidiIterator end = position;
end += std::min((unsigned)re_detail::distance(position, last), desired); std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
BidiIterator origin(position); BidiIterator origin(position);
while((position != end) && (traits_inst.translate(*position, icase) == what)) while((position != end) && (traits_inst.translate(*position, icase) == what))
{ {
@ -592,7 +592,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set_repeat
if(::boost::is_random_access_iterator<BidiIterator>::value) if(::boost::is_random_access_iterator<BidiIterator>::value)
{ {
BidiIterator end = position; BidiIterator end = position;
end += std::min((unsigned)re_detail::distance(position, last), desired); std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
BidiIterator origin(position); BidiIterator origin(position);
while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)]) while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)])
{ {
@ -653,7 +653,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set_r
if(::boost::is_random_access_iterator<BidiIterator>::value) if(::boost::is_random_access_iterator<BidiIterator>::value)
{ {
BidiIterator end = position; BidiIterator end = position;
end += std::min((unsigned)re_detail::distance(position, last), desired); std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
BidiIterator origin(position); BidiIterator origin(position);
while((position != end) && (position != re_is_set_member(position, last, set, re))) while((position != end) && (position != re_is_set_member(position, last, set, re)))
{ {

View File

@ -394,7 +394,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_char_repea
if(::boost::is_random_access_iterator<BidiIterator>::value) if(::boost::is_random_access_iterator<BidiIterator>::value)
{ {
BidiIterator end = position; BidiIterator end = position;
end += std::min((unsigned)re_detail::distance(position, last), desired); std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
BidiIterator origin(position); BidiIterator origin(position);
while((position != end) && (traits_inst.translate(*position, icase) == what)) while((position != end) && (traits_inst.translate(*position, icase) == what))
{ {
@ -468,7 +468,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set_repeat
if(::boost::is_random_access_iterator<BidiIterator>::value) if(::boost::is_random_access_iterator<BidiIterator>::value)
{ {
BidiIterator end = position; BidiIterator end = position;
end += std::min((unsigned)re_detail::distance(position, last), desired); std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
BidiIterator origin(position); BidiIterator origin(position);
while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)]) while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)])
{ {
@ -542,7 +542,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set_r
if(::boost::is_random_access_iterator<BidiIterator>::value) if(::boost::is_random_access_iterator<BidiIterator>::value)
{ {
BidiIterator end = position; BidiIterator end = position;
end += std::min((unsigned)re_detail::distance(position, last), desired); std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
BidiIterator origin(position); BidiIterator origin(position);
while((position != end) && (position != re_is_set_member(position, last, set, re))) while((position != end) && (position != re_is_set_member(position, last, set, re)))
{ {

View File

@ -109,7 +109,7 @@ enum syntax_element_type
syntax_element_dot_rep = syntax_element_restart_continue + 1, syntax_element_dot_rep = syntax_element_restart_continue + 1,
syntax_element_char_rep = syntax_element_dot_rep + 1, syntax_element_char_rep = syntax_element_dot_rep + 1,
syntax_element_short_set_rep = syntax_element_char_rep + 1, syntax_element_short_set_rep = syntax_element_char_rep + 1,
syntax_element_long_set_rep = syntax_element_short_set_rep + 1, syntax_element_long_set_rep = syntax_element_short_set_rep + 1
}; };
#ifdef BOOST_REGEX_DEBUG #ifdef BOOST_REGEX_DEBUG
@ -231,3 +231,4 @@ iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
#endif #endif
#endif #endif