mirror of
https://github.com/boostorg/regex.git
synced 2025-07-17 06:12:10 +02:00
Merge minor fixes from Trunk.
[SVN r83498]
This commit is contained in:
@ -1107,7 +1107,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic)
|
||||
}
|
||||
// get the value if any:
|
||||
v = this->m_traits.toi(m_position, m_end, 10);
|
||||
max = (v >= 0) ? v : (std::numeric_limits<std::size_t>::max)();
|
||||
max = (v >= 0) ? (std::size_t)v : (std::numeric_limits<std::size_t>::max)();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -65,6 +65,8 @@ void perl_matcher<BidiIterator, Allocator, traits>::construct_init(const basic_r
|
||||
m_match_flags |= match_perl;
|
||||
else if((re_f & (regbase::main_option_type|regbase::emacs_ex)) == (regbase::basic_syntax_group|regbase::emacs_ex))
|
||||
m_match_flags |= match_perl;
|
||||
else if((re_f & (regbase::main_option_type|regbase::literal)) == (regbase::literal))
|
||||
m_match_flags |= match_perl;
|
||||
else
|
||||
m_match_flags |= match_posix;
|
||||
}
|
||||
@ -326,6 +328,10 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_prefix()
|
||||
m_has_found_match = true;
|
||||
m_presult->set_second(last, 0, false);
|
||||
position = last;
|
||||
if((m_match_flags & match_posix) == match_posix)
|
||||
{
|
||||
m_result.maybe_assign(*m_presult);
|
||||
}
|
||||
}
|
||||
#ifdef BOOST_REGEX_MATCH_EXTRA
|
||||
if(m_has_found_match && (match_extra & m_match_flags))
|
||||
|
@ -3,12 +3,12 @@
|
||||
* Copyright (c) 2004
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_traits_defaults.hpp
|
||||
@ -85,7 +85,7 @@ inline bool is_combining<unsigned char>(unsigned char)
|
||||
return false;
|
||||
}
|
||||
#if !defined(__hpux) && !defined(__WINSCW__) // can't use WCHAR_MAX/MIN in pp-directives
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _MSC_VER
|
||||
template<>
|
||||
inline bool is_combining<wchar_t>(wchar_t c)
|
||||
{
|
||||
@ -115,11 +115,11 @@ template <class charT>
|
||||
inline bool is_separator(charT c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL(
|
||||
(c == static_cast<charT>('\n'))
|
||||
|| (c == static_cast<charT>('\r'))
|
||||
|| (c == static_cast<charT>('\f'))
|
||||
|| (static_cast<boost::uint16_t>(c) == 0x2028u)
|
||||
|| (static_cast<boost::uint16_t>(c) == 0x2029u)
|
||||
(c == static_cast<charT>('\n'))
|
||||
|| (c == static_cast<charT>('\r'))
|
||||
|| (c == static_cast<charT>('\f'))
|
||||
|| (static_cast<boost::uint16_t>(c) == 0x2028u)
|
||||
|| (static_cast<boost::uint16_t>(c) == 0x2029u)
|
||||
|| (static_cast<boost::uint16_t>(c) == 0x85u));
|
||||
}
|
||||
template <>
|
||||
@ -177,7 +177,7 @@ int get_default_class_id(const charT* p1, const charT* p2)
|
||||
'x', 'd', 'i', 'g', 'i', 't',
|
||||
};
|
||||
|
||||
static const character_pointer_range<charT> ranges[21] =
|
||||
static const character_pointer_range<charT> ranges[21] =
|
||||
{
|
||||
{data+0, data+5,}, // alnum
|
||||
{data+5, data+10,}, // alpha
|
||||
@ -203,7 +203,7 @@ int get_default_class_id(const charT* p1, const charT* p2)
|
||||
};
|
||||
static const character_pointer_range<charT>* ranges_begin = ranges;
|
||||
static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
|
||||
|
||||
|
||||
character_pointer_range<charT> t = { p1, p2, };
|
||||
const character_pointer_range<charT>* p = std::lower_bound(ranges_begin, ranges_end, t);
|
||||
if((p != ranges_end) && (t == *p))
|
||||
@ -324,15 +324,15 @@ inline const charT* get_escape_R_string()
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4309 4245)
|
||||
#endif
|
||||
static const charT e1[] = { '(', '?', '>', '\x0D', '\x0A', '?',
|
||||
'|', '[', '\x0A', '\x0B', '\x0C', '\x85', '\\', 'x', '{', '2', '0', '2', '8', '}',
|
||||
static const charT e1[] = { '(', '?', '>', '\x0D', '\x0A', '?',
|
||||
'|', '[', '\x0A', '\x0B', '\x0C', static_cast<unsigned char>('\x85'), '\\', 'x', '{', '2', '0', '2', '8', '}',
|
||||
'\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' };
|
||||
static const charT e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
|
||||
'|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' };
|
||||
static const charT e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
|
||||
'|', '[', '\x0A', '\x0B', '\x0C', static_cast<unsigned char>('\x85'), ']', ')', '\0' };
|
||||
|
||||
charT c = static_cast<charT>(0x2029u);
|
||||
bool b = (static_cast<unsigned>(c) == 0x2029u);
|
||||
|
||||
|
||||
return (b ? e1 : e2);
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
@ -346,7 +346,7 @@ inline const char* get_escape_R_string<char>()
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4309)
|
||||
#endif
|
||||
static const char e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
|
||||
static const char e2[] = { '(', '?', '>', '\x0D', '\x0A', '?',
|
||||
'|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' };
|
||||
return e2;
|
||||
#ifdef BOOST_MSVC
|
||||
|
Reference in New Issue
Block a user