Remove a lot of boost dependencies and workarounds.

This commit is contained in:
jzmaddock
2020-12-01 18:57:42 +00:00
parent 678b3f5c4d
commit 957dc5b79c
48 changed files with 600 additions and 697 deletions

View File

@ -617,32 +617,32 @@ public:
//
const BOOST_REGEX_DETAIL_NS::re_syntax_base* get_first_state()const
{
BOOST_ASSERT(0 != m_pimpl.get());
BOOST_REGEX_ASSERT(0 != m_pimpl.get());
return m_pimpl->get_first_state();
}
unsigned get_restart_type()const
{
BOOST_ASSERT(0 != m_pimpl.get());
BOOST_REGEX_ASSERT(0 != m_pimpl.get());
return m_pimpl->get_restart_type();
}
const unsigned char* get_map()const
{
BOOST_ASSERT(0 != m_pimpl.get());
BOOST_REGEX_ASSERT(0 != m_pimpl.get());
return m_pimpl->get_map();
}
const ::boost::regex_traits_wrapper<traits>& get_traits()const
{
BOOST_ASSERT(0 != m_pimpl.get());
BOOST_REGEX_ASSERT(0 != m_pimpl.get());
return m_pimpl->get_traits();
}
bool can_be_null()const
{
BOOST_ASSERT(0 != m_pimpl.get());
BOOST_REGEX_ASSERT(0 != m_pimpl.get());
return m_pimpl->can_be_null();
}
const BOOST_REGEX_DETAIL_NS::regex_data<charT, traits>& get_data()const
{
BOOST_ASSERT(0 != m_pimpl.get());
BOOST_REGEX_ASSERT(0 != m_pimpl.get());
return m_pimpl->get_data();
}
boost::shared_ptr<BOOST_REGEX_DETAIL_NS::named_subexpressions > get_named_subs()const

View File

