forked from boostorg/regex
Fixed remaining zero-width assertion issues.
Added separate file instantiation of ICU support templates. Ensured code is STLport debug mode clean. [SVN r30980]
This commit is contained in:
@ -35,9 +35,10 @@ template <class BidiIterator, class Allocator, class traits>
|
||||
perl_matcher<BidiIterator, Allocator, traits>::perl_matcher(BidiIterator first, BidiIterator end,
|
||||
match_results<BidiIterator, Allocator>& what,
|
||||
const basic_regex<char_type, traits>& e,
|
||||
match_flag_type f)
|
||||
match_flag_type f,
|
||||
BidiIterator b)
|
||||
: m_result(what), base(first), last(end),
|
||||
position(first), re(e), traits_inst(e.get_traits()),
|
||||
position(first), backstop(b), re(e), traits_inst(e.get_traits()),
|
||||
m_independent(false), next_count(&rep_obj), rep_obj(&next_count)
|
||||
{
|
||||
construct_init(first, last, what, e, f);
|
||||
@ -161,7 +162,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(), base, last);
|
||||
m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last);
|
||||
m_presult->set_base(base);
|
||||
if(m_match_flags & match_posix)
|
||||
m_result = *m_presult;
|
||||
@ -220,8 +221,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_imp()
|
||||
if((m_match_flags & regex_constants::match_init) == 0)
|
||||
{
|
||||
// reset our state machine:
|
||||
position = base;
|
||||
search_base = base;
|
||||
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_base(base);
|
||||
@ -242,8 +242,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_imp()
|
||||
}
|
||||
// reset $` start:
|
||||
m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last);
|
||||
if(base != search_base)
|
||||
m_match_flags |= match_prev_avail;
|
||||
//if((base != search_base) && (base == backstop))
|
||||
// m_match_flags |= match_prev_avail;
|
||||
}
|
||||
if(m_match_flags & match_posix)
|
||||
{
|
||||
@ -346,7 +346,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_literal()
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_start_line()
|
||||
{
|
||||
if(position == base)
|
||||
if(position == backstop)
|
||||
{
|
||||
if((m_match_flags & match_prev_avail) == 0)
|
||||
{
|
||||
@ -390,7 +390,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_end_line()
|
||||
// we're not yet at the end so *first is always valid:
|
||||
if(is_separator(*position))
|
||||
{
|
||||
if((position != base) || (m_match_flags & match_prev_avail))
|
||||
if((position != backstop) || (m_match_flags & match_prev_avail))
|
||||
{
|
||||
// check that we're not in the middle of \r\n sequence
|
||||
BidiIterator t(position);
|
||||
@ -472,7 +472,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_word_boundary()
|
||||
{
|
||||
b = (m_match_flags & match_not_eow) ? true : false;
|
||||
}
|
||||
if((position == base) && ((m_match_flags & match_prev_avail) == 0))
|
||||
if((position == backstop) && ((m_match_flags & match_prev_avail) == 0))
|
||||
{
|
||||
if(m_match_flags & match_not_bow)
|
||||
b ^= true;
|
||||
@ -502,7 +502,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_within_word()
|
||||
if(traits_inst.isctype(*position, m_word_mask))
|
||||
{
|
||||
bool b;
|
||||
if((position == base) && ((m_match_flags & match_prev_avail) == 0))
|
||||
if((position == backstop) && ((m_match_flags & match_prev_avail) == 0))
|
||||
return false;
|
||||
else
|
||||
{
|
||||
@ -526,7 +526,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_word_start()
|
||||
return false; // can't be starting a word if we're already at the end of input
|
||||
if(!traits_inst.isctype(*position, m_word_mask))
|
||||
return false; // next character isn't a word character
|
||||
if((position == base) && ((m_match_flags & match_prev_avail) == 0))
|
||||
if((position == backstop) && ((m_match_flags & match_prev_avail) == 0))
|
||||
{
|
||||
if(m_match_flags & match_not_bow)
|
||||
return false; // no previous input
|
||||
@ -547,7 +547,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_word_start()
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_word_end()
|
||||
{
|
||||
if((position == base) && ((m_match_flags & match_prev_avail) == 0))
|
||||
if((position == backstop) && ((m_match_flags & match_prev_avail) == 0))
|
||||
return false; // start of buffer can't be end of word
|
||||
BidiIterator t(position);
|
||||
--t;
|
||||
@ -572,7 +572,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_word_end()
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_buffer_start()
|
||||
{
|
||||
if((position != base) || (m_match_flags & match_not_bob))
|
||||
if((position != backstop) || (m_match_flags & match_not_bob))
|
||||
return false;
|
||||
// OK match:
|
||||
pstate = pstate->next.p;
|
||||
@ -685,7 +685,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_restart_continue()
|
||||
template <class BidiIterator, class Allocator, class traits>
|
||||
bool perl_matcher<BidiIterator, Allocator, traits>::match_backstep()
|
||||
{
|
||||
std::ptrdiff_t maxlen = ::boost::re_detail::distance(search_base, position);
|
||||
std::ptrdiff_t maxlen = ::boost::re_detail::distance(backstop, position);
|
||||
if(maxlen < static_cast<const re_brace*>(pstate)->index)
|
||||
return false;
|
||||
std::advance(position, -static_cast<const re_brace*>(pstate)->index);
|
||||
|
Reference in New Issue
Block a user