mirror of
https://github.com/boostorg/regex.git
synced 2025-06-26 12:21:34 +02:00
Compare commits
3 Commits
svn-branch
...
boost-1.29
Author | SHA1 | Date | |
---|---|---|---|
354bb1e035 | |||
3389eae235 | |||
0f55cfb574 |
@ -68,7 +68,7 @@ template class BOOST_REGEX_DECL match_results<std::basic_string<BOOST_REGEX_CHAR
|
|||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4251 4231 4660)
|
#pragma warning(disable : 4251 4231 4660)
|
||||||
|
|
||||||
template class BOOST_REGEX_DECL regex_traits< BOOST_REGEX_CHAR_T >;
|
//template class BOOST_REGEX_DECL regex_traits< BOOST_REGEX_CHAR_T >;
|
||||||
template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
|
template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
|
||||||
template class BOOST_REGEX_DECL re_detail::match_results_base<BOOST_REGEX_CHAR_T const*, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<BOOST_REGEX_CHAR_T const*>::type)>;
|
template class BOOST_REGEX_DECL re_detail::match_results_base<BOOST_REGEX_CHAR_T const*, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<BOOST_REGEX_CHAR_T const*>::type)>;
|
||||||
template class BOOST_REGEX_DECL re_detail::match_results_base<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::type)>;
|
template class BOOST_REGEX_DECL re_detail::match_results_base<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::type)>;
|
||||||
|
@ -195,7 +195,7 @@ public:
|
|||||||
difference_type max_state_count;
|
difference_type max_state_count;
|
||||||
iterator* loop_starts;
|
iterator* loop_starts;
|
||||||
|
|
||||||
_priv_match_data(const match_results_base<iterator, Allocator>&, iterator, iterator, unsigned);
|
_priv_match_data(const match_results_base<iterator, Allocator>&, iterator, iterator, std::size_t);
|
||||||
|
|
||||||
~_priv_match_data()
|
~_priv_match_data()
|
||||||
{
|
{
|
||||||
@ -211,7 +211,7 @@ public:
|
|||||||
{
|
{
|
||||||
return loop_starts;
|
return loop_starts;
|
||||||
}
|
}
|
||||||
void estimate_max_state_count(iterator a, iterator b, unsigned states, std::random_access_iterator_tag*)
|
void estimate_max_state_count(iterator a, iterator b, std::size_t states, std::random_access_iterator_tag*)
|
||||||
{
|
{
|
||||||
difference_type dist = std::distance(a,b);
|
difference_type dist = std::distance(a,b);
|
||||||
states *= states;
|
states *= states;
|
||||||
@ -221,7 +221,7 @@ public:
|
|||||||
else
|
else
|
||||||
max_state_count = 1000 + states * dist;
|
max_state_count = 1000 + states * dist;
|
||||||
}
|
}
|
||||||
void estimate_max_state_count(iterator a, iterator b, unsigned states, void*)
|
void estimate_max_state_count(iterator a, iterator b, std::size_t states, void*)
|
||||||
{
|
{
|
||||||
// we don't know how long the sequence is:
|
// we don't know how long the sequence is:
|
||||||
max_state_count = BOOST_REGEX_MAX_STATE_COUNT;
|
max_state_count = BOOST_REGEX_MAX_STATE_COUNT;
|
||||||
@ -229,14 +229,16 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class iterator, class Allocator>
|
template <class iterator, class Allocator>
|
||||||
_priv_match_data<iterator, Allocator>::_priv_match_data(const match_results_base<iterator, Allocator>& m, iterator a, iterator b, unsigned states)
|
_priv_match_data<iterator, Allocator>::_priv_match_data(const match_results_base<iterator, Allocator>& m, iterator a, iterator b, std::size_t states)
|
||||||
: temp_match(m), matches(64, m.allocator()), prev_pos(64, m.allocator()), prev_record(64, m.allocator())
|
: temp_match(m), matches(64, m.allocator()), prev_pos(64, m.allocator()), prev_record(64, m.allocator())
|
||||||
{
|
{
|
||||||
|
typedef typename regex_iterator_traits<iterator>::iterator_category category;
|
||||||
|
|
||||||
accumulators = 0;
|
accumulators = 0;
|
||||||
caccumulators = 0;
|
caccumulators = 0;
|
||||||
loop_starts = 0;
|
loop_starts = 0;
|
||||||
state_count = 0;
|
state_count = 0;
|
||||||
estimate_max_state_count(a, b, states, static_cast<regex_iterator_traits<iterator>::iterator_category*>(0));
|
estimate_max_state_count(a, b, states, static_cast<category*>(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class iterator, class Allocator>
|
template <class iterator, class Allocator>
|
||||||
@ -1088,8 +1090,8 @@ bool query_match_aux(iterator first,
|
|||||||
|
|
||||||
if(match_found || have_partial_match)
|
if(match_found || have_partial_match)
|
||||||
{
|
{
|
||||||
return true;
|
|
||||||
pd.state_count = 0;
|
pd.state_count = 0;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we get to here then everything has failed
|
// if we get to here then everything has failed
|
||||||
@ -1978,3 +1980,5 @@ inline unsigned int regex_grep(bool (*foo)(const match_results<std::basic_string
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,12 +31,19 @@ namespace boost{
|
|||||||
#pragma option push -a8 -b -Vx -Ve -pc
|
#pragma option push -a8 -b -Vx -Ve -pc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4275)
|
||||||
|
#endif
|
||||||
class BOOST_REGEX_DECL bad_pattern : public std::runtime_error
|
class BOOST_REGEX_DECL bad_pattern : public std::runtime_error
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit bad_pattern(const std::string& s) : std::runtime_error(s){};
|
explicit bad_pattern(const std::string& s) : std::runtime_error(s){};
|
||||||
~bad_pattern() throw();
|
~bad_pattern() throw();
|
||||||
};
|
};
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
class BOOST_REGEX_DECL bad_expression : public bad_pattern
|
class BOOST_REGEX_DECL bad_expression : public bad_pattern
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user