Compare commits

...

6 Commits

Author SHA1 Message Date
136f8c02e0 This commit was manufactured by cvs2svn to create tag
'Version_1_30_2'.

[SVN r19685]
2003-08-18 18:40:31 +00:00
34762f91fb Fix facet support for intel-win32
[SVN r19625]
2003-08-16 00:18:24 +00:00
644e41ba31 Added minor gcc 3.3 fixes (warning suppression)
[SVN r19415]
2003-08-03 11:59:11 +00:00
51fe53f437 Fixed bug that effect some searches
[SVN r18003]
2003-03-19 12:19:14 +00:00
6d4dd63cba Merged from main truck
[SVN r17910]
2003-03-14 12:18:04 +00:00
686a939498 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17693]
2003-03-01 19:43:06 +00:00
8 changed files with 49 additions and 9 deletions

View File

@ -9,6 +9,8 @@ lib boost_regex : ../src/$(SOURCES).cpp
<sysinclude>$(BOOST_ROOT) <sysinclude>$(BOOST_ROOT)
<define>BOOST_REGEX_NO_LIB=1 <define>BOOST_REGEX_NO_LIB=1
<define>BOOST_REGEX_STATIC_LINK=1 <define>BOOST_REGEX_STATIC_LINK=1
std::facet-support
: :
debug release debug release
; ;

View File

@ -21,6 +21,7 @@ rule regex-test-run ( sources + : input * )
<define>BOOST_REGEX_NO_LIB=1 <define>BOOST_REGEX_NO_LIB=1
<define>BOOST_REGEX_STATIC_LINK=1 <define>BOOST_REGEX_STATIC_LINK=1
<threading>multi <threading>multi
std::facet-support
: # test name : # test name
] ; ] ;
} }

View File

@ -125,8 +125,10 @@
// If there isn't good enough wide character support then there will // If there isn't good enough wide character support then there will
// be no wide character regular expressions: // be no wide character regular expressions:
// //
#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX) #if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING))
# define BOOST_NO_WREGEX # if !defined(BOOST_NO_WREGEX)
# define BOOST_NO_WREGEX
# endif
#else #else
# if defined(__sgi) && defined(__SGI_STL_PORT) # if defined(__sgi) && defined(__SGI_STL_PORT)
// STLPort on IRIX is misconfigured: <cwctype> does not compile // STLPort on IRIX is misconfigured: <cwctype> does not compile
@ -645,3 +647,4 @@ inline void pointer_construct(T* p, const T& t)

View File

@ -1990,6 +1990,8 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_re
{ {
case re_detail::syntax_element_startmark: case re_detail::syntax_element_startmark:
case re_detail::syntax_element_endmark: case re_detail::syntax_element_endmark:
if(static_cast<const re_detail::re_brace*>(dat)->index == -2)
return regbase::restart_any;
return probe_restart(dat->next.p); return probe_restart(dat->next.p);
case re_detail::syntax_element_start_line: case re_detail::syntax_element_start_line:
return regbase::restart_line; return regbase::restart_line;
@ -2018,7 +2020,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_le
if((leading_lit) && (static_cast<re_detail::re_literal*>(dat)->length > 2)) if((leading_lit) && (static_cast<re_detail::re_literal*>(dat)->length > 2))
{ {
// we can do a literal search for the leading literal string // we can do a literal search for the leading literal string
// using Knuth-Morris-Pratt (or whatever), and only then check for // using Knuth-Morris-Pratt (or whatever), and only then check for
// matches. We need a decent length string though to make it // matches. We need a decent length string though to make it
// worth while. // worth while.
_leading_string = reinterpret_cast<charT*>(reinterpret_cast<char*>(dat) + sizeof(re_detail::re_literal)); _leading_string = reinterpret_cast<charT*>(reinterpret_cast<char*>(dat) + sizeof(re_detail::re_literal));
@ -2066,10 +2068,14 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_le
case re_detail::syntax_element_rep: case re_detail::syntax_element_rep:
if((len == 0) && (1 == fixup_leading_rep(dat->next.p, static_cast<re_detail::re_repeat*>(dat)->alt.p) )) if((len == 0) && (1 == fixup_leading_rep(dat->next.p, static_cast<re_detail::re_repeat*>(dat)->alt.p) ))
{ {
static_cast<re_detail::re_repeat*>(dat)->leading = true; static_cast<re_detail::re_repeat*>(dat)->leading = leading_lit;
return len; return len;
} }
return len; return len;
case re_detail::syntax_element_startmark:
if(static_cast<const re_detail::re_brace*>(dat)->index == -2)
return 0;
// fall through:
default: default:
break; break;
} }
@ -2115,3 +2121,4 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fail(unsigned in

View File

@ -56,8 +56,10 @@ inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
{ return s.compare(p); } { return s.compare(p); }
inline int string_compare(const std::string& s, const char* p) inline int string_compare(const std::string& s, const char* p)
{ return std::strcmp(s.c_str(), p); } { return std::strcmp(s.c_str(), p); }
# ifndef BOOST_NO_WREGEX
inline int string_compare(const std::wstring& s, const wchar_t* p) inline int string_compare(const std::wstring& s, const wchar_t* p)
{ return std::wcscmp(s.c_str(), p); } { return std::wcscmp(s.c_str(), p); }
# endif
# define STR_COMP(s,p) string_compare(s,p) # define STR_COMP(s,p) string_compare(s,p)
#endif #endif
@ -753,6 +755,15 @@ bool query_match_aux(iterator first,
start_loop[cur_acc] = first; start_loop[cur_acc] = first;
continue; continue;
} }
else if((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->min)
{
// the repeat was null, and we haven't gone round min times yet,
// since all subsequent repeats will be null as well, just update
// our repeat count and skip out.
accumulators[cur_acc] = static_cast<const re_repeat*>(ptr)->min;
ptr = static_cast<const re_repeat*>(ptr)->alt.p;
continue;
}
goto failure; goto failure;
} }
// see if we can skip the repeat: // see if we can skip the repeat:
@ -809,6 +820,15 @@ bool query_match_aux(iterator first,
start_loop[cur_acc] = first; start_loop[cur_acc] = first;
continue; continue;
} }
else if((first == start_loop[cur_acc]) && accumulators[cur_acc] && ((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->min))
{
// the repeat was null, and we haven't gone round min times yet,
// since all subsequent repeats will be null as well, just update
// our repeat count and skip out.
accumulators[cur_acc] = static_cast<const re_repeat*>(ptr)->min;
ptr = static_cast<const re_repeat*>(ptr)->alt.p;
continue;
}
// if we get here then neither option is allowed so fail: // if we get here then neither option is allowed so fail:
goto failure; goto failure;
@ -826,7 +846,7 @@ bool query_match_aux(iterator first,
if(flags & match_not_eob) if(flags & match_not_eob)
goto failure; goto failure;
iterator p(first); iterator p(first);
while((p != last) && traits_inst.is_separator(traits_inst.translate(*first, icase)))++p; while((p != last) && traits_inst.is_separator(traits_inst.translate(*p, icase)))++p;
if(p != last) if(p != last)
goto failure; goto failure;
ptr = ptr->next.p; ptr = ptr->next.p;
@ -958,6 +978,12 @@ bool query_match_aux(iterator first,
goto failure; goto failure;
ptr = ptr->next.p; ptr = ptr->next.p;
continue; continue;
case syntax_element_backref:
if(temp_match[static_cast<const re_brace*>(ptr)->index].first
!= temp_match[static_cast<const re_brace*>(ptr)->index].second)
goto failure;
ptr = ptr->next.p;
continue;
default: default:
goto failure; goto failure;
} }

View File

@ -514,9 +514,9 @@ void BOOST_REGEX_CALL c_traits_base::do_update_ctype()
if(std::isxdigit(i)) if(std::isxdigit(i))
class_map[i] |= char_class_xdigit; class_map[i] |= char_class_xdigit;
} }
class_map['_'] |= char_class_underscore; class_map[(unsigned char)'_'] |= char_class_underscore;
class_map[' '] |= char_class_blank; class_map[(unsigned char)' '] |= char_class_blank;
class_map['\t'] |= char_class_blank; class_map[(unsigned char)'\t'] |= char_class_blank;
for(i = 0; i < map_size; ++i) for(i = 0; i < map_size; ++i)
{ {
lower_case_map[i] = (char)std::tolower(i); lower_case_map[i] = (char)std::tolower(i);

View File

@ -241,7 +241,7 @@ message_data<char>::message_data(const std::locale& l, const std::string& regex_
#endif #endif
for(std::size_t j = 0; j < s.size(); ++j) for(std::size_t j = 0; j < s.size(); ++j)
{ {
syntax_map[s[j]] = (unsigned char)(i); syntax_map[(unsigned char)s[j]] = (unsigned char)(i);
} }
} }

View File

@ -9,6 +9,7 @@ template test
: <define>BOOST_REGEX_NO_LIB=1 # requirements : <define>BOOST_REGEX_NO_LIB=1 # requirements
<define>BOOST_REGEX_STATIC_LINK=1 <define>BOOST_REGEX_STATIC_LINK=1
<threading>multi <threading>multi
std::facet-support
; ;
template regression template regression