forked from boostorg/regex
Merge collected bug fixes from Trunk:
Refs #589. Refs #7032. Refs #7084. Refs #6346. [SVN r79556]
This commit is contained in:
@ -170,7 +170,10 @@
|
||||
# define BOOST_REGEX_HAS_OTHER_WCHAR_T
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4251 4231 4660)
|
||||
# pragma warning(disable : 4251 4231)
|
||||
# if BOOST_MSVC < 1600
|
||||
# pragma warning(disable : 4660)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_DLL) && defined(BOOST_MSVC) && (BOOST_MSVC < 1600)
|
||||
# include <string>
|
||||
|
@ -36,7 +36,10 @@
|
||||
namespace boost{
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4251 4231 4660 4800)
|
||||
#pragma warning(disable : 4251 4231 4800)
|
||||
#if BOOST_MSVC < 1600
|
||||
#pragma warning(disable : 4660)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace re_detail{
|
||||
@ -243,11 +246,11 @@ public:
|
||||
// begin, end:
|
||||
const_iterator BOOST_REGEX_CALL begin()const
|
||||
{
|
||||
return (!this->m_status ? 0 : this->m_expression);
|
||||
return (this->m_status ? 0 : this->m_expression);
|
||||
}
|
||||
const_iterator BOOST_REGEX_CALL end()const
|
||||
{
|
||||
return (!this->m_status ? 0 : this->m_expression + this->m_expression_len);
|
||||
return (this->m_status ? 0 : this->m_expression + this->m_expression_len);
|
||||
}
|
||||
flag_type BOOST_REGEX_CALL flags()const
|
||||
{
|
||||
|
@ -191,6 +191,7 @@ void basic_regex_parser<charT, traits>::fail(regex_constants::error_type error_c
|
||||
this->m_pdata->m_status = error_code;
|
||||
m_position = m_end; // don't bother parsing anything else
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
|
||||
//
|
||||
// Augment error message with the regular expression text:
|
||||
//
|
||||
@ -211,6 +212,7 @@ void basic_regex_parser<charT, traits>::fail(regex_constants::error_type error_c
|
||||
}
|
||||
message += "'.";
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
if(0 == (this->flags() & regex_constants::no_except))
|
||||
@ -660,6 +662,11 @@ template <class charT, class traits>
|
||||
bool basic_regex_parser<charT, traits>::parse_extended_escape()
|
||||
{
|
||||
++m_position;
|
||||
if(m_position == m_end)
|
||||
{
|
||||
fail(regex_constants::error_escape, m_position - m_base, "Incomplete escape sequence found.");
|
||||
return false;
|
||||
}
|
||||
bool negate = false; // in case this is a character class escape: \w \d etc
|
||||
switch(this->m_traits.escape_syntax_type(*m_position))
|
||||
{
|
||||
@ -2089,6 +2096,14 @@ insert_recursion:
|
||||
return false;
|
||||
}
|
||||
v = this->m_traits.toi(m_position, m_end, 10);
|
||||
if(m_position == m_end)
|
||||
{
|
||||
// Rewind to start of (? sequence:
|
||||
--m_position;
|
||||
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
|
||||
fail(regex_constants::error_perl_extension, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
if(*m_position == charT('R'))
|
||||
{
|
||||
if(++m_position == m_end)
|
||||
|
@ -84,7 +84,10 @@ template class BOOST_REGEX_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHA
|
||||
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4251 4231 4660)
|
||||
# pragma warning(disable : 4251 4231)
|
||||
# if BOOST_MSVC < 1600
|
||||
# pragma warning(disable : 4660)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
|
||||
|
@ -33,7 +33,10 @@
|
||||
namespace boost{
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4251 4231 4660)
|
||||
#pragma warning(disable : 4251 4231)
|
||||
# if BOOST_MSVC < 1600
|
||||
# pragma warning(disable : 4660)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace re_detail{
|
||||
|
@ -344,7 +344,10 @@ struct recursion_info
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4251 4231 4660)
|
||||
#pragma warning(disable : 4251 4231)
|
||||
# if BOOST_MSVC < 1600
|
||||
# pragma warning(disable : 4660)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
// flags |= match_prev_avail;
|
||||
BidirectionalIterator next_start = what[0].second;
|
||||
match_flag_type f(flags);
|
||||
if(!what.length())
|
||||
if(!what.length() || (f & regex_constants::match_posix))
|
||||
f |= regex_constants::match_not_initial_null;
|
||||
//if(base != next_start)
|
||||
// f |= regex_constants::match_not_bob;
|
||||
|
Reference in New Issue
Block a user