mirror of
https://github.com/boostorg/regex.git
synced 2025-07-16 22:02:08 +02:00
Cleaned up non-standard behaviour in traits classes.
Suppressed explicit instantiations for older Intel versions. Added std::distance workaround for Sunpro. [SVN r26716]
This commit is contained in:
@ -393,39 +393,7 @@ public:
|
|||||||
BOOST_STATIC_CONSTANT(char_class_type, mask_blank = 1u << 16);
|
BOOST_STATIC_CONSTANT(char_class_type, mask_blank = 1u << 16);
|
||||||
BOOST_STATIC_CONSTANT(char_class_type, mask_word = 1u << 17);
|
BOOST_STATIC_CONSTANT(char_class_type, mask_word = 1u << 17);
|
||||||
BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 1u << 18);
|
BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 1u << 18);
|
||||||
#ifdef __GNUC__
|
|
||||||
BOOST_STATIC_CONSTANT(native_mask_type,
|
|
||||||
mask_base =
|
|
||||||
static_cast<native_mask_type>(
|
|
||||||
std::ctype<charT>::alnum
|
|
||||||
| std::ctype<charT>::alpha
|
|
||||||
| std::ctype<charT>::cntrl
|
|
||||||
| std::ctype<charT>::digit
|
|
||||||
| std::ctype<charT>::graph
|
|
||||||
| std::ctype<charT>::lower
|
|
||||||
| std::ctype<charT>::print
|
|
||||||
| std::ctype<charT>::punct
|
|
||||||
| std::ctype<charT>::space
|
|
||||||
| std::ctype<charT>::upper
|
|
||||||
| std::ctype<charT>::xdigit));
|
|
||||||
#else
|
|
||||||
BOOST_STATIC_CONSTANT(char_class_type,
|
|
||||||
mask_base =
|
|
||||||
std::ctype<charT>::alnum
|
|
||||||
| std::ctype<charT>::alpha
|
|
||||||
| std::ctype<charT>::cntrl
|
|
||||||
| std::ctype<charT>::digit
|
|
||||||
| std::ctype<charT>::graph
|
|
||||||
| std::ctype<charT>::lower
|
|
||||||
| std::ctype<charT>::print
|
|
||||||
| std::ctype<charT>::punct
|
|
||||||
| std::ctype<charT>::space
|
|
||||||
| std::ctype<charT>::upper
|
|
||||||
| std::ctype<charT>::xdigit);
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
//BOOST_STATIC_ASSERT(0 == (mask_base & (mask_word | mask_unicode)));
|
|
||||||
|
|
||||||
|
|
||||||
typedef std::basic_string<charT> string_type;
|
typedef std::basic_string<charT> string_type;
|
||||||
typedef charT char_type;
|
typedef charT char_type;
|
||||||
@ -491,13 +459,6 @@ template <class charT>
|
|||||||
typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_word;
|
typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_word;
|
||||||
template <class charT>
|
template <class charT>
|
||||||
typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_unicode;
|
typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_unicode;
|
||||||
#ifdef __GNUC__
|
|
||||||
template <class charT>
|
|
||||||
typename cpp_regex_traits_implementation<charT>::native_mask_type const cpp_regex_traits_implementation<charT>::mask_base;
|
|
||||||
#else
|
|
||||||
template <class charT>
|
|
||||||
typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_base;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -919,9 +880,24 @@ public:
|
|||||||
{
|
{
|
||||||
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
|
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
|
||||||
typedef typename std::ctype<charT>::mask ctype_mask;
|
typedef typename std::ctype<charT>::mask ctype_mask;
|
||||||
if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_base)
|
|
||||||
|
static const ctype_mask mask_base =
|
||||||
|
static_cast<ctype_mask>(
|
||||||
|
std::ctype<charT>::alnum
|
||||||
|
| std::ctype<charT>::alpha
|
||||||
|
| std::ctype<charT>::cntrl
|
||||||
|
| std::ctype<charT>::digit
|
||||||
|
| std::ctype<charT>::graph
|
||||||
|
| std::ctype<charT>::lower
|
||||||
|
| std::ctype<charT>::print
|
||||||
|
| std::ctype<charT>::punct
|
||||||
|
| std::ctype<charT>::space
|
||||||
|
| std::ctype<charT>::upper
|
||||||
|
| std::ctype<charT>::xdigit);
|
||||||
|
|
||||||
|
if((f & mask_base)
|
||||||
&& (m_pimpl->m_pctype->is(
|
&& (m_pimpl->m_pctype->is(
|
||||||
static_cast<ctype_mask>(f & re_detail::cpp_regex_traits_implementation<charT>::mask_base), c)))
|
static_cast<ctype_mask>(f & mask_base), c)))
|
||||||
return true;
|
return true;
|
||||||
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_unicode) && re_detail::is_extended(c))
|
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_unicode) && re_detail::is_extended(c))
|
||||||
return true;
|
return true;
|
||||||
|
@ -79,7 +79,7 @@ template class BOOST_REGEX_DECL match_results< const BOOST_REGEX_CHAR_T* >;
|
|||||||
#ifndef BOOST_NO_STD_ALLOCATOR
|
#ifndef BOOST_NO_STD_ALLOCATOR
|
||||||
template class BOOST_REGEX_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
|
template class BOOST_REGEX_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
|
||||||
#endif
|
#endif
|
||||||
#if !(defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB <= 1))
|
#if !(defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB <= 1)) && !(defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 800))
|
||||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||||
template class BOOST_REGEX_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
|
template class BOOST_REGEX_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
|
||||||
#endif
|
#endif
|
||||||
|
@ -243,7 +243,7 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_perl()
|
|||||||
default:
|
default:
|
||||||
// see if we have a number:
|
// see if we have a number:
|
||||||
{
|
{
|
||||||
std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(2), std::distance(m_position, m_end));
|
std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(2), ::boost::re_detail::distance(m_position, m_end));
|
||||||
int v = m_traits.toi(m_position, m_position + len, 10);
|
int v = m_traits.toi(m_position, m_position + len, 10);
|
||||||
if(v < 0)
|
if(v < 0)
|
||||||
{
|
{
|
||||||
@ -327,7 +327,7 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_escape()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(2), std::distance(m_position, m_end));
|
std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(2), ::boost::re_detail::distance(m_position, m_end));
|
||||||
int val = m_traits.toi(m_position, m_position + len, 16);
|
int val = m_traits.toi(m_position, m_position + len, 16);
|
||||||
if(val < 0)
|
if(val < 0)
|
||||||
{
|
{
|
||||||
@ -398,7 +398,7 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_escape()
|
|||||||
{
|
{
|
||||||
// octal ecape sequence:
|
// octal ecape sequence:
|
||||||
--m_position;
|
--m_position;
|
||||||
std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(4), std::distance(m_position, m_end));
|
std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(4), ::boost::re_detail::distance(m_position, m_end));
|
||||||
v = m_traits.toi(m_position, m_position + len, 8);
|
v = m_traits.toi(m_position, m_position + len, 8);
|
||||||
BOOST_ASSERT(v >= 0);
|
BOOST_ASSERT(v >= 0);
|
||||||
put(static_cast<char_type>(v));
|
put(static_cast<char_type>(v));
|
||||||
@ -419,7 +419,7 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_conditional(
|
|||||||
put(static_cast<char_type>('?'));
|
put(static_cast<char_type>('?'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(2), std::distance(m_position, m_end));
|
std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(2), ::boost::re_detail::distance(m_position, m_end));
|
||||||
int v = m_traits.toi(m_position, m_position + len, 10);
|
int v = m_traits.toi(m_position, m_position + len, 10);
|
||||||
if(v < 0)
|
if(v < 0)
|
||||||
{
|
{
|
||||||
|
@ -548,8 +548,6 @@ boost::shared_ptr<w32_regex_traits_implementation<charT> > create_w32_regex_trai
|
|||||||
template <class charT>
|
template <class charT>
|
||||||
class w32_regex_traits
|
class w32_regex_traits
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
typedef std::ctype<charT> ctype_type;
|
|
||||||
public:
|
public:
|
||||||
typedef charT char_type;
|
typedef charT char_type;
|
||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
|
Reference in New Issue
Block a user