In Perl mode then "something+++" should be an error.

Add the necessary error handling.
Fixes #4608.

[SVN r65145]
This commit is contained in:
John Maddock
2010-08-31 11:25:56 +00:00
parent 6d53e5ecae
commit ae013c447c

View File

@ -1003,6 +1003,21 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
//
if(pocessive)
{
if(m_position != m_end)
{
//
// Check for illegal following quantifier, we have to do this here, because
// the extra states we insert below circumvents are usual error checking :-(
//
switch(this->m_traits.syntax_type(*m_position))
{
case regex_constants::syntax_star:
case regex_constants::syntax_plus:
case regex_constants::syntax_question:
fail(regex_constants::error_badrepeat, m_position - m_base);
return false;
}
}
re_brace* pb = static_cast<re_brace*>(this->insert_state(insert_point, syntax_element_startmark, sizeof(re_brace)));
pb->index = -3;
pb->icase = this->flags() & regbase::icase;