stripped tabs from files

[SVN r18526]
This commit is contained in:
John Maddock
2003-05-24 11:14:53 +00:00
parent 8fb69853fc
commit a69678c3c6
3 changed files with 52 additions and 51 deletions

View File

@ -161,7 +161,7 @@ public:
#ifndef BOOST_NO_STD_ALLOCATOR #ifndef BOOST_NO_STD_ALLOCATOR
return m_subs.get_allocator(); return m_subs.get_allocator();
#else #else
return allocator_type(); return allocator_type();
#endif #endif
} }
void swap(match_results& that) void swap(match_results& that)

View File

@ -34,7 +34,7 @@ namespace boost{
namespace re_detail{ namespace re_detail{
template <class T> template <class T>
inline void destroy(T* p) inline void inplace_destroy(T* p)
{ {
(void)p; // warning suppression (void)p; // warning suppression
p->~T(); p->~T();
@ -485,15 +485,15 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat
if(count - rep->min) if(count - rep->min)
push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
// jump to next state: // jump to next state:
pstate = rep->alt.p; pstate = rep->alt.p;
return true; return true;
} }
else else
{ {
// non-greedy, push state and return true if we can skip: // non-greedy, push state and return true if we can skip:
if(count < rep->max) if(count < rep->max)
push_single_repeat(count, rep, position, saved_state_rep_slow_dot); push_single_repeat(count, rep, position, saved_state_rep_slow_dot);
pstate = rep->alt.p; pstate = rep->alt.p;
return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
} }
} }
@ -518,15 +518,15 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat
if(count - rep->min) if(count - rep->min)
push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
// jump to next state: // jump to next state:
pstate = rep->alt.p; pstate = rep->alt.p;
return true; return true;
} }
else else
{ {
// non-greedy, push state and return true if we can skip: // non-greedy, push state and return true if we can skip:
if(count < rep->max) if(count < rep->max)
push_single_repeat(count, rep, position, saved_state_rep_fast_dot); push_single_repeat(count, rep, position, saved_state_rep_fast_dot);
pstate = rep->alt.p; pstate = rep->alt.p;
return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
} }
} }
@ -577,15 +577,15 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_char_repea
if(count - rep->min) if(count - rep->min)
push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
// jump to next state: // jump to next state:
pstate = rep->alt.p; pstate = rep->alt.p;
return true; return true;
} }
else else
{ {
// non-greedy, push state and return true if we can skip: // non-greedy, push state and return true if we can skip:
if(count < rep->max) if(count < rep->max)
push_single_repeat(count, rep, position, saved_state_rep_char); push_single_repeat(count, rep, position, saved_state_rep_char);
pstate = rep->alt.p; pstate = rep->alt.p;
return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
} }
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
@ -638,15 +638,15 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set_repeat
if(count - rep->min) if(count - rep->min)
push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
// jump to next state: // jump to next state:
pstate = rep->alt.p; pstate = rep->alt.p;
return true; return true;
} }
else else
{ {
// non-greedy, push state and return true if we can skip: // non-greedy, push state and return true if we can skip:
if(count < rep->max) if(count < rep->max)
push_single_repeat(count, rep, position, saved_state_rep_short_set); push_single_repeat(count, rep, position, saved_state_rep_short_set);
pstate = rep->alt.p; pstate = rep->alt.p;
return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
} }
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
@ -699,15 +699,15 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set_r
if(count - rep->min) if(count - rep->min)
push_single_repeat(count, rep, position, saved_state_greedy_single_repeat); push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
// jump to next state: // jump to next state:
pstate = rep->alt.p; pstate = rep->alt.p;
return true; return true;
} }
else else
{ {
// non-greedy, push state and return true if we can skip: // non-greedy, push state and return true if we can skip:
if(count < rep->max) if(count < rep->max)
push_single_repeat(count, rep, position, saved_state_rep_long_set); push_single_repeat(count, rep, position, saved_state_rep_long_set);
pstate = rep->alt.p; pstate = rep->alt.p;
return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
} }
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
@ -761,14 +761,14 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_paren(boo
} }
// unwind stack: // unwind stack:
m_backup_state = pmp+1; m_backup_state = pmp+1;
boost::re_detail::destroy(pmp); boost::re_detail::inplace_destroy(pmp);
return true; // keep looking return true; // keep looking
} }
template <class BidiIterator, class Allocator, class traits, class Allocator2> template <class BidiIterator, class Allocator, class traits, class Allocator2>
bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_recursion_stopper(bool) bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_recursion_stopper(bool)
{ {
boost::re_detail::destroy(m_backup_state++); boost::re_detail::inplace_destroy(m_backup_state++);
pstate = 0; // nothing left to search pstate = 0; // nothing left to search
return false; // end of stack nothing more to search return false; // end of stack nothing more to search
} }
@ -781,7 +781,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_assertion
position = pmp->position; position = pmp->position;
bool result = (r == pmp->positive); bool result = (r == pmp->positive);
m_recursive_result = pmp->positive ? r : !r; m_recursive_result = pmp->positive ? r : !r;
boost::re_detail::destroy(pmp++); boost::re_detail::inplace_destroy(pmp++);
m_backup_state = pmp; m_backup_state = pmp;
return !result; // return false if the assertion was matched to stop search. return !result; // return false if the assertion was matched to stop search.
} }
@ -795,7 +795,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_alt(bool
pstate = pmp->pstate; pstate = pmp->pstate;
position = pmp->position; position = pmp->position;
} }
boost::re_detail::destroy(pmp++); boost::re_detail::inplace_destroy(pmp++);
m_backup_state = pmp; m_backup_state = pmp;
return r; return r;
} }
@ -804,7 +804,7 @@ template <class BidiIterator, class Allocator, class traits, class Allocator2>
bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_repeater_counter(bool) bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_repeater_counter(bool)
{ {
saved_repeater<BidiIterator>* pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state); saved_repeater<BidiIterator>* pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
boost::re_detail::destroy(pmp++); boost::re_detail::inplace_destroy(pmp++);
m_backup_state = pmp; m_backup_state = pmp;
return true; // keep looking return true; // keep looking
} }
@ -816,7 +816,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_extra_blo
void* condemmed = m_stack_base; void* condemmed = m_stack_base;
m_stack_base = pmp->base; m_stack_base = pmp->base;
m_backup_state = pmp->end; m_backup_state = pmp->end;
boost::re_detail::destroy(pmp); boost::re_detail::inplace_destroy(pmp);
block_cache.put(condemmed); block_cache.put(condemmed);
return true; // keep looking return true; // keep looking
} }
@ -825,7 +825,7 @@ template <class BidiIterator, class Allocator, class traits, class Allocator2>
inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::destroy_single_repeat() inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::destroy_single_repeat()
{ {
saved_single_repeat<BidiIterator>* p = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state); saved_single_repeat<BidiIterator>* p = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
boost::re_detail::destroy(p++); boost::re_detail::inplace_destroy(p++);
m_backup_state = p; m_backup_state = p;
} }
@ -841,26 +841,26 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_greedy_si
return true; return true;
} }
const re_repeat* rep = pmp->rep; const re_repeat* rep = pmp->rep;
unsigned count = pmp->count; unsigned count = pmp->count;
assert(rep->next.p); assert(rep->next.p);
assert(rep->alt.p); assert(rep->alt.p);
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); assert(count);
position = pmp->last_position; position = pmp->last_position;
// backtrack till we can skip out: // backtrack till we can skip out:
do do
{ {
--position; --position;
--count; --count;
++state_count; ++state_count;
}while(count && !access::can_start(*position, rep->_map, mask_skip)); }while(count && !access::can_start(*position, rep->_map, mask_skip));
// if we've hit base, destroy this state: // if we've hit base, destroy this state:
if(count == 0) if(count == 0)
@ -874,8 +874,8 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_greedy_si
pmp->count = count + rep->min; pmp->count = count + rep->min;
pmp->last_position = position; pmp->last_position = position;
} }
pstate = rep->alt.p; pstate = rep->alt.p;
return false; return false;
} }
template <class BidiIterator, class Allocator, class traits, class Allocator2> template <class BidiIterator, class Allocator, class traits, class Allocator2>
@ -890,7 +890,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_slow_dot_
return true; return true;
} }
const re_repeat* rep = pmp->rep; const re_repeat* rep = pmp->rep;
unsigned count = pmp->count; unsigned count = pmp->count;
assert(rep->type == syntax_element_dot_rep); assert(rep->type == syntax_element_dot_rep);
assert(rep->next.p); assert(rep->next.p);
@ -936,8 +936,8 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_slow_dot_
pmp->count = count; pmp->count = count;
pmp->last_position = position; pmp->last_position = position;
} }
pstate = rep->alt.p; pstate = rep->alt.p;
return false; return false;
} }
template <class BidiIterator, class Allocator, class traits, class Allocator2> template <class BidiIterator, class Allocator, class traits, class Allocator2>
@ -952,7 +952,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_fast_dot_
return true; return true;
} }
const re_repeat* rep = pmp->rep; const re_repeat* rep = pmp->rep;
unsigned count = pmp->count; unsigned count = pmp->count;
assert(count < rep->max); assert(count < rep->max);
@ -988,8 +988,8 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_fast_dot_
pmp->count = count; pmp->count = count;
pmp->last_position = position; pmp->last_position = position;
} }
pstate = rep->alt.p; pstate = rep->alt.p;
return false; return false;
} }
template <class BidiIterator, class Allocator, class traits, class Allocator2> template <class BidiIterator, class Allocator, class traits, class Allocator2>
@ -1004,7 +1004,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_char_repe
return true; return true;
} }
const re_repeat* rep = pmp->rep; const re_repeat* rep = pmp->rep;
unsigned count = pmp->count; unsigned count = pmp->count;
pstate = rep->next.p; pstate = rep->next.p;
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);
@ -1052,8 +1052,8 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_char_repe
pmp->count = count; pmp->count = count;
pmp->last_position = position; pmp->last_position = position;
} }
pstate = rep->alt.p; pstate = rep->alt.p;
return false; return false;
} }
template <class BidiIterator, class Allocator, class traits, class Allocator2> template <class BidiIterator, class Allocator, class traits, class Allocator2>
@ -1068,7 +1068,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_short_set
return true; return true;
} }
const re_repeat* rep = pmp->rep; const re_repeat* rep = pmp->rep;
unsigned count = pmp->count; unsigned count = pmp->count;
pstate = rep->next.p; pstate = rep->next.p;
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;
@ -1116,8 +1116,8 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_short_set
pmp->count = count; pmp->count = count;
pmp->last_position = position; pmp->last_position = position;
} }
pstate = rep->alt.p; pstate = rep->alt.p;
return false; return false;
} }
template <class BidiIterator, class Allocator, class traits, class Allocator2> template <class BidiIterator, class Allocator, class traits, class Allocator2>
@ -1132,7 +1132,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_long_set_
return true; return true;
} }
const re_repeat* rep = pmp->rep; const re_repeat* rep = pmp->rep;
unsigned count = pmp->count; unsigned count = pmp->count;
pstate = rep->next.p; pstate = rep->next.p;
const re_set_long* set = static_cast<const re_set_long*>(pstate); const re_set_long* set = static_cast<const re_set_long*>(pstate);
@ -1181,8 +1181,8 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_long_set_
pmp->count = count; pmp->count = count;
pmp->last_position = position; pmp->last_position = position;
} }
pstate = rep->alt.p; pstate = rep->alt.p;
return false; return false;
} }
template <class BidiIterator, class Allocator, class traits, class Allocator2> template <class BidiIterator, class Allocator, class traits, class Allocator2>
@ -1195,7 +1195,7 @@ bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_non_greed
pstate = pmp->pstate; pstate = pmp->pstate;
++(*next_count); ++(*next_count);
} }
boost::re_detail::destroy(pmp++); boost::re_detail::inplace_destroy(pmp++);
m_backup_state = pmp; m_backup_state = pmp;
return r; return r;
} }
@ -1228,3 +1228,4 @@ perl_matcher<BidiIterator, Allocator, traits, Allocator2>::s_unwind_table[] =
#endif #endif
#endif #endif

View File

@ -2130,7 +2130,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_le
return len; return len;
} }
return len; return len;
case re_detail::syntax_element_startmark: case re_detail::syntax_element_startmark:
if(static_cast<const re_detail::re_brace*>(dat)->index == -2) if(static_cast<const re_detail::re_brace*>(dat)->index == -2)
return 0; return 0;
// fall through: // fall through: