mirror of
https://github.com/boostorg/regex.git
synced 2025-07-18 23:02:09 +02:00
Added support for \g \K and \R.
[SVN r52592]
This commit is contained in:
@ -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
|
||||
//
|
||||
|
Reference in New Issue
Block a user