@ -58,8 +58,8 @@ struct digraph : public std::pair<charT, charT>
template <class Seq>
digraph(const Seq& s) : std::pair<charT, charT>()
{
BOOST_ASSERT(s.size() <= 2);
BOOST_ASSERT(s.size());
BOOST_REGEX_ASSERT(s.size() <= 2);
BOOST_REGEX_ASSERT(s.size());
this->first = s[0];
this->second = (s.size() > 1) ? s[1] : 0;
}
@ -288,11 +288,11 @@ basic_regex_creator<charT, traits>::basic_regex_creator(regex_data<charT, traits
m_upper_mask = m_traits.lookup_classname(u, u + 5);
m_alpha_mask = m_traits.lookup_classname(a, a + 5);
m_pdata->m_word_mask = m_word_mask;
BOOST_ASSERT(m_word_mask != 0);
BOOST_ASSERT(m_mask_space != 0);
BOOST_ASSERT(m_lower_mask != 0);
BOOST_ASSERT(m_upper_mask != 0);
BOOST_ASSERT(m_alpha_mask != 0);
BOOST_REGEX_ASSERT(m_word_mask != 0);
BOOST_REGEX_ASSERT(m_mask_space != 0);
BOOST_REGEX_ASSERT(m_lower_mask != 0);
BOOST_REGEX_ASSERT(m_upper_mask != 0);
BOOST_REGEX_ASSERT(m_alpha_mask != 0);
}
template <class charT, class traits>
@ -580,7 +580,7 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
// Oops error:
return 0;
}
BOOST_ASSERT(c3[1] == charT(0));
BOOST_REGEX_ASSERT(c3[1] == charT(0));
for(unsigned i = 0; i < (1u << CHAR_BIT); ++i)
{
c3[0] = static_cast<charT>(i);
@ -645,7 +645,7 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
while(sfirst != slast)
{
string_type s;
BOOST_ASSERT(static_cast<charT>(0) == sfirst->second);
BOOST_REGEX_ASSERT(static_cast<charT>(0) == sfirst->second);
s = m_traits.transform_primary(&sfirst->first, &sfirst->first+1);
if(s.empty())
return 0; // invalid or unsupported equivalence class
@ -1038,7 +1038,7 @@ int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state
}
else if(state->type == syntax_element_long_set_rep)
{
BOOST_ASSERT(rep->next.p->type == syntax_element_long_set);
BOOST_REGEX_ASSERT(rep->next.p->type == syntax_element_long_set);
if(static_cast<re_set_long<m_type>*>(rep->next.p)->singleton == 0)
return -1;
if(rep->max != rep->min)
@ -1138,7 +1138,7 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
}
case syntax_element_recurse:
{
BOOST_ASSERT(static_cast<const re_jump*>(state)->alt.p->type == syntax_element_startmark);
BOOST_REGEX_ASSERT(static_cast<const re_jump*>(state)->alt.p->type == syntax_element_startmark);
recursion_sub = static_cast<re_brace*>(static_cast<const re_jump*>(state)->alt.p)->index;
if(m_recursion_checks[recursion_sub] & 1u)
{

View File

@ -1948,7 +1948,7 @@ charT basic_regex_parser<charT, traits>::unescape_character()
template <class charT, class traits>
bool basic_regex_parser<charT, traits>::parse_backref()
{
BOOST_ASSERT(m_position != m_end);
BOOST_REGEX_ASSERT(m_position != m_end);
const charT* pc = m_position;
boost::intmax_t i = this->m_traits.toi(pc, pc + 1, 10);
if((i == 0) || (((this->flags() & regbase::main_option_type) == regbase::perl_syntax_group) && (this->flags() & regbase::no_bk_refs)))
@ -2609,7 +2609,7 @@ option_group_jump:
this->fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_end));
return false;
}
BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark);
BOOST_REGEX_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark);
++m_position;
//
// restore the flags:
@ -3137,7 +3137,7 @@ bool basic_regex_parser<charT, traits>::unwind_alts(std::ptrdiff_t last_paren_st
m_alt_jumps.pop_back();
this->m_pdata->m_data.align();
re_jump* jmp = static_cast<re_jump*>(this->getaddress(jump_offset));
BOOST_ASSERT(jmp->type == syntax_element_jump);
BOOST_REGEX_ASSERT(jmp->type == syntax_element_jump);
jmp->alt.i = this->m_pdata->m_data.size() - jump_offset;
}
return true;

View File

@ -23,7 +23,7 @@
#include <boost/regex/config.hpp>
#endif
#ifndef BOOST_REGEX_WORKAROUND_HPP
#include <boost/regex/v5/regex_workaround.hpp>
#include <boost/regex/v4/regex_workaround.hpp>
#endif
#include <cctype>
@ -277,7 +277,7 @@ inline c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<cha
s[i] = static_cast<char>((std::tolower)(static_cast<unsigned char>(s[i])));
idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
}
BOOST_ASSERT(std::size_t(idx) + 1u < sizeof(masks) / sizeof(masks[0]));
BOOST_REGEX_ASSERT(std::size_t(idx) + 1u < sizeof(masks) / sizeof(masks[0]));
return masks[idx + 1];
}
@ -433,7 +433,7 @@ inline c_regex_traits<wchar_t>::char_class_type BOOST_REGEX_CALL c_regex_traits<
s[i] = (std::towlower)(s[i]);
idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
}
BOOST_ASSERT(idx + 1 < static_cast<int>(sizeof(masks) / sizeof(masks[0])));
BOOST_REGEX_ASSERT(idx + 1 < static_cast<int>(sizeof(masks) / sizeof(masks[0])));
return masks[idx + 1];
}

View File

