Add COMMIT support plus lots of tests.

This commit is contained in:
jzmaddock
2015-09-29 17:40:43 +01:00
parent 2580fb035f
commit c281c9cc40
10 changed files with 308 additions and 19 deletions

View File

@ -2740,6 +2740,31 @@ bool basic_regex_parser<charT, traits>::parse_perl_verb()
return true;
}
break;
case 'C':
if(++m_position == m_end)
{
// Rewind to start of (* sequence:
--m_position;
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
fail(regex_constants::error_perl_extension, m_position - m_base);
return false;
}
if(match_verb("OMMIT"))
{
if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
{
// Rewind to start of (* sequence:
--m_position;
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
fail(regex_constants::error_perl_extension, m_position - m_base);
return false;
}
++m_position;
this->append_state(syntax_element_commit);
this->m_pdata->m_disable_match_any = true;
return true;
}
break;
}
return false;
}