forked from boostorg/regex
Changed assert's to BOOST_ASSERT's.
Made array sizes explicit to fix MWCW problems. [SVN r26723]
This commit is contained in:
@ -509,7 +509,7 @@ struct BaseRegexConcept
|
|||||||
ignore_unused_variable_warning(ti4);
|
ignore_unused_variable_warning(ti4);
|
||||||
regex_token_iterator_type ti5(m_in, m_in, e, subs, m_mft);
|
regex_token_iterator_type ti5(m_in, m_in, e, subs, m_mft);
|
||||||
ignore_unused_variable_warning(ti5);
|
ignore_unused_variable_warning(ti5);
|
||||||
static const int i_array[] = { 1, 2, 3, };
|
static const int i_array[3] = { 1, 2, 3, };
|
||||||
regex_token_iterator_type ti6(m_in, m_in, e, i_array);
|
regex_token_iterator_type ti6(m_in, m_in, e, i_array);
|
||||||
ignore_unused_variable_warning(ti6);
|
ignore_unused_variable_warning(ti6);
|
||||||
regex_token_iterator_type ti7(m_in, m_in, e, i_array, m_mft);
|
regex_token_iterator_type ti7(m_in, m_in, e, i_array, m_mft);
|
||||||
|
@ -12,10 +12,10 @@
|
|||||||
#ifndef BOOST_DETAIL_ALLOCATOR_HPP
|
#ifndef BOOST_DETAIL_ALLOCATOR_HPP
|
||||||
#define BOOST_DETAIL_ALLOCATOR_HPP
|
#define BOOST_DETAIL_ALLOCATOR_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <assert.h>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/assert.hpp>
|
||||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||||
namespace std{
|
namespace std{
|
||||||
using ::ptrdiff_t;
|
using ::ptrdiff_t;
|
||||||
@ -133,11 +133,11 @@ public:
|
|||||||
void deallocate(pointer p, size_type n)
|
void deallocate(pointer p, size_type n)
|
||||||
{
|
{
|
||||||
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
||||||
assert( (p == 0) == (n == 0) );
|
BOOST_ASSERT( (p == 0) == (n == 0) );
|
||||||
if (p != 0)
|
if (p != 0)
|
||||||
alloc_type::deallocate((void*)p, n);
|
alloc_type::deallocate((void*)p, n);
|
||||||
#else
|
#else
|
||||||
assert( (p == 0) == (n == 0) );
|
BOOST_ASSERT( (p == 0) == (n == 0) );
|
||||||
if (p != 0)
|
if (p != 0)
|
||||||
::operator delete((void*)p);
|
::operator delete((void*)p);
|
||||||
#endif
|
#endif
|
||||||
@ -204,11 +204,11 @@ public:
|
|||||||
void deallocate(pointer p, size_type n)
|
void deallocate(pointer p, size_type n)
|
||||||
{
|
{
|
||||||
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
||||||
assert( (p == 0) == (n == 0) );
|
BOOST_ASSERT( (p == 0) == (n == 0) );
|
||||||
if (p != 0)
|
if (p != 0)
|
||||||
alloc_type::deallocate((void*)p, n);
|
alloc_type::deallocate((void*)p, n);
|
||||||
#else
|
#else
|
||||||
assert( (p == 0) == (n == 0) );
|
BOOST_ASSERT( (p == 0) == (n == 0) );
|
||||||
if (p != 0)
|
if (p != 0)
|
||||||
::operator delete((void*)p);
|
::operator delete((void*)p);
|
||||||
#endif
|
#endif
|
||||||
@ -252,7 +252,7 @@ public:
|
|||||||
|
|
||||||
void deallocate(pointer p, size_type n)
|
void deallocate(pointer p, size_type n)
|
||||||
{
|
{
|
||||||
assert( (p == 0) == (n == 0) );
|
BOOST_ASSERT( (p == 0) == (n == 0) );
|
||||||
if (p != 0)
|
if (p != 0)
|
||||||
static_cast<base_type*>(this)->deallocate((void*)p, n * sizeof(value_type));
|
static_cast<base_type*>(this)->deallocate((void*)p, n * sizeof(value_type));
|
||||||
}
|
}
|
||||||
|
@ -522,7 +522,7 @@ private:
|
|||||||
}
|
}
|
||||||
// we now need to remove a few of the leftmost bits, but how many depends
|
// we now need to remove a few of the leftmost bits, but how many depends
|
||||||
// upon how many extra bytes we've extracted:
|
// upon how many extra bytes we've extracted:
|
||||||
static const boost::uint32_t masks[] =
|
static const boost::uint32_t masks[4] =
|
||||||
{
|
{
|
||||||
0x7Fu,
|
0x7Fu,
|
||||||
0x7FFu,
|
0x7FFu,
|
||||||
|
@ -453,32 +453,32 @@ public:
|
|||||||
//
|
//
|
||||||
const re_detail::re_syntax_base* get_first_state()const
|
const re_detail::re_syntax_base* get_first_state()const
|
||||||
{
|
{
|
||||||
assert(0 != m_pimpl.get());
|
BOOST_ASSERT(0 != m_pimpl.get());
|
||||||
return m_pimpl->get_first_state();
|
return m_pimpl->get_first_state();
|
||||||
}
|
}
|
||||||
unsigned get_restart_type()const
|
unsigned get_restart_type()const
|
||||||
{
|
{
|
||||||
assert(0 != m_pimpl.get());
|
BOOST_ASSERT(0 != m_pimpl.get());
|
||||||
return m_pimpl->get_restart_type();
|
return m_pimpl->get_restart_type();
|
||||||
}
|
}
|
||||||
const unsigned char* get_map()const
|
const unsigned char* get_map()const
|
||||||
{
|
{
|
||||||
assert(0 != m_pimpl.get());
|
BOOST_ASSERT(0 != m_pimpl.get());
|
||||||
return m_pimpl->get_map();
|
return m_pimpl->get_map();
|
||||||
}
|
}
|
||||||
const ::boost::regex_traits_wrapper<traits>& get_traits()const
|
const ::boost::regex_traits_wrapper<traits>& get_traits()const
|
||||||
{
|
{
|
||||||
assert(0 != m_pimpl.get());
|
BOOST_ASSERT(0 != m_pimpl.get());
|
||||||
return m_pimpl->get_traits();
|
return m_pimpl->get_traits();
|
||||||
}
|
}
|
||||||
bool can_be_null()const
|
bool can_be_null()const
|
||||||
{
|
{
|
||||||
assert(0 != m_pimpl.get());
|
BOOST_ASSERT(0 != m_pimpl.get());
|
||||||
return m_pimpl->can_be_null();
|
return m_pimpl->can_be_null();
|
||||||
}
|
}
|
||||||
const re_detail::regex_data<charT, traits>& get_data()const
|
const re_detail::regex_data<charT, traits>& get_data()const
|
||||||
{
|
{
|
||||||
assert(0 != m_pimpl.get());
|
BOOST_ASSERT(0 != m_pimpl.get());
|
||||||
return m_pimpl->get_data();
|
return m_pimpl->get_data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,9 +246,9 @@ basic_regex_creator<charT, traits>::basic_regex_creator(regex_data<charT, traits
|
|||||||
m_pdata->m_status = ::boost::regex_constants::error_ok;
|
m_pdata->m_status = ::boost::regex_constants::error_ok;
|
||||||
static const charT w = 'w';
|
static const charT w = 'w';
|
||||||
static const charT s = 's';
|
static const charT s = 's';
|
||||||
static const charT l[] = { 'l', 'o', 'w', 'e', 'r', };
|
static const charT l[5] = { 'l', 'o', 'w', 'e', 'r', };
|
||||||
static const charT u[] = { 'u', 'p', 'p', 'e', 'r', };
|
static const charT u[5] = { 'u', 'p', 'p', 'e', 'r', };
|
||||||
static const charT a[] = { 'a', 'l', 'p', 'h', 'a', };
|
static const charT a[5] = { 'a', 'l', 'p', 'h', 'a', };
|
||||||
m_word_mask = m_traits.lookup_classname(&w, &w +1);
|
m_word_mask = m_traits.lookup_classname(&w, &w +1);
|
||||||
m_mask_space = m_traits.lookup_classname(&s, &s +1);
|
m_mask_space = m_traits.lookup_classname(&s, &s +1);
|
||||||
m_lower_mask = m_traits.lookup_classname(l, l + 5);
|
m_lower_mask = m_traits.lookup_classname(l, l + 5);
|
||||||
@ -538,7 +538,7 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
|
|||||||
}
|
}
|
||||||
for(unsigned i = 0; i < (1u << CHAR_BIT); ++i)
|
for(unsigned i = 0; i < (1u << CHAR_BIT); ++i)
|
||||||
{
|
{
|
||||||
charT c3[] = { static_cast<charT>(i), charT(0), };
|
charT c3[2] = { static_cast<charT>(i), charT(0), };
|
||||||
string_type s3 = this->m_traits.transform(c3, c3 +1);
|
string_type s3 = this->m_traits.transform(c3, c3 +1);
|
||||||
if((s1 <= s3) && (s3 <= s2))
|
if((s1 <= s3) && (s3 <= s2))
|
||||||
result->_map[i] = true;
|
result->_map[i] = true;
|
||||||
|
@ -1848,7 +1848,7 @@ bool basic_regex_parser<charT, traits>::add_emacs_code(bool negate)
|
|||||||
if(negate)
|
if(negate)
|
||||||
char_set.negate();
|
char_set.negate();
|
||||||
|
|
||||||
static const charT s_punct[] = { 'p', 'u', 'n', 'c', 't', };
|
static const charT s_punct[5] = { 'p', 'u', 'n', 'c', 't', };
|
||||||
|
|
||||||
switch(*m_position)
|
switch(*m_position)
|
||||||
{
|
{
|
||||||
|
@ -665,7 +665,7 @@ void cpp_regex_traits_implementation<charT>::init()
|
|||||||
// Custom class names:
|
// Custom class names:
|
||||||
//
|
//
|
||||||
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
|
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
|
||||||
static const char_class_type masks[] =
|
static const char_class_type masks[14] =
|
||||||
{
|
{
|
||||||
std::ctype<charT>::alnum,
|
std::ctype<charT>::alnum,
|
||||||
std::ctype<charT>::alpha,
|
std::ctype<charT>::alpha,
|
||||||
@ -683,7 +683,7 @@ void cpp_regex_traits_implementation<charT>::init()
|
|||||||
cpp_regex_traits_implementation<charT>::mask_unicode,
|
cpp_regex_traits_implementation<charT>::mask_unicode,
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
static const char_class_type masks[] =
|
static const char_class_type masks[14] =
|
||||||
{
|
{
|
||||||
::boost::re_detail::char_class_alnum,
|
::boost::re_detail::char_class_alnum,
|
||||||
::boost::re_detail::char_class_alpha,
|
::boost::re_detail::char_class_alpha,
|
||||||
@ -721,7 +721,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
|
|||||||
cpp_regex_traits_implementation<charT>::lookup_classname_imp(const charT* p1, const charT* p2) const
|
cpp_regex_traits_implementation<charT>::lookup_classname_imp(const charT* p1, const charT* p2) const
|
||||||
{
|
{
|
||||||
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
|
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
|
||||||
static const char_class_type masks[] =
|
static const char_class_type masks[20] =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
std::ctype<char>::alnum,
|
std::ctype<char>::alnum,
|
||||||
@ -745,7 +745,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
|
|||||||
std::ctype<char>::xdigit,
|
std::ctype<char>::xdigit,
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
static const char_class_type masks[] =
|
static const char_class_type masks[20] =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
::boost::re_detail::char_class_alnum,
|
::boost::re_detail::char_class_alnum,
|
||||||
@ -777,7 +777,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
|
|||||||
return pos->second;
|
return pos->second;
|
||||||
}
|
}
|
||||||
std::size_t id = 1 + re_detail::get_default_class_id(p1, p2);
|
std::size_t id = 1 + re_detail::get_default_class_id(p1, p2);
|
||||||
assert(id < sizeof(masks) / sizeof(masks[0]));
|
BOOST_ASSERT(id < sizeof(masks) / sizeof(masks[0]));
|
||||||
return masks[id];
|
return masks[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#ifndef BOOST_REGEX_CONFIG_HPP
|
#ifndef BOOST_REGEX_CONFIG_HPP
|
||||||
#include <boost/regex/config.hpp>
|
#include <boost/regex/config.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
#ifndef BOOST_REGEX_NO_FILEITER
|
#ifndef BOOST_REGEX_NO_FILEITER
|
||||||
|
|
||||||
@ -239,8 +240,8 @@ public:
|
|||||||
mapfile_iterator& operator = (const mapfile_iterator& i);
|
mapfile_iterator& operator = (const mapfile_iterator& i);
|
||||||
char operator* ()const
|
char operator* ()const
|
||||||
{
|
{
|
||||||
assert(node >= file->_first);
|
BOOST_ASSERT(node >= file->_first);
|
||||||
assert(node < file->_last);
|
BOOST_ASSERT(node < file->_last);
|
||||||
return file ? *(*node + sizeof(int) + offset) : char(0);
|
return file ? *(*node + sizeof(int) + offset) : char(0);
|
||||||
}
|
}
|
||||||
char operator[] (long off)const
|
char operator[] (long off)const
|
||||||
|
@ -49,11 +49,11 @@ public:
|
|||||||
typedef typename vector_type::const_iterator const_iterator;
|
typedef typename vector_type::const_iterator const_iterator;
|
||||||
typedef const_iterator iterator;
|
typedef const_iterator iterator;
|
||||||
typedef typename re_detail::regex_iterator_traits<
|
typedef typename re_detail::regex_iterator_traits<
|
||||||
BidiIterator>::difference_type difference_type;
|
BidiIterator>::difference_type difference_type;
|
||||||
typedef typename Allocator::size_type size_type;
|
typedef typename Allocator::size_type size_type;
|
||||||
typedef Allocator allocator_type;
|
typedef Allocator allocator_type;
|
||||||
typedef typename re_detail::regex_iterator_traits<
|
typedef typename re_detail::regex_iterator_traits<
|
||||||
BidiIterator>::value_type char_type;
|
BidiIterator>::value_type char_type;
|
||||||
typedef std::basic_string<char_type> string_type;
|
typedef std::basic_string<char_type> string_type;
|
||||||
|
|
||||||
// construct/copy/destroy:
|
// construct/copy/destroy:
|
||||||
@ -153,7 +153,7 @@ public:
|
|||||||
string_type format(const string_type& fmt,
|
string_type format(const string_type& fmt,
|
||||||
match_flag_type flags = format_default) const
|
match_flag_type flags = format_default) const
|
||||||
{
|
{
|
||||||
return regex_format<BidiIterator, char_type>(*this, fmt, flags);
|
return ::boost::regex_format(*this, fmt, flags);
|
||||||
}
|
}
|
||||||
// format with locale:
|
// format with locale:
|
||||||
template <class OutputIterator, class RegexT>
|
template <class OutputIterator, class RegexT>
|
||||||
@ -208,7 +208,7 @@ public:
|
|||||||
// private access functions:
|
// private access functions:
|
||||||
void BOOST_REGEX_CALL set_second(BidiIterator i)
|
void BOOST_REGEX_CALL set_second(BidiIterator i)
|
||||||
{
|
{
|
||||||
assert(m_subs.size() > 2);
|
BOOST_ASSERT(m_subs.size() > 2);
|
||||||
m_subs[2].second = i;
|
m_subs[2].second = i;
|
||||||
m_subs[2].matched = true;
|
m_subs[2].matched = true;
|
||||||
m_subs[0].first = i;
|
m_subs[0].first = i;
|
||||||
@ -221,7 +221,7 @@ public:
|
|||||||
void BOOST_REGEX_CALL set_second(BidiIterator i, size_type pos, bool m = true)
|
void BOOST_REGEX_CALL set_second(BidiIterator i, size_type pos, bool m = true)
|
||||||
{
|
{
|
||||||
pos += 2;
|
pos += 2;
|
||||||
assert(m_subs.size() > pos);
|
BOOST_ASSERT(m_subs.size() > pos);
|
||||||
m_subs[pos].second = i;
|
m_subs[pos].second = i;
|
||||||
m_subs[pos].matched = m;
|
m_subs[pos].matched = m;
|
||||||
if(pos == 2)
|
if(pos == 2)
|
||||||
@ -274,7 +274,7 @@ public:
|
|||||||
}
|
}
|
||||||
void BOOST_REGEX_CALL set_first(BidiIterator i, size_type pos)
|
void BOOST_REGEX_CALL set_first(BidiIterator i, size_type pos)
|
||||||
{
|
{
|
||||||
assert(pos+2 < m_subs.size());
|
BOOST_ASSERT(pos+2 < m_subs.size());
|
||||||
if(pos)
|
if(pos)
|
||||||
m_subs[pos+2].first = i;
|
m_subs[pos+2].first = i;
|
||||||
else
|
else
|
||||||
|
@ -97,7 +97,7 @@ struct save_state_init
|
|||||||
*end = reinterpret_cast<saved_state*>(reinterpret_cast<char*>(*base)+BOOST_REGEX_BLOCKSIZE);
|
*end = reinterpret_cast<saved_state*>(reinterpret_cast<char*>(*base)+BOOST_REGEX_BLOCKSIZE);
|
||||||
--(*end);
|
--(*end);
|
||||||
(void) new (*end)saved_state(0);
|
(void) new (*end)saved_state(0);
|
||||||
assert(*end > *base);
|
BOOST_ASSERT(*end > *base);
|
||||||
}
|
}
|
||||||
~save_state_init()
|
~save_state_init()
|
||||||
{
|
{
|
||||||
@ -195,7 +195,7 @@ void perl_matcher<BidiIterator, Allocator, traits>::extend_stack()
|
|||||||
template <class BidiIterator, class Allocator, class traits>
|
template <class BidiIterator, class Allocator, class traits>
|
||||||
inline void perl_matcher<BidiIterator, Allocator, traits>::push_matched_paren(int index, const sub_match<BidiIterator>& sub)
|
inline void perl_matcher<BidiIterator, Allocator, traits>::push_matched_paren(int index, const sub_match<BidiIterator>& sub)
|
||||||
{
|
{
|
||||||
assert(index);
|
BOOST_ASSERT(index);
|
||||||
saved_matched_paren<BidiIterator>* pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
|
saved_matched_paren<BidiIterator>* pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
|
||||||
--pmp;
|
--pmp;
|
||||||
if(pmp < m_stack_base)
|
if(pmp < m_stack_base)
|
||||||
@ -388,7 +388,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
assert(index > 0);
|
BOOST_ASSERT(index > 0);
|
||||||
if((m_match_flags & match_nosubs) == 0)
|
if((m_match_flags & match_nosubs) == 0)
|
||||||
{
|
{
|
||||||
push_matched_paren(index, (*m_presult)[index]);
|
push_matched_paren(index, (*m_presult)[index]);
|
||||||
@ -634,7 +634,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
|
|||||||
#pragma option push -w-8008 -w-8066 -w-8004
|
#pragma option push -w-8008 -w-8066 -w-8004
|
||||||
#endif
|
#endif
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
assert(1 == static_cast<const re_literal*>(rep->next.p)->length);
|
BOOST_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);
|
const char_type what = *reinterpret_cast<const char_type*>(static_cast<const re_literal*>(rep->next.p) + 1);
|
||||||
std::size_t count = 0;
|
std::size_t count = 0;
|
||||||
//
|
//
|
||||||
@ -982,15 +982,15 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_greedy_single_repeat(
|
|||||||
|
|
||||||
const re_repeat* rep = pmp->rep;
|
const re_repeat* rep = pmp->rep;
|
||||||
std::size_t count = pmp->count;
|
std::size_t count = pmp->count;
|
||||||
assert(rep->next.p != 0);
|
BOOST_ASSERT(rep->next.p != 0);
|
||||||
assert(rep->alt.p != 0);
|
BOOST_ASSERT(rep->alt.p != 0);
|
||||||
|
|
||||||
count -= rep->min;
|
count -= rep->min;
|
||||||
|
|
||||||
if((m_match_flags & match_partial) && (position == last))
|
if((m_match_flags & match_partial) && (position == last))
|
||||||
m_has_partial_match = true;
|
m_has_partial_match = true;
|
||||||
|
|
||||||
assert(count);
|
BOOST_ASSERT(count);
|
||||||
position = pmp->last_position;
|
position = pmp->last_position;
|
||||||
|
|
||||||
// backtrack till we can skip out:
|
// backtrack till we can skip out:
|
||||||
@ -1031,12 +1031,12 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_slow_dot_repeat(bool
|
|||||||
|
|
||||||
const re_repeat* rep = pmp->rep;
|
const re_repeat* rep = pmp->rep;
|
||||||
std::size_t count = pmp->count;
|
std::size_t count = pmp->count;
|
||||||
assert(rep->type == syntax_element_dot_rep);
|
BOOST_ASSERT(rep->type == syntax_element_dot_rep);
|
||||||
assert(rep->next.p != 0);
|
BOOST_ASSERT(rep->next.p != 0);
|
||||||
assert(rep->alt.p != 0);
|
BOOST_ASSERT(rep->alt.p != 0);
|
||||||
assert(rep->next.p->type == syntax_element_wild);
|
BOOST_ASSERT(rep->next.p->type == syntax_element_wild);
|
||||||
|
|
||||||
assert(count < rep->max);
|
BOOST_ASSERT(count < rep->max);
|
||||||
pstate = rep->next.p;
|
pstate = rep->next.p;
|
||||||
position = pmp->last_position;
|
position = pmp->last_position;
|
||||||
|
|
||||||
@ -1094,7 +1094,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_fast_dot_repeat(bool
|
|||||||
const re_repeat* rep = pmp->rep;
|
const re_repeat* rep = pmp->rep;
|
||||||
std::size_t count = pmp->count;
|
std::size_t count = pmp->count;
|
||||||
|
|
||||||
assert(count < rep->max);
|
BOOST_ASSERT(count < rep->max);
|
||||||
position = pmp->last_position;
|
position = pmp->last_position;
|
||||||
if(position != last)
|
if(position != last)
|
||||||
{
|
{
|
||||||
@ -1149,11 +1149,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);
|
const char_type what = *reinterpret_cast<const char_type*>(static_cast<const re_literal*>(pstate) + 1);
|
||||||
position = pmp->last_position;
|
position = pmp->last_position;
|
||||||
|
|
||||||
assert(rep->type == syntax_element_char_rep);
|
BOOST_ASSERT(rep->type == syntax_element_char_rep);
|
||||||
assert(rep->next.p != 0);
|
BOOST_ASSERT(rep->next.p != 0);
|
||||||
assert(rep->alt.p != 0);
|
BOOST_ASSERT(rep->alt.p != 0);
|
||||||
assert(rep->next.p->type == syntax_element_literal);
|
BOOST_ASSERT(rep->next.p->type == syntax_element_literal);
|
||||||
assert(count < rep->max);
|
BOOST_ASSERT(count < rep->max);
|
||||||
|
|
||||||
if(position != last)
|
if(position != last)
|
||||||
{
|
{
|
||||||
@ -1213,11 +1213,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;
|
const unsigned char* map = static_cast<const re_set*>(rep->next.p)->_map;
|
||||||
position = pmp->last_position;
|
position = pmp->last_position;
|
||||||
|
|
||||||
assert(rep->type == syntax_element_short_set_rep);
|
BOOST_ASSERT(rep->type == syntax_element_short_set_rep);
|
||||||
assert(rep->next.p != 0);
|
BOOST_ASSERT(rep->next.p != 0);
|
||||||
assert(rep->alt.p != 0);
|
BOOST_ASSERT(rep->alt.p != 0);
|
||||||
assert(rep->next.p->type == syntax_element_set);
|
BOOST_ASSERT(rep->next.p->type == syntax_element_set);
|
||||||
assert(count < rep->max);
|
BOOST_ASSERT(count < rep->max);
|
||||||
|
|
||||||
if(position != last)
|
if(position != last)
|
||||||
{
|
{
|
||||||
@ -1278,11 +1278,11 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat(bool
|
|||||||
const re_set_long<mask_type>* set = static_cast<const re_set_long<mask_type>*>(pstate);
|
const re_set_long<mask_type>* set = static_cast<const re_set_long<mask_type>*>(pstate);
|
||||||
position = pmp->last_position;
|
position = pmp->last_position;
|
||||||
|
|
||||||
assert(rep->type == syntax_element_long_set_rep);
|
BOOST_ASSERT(rep->type == syntax_element_long_set_rep);
|
||||||
assert(rep->next.p != 0);
|
BOOST_ASSERT(rep->next.p != 0);
|
||||||
assert(rep->alt.p != 0);
|
BOOST_ASSERT(rep->alt.p != 0);
|
||||||
assert(rep->next.p->type == syntax_element_long_set);
|
BOOST_ASSERT(rep->next.p->type == syntax_element_long_set);
|
||||||
assert(count < rep->max);
|
BOOST_ASSERT(count < rep->max);
|
||||||
|
|
||||||
if(position != last)
|
if(position != last)
|
||||||
{
|
{
|
||||||
|
@ -195,7 +195,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
assert(index > 0);
|
BOOST_ASSERT(index > 0);
|
||||||
if((m_match_flags & match_nosubs) == 0)
|
if((m_match_flags & match_nosubs) == 0)
|
||||||
{
|
{
|
||||||
backup_subex<BidiIterator> sub(*m_presult, index);
|
backup_subex<BidiIterator> sub(*m_presult, index);
|
||||||
@ -499,7 +499,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
|
|||||||
#pragma option push -w-8008 -w-8066 -w-8004
|
#pragma option push -w-8008 -w-8066 -w-8004
|
||||||
#endif
|
#endif
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
assert(1 == static_cast<const re_literal*>(rep->next.p)->length);
|
BOOST_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);
|
const char_type what = *reinterpret_cast<const char_type*>(static_cast<const re_literal*>(rep->next.p) + 1);
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
//
|
//
|
||||||
|
@ -465,7 +465,7 @@ w32_regex_traits_implementation<charT>::w32_regex_traits_implementation(::boost:
|
|||||||
//
|
//
|
||||||
// Custom class names:
|
// Custom class names:
|
||||||
//
|
//
|
||||||
static const char_class_type masks[] =
|
static const char_class_type masks[14] =
|
||||||
{
|
{
|
||||||
0x0104u, // C1_ALPHA | C1_DIGIT
|
0x0104u, // C1_ALPHA | C1_DIGIT
|
||||||
0x0100u, // C1_ALPHA
|
0x0100u, // C1_ALPHA
|
||||||
@ -500,7 +500,7 @@ template <class charT>
|
|||||||
typename w32_regex_traits_implementation<charT>::char_class_type
|
typename w32_regex_traits_implementation<charT>::char_class_type
|
||||||
w32_regex_traits_implementation<charT>::lookup_classname_imp(const charT* p1, const charT* p2) const
|
w32_regex_traits_implementation<charT>::lookup_classname_imp(const charT* p1, const charT* p2) const
|
||||||
{
|
{
|
||||||
static const char_class_type masks[] =
|
static const char_class_type masks[20] =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
0x0104u, // C1_ALPHA | C1_DIGIT
|
0x0104u, // C1_ALPHA | C1_DIGIT
|
||||||
@ -531,7 +531,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type
|
|||||||
return pos->second;
|
return pos->second;
|
||||||
}
|
}
|
||||||
std::size_t id = 1 + re_detail::get_default_class_id(p1, p2);
|
std::size_t id = 1 + re_detail::get_default_class_id(p1, p2);
|
||||||
assert(id < sizeof(masks) / sizeof(masks[0]));
|
BOOST_ASSERT(id < sizeof(masks) / sizeof(masks[0]));
|
||||||
return masks[id];
|
return masks[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user