Add support for ACCEPT verb.

This commit is contained in:
jzmaddock
2015-09-26 18:47:39 +01:00
parent b557febb0e
commit 2580fb035f
7 changed files with 48 additions and 4 deletions

View File

@ -2715,7 +2715,31 @@ bool basic_regex_parser<charT, traits>::parse_perl_verb()
this->append_state(syntax_element_fail);
return true;
}
return false;
break;
case 'A':
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("CCEPT"))
{
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_accept);
return true;
}
break;
}
return false;
}