summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-19 20:22:58 (GMT)
committerTobias Markmann <tm@ayena.de>2014-10-20 13:49:33 (GMT)
commit6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch)
tree2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/regex
parent38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff)
downloadswift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip
swift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0. Updated our update.sh script to stop on error. Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to missing include of <iostream> with newer Boost. Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/regex')
-rw-r--r--3rdParty/Boost/src/boost/regex/config.hpp2
-rw-r--r--3rdParty/Boost/src/boost/regex/icu.hpp17
-rw-r--r--3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp32
-rw-r--r--3rdParty/Boost/src/boost/regex/pending/unicode_iterator.hpp40
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/basic_regex.hpp6
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/basic_regex_creator.hpp40
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/basic_regex_parser.hpp86
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/cpp_regex_traits.hpp61
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/instances.hpp6
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/iterator_traits.hpp2
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/match_flags.hpp2
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/perl_matcher.hpp4
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/perl_matcher_common.hpp18
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp27
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/perl_matcher_recursive.hpp16
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/regex_format.hpp9
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/regex_raw_buffer.hpp2
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/regex_split.hpp4
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/regex_token_iterator.hpp15
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/regex_traits.hpp4
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/regex_traits_defaults.hpp34
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/sub_match.hpp3
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/u32regex_token_iterator.hpp17
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/w32_regex_traits.hpp4
24 files changed, 270 insertions, 181 deletions
diff --git a/3rdParty/Boost/src/boost/regex/config.hpp b/3rdParty/Boost/src/boost/regex/config.hpp
index e8cec5b..7e6cc51 100644
--- a/3rdParty/Boost/src/boost/regex/config.hpp
+++ b/3rdParty/Boost/src/boost/regex/config.hpp
@@ -224,7 +224,7 @@
*
****************************************************************************/
-#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1200) && defined(_MSC_EXTENSIONS)
+#if defined(BOOST_MSVC) && defined(_MSC_EXTENSIONS)
#if defined(_DEBUG) || defined(__MSVC_RUNTIME_CHECKS) || defined(_MANAGED) || defined(BOOST_REGEX_NO_FASTCALL)
# define BOOST_REGEX_CALL __cdecl
#else
diff --git a/3rdParty/Boost/src/boost/regex/icu.hpp b/3rdParty/Boost/src/boost/regex/icu.hpp
index 772806e..37fec2a 100644
--- a/3rdParty/Boost/src/boost/regex/icu.hpp
+++ b/3rdParty/Boost/src/boost/regex/icu.hpp
@@ -423,7 +423,7 @@ bool do_regex_match(BidiIterator first, BidiIterator last,
{
typedef u16_to_u32_iterator<BidiIterator, UChar32> conv_type;
typedef match_results<conv_type> match_type;
- typedef typename match_type::allocator_type alloc_type;
+ //typedef typename match_type::allocator_type alloc_type;
match_type what;
bool result = ::boost::regex_match(conv_type(first, first, last), conv_type(last, first, last), what, e, flags);
// copy results across to m:
@@ -439,7 +439,7 @@ bool do_regex_match(BidiIterator first, BidiIterator last,
{
typedef u8_to_u32_iterator<BidiIterator, UChar32> conv_type;
typedef match_results<conv_type> match_type;
- typedef typename match_type::allocator_type alloc_type;
+ //typedef typename match_type::allocator_type alloc_type;
match_type what;
bool result = ::boost::regex_match(conv_type(first, first, last), conv_type(last, first, last), what, e, flags);
// copy results across to m:
@@ -598,7 +598,7 @@ bool do_regex_search(BidiIterator first, BidiIterator last,
{
typedef u16_to_u32_iterator<BidiIterator, UChar32> conv_type;
typedef match_results<conv_type> match_type;
- typedef typename match_type::allocator_type alloc_type;
+ //typedef typename match_type::allocator_type alloc_type;
match_type what;
bool result = ::boost::regex_search(conv_type(first, first, last), conv_type(last, first, last), what, e, flags, conv_type(base));
// copy results across to m:
@@ -615,7 +615,7 @@ bool do_regex_search(BidiIterator first, BidiIterator last,
{
typedef u8_to_u32_iterator<BidiIterator, UChar32> conv_type;
typedef match_results<conv_type> match_type;
- typedef typename match_type::allocator_type alloc_type;
+ //typedef typename match_type::allocator_type alloc_type;
match_type what;
bool result = ::boost::regex_search(conv_type(first, first, last), conv_type(last, first, last), what, e, flags, conv_type(base));
// copy results across to m:
@@ -887,9 +887,6 @@ inline OutputIterator u32regex_replace(OutputIterator out,
match_flag_type flags = match_default)
{
return re_detail::extract_output_base
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- <OutputIterator>
-#endif
(
re_detail::do_regex_replace(
re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
@@ -909,9 +906,6 @@ inline OutputIterator u32regex_replace(OutputIterator out,
match_flag_type flags = match_default)
{
return re_detail::extract_output_base
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- <OutputIterator>
-#endif
(
re_detail::do_regex_replace(
re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
@@ -931,9 +925,6 @@ inline OutputIterator u32regex_replace(OutputIterator out,
match_flag_type flags = match_default)
{
return re_detail::extract_output_base
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- <OutputIterator>
-#endif
(
re_detail::do_regex_replace(
re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
diff --git a/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp b/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp
index 9c10050..344926f 100644
--- a/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp
+++ b/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp
@@ -36,14 +36,7 @@
//
namespace boost{
-class BOOST_REGEX_DECL scoped_static_mutex_lock;
-
-class static_mutex
-{
-public:
- typedef scoped_static_mutex_lock scoped_lock;
- pthread_mutex_t m_mutex;
-};
+class static_mutex;
#define BOOST_STATIC_MUTEX_INIT { PTHREAD_MUTEX_INITIALIZER, }
@@ -67,6 +60,12 @@ private:
bool m_have_lock;
};
+class static_mutex
+{
+public:
+ typedef scoped_static_mutex_lock scoped_lock;
+ pthread_mutex_t m_mutex;
+};
} // namespace boost
#elif defined(BOOST_HAS_WINTHREADS)
@@ -126,12 +125,15 @@ private:
// Since this preprocessor path is almost never taken, we hide these header
// dependencies so that build tools don't find them.
//
-#define B1 <boost/thread/once.hpp>
-#define B2 <boost/thread/recursive_mutex.hpp>
-#include B1
-#include B2
-#undef B1
-#undef B2
+#define BOOST_REGEX_H1 <boost/thread/once.hpp>
+#define BOOST_REGEX_H2 <boost/thread/recursive_mutex.hpp>
+#define BOOST_REGEX_H3 <boost/thread/lock_types.hpp>
+#include BOOST_REGEX_H1
+#include BOOST_REGEX_H2
+#include BOOST_REGEX_H3
+#undef BOOST_REGEX_H1
+#undef BOOST_REGEX_H2
+#undef BOOST_REGEX_H3
namespace boost{
@@ -159,7 +161,7 @@ public:
void lock();
void unlock();
private:
- boost::recursive_mutex::scoped_lock* m_plock;
+ boost::unique_lock<boost::recursive_mutex>* m_plock;
bool m_have_lock;
};
diff --git a/3rdParty/Boost/src/boost/regex/pending/unicode_iterator.hpp b/3rdParty/Boost/src/boost/regex/pending/unicode_iterator.hpp
index e6399b5..b84cfa0 100644
--- a/3rdParty/Boost/src/boost/regex/pending/unicode_iterator.hpp
+++ b/3rdParty/Boost/src/boost/regex/pending/unicode_iterator.hpp
@@ -141,7 +141,7 @@ class u32_to_u16_iterator
{
typedef boost::iterator_facade<u32_to_u16_iterator<BaseIterator, U16Type>, U16Type, std::bidirectional_iterator_tag, const U16Type> base_type;
-#if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+#if !defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
BOOST_STATIC_ASSERT(sizeof(base_value_type)*CHAR_BIT == 32);
@@ -256,7 +256,7 @@ class u16_to_u32_iterator
// special values for pending iterator reads:
BOOST_STATIC_CONSTANT(U32Type, pending_read = 0xffffffffu);
-#if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+#if !defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
BOOST_STATIC_ASSERT(sizeof(base_value_type)*CHAR_BIT == 16);
@@ -371,7 +371,7 @@ class u32_to_u8_iterator
{
typedef boost::iterator_facade<u32_to_u8_iterator<BaseIterator, U8Type>, U8Type, std::bidirectional_iterator_tag, const U8Type> base_type;
-#if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+#if !defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
BOOST_STATIC_ASSERT(sizeof(base_value_type)*CHAR_BIT == 32);
@@ -499,7 +499,7 @@ class u8_to_u32_iterator
// special values for pending iterator reads:
BOOST_STATIC_CONSTANT(U32Type, pending_read = 0xffffffffu);
-#if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+#if !defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
BOOST_STATIC_ASSERT(sizeof(base_value_type)*CHAR_BIT == 8);
@@ -520,9 +520,26 @@ public:
}
void increment()
{
+ // We must not start with a continuation character:
+ if((static_cast<boost::uint8_t>(*m_position) & 0xC0) == 0x80)
+ invalid_sequence();
// skip high surrogate first if there is one:
unsigned c = detail::utf8_byte_count(*m_position);
- std::advance(m_position, c);
+ if(m_value == pending_read)
+ {
+ // Since we haven't read in a value, we need to validate the code points:
+ for(unsigned i = 0; i < c; ++i)
+ {
+ ++m_position;
+ // We must have a continuation byte:
+ if((i != c - 1) && ((static_cast<boost::uint8_t>(*m_position) & 0xC0) != 0x80))
+ invalid_sequence();
+ }
+ }
+ else
+ {
+ std::advance(m_position, c);
+ }
m_value = pending_read;
}
void decrement()
@@ -589,7 +606,7 @@ private:
// we must not have a continuation character:
if((m_value & 0xC0u) == 0x80u)
invalid_sequence();
- // see how many extra byts we have:
+ // see how many extra bytes we have:
unsigned extra = detail::utf8_trailing_byte_count(*m_position);
// extract the extra bits, 6 from each extra byte:
BaseIterator next(m_position);
@@ -597,6 +614,9 @@ private:
{
++next;
m_value <<= 6;
+ // We must have a continuation byte:
+ if((static_cast<boost::uint8_t>(*next) & 0xC0) != 0x80)
+ invalid_sequence();
m_value += static_cast<boost::uint8_t>(*next) & 0x3Fu;
}
// we now need to remove a few of the leftmost bits, but how many depends
@@ -609,9 +629,15 @@ private:
0x1FFFFFu,
};
m_value &= masks[extra];
- // check the result:
+ // check the result is in range:
if(m_value > static_cast<U32Type>(0x10FFFFu))
invalid_sequence();
+ // The result must not be a surrogate:
+ if((m_value >= static_cast<U32Type>(0xD800)) && (m_value <= static_cast<U32Type>(0xDFFF)))
+ invalid_sequence();
+ // We should not have had an invalidly encoded UTF8 sequence:
+ if((extra > 0) && (m_value <= static_cast<U32Type>(masks[extra - 1])))
+ invalid_sequence();
}
BaseIterator m_position;
mutable U32Type m_value;
diff --git a/3rdParty/Boost/src/boost/regex/v4/basic_regex.hpp b/3rdParty/Boost/src/boost/regex/v4/basic_regex.hpp
index 0b63e3a..ae86152 100644
--- a/3rdParty/Boost/src/boost/regex/v4/basic_regex.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/basic_regex.hpp
@@ -236,9 +236,7 @@ public:
}
std::pair<const_iterator, const_iterator> BOOST_REGEX_CALL subexpression(std::size_t n)const
{
- if(n == 0)
- boost::throw_exception(std::out_of_range("0 is not a valid subexpression index."));
- const std::pair<std::size_t, std::size_t>& pi = this->m_subs.at(n - 1);
+ const std::pair<std::size_t, std::size_t>& pi = this->m_subs.at(n);
std::pair<const_iterator, const_iterator> p(expression() + pi.first, expression() + pi.second);
return p;
}
@@ -266,7 +264,7 @@ public:
}
size_type BOOST_REGEX_CALL mark_count()const
{
- return this->m_mark_count;
+ return this->m_mark_count - 1;
}
const re_detail::re_syntax_base* get_first_state()const
{
diff --git a/3rdParty/Boost/src/boost/regex/v4/basic_regex_creator.hpp b/3rdParty/Boost/src/boost/regex/v4/basic_regex_creator.hpp
index efb649c..821fb82 100644
--- a/3rdParty/Boost/src/boost/regex/v4/basic_regex_creator.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/basic_regex_creator.hpp
@@ -47,9 +47,7 @@ struct digraph : public std::pair<charT, charT>
digraph(charT c1) : std::pair<charT, charT>(c1, 0){}
digraph(charT c1, charT c2) : std::pair<charT, charT>(c1, c2)
{}
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
digraph(const digraph<charT>& d) : std::pair<charT, charT>(d.first, d.second){}
-#endif
template <class Seq>
digraph(const Seq& s) : std::pair<charT, charT>()
{
@@ -346,7 +344,7 @@ re_literal* basic_regex_creator<charT, traits>::append_literal(charT c)
m_last_state = result = static_cast<re_literal*>(getaddress(off));
charT* characters = static_cast<charT*>(static_cast<void*>(result+1));
characters[result->length] = m_traits.translate(c, m_icase);
- ++(result->length);
+ result->length += 1;
}
return result;
}
@@ -433,20 +431,10 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
if(flags() & regex_constants::collate)
{
// we need to transform our range into sort keys:
-#if BOOST_WORKAROUND(__GNUC__, < 3)
- string_type in(3, charT(0));
- in[0] = c1.first;
- in[1] = c1.second;
- s1 = this->m_traits.transform(in.c_str(), (in[1] ? in.c_str()+2 : in.c_str()+1));
- in[0] = c2.first;
- in[1] = c2.second;
- s2 = this->m_traits.transform(in.c_str(), (in[1] ? in.c_str()+2 : in.c_str()+1));
-#else
charT a1[3] = { c1.first, c1.second, charT(0), };
charT a2[3] = { c2.first, c2.second, charT(0), };
s1 = this->m_traits.transform(a1, (a1[1] ? a1+2 : a1+1));
s2 = this->m_traits.transform(a2, (a2[1] ? a2+2 : a2+1));
-#endif
if(s1.size() == 0)
s1 = string_type(1, charT(0));
if(s2.size() == 0)
@@ -491,15 +479,8 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
string_type s;
if(first->second)
{
-#if BOOST_WORKAROUND(__GNUC__, < 3)
- string_type in(3, charT(0));
- in[0] = first->first;
- in[1] = first->second;
- s = m_traits.transform_primary(in.c_str(), in.c_str()+2);
-#else
charT cs[3] = { first->first, first->second, charT(0), };
s = m_traits.transform_primary(cs, cs+2);
-#endif
}
else
s = m_traits.transform_primary(&first->first, &first->first+1);
@@ -738,14 +719,14 @@ void basic_regex_creator<charT, traits>::fixup_pointers(re_syntax_base* state)
case syntax_element_long_set_rep:
// set the state_id of this repeat:
static_cast<re_repeat*>(state)->state_id = m_repeater_id++;
- // fall through:
+ BOOST_FALLTHROUGH;
case syntax_element_alt:
std::memset(static_cast<re_alt*>(state)->_map, 0, sizeof(static_cast<re_alt*>(state)->_map));
static_cast<re_alt*>(state)->can_be_null = 0;
- // fall through:
+ BOOST_FALLTHROUGH;
case syntax_element_jump:
static_cast<re_jump*>(state)->alt.p = getaddress(static_cast<re_jump*>(state)->alt.i, state);
- // fall through again:
+ BOOST_FALLTHROUGH;
default:
if(state->next.i)
state->next.p = getaddress(state->next.i, state);
@@ -877,6 +858,7 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
}
}
}
+ break;
default:
break;
}
@@ -941,7 +923,7 @@ void basic_regex_creator<charT, traits>::create_startmaps(re_syntax_base* state)
e.raise();
}
}
- // fall through:
+ BOOST_FALLTHROUGH;
default:
state = state->next.p;
}
@@ -1153,13 +1135,14 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
break;
}
m_recursion_checks[recursion_sub] = true;
- // fall through, can't handle nested recursion here...
+ // can't handle nested recursion here...
+ BOOST_FALLTHROUGH;
}
case syntax_element_backref:
// can be null, and any character can match:
if(pnull)
*pnull |= mask;
- // fall through:
+ BOOST_FALLTHROUGH;
case syntax_element_wild:
{
// can't be null, any character can match:
@@ -1359,7 +1342,7 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
state = state->next.p->next.p;
break;
}
- // otherwise fall through:
+ BOOST_FALLTHROUGH;
default:
state = state->next.p;
}
@@ -1456,6 +1439,7 @@ void basic_regex_creator<charT, traits>::set_bad_repeat(re_syntax_base* pt)
if(state_id <= sizeof(m_bad_repeats) * CHAR_BIT)
m_bad_repeats |= (one << state_id);
}
+ break;
default:
break;
}
@@ -1537,7 +1521,7 @@ void basic_regex_creator<charT, traits>::probe_leading_repeat(re_syntax_base* st
case syntax_element_long_set_rep:
if(this->m_has_backrefs == 0)
static_cast<re_repeat*>(state)->leading = true;
- // fall through:
+ BOOST_FALLTHROUGH;
default:
return;
}
diff --git a/3rdParty/Boost/src/boost/regex/v4/basic_regex_parser.hpp b/3rdParty/Boost/src/boost/regex/v4/basic_regex_parser.hpp
index 72dc4ee..2757898 100644
--- a/3rdParty/Boost/src/boost/regex/v4/basic_regex_parser.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/basic_regex_parser.hpp
@@ -369,7 +369,7 @@ bool basic_regex_parser<charT, traits>::parse_extended()
while((m_position != m_end) && !is_separator(*m_position++)){}
return true;
}
- // Otherwise fall through:
+ BOOST_FALLTHROUGH;
default:
result = parse_literal();
break;
@@ -623,7 +623,7 @@ bool basic_regex_parser<charT, traits>::parse_basic_escape()
{
case 'w':
negate = false;
- // fall through:
+ BOOST_FALLTHROUGH;
case 'W':
{
basic_char_set<charT, traits> char_set;
@@ -640,7 +640,7 @@ bool basic_regex_parser<charT, traits>::parse_basic_escape()
}
case 's':
negate = false;
- // fall through:
+ BOOST_FALLTHROUGH;
case 'S':
return add_emacs_code(negate);
case 'c':
@@ -672,7 +672,7 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape()
{
case regex_constants::escape_type_not_class:
negate = true;
- // fall through:
+ BOOST_FALLTHROUGH;
case regex_constants::escape_type_class:
{
escape_type_class_jump:
@@ -742,7 +742,7 @@ escape_type_class_jump:
break;
case regex_constants::escape_type_not_property:
negate = true;
- // fall through:
+ BOOST_FALLTHROUGH;
case regex_constants::escape_type_property:
{
++m_position;
@@ -901,7 +901,7 @@ escape_type_class_jump:
case regex_constants::escape_type_control_v:
if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex)))
goto escape_type_class_jump;
- // fallthrough:
+ BOOST_FALLTHROUGH;
default:
this->append_literal(unescape_character());
break;
@@ -971,7 +971,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
// the last state was a literal with more than one character, split it in two:
re_literal* lit = static_cast<re_literal*>(this->m_last_state);
charT c = (static_cast<charT*>(static_cast<void*>(lit+1)))[lit->length - 1];
- --(lit->length);
+ lit->length -= 1;
// now append new state:
lit = static_cast<re_literal*>(this->append_state(syntax_element_literal, sizeof(re_literal) + sizeof(charT)));
lit->length = 1;
@@ -1070,26 +1070,46 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic)
// skip whitespace:
while((m_position != m_end) && this->m_traits.isctype(*m_position, this->m_mask_space))
++m_position;
- // fail if at end:
if(this->m_position == this->m_end)
{
- fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
- return false;
+ if(this->flags() & (regbase::main_option_type | regbase::no_perl_ex))
+ {
+ fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
+ return false;
+ }
+ // Treat the opening '{' as a literal character, rewind to start of error:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_brace) --m_position;
+ return parse_literal();
}
// get min:
v = this->m_traits.toi(m_position, m_end, 10);
// skip whitespace:
- while((m_position != m_end) && this->m_traits.isctype(*m_position, this->m_mask_space))
- ++m_position;
if(v < 0)
{
- fail(regex_constants::error_badbrace, this->m_position - this->m_base);
- return false;
+ if(this->flags() & (regbase::main_option_type | regbase::no_perl_ex))
+ {
+ fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
+ return false;
+ }
+ // Treat the opening '{' as a literal character, rewind to start of error:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_brace) --m_position;
+ return parse_literal();
}
- else if(this->m_position == this->m_end)
+ while((m_position != m_end) && this->m_traits.isctype(*m_position, this->m_mask_space))
+ ++m_position;
+ if(this->m_position == this->m_end)
{
- fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
- return false;
+ if(this->flags() & (regbase::main_option_type | regbase::no_perl_ex))
+ {
+ fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
+ return false;
+ }
+ // Treat the opening '{' as a literal character, rewind to start of error:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_brace) --m_position;
+ return parse_literal();
}
min = v;
// see if we have a comma:
@@ -1102,12 +1122,19 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic)
++m_position;
if(this->m_position == this->m_end)
{
- fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
- return false;
+ if(this->flags() & (regbase::main_option_type | regbase::no_perl_ex))
+ {
+ fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
+ return false;
+ }
+ // Treat the opening '{' as a literal character, rewind to start of error:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_brace) --m_position;
+ return parse_literal();
}
// 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
{
@@ -1120,8 +1147,15 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic)
// OK now check trailing }:
if(this->m_position == this->m_end)
{
- fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
- return false;
+ if(this->flags() & (regbase::main_option_type | regbase::no_perl_ex))
+ {
+ fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
+ return false;
+ }
+ // Treat the opening '{' as a literal character, rewind to start of error:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_brace) --m_position;
+ return parse_literal();
}
if(isbasic)
{
@@ -1144,8 +1178,10 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic)
++m_position;
else
{
- fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message);
- return false;
+ // Treat the opening '{' as a literal character, rewind to start of error:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_brace) --m_position;
+ return parse_literal();
}
//
// finally go and add the repeat, unless error:
@@ -1959,7 +1995,7 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
{
case regex_constants::syntax_or:
m_mark_reset = m_mark_count;
- // fall through:
+ BOOST_FALLTHROUGH;
case regex_constants::syntax_colon:
//
// a non-capturing mark:
diff --git a/3rdParty/Boost/src/boost/regex/v4/cpp_regex_traits.hpp b/3rdParty/Boost/src/boost/regex/v4/cpp_regex_traits.hpp
index bcae455..106ffcb 100644
--- a/3rdParty/Boost/src/boost/regex/v4/cpp_regex_traits.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/cpp_regex_traits.hpp
@@ -20,6 +20,8 @@
#define BOOST_CPP_REGEX_TRAITS_HPP_INCLUDED
#include <boost/config.hpp>
+#include <boost/integer.hpp>
+#include <boost/type_traits/make_unsigned.hpp>
#ifndef BOOST_NO_STD_LOCALE
@@ -107,12 +109,14 @@ template<class charT, class traits>
typename parser_buf<charT, traits>::pos_type
parser_buf<charT, traits>::seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which)
{
+ typedef typename boost::int_t<sizeof(way) * CHAR_BIT>::least cast_type;
+
if(which & ::std::ios_base::out)
return pos_type(off_type(-1));
std::ptrdiff_t size = this->egptr() - this->eback();
std::ptrdiff_t pos = this->gptr() - this->eback();
charT* g = this->eback();
- switch(way)
+ switch(static_cast<cast_type>(way))
{
case ::std::ios_base::beg:
if((off < 0) || (off > size))
@@ -504,8 +508,18 @@ typename cpp_regex_traits_implementation<charT>::string_type
// we adhere to gcc's (buggy) preconditions...
//
BOOST_ASSERT(*p2 == 0);
-
string_type result;
+#if defined(_CPPLIB_VER)
+ //
+ // A bug in VC11 and 12 causes the program to hang if we pass a null-string
+ // to std::collate::transform, but only for certain locales :-(
+ // Probably effects Intel and Clang or any compiler using the VC std library (Dinkumware).
+ //
+ if(*p1 == 0)
+ {
+ return string_type(1, charT(0));
+ }
+#endif
//
// swallowing all exceptions here is a bad idea
// however at least one std lib will always throw
@@ -579,7 +593,18 @@ typename cpp_regex_traits_implementation<charT>::string_type
// however at least one std lib will always throw
// std::bad_alloc for certain arguments...
//
- string_type result;
+ string_type result, result2;
+#if defined(_CPPLIB_VER)
+ //
+ // A bug in VC11 and 12 causes the program to hang if we pass a null-string
+ // to std::collate::transform, but only for certain locales :-(
+ // Probably effects Intel and Clang or any compiler using the VC std library (Dinkumware).
+ //
+ if(*p1 == 0)
+ {
+ return result;
+ }
+#endif
#ifndef BOOST_NO_EXCEPTIONS
try{
#endif
@@ -598,14 +623,36 @@ typename cpp_regex_traits_implementation<charT>::string_type
while(result.size() && (charT(0) == *result.rbegin()))
result.erase(result.size() - 1);
#endif
- BOOST_ASSERT(std::find(result.begin(), result.end(), charT(0)) == result.end());
+ //
+ // We may have NULL's used as separators between sections of the collate string,
+ // an example would be Boost.Locale. We have no way to detect this case via
+ // #defines since this can be used with any compiler/platform combination.
+ // Unfortunately our state machine (which was devised when all implementations
+ // used underlying C language API's) can't cope with that case. One workaround
+ // is to replace each character with 2, fortunately this code isn't used that
+ // much as this is now slower than before :-(
+ //
+ typedef typename make_unsigned<charT>::type uchar_type;
+ result2.reserve(result.size() * 2 + 2);
+ for(unsigned i = 0; i < result.size(); ++i)
+ {
+ if(static_cast<uchar_type>(result[i]) == (std::numeric_limits<uchar_type>::max)())
+ {
+ result2.append(1, charT((std::numeric_limits<uchar_type>::max)())).append(1, charT('b'));
+ }
+ else
+ {
+ result2.append(1, static_cast<charT>(1 + static_cast<uchar_type>(result[i]))).append(1, charT('b') - 1);
+ }
+ }
+ BOOST_ASSERT(std::find(result2.begin(), result2.end(), charT(0)) == result2.end());
#ifndef BOOST_NO_EXCEPTIONS
}
catch(...)
{
}
#endif
- return result;
+ return result2;
}
@@ -621,7 +668,6 @@ typename cpp_regex_traits_implementation<charT>::string_type
return pos->second;
}
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
- && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
std::string name(p1, p2);
#else
@@ -632,7 +678,6 @@ typename cpp_regex_traits_implementation<charT>::string_type
#endif
name = lookup_default_collate_name(name);
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
- && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
if(name.size())
return string_type(name.begin(), name.end());
@@ -854,7 +899,7 @@ bool cpp_regex_traits_implementation<charT>::isctype(const charT c, char_class_t
template <class charT>
-inline boost::shared_ptr<const cpp_regex_traits_implementation<charT> > create_cpp_regex_traits(const std::locale& l BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(charT))
+inline boost::shared_ptr<const cpp_regex_traits_implementation<charT> > create_cpp_regex_traits(const std::locale& l)
{
cpp_regex_traits_base<charT> key(l);
return ::boost::object_cache<cpp_regex_traits_base<charT>, cpp_regex_traits_implementation<charT> >::get(key, 5);
diff --git a/3rdParty/Boost/src/boost/regex/v4/instances.hpp b/3rdParty/Boost/src/boost/regex/v4/instances.hpp
index 2839c0b..6fa811d 100644
--- a/3rdParty/Boost/src/boost/regex/v4/instances.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/instances.hpp
@@ -92,9 +92,7 @@ template class BOOST_REGEX_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHA
template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
template class BOOST_REGEX_TEMPLATE_DECL match_results< const BOOST_REGEX_CHAR_T* >;
-#endif
#ifndef BOOST_NO_STD_ALLOCATOR
template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
#endif
@@ -102,9 +100,7 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher<BOOST_
&& !(defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 800))\
&& !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))\
&& !defined(BOOST_REGEX_ICU_INSTANCES)
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
template class BOOST_REGEX_TEMPLATE_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
-#endif
#ifndef BOOST_NO_STD_ALLOCATOR
template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
#endif
@@ -121,7 +117,7 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std::
#undef BOOST_REGEX_TEMPLATE_DECL
-#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_EXTERN_TEMPLATE)
+#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE)
# ifndef BOOST_REGEX_INSTANTIATE
# ifdef __GNUC__
diff --git a/3rdParty/Boost/src/boost/regex/v4/iterator_traits.hpp b/3rdParty/Boost/src/boost/regex/v4/iterator_traits.hpp
index f7afacb..53e1376 100644
--- a/3rdParty/Boost/src/boost/regex/v4/iterator_traits.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/iterator_traits.hpp
@@ -33,7 +33,7 @@
namespace boost{
namespace re_detail{
-#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
template <class T>
struct regex_iterator_traits
diff --git a/3rdParty/Boost/src/boost/regex/v4/match_flags.hpp b/3rdParty/Boost/src/boost/regex/v4/match_flags.hpp
index 26bde9a..e21de6c 100644
--- a/3rdParty/Boost/src/boost/regex/v4/match_flags.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/match_flags.hpp
@@ -71,7 +71,7 @@ typedef enum _match_flags
} match_flags;
-#if (defined(_MSC_VER) && (_MSC_VER < 1300)) || defined(__BORLANDC__)
+#if defined(__BORLANDC__)
typedef unsigned long match_flag_type;
#else
typedef match_flags match_flag_type;
diff --git a/3rdParty/Boost/src/boost/regex/v4/perl_matcher.hpp b/3rdParty/Boost/src/boost/regex/v4/perl_matcher.hpp
index ddaafbd..0a37a84 100644
--- a/3rdParty/Boost/src/boost/regex/v4/perl_matcher.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/perl_matcher.hpp
@@ -86,7 +86,6 @@ inline bool can_start(unsigned int c, const unsigned char* map, unsigned char ma
// which succeeds when it should not.
//
#ifndef _RWSTD_VER
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
template <class C, class T, class A>
inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
{
@@ -97,9 +96,7 @@ inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
}
return s.compare(p);
}
-#endif
#else
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
template <class C, class T, class A>
inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
{
@@ -110,7 +107,6 @@ inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
}
return s.compare(p);
}
-#endif
inline int string_compare(const std::string& s, const char* p)
{ return std::strcmp(s.c_str(), p); }
# ifndef BOOST_NO_WREGEX
diff --git a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_common.hpp b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_common.hpp
index b8c4e96..480d8f1 100644
--- a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_common.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_common.hpp
@@ -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;
}
@@ -198,7 +200,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_imp()
search_base = base;
state_count = 0;
m_match_flags |= regex_constants::match_all;
- m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last);
+ m_presult->set_size((m_match_flags & match_nosubs) ? 1 : 1 + re.mark_count(), search_base, last);
m_presult->set_base(base);
m_presult->set_named_subs(this->re.get_named_subs());
if(m_match_flags & match_posix)
@@ -260,7 +262,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_imp()
// reset our state machine:
search_base = position = base;
pstate = re.get_first_state();
- m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), base, last);
+ m_presult->set_size((m_match_flags & match_nosubs) ? 1 : 1 + re.mark_count(), base, last);
m_presult->set_base(base);
m_presult->set_named_subs(this->re.get_named_subs());
m_match_flags |= regex_constants::match_init;
@@ -279,13 +281,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_imp()
++position;
}
// reset $` start:
- m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last);
+ m_presult->set_size((m_match_flags & match_nosubs) ? 1 : 1 + re.mark_count(), search_base, last);
//if((base != search_base) && (base == backstop))
// m_match_flags |= match_prev_avail;
}
if(m_match_flags & match_posix)
{
- m_result.set_size(re.mark_count(), base, last);
+ m_result.set_size(1 + re.mark_count(), base, last);
m_result.set_base(base);
}
@@ -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))
@@ -452,11 +458,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_word_boundary()
if(position != last)
{
// prev and this character must be opposites:
- #if defined(BOOST_REGEX_USE_C_LOCALE) && defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
- b = traits::isctype(*position, m_word_mask);
- #else
b = traits_inst.isctype(*position, m_word_mask);
- #endif
}
else
{
diff --git a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp
index 0da43e3..5c1f7a9 100644
--- a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp
@@ -703,7 +703,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, (std::min)((std::size_t)::boost::re_detail::distance(position, last), desired));
+ // Move end forward by "desired", preferably without using distance or advance if we can
+ // as these can be slow for some iterator types.
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ if(desired >= len)
+ end = last;
+ else
+ std::advance(end, desired);
BidiIterator origin(position);
while((position != end) && (traits_inst.translate(*position, icase) == what))
{
@@ -771,7 +777,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, (std::min)((std::size_t)::boost::re_detail::distance(position, last), desired));
+ // Move end forward by "desired", preferably without using distance or advance if we can
+ // as these can be slow for some iterator types.
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ if(desired >= len)
+ end = last;
+ else
+ std::advance(end, desired);
BidiIterator origin(position);
while((position != end) && map[static_cast<unsigned char>(traits_inst.translate(*position, icase))])
{
@@ -840,7 +852,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, (std::min)((std::size_t)::boost::re_detail::distance(position, last), desired));
+ // Move end forward by "desired", preferably without using distance or advance if we can
+ // as these can be slow for some iterator types.
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ if(desired >= len)
+ end = last;
+ else
+ std::advance(end, desired);
BidiIterator origin(position);
while((position != end) && (position != re_is_set_member(position, last, set, re.get_data(), icase)))
{
@@ -1268,6 +1286,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_fast_dot_repeat(bool
}while((count < rep->max) && (position != last) && !can_start(*position, rep->_map, mask_skip));
}
+ // remember where we got to if this is a leading repeat:
+ if((rep->leading) && (count < rep->max))
+ restart = position;
if(position == last)
{
// can't repeat any more, remove the pushed state:
diff --git a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_recursive.hpp b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_recursive.hpp
index 07a1c20..8e0e182 100644
--- a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_recursive.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_recursive.hpp
@@ -641,7 +641,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, (std::min)((std::size_t)::boost::re_detail::distance(position, last), desired));
+ // Move end forward by "desired", preferably without using distance or advance if we can
+ // as these can be slow for some iterator types.
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ if(desired >= len)
+ end = last;
+ else
+ std::advance(end, desired);
BidiIterator origin(position);
while((position != end) && map[static_cast<unsigned char>(traits_inst.translate(*position, icase))])
{
@@ -731,7 +737,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, (std::min)((std::size_t)::boost::re_detail::distance(position, last), desired));
+ // Move end forward by "desired", preferably without using distance or advance if we can
+ // as these can be slow for some iterator types.
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ if(desired >= len)
+ end = last;
+ else
+ std::advance(end, desired);
BidiIterator origin(position);
while((position != end) && (position != re_is_set_member(position, last, set, re.get_data(), icase)))
{
diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp
index 3b1d19d..80c654e 100644
--- a/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp
@@ -283,7 +283,8 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
format_perl();
break;
}
- // fall through, not a special character:
+ // not a special character:
+ BOOST_FALLTHROUGH;
default:
put(*m_position);
++m_position;
@@ -354,7 +355,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
case '{':
have_brace = true;
++m_position;
- // fall through....
+ BOOST_FALLTHROUGH;
default:
// see if we have a number:
{
@@ -1064,7 +1065,7 @@ struct format_functor_c_string
template <class OutputIter>
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits& t = Traits())
{
- typedef typename Match::char_type char_type;
+ //typedef typename Match::char_type char_type;
const charT* end = func;
while(*end) ++end;
return regex_format_imp(i, m, func, end, f, t);
@@ -1083,7 +1084,7 @@ struct format_functor_container
template <class OutputIter>
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits& t = Traits())
{
- typedef typename Match::char_type char_type;
+ //typedef typename Match::char_type char_type;
return re_detail::regex_format_imp(i, m, func.begin(), func.end(), f, t);
}
private:
diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_raw_buffer.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_raw_buffer.hpp
index 52d45a2..c7792e3 100644
--- a/3rdParty/Boost/src/boost/regex/v4/regex_raw_buffer.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/regex_raw_buffer.hpp
@@ -129,7 +129,7 @@ public:
{
if(size_type(last - end) < n)
resize(n + (end - start));
- register pointer result = end;
+ pointer result = end;
end += n;
return result;
}
diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_split.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_split.hpp
index a7ae350..c12d7ba 100644
--- a/3rdParty/Boost/src/boost/regex/v4/regex_split.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/regex_split.hpp
@@ -107,7 +107,7 @@ std::size_t regex_split(OutputIterator out,
std::size_t max_split)
{
typedef typename std::basic_string<charT, Traits1, Alloc1>::const_iterator ci_t;
- typedef typename match_results<ci_t>::allocator_type match_allocator;
+ //typedef typename match_results<ci_t>::allocator_type match_allocator;
ci_t last = s.begin();
std::size_t init_size = max_split;
re_detail::split_pred<OutputIterator, charT, Traits1, Alloc1> pred(&last, &out, &max_split);
@@ -119,7 +119,7 @@ std::size_t regex_split(OutputIterator out,
// if there is still input left, do a final push as long as max_split
// is not exhausted, and we're not splitting sub-expressions rather
// than whitespace:
- if(max_split && (last != s.end()) && (e.mark_count() == 1))
+ if(max_split && (last != s.end()) && (e.mark_count() == 0))
{
*out = std::basic_string<charT, Traits1, Alloc1>((ci_t)last, (ci_t)s.end());
++out;
diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_token_iterator.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_token_iterator.hpp
index 4e8bc36..dbb0803 100644
--- a/3rdParty/Boost/src/boost/regex/v4/regex_token_iterator.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/regex_token_iterator.hpp
@@ -22,7 +22,6 @@
#include <boost/shared_ptr.hpp>
#include <boost/detail/workaround.hpp>
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
- || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
//
// Borland C++ Builder 6, and Visual C++ 6,
@@ -45,10 +44,8 @@ namespace boost{
#endif
#ifdef BOOST_MSVC
#pragma warning(pop)
-#endif
-#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
-# pragma warning(push)
-# pragma warning(disable:4700)
+#pragma warning(push)
+#pragma warning(disable:4700)
#endif
template <class BidirectionalIterator,
@@ -75,7 +72,6 @@ public:
: end(last), re(*p), flags(f), subs(v){}
#if !BOOST_WORKAROUND(__HP_aCC, < 60700)
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
- || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
template <class T>
@@ -209,7 +205,6 @@ public:
}
#if !BOOST_WORKAROUND(__HP_aCC, < 60700)
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
- || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
template <class T>
@@ -296,7 +291,6 @@ inline regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_ite
{
return regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_iterator, charT, traits>(p.begin(), p.end(), e, submatch, m);
}
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
template <class charT, class traits, std::size_t N>
inline regex_token_iterator<const charT*, charT, traits> make_regex_token_iterator(const charT* p, const basic_regex<charT, traits>& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default)
{
@@ -307,7 +301,6 @@ inline regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_ite
{
return regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_iterator, charT, traits>(p.begin(), p.end(), e, submatch, m);
}
-#endif
template <class charT, class traits>
inline regex_token_iterator<const charT*, charT, traits> make_regex_token_iterator(const charT* p, const basic_regex<charT, traits>& e, const std::vector<int>& submatch, regex_constants::match_flag_type m = regex_constants::match_default)
{
@@ -319,10 +312,8 @@ inline regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_ite
return regex_token_iterator<typename std::basic_string<charT, ST, SA>::const_iterator, charT, traits>(p.begin(), p.end(), e, submatch, m);
}
-#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
-# pragma warning(pop)
-#endif
#ifdef BOOST_MSVC
+#pragma warning(pop)
#pragma warning(push)
#pragma warning(disable: 4103)
#endif
diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_traits.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_traits.hpp
index f5f0402..8b1cb6f 100644
--- a/3rdParty/Boost/src/boost/regex/v4/regex_traits.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/regex_traits.hpp
@@ -83,7 +83,7 @@ struct regex_traits : public implementationT
// required "standard" ones:
//
namespace re_detail{
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__HP_aCC, < 60000)
+#if !BOOST_WORKAROUND(__HP_aCC, < 60000)
BOOST_MPL_HAS_XXX_TRAIT_DEF(boost_extensions_tag)
#else
template<class T>
@@ -136,7 +136,7 @@ struct compute_wrapper_base
{
typedef BaseT type;
};
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__HP_aCC, < 60000)
+#if !BOOST_WORKAROUND(__HP_aCC, < 60000)
template <class BaseT>
struct compute_wrapper_base<BaseT, false>
{
diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_traits_defaults.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_traits_defaults.hpp
index ca13f19..a087d78 100644
--- a/3rdParty/Boost/src/boost/regex/v4/regex_traits_defaults.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/regex_traits_defaults.hpp
@@ -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
diff --git a/3rdParty/Boost/src/boost/regex/v4/sub_match.hpp b/3rdParty/Boost/src/boost/regex/v4/sub_match.hpp
index 34a8684..7ce8d53 100644
--- a/3rdParty/Boost/src/boost/regex/v4/sub_match.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/sub_match.hpp
@@ -36,7 +36,7 @@ template <class BidiIterator>
struct sub_match : public std::pair<BidiIterator, BidiIterator>
{
typedef typename re_detail::regex_iterator_traits<BidiIterator>::value_type value_type;
-#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef std::ptrdiff_t difference_type;
#else
typedef typename re_detail::regex_iterator_traits<BidiIterator>::difference_type difference_type;
@@ -50,7 +50,6 @@ struct sub_match : public std::pair<BidiIterator, BidiIterator>
sub_match() : std::pair<BidiIterator, BidiIterator>(), matched(false) {}
sub_match(BidiIterator i) : std::pair<BidiIterator, BidiIterator>(i, i), matched(false) {}
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
- && !BOOST_WORKAROUND(BOOST_MSVC, < 1310)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)\
&& !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
template <class T, class A>
diff --git a/3rdParty/Boost/src/boost/regex/v4/u32regex_token_iterator.hpp b/3rdParty/Boost/src/boost/regex/v4/u32regex_token_iterator.hpp
index de16771..e8649f3 100644
--- a/3rdParty/Boost/src/boost/regex/v4/u32regex_token_iterator.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/u32regex_token_iterator.hpp
@@ -20,7 +20,6 @@
#define BOOST_REGEX_V4_U32REGEX_TOKEN_ITERATOR_HPP
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
- || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
//
// Borland C++ Builder 6, and Visual C++ 6,
@@ -37,7 +36,7 @@ namespace boost{
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
-#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
+#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable:4700)
#endif
@@ -62,10 +61,7 @@ public:
: end(last), re(*p), flags(f){ subs.push_back(sub); }
u32regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const std::vector<int>& v, match_flag_type f)
: end(last), re(*p), flags(f), subs(v){}
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- // can't reliably get this to work....
-#elif (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
- || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
+#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
template <class T>
@@ -195,10 +191,7 @@ public:
if(!pdata->init(a))
pdata.reset();
}
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- // can't reliably get this to work....
-#elif (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
- || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
+#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
template <class T>
@@ -299,7 +292,6 @@ inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const
return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m);
}
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
// construction from a reference to an array:
template <std::size_t N>
inline u32regex_token_iterator<const char*> make_u32regex_token_iterator(const char* p, const u32regex& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default)
@@ -331,7 +323,6 @@ inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const
{
return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m);
}
-#endif // BOOST_MSVC < 1300
// construction from a vector of sub_match state_id's:
inline u32regex_token_iterator<const char*> make_u32regex_token_iterator(const char* p, const u32regex& e, const std::vector<int>& submatch, regex_constants::match_flag_type m = regex_constants::match_default)
@@ -361,7 +352,7 @@ inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const
return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m);
}
-#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
+#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#ifdef BOOST_HAS_ABI_HEADERS
diff --git a/3rdParty/Boost/src/boost/regex/v4/w32_regex_traits.hpp b/3rdParty/Boost/src/boost/regex/v4/w32_regex_traits.hpp
index d556207..ef934b7 100644
--- a/3rdParty/Boost/src/boost/regex/v4/w32_regex_traits.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/w32_regex_traits.hpp
@@ -399,7 +399,6 @@ typename w32_regex_traits_implementation<charT>::string_type
return pos->second;
}
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
- && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
std::string name(p1, p2);
#else
@@ -410,7 +409,6 @@ typename w32_regex_traits_implementation<charT>::string_type
#endif
name = lookup_default_collate_name(name);
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
- && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
if(name.size())
return string_type(name.begin(), name.end());
@@ -552,7 +550,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type
template <class charT>
-boost::shared_ptr<const w32_regex_traits_implementation<charT> > create_w32_regex_traits(::boost::re_detail::lcid_type l BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(charT))
+boost::shared_ptr<const w32_regex_traits_implementation<charT> > create_w32_regex_traits(::boost::re_detail::lcid_type l)
{
// TODO: create a cache for previously constructed objects.
return boost::object_cache< ::boost::re_detail::lcid_type, w32_regex_traits_implementation<charT> >::get(l, 5);