Added support for \g \K and \R.

[SVN r52592]
This commit is contained in:
John Maddock
2009-04-25 17:32:49 +00:00
parent 7b10b5dac5
commit 30941e330d
42 changed files with 795 additions and 519 deletions

View File

@ -213,7 +213,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_ASSERT(index);
saved_matched_paren<BidiIterator>* pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
--pmp;
if(pmp < m_stack_base)
@ -404,6 +404,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
break;
}
}
case -5:
{
push_matched_paren(0, (*m_presult)[0]);
m_presult->set_first(position, 0, true);
pstate = pstate->next.p;
break;
}
default:
{
BOOST_ASSERT(index > 0);
@ -911,8 +918,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_paren(bool have_match
// restore previous values if no match was found:
if(have_match == false)
{
m_presult->set_first(pmp->sub.first, pmp->index);
m_presult->set_second(pmp->sub.second, pmp->index, pmp->sub.matched);
m_presult->set_first(pmp->sub.first, pmp->index, pmp->index == 0);
m_presult->set_second(pmp->sub.second, pmp->index, pmp->sub.matched, pmp->index == 0);
}
#ifdef BOOST_REGEX_MATCH_EXTRA
//