@ -29,16 +29,16 @@
#include <boost/regex/pattern_except.hpp>
#endif
#ifndef BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED
#include <boost/regex/v5/regex_traits_defaults.hpp>
#include <boost/regex/v4/regex_traits_defaults.hpp>
#endif
#ifdef BOOST_HAS_THREADS
#include <boost/regex/pending/static_mutex.hpp>
#endif
#ifndef BOOST_REGEX_PRIMARY_TRANSFORM
#include <boost/regex/v5/primary_transform.hpp>
#include <boost/regex/v4/primary_transform.hpp>
#endif
#ifndef BOOST_REGEX_OBJECT_CACHE_HPP
#include <boost/regex/pending/object_cache.hpp>
#include <boost/regex/v4/object_cache.hpp>
#endif
#include <climits>
@ -508,7 +508,7 @@ typename cpp_regex_traits_implementation<charT>::string_type
// we work around this elsewhere, but just assert here that
// we adhere to gcc's (buggy) preconditions...
//
BOOST_ASSERT(*p2 == 0);
BOOST_REGEX_ASSERT(*p2 == 0);
string_type result;
#if defined(_CPPLIB_VER)
//
@ -588,7 +588,7 @@ typename cpp_regex_traits_implementation<charT>::string_type
// we work around this elsewhere, but just assert here that
// we adhere to gcc's (buggy) preconditions...
//
BOOST_ASSERT(*p2 == 0);
BOOST_REGEX_ASSERT(*p2 == 0);
//
// swallowing all exceptions here is a bad idea
// however at least one std lib will always throw
@ -646,7 +646,7 @@ typename cpp_regex_traits_implementation<charT>::string_type
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());
BOOST_REGEX_ASSERT(std::find(result2.begin(), result2.end(), charT(0)) == result2.end());
#ifndef BOOST_NO_EXCEPTIONS
}
catch(...)
@ -872,7 +872,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
return pos->second;
}
std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
BOOST_ASSERT(state_id < sizeof(masks) / sizeof(masks[0]));
BOOST_REGEX_ASSERT(state_id < sizeof(masks) / sizeof(masks[0]));
return masks[state_id];
}

View File

@ -474,7 +474,7 @@ public:
// private access functions:
void BOOST_REGEX_CALL set_second(BidiIterator i)
{
BOOST_ASSERT(m_subs.size() > 2);
BOOST_REGEX_ASSERT(m_subs.size() > 2);
m_subs[2].second = i;
m_subs[2].matched = true;
m_subs[0].first = i;
@ -490,7 +490,7 @@ public:
if(pos)
m_last_closed_paren = static_cast<int>(pos);
pos += 2;
BOOST_ASSERT(m_subs.size() > pos);
BOOST_REGEX_ASSERT(m_subs.size() > pos);
m_subs[pos].second = i;
m_subs[pos].matched = m;
if((pos == 2) && !escape_k)
@ -531,7 +531,7 @@ public:
}
void BOOST_REGEX_CALL set_first(BidiIterator i)
{
BOOST_ASSERT(m_subs.size() > 2);
BOOST_REGEX_ASSERT(m_subs.size() > 2);
// set up prefix:
m_subs[1].second = i;
m_subs[1].matched = (m_subs[1].first != i);
@ -546,7 +546,7 @@ public:
}
void BOOST_REGEX_CALL set_first(BidiIterator i, size_type pos, bool escape_k = false)
{
BOOST_ASSERT(pos+2 < m_subs.size());
BOOST_REGEX_ASSERT(pos+2 < m_subs.size());
if(pos || escape_k)
{
m_subs[pos+2].first = i;
@ -650,15 +650,15 @@ void BOOST_REGEX_CALL match_results<BidiIterator, Allocator>::maybe_assign(const
}
base1 = ::boost::BOOST_REGEX_DETAIL_NS::distance(l_base, p1->first);
base2 = ::boost::BOOST_REGEX_DETAIL_NS::distance(l_base, p2->first);
BOOST_ASSERT(base1 >= 0);
BOOST_ASSERT(base2 >= 0);
BOOST_REGEX_ASSERT(base1 >= 0);
BOOST_REGEX_ASSERT(base2 >= 0);
if(base1 < base2) return;
if(base2 < base1) break;
len1 = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)p1->first, (BidiIterator)p1->second);
len2 = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)p2->first, (BidiIterator)p2->second);
BOOST_ASSERT(len1 >= 0);
BOOST_ASSERT(len2 >= 0);
BOOST_REGEX_ASSERT(len1 >= 0);
BOOST_REGEX_ASSERT(len2 >= 0);
if((len1 != len2) || ((p1->matched == false) && (p2->matched == true)))
break;
if((p1->matched == true) && (p2->matched == false))

View File

@ -622,7 +622,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_backref()
if(index >= hash_value_mask)
{
named_subexpressions::range_type r = re.get_data().equal_range(index);
BOOST_ASSERT(r.first != r.second);
BOOST_REGEX_ASSERT(r.first != r.second);
do
{
index = r.first->index;

View File

@ -111,7 +111,7 @@ struct save_state_init
*end = reinterpret_cast<saved_state*>(reinterpret_cast<char*>(*base)+BOOST_REGEX_BLOCKSIZE);
--(*end);
(void) new (*end)saved_state(0);
BOOST_ASSERT(*end > *base);
BOOST_REGEX_ASSERT(*end > *base);
}
~save_state_init()
{
@ -248,7 +248,7 @@ void perl_matcher<BidiIterator, Allocator, traits>::extend_stack()
template <class BidiIterator, class Allocator, class traits>
inline void perl_matcher<BidiIterator, Allocator, traits>::push_matched_paren(int index, const sub_match<BidiIterator>& sub)
{
//BOOST_ASSERT(index);
//BOOST_REGEX_ASSERT(index);
saved_matched_paren<BidiIterator>* pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
--pmp;
if(pmp < m_stack_base)
@ -264,7 +264,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits>::push_matched_paren(in
template <class BidiIterator, class Allocator, class traits>
inline void perl_matcher<BidiIterator, Allocator, traits>::push_case_change(bool c)
{
//BOOST_ASSERT(index);
//BOOST_REGEX_ASSERT(index);
saved_change_case* pmp = static_cast<saved_change_case*>(m_backup_state);
--pmp;
if(pmp < m_stack_base)
@ -492,7 +492,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
{
// conditional expression:
const re_alt* alt = static_cast<const re_alt*>(pstate->next.p);
BOOST_ASSERT(alt->type == syntax_element_alt);
BOOST_REGEX_ASSERT(alt->type == syntax_element_alt);
pstate = alt->next.p;
if(pstate->type == syntax_element_assert_backref)
{
@ -503,7 +503,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
else
{
// zero width assertion, have to match this recursively:
BOOST_ASSERT(pstate->type == syntax_element_startmark);
BOOST_REGEX_ASSERT(pstate->type == syntax_element_startmark);
bool negated = static_cast<const re_brace*>(pstate)->index == -2;
BidiIterator saved_position = position;
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
@ -543,7 +543,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
}
default:
{
BOOST_ASSERT(index > 0);
BOOST_REGEX_ASSERT(index > 0);
if((m_match_flags & match_nosubs) == 0)
{
push_matched_paren(index, (*m_presult)[index]);
@ -794,7 +794,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
#pragma option push -w-8008 -w-8066 -w-8004
#endif
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
BOOST_ASSERT(1 == static_cast<const re_literal*>(rep->next.p)->length);
BOOST_REGEX_ASSERT(1 == static_cast<const re_literal*>(rep->next.p)->length);
const char_type what = *reinterpret_cast<const char_type*>(static_cast<const re_literal*>(rep->next.p) + 1);
std::size_t count = 0;
//
@ -1010,7 +1010,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion()
{
BOOST_ASSERT(pstate->type == syntax_element_recurse);
BOOST_REGEX_ASSERT(pstate->type == syntax_element_recurse);
//
// See if we've seen this recursion before at this location, if we have then
// we need to prevent infinite recursion:
@ -1087,7 +1087,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
{
if(!recursion_stack.empty())
{
BOOST_ASSERT(0 == recursion_stack.back().idx);
BOOST_REGEX_ASSERT(0 == recursion_stack.back().idx);
pstate = recursion_stack.back().preturn_address;
push_recursion(recursion_stack.back().idx, recursion_stack.back().preturn_address, m_presult, &recursion_stack.back().results);
*m_presult = recursion_stack.back().results;
@ -1394,15 +1394,15 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_greedy_single_repeat(
const re_repeat* rep = pmp->rep;
std::size_t count = pmp->count;
BOOST_ASSERT(rep->next.p != 0);
BOOST_ASSERT(rep->alt.p != 0);
BOOST_REGEX_ASSERT(rep->next.p != 0);
BOOST_REGEX_ASSERT(rep->alt.p != 0);
count -= rep->min;
if((m_match_flags & match_partial) && (position == last))
m_has_partial_match = true;
BOOST_ASSERT(count);
BOOST_REGEX_ASSERT(count);
position = pmp->last_position;
// backtrack till we can skip out:
@ -1443,12 +1443,12 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_slow_dot_repeat(bool
const re_repeat* rep = pmp->rep;
std::size_t count = pmp->count;
BOOST_ASSERT(rep->type == syntax_element_dot_rep);
BOOST_ASSERT(rep->next.p != 0);
BOOST_ASSERT(rep->alt.p != 0);
BOOST_ASSERT(rep->next.p->type == syntax_element_wild);
BOOST_REGEX_ASSERT(rep->type == syntax_element_dot_rep);
BOOST_REGEX_ASSERT(rep->next.p != 0);
BOOST_REGEX_ASSERT(rep->alt.p != 0);
BOOST_REGEX_ASSERT(rep->next.p->type == syntax_element_wild);
BOOST_ASSERT(count < rep->max);
BOOST_REGEX_ASSERT(count < rep->max);
pstate = rep->next.p;
position = pmp->last_position;
@ -1508,7 +1508,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_fast_dot_repeat(bool
const re_repeat* rep = pmp->rep;
std::size_t count = pmp->count;
BOOST_ASSERT(count < rep->max);
BOOST_REGEX_ASSERT(count < rep->max);
position = pmp->last_position;
if(position != last)
{
@ -1568,11 +1568,11 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_char_repeat(bool r)
const char_type what = *reinterpret_cast<const char_type*>(static_cast<const re_literal*>(pstate) + 1);
position = pmp->last_position;
BOOST_ASSERT(rep->type == syntax_element_char_rep);
BOOST_ASSERT(rep->next.p != 0);
BOOST_ASSERT(rep->alt.p != 0);
BOOST_ASSERT(rep->next.p->type == syntax_element_literal);
BOOST_ASSERT(count < rep->max);
BOOST_REGEX_ASSERT(rep->type == syntax_element_char_rep);
BOOST_REGEX_ASSERT(rep->next.p != 0);
BOOST_REGEX_ASSERT(rep->alt.p != 0);
BOOST_REGEX_ASSERT(rep->next.p->type == syntax_element_literal);
BOOST_REGEX_ASSERT(count < rep->max);
if(position != last)
{
@ -1637,11 +1637,11 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_short_set_repeat(bool
const unsigned char* map = static_cast<const re_set*>(rep->next.p)->_map;
position = pmp->last_position;
BOOST_ASSERT(rep->type == syntax_element_short_set_rep);
BOOST_ASSERT(rep->next.p != 0);
BOOST_ASSERT(rep->alt.p != 0);
BOOST_ASSERT(rep->next.p->type == syntax_element_set);
BOOST_ASSERT(count < rep->max);
BOOST_REGEX_ASSERT(rep->type == syntax_element_short_set_rep);
BOOST_REGEX_ASSERT(rep->next.p != 0);
BOOST_REGEX_ASSERT(rep->alt.p != 0);
BOOST_REGEX_ASSERT(rep->next.p->type == syntax_element_set);
BOOST_REGEX_ASSERT(count < rep->max);
if(position != last)
{
@ -1707,11 +1707,11 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat(bool
const re_set_long<m_type>* set = static_cast<const re_set_long<m_type>*>(pstate);
position = pmp->last_position;
BOOST_ASSERT(rep->type == syntax_element_long_set_rep);
BOOST_ASSERT(rep->next.p != 0);
BOOST_ASSERT(rep->alt.p != 0);
BOOST_ASSERT(rep->next.p->type == syntax_element_long_set);
BOOST_ASSERT(count < rep->max);
BOOST_REGEX_ASSERT(rep->type == syntax_element_long_set_rep);
BOOST_REGEX_ASSERT(rep->next.p != 0);
BOOST_REGEX_ASSERT(rep->alt.p != 0);
BOOST_REGEX_ASSERT(rep->next.p->type == syntax_element_long_set);
BOOST_REGEX_ASSERT(count < rep->max);
if(position != last)
{

View File

@ -195,7 +195,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
{
// conditional expression:
const re_alt* alt = static_cast<const re_alt*>(pstate->next.p);
BOOST_ASSERT(alt->type == syntax_element_alt);
BOOST_REGEX_ASSERT(alt->type == syntax_element_alt);
pstate = alt->next.p;
if(pstate->type == syntax_element_assert_backref)
{
@ -206,7 +206,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
else
{
// zero width assertion, have to match this recursively:
BOOST_ASSERT(pstate->type == syntax_element_startmark);
BOOST_REGEX_ASSERT(pstate->type == syntax_element_startmark);
bool negated = static_cast<const re_brace*>(pstate)->index == -2;
BidiIterator saved_position = position;
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
@ -235,7 +235,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
}
default:
{
BOOST_ASSERT(index > 0);
BOOST_REGEX_ASSERT(index > 0);
if((m_match_flags & match_nosubs) == 0)
{
backup_subex<BidiIterator> sub(*m_presult, index);
@ -552,7 +552,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
#pragma option push -w-8008 -w-8066 -w-8004
#endif
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
BOOST_ASSERT(1 == static_cast<const re_literal*>(rep->next.p)->length);
BOOST_REGEX_ASSERT(1 == static_cast<const re_literal*>(rep->next.p)->length);
const char_type what = *reinterpret_cast<const char_type*>(static_cast<const re_literal*>(rep->next.p) + 1);
//
// start by working out how much we can skip:
@ -892,7 +892,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::backtrack_till_match(std::si
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion()
{
BOOST_ASSERT(pstate->type == syntax_element_recurse);
BOOST_REGEX_ASSERT(pstate->type == syntax_element_recurse);
//
// Set new call stack:
//
@ -987,7 +987,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
{
if(!recursion_stack.empty())
{
BOOST_ASSERT(0 == recursion_stack.back().idx);
BOOST_REGEX_ASSERT(0 == recursion_stack.back().idx);
const re_syntax_base* saved_state = pstate = recursion_stack.back().preturn_address;
*m_presult = recursion_stack.back().results;
recursion_stack.pop_back();

View File

@ -251,7 +251,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
m_have_conditional = have_conditional;
if(m_position == m_end)
return;
BOOST_ASSERT(*m_position == static_cast<char_type>(')'));
BOOST_REGEX_ASSERT(*m_position == static_cast<char_type>(')'));
++m_position; // skip the closing ')'
break;
}
@ -307,7 +307,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
// On entry *m_position points to a '$' character
// output the information that goes with it:
//
BOOST_ASSERT(*m_position == '$');
BOOST_REGEX_ASSERT(*m_position == '$');
//
// see if this is a trailing '$':
//
@ -656,7 +656,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
len = (std::min)(static_cast<std::ptrdiff_t>(4), len);
v = this->toi(m_position, m_position + len, 8);
BOOST_ASSERT(v >= 0);
BOOST_REGEX_ASSERT(v >= 0);
put(static_cast<char_type>(v));
break;
}

View File

@ -158,7 +158,7 @@ public:
void* BOOST_REGEX_CALL insert(size_type pos, size_type n)
{
BOOST_ASSERT(pos <= size_type(end - start));
BOOST_REGEX_ASSERT(pos <= size_type(end - start));
if (size_type(last - end) < n)
resize(n + (end - start));
void* result = start + pos;

View File

@ -34,12 +34,12 @@
#include <boost/cstdint.hpp>
#ifndef BOOST_REGEX_SYNTAX_TYPE_HPP
#include <boost/regex/v5/syntax_type.hpp>
#include <boost/regex/v4/syntax_type.hpp>
#endif
#ifndef BOOST_REGEX_ERROR_TYPE_HPP
#include <boost/regex/v5/error_type.hpp>
#include <boost/regex/v4/error_type.hpp>
#endif
#include <boost/regex/v5/regex_workaround.hpp>
#include <boost/regex/v4/regex_workaround.hpp>
#include <boost/type_traits/make_unsigned.hpp>
#include <boost/utility/enable_if.hpp>

View File

@ -25,16 +25,16 @@
#include <boost/regex/pattern_except.hpp>
#endif
#ifndef BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED
#include <boost/regex/v5/regex_traits_defaults.hpp>
#include <boost/regex/v4/regex_traits_defaults.hpp>
#endif
#ifdef BOOST_HAS_THREADS
#include <boost/regex/pending/static_mutex.hpp>
#endif
#ifndef BOOST_REGEX_PRIMARY_TRANSFORM
#include <boost/regex/v5/primary_transform.hpp>
#include <boost/regex/v4/primary_transform.hpp>
#endif
#ifndef BOOST_REGEX_OBJECT_CACHE_HPP
#include <boost/regex/pending/object_cache.hpp>
#include <boost/regex/v4/object_cache.hpp>
#endif
#define VC_EXTRALEAN
@ -794,21 +794,21 @@ namespace BOOST_REGEX_DETAIL_NS {
char_map[ii] = static_cast<char>(ii);
#ifndef BOOST_NO_ANSI_APIS
int r = ::LCMapStringA(this->m_locale, LCMAP_LOWERCASE, char_map, 1 << CHAR_BIT, this->m_lower_map, 1 << CHAR_BIT);
BOOST_ASSERT(r != 0);
BOOST_REGEX_ASSERT(r != 0);
#else
UINT code_page = get_code_page_for_locale_id(this->m_locale);
BOOST_ASSERT(code_page != 0);
BOOST_REGEX_ASSERT(code_page != 0);
WCHAR wide_char_map[1 << CHAR_BIT];
int conv_r = ::MultiByteToWideChar(code_page, 0, char_map, 1 << CHAR_BIT, wide_char_map, 1 << CHAR_BIT);
BOOST_ASSERT(conv_r != 0);
BOOST_REGEX_ASSERT(conv_r != 0);
WCHAR wide_lower_map[1 << CHAR_BIT];
int r = ::LCMapStringW(this->m_locale, LCMAP_LOWERCASE, wide_char_map, 1 << CHAR_BIT, wide_lower_map, 1 << CHAR_BIT);
BOOST_ASSERT(r != 0);
BOOST_REGEX_ASSERT(r != 0);
conv_r = ::WideCharToMultiByte(code_page, 0, wide_lower_map, r, this->m_lower_map, 1 << CHAR_BIT, NULL, NULL);
BOOST_ASSERT(conv_r != 0);
BOOST_REGEX_ASSERT(conv_r != 0);
#endif
if (r < (1 << CHAR_BIT))
{
@ -823,7 +823,7 @@ namespace BOOST_REGEX_DETAIL_NS {
#else
r = ::GetStringTypeExW(this->m_locale, CT_CTYPE1, wide_char_map, 1 << CHAR_BIT, this->m_type_map);
#endif
BOOST_ASSERT(0 != r);
BOOST_REGEX_ASSERT(0 != r);
}
inline lcid_type BOOST_REGEX_CALL w32_get_default_locale()