Lines 777-782
Link Here
|
777 |
case syntax_element_restart_continue: |
777 |
case syntax_element_restart_continue: |
778 |
case syntax_element_jump: |
778 |
case syntax_element_jump: |
779 |
case syntax_element_startmark: |
779 |
case syntax_element_startmark: |
|
|
780 |
case syntax_element_backstep: |
780 |
// can't legally repeat any of the above: |
781 |
// can't legally repeat any of the above: |
781 |
fail(regex_constants::error_badrepeat, m_position - m_base); |
782 |
fail(regex_constants::error_badrepeat, m_position - m_base); |
782 |
return false; |
783 |
return false; |
Lines 1862-1867
Link Here
|
1862 |
if(markid == -4) |
1863 |
if(markid == -4) |
1863 |
{ |
1864 |
{ |
1864 |
re_syntax_base* b = this->getaddress(expected_alt_point); |
1865 |
re_syntax_base* b = this->getaddress(expected_alt_point); |
|
|
1866 |
// Make sure we have exactly one alternative following this state: |
1865 |
if(b->type != syntax_element_alt) |
1867 |
if(b->type != syntax_element_alt) |
1866 |
{ |
1868 |
{ |
1867 |
re_alt* alt = static_cast<re_alt*>(this->insert_state(expected_alt_point, syntax_element_alt, sizeof(re_alt))); |
1869 |
re_alt* alt = static_cast<re_alt*>(this->insert_state(expected_alt_point, syntax_element_alt, sizeof(re_alt))); |
Lines 1872-1882
Link Here
|
1872 |
fail(regex_constants::error_bad_pattern, m_position - m_base); |
1874 |
fail(regex_constants::error_bad_pattern, m_position - m_base); |
1873 |
return false; |
1875 |
return false; |
1874 |
} |
1876 |
} |
|
|
1877 |
// check for invalid repetition of next state: |
1878 |
b = this->getaddress(expected_alt_point); |
1879 |
b = this->getaddress(static_cast<re_alt*>(b)->next.i, b); |
1880 |
if((b->type != syntax_element_assert_backref) |
1881 |
&& (b->type != syntax_element_startmark)) |
1882 |
{ |
1883 |
fail(regex_constants::error_badrepeat, m_position - m_base); |
1884 |
} |
1875 |
} |
1885 |
} |
1876 |
// |
1886 |
// |
1877 |
// append closing parenthesis state: |
1887 |
// append closing parenthesis state: |
1878 |
// |
1888 |
// |
1879 |
pb = static_cast<re_brace*>(this->append_state(syntax_element_endmark, sizeof(re_brace))); |
1889 |
pb = static_cast<re_brace*>(this->append_state(syntax_element_endmark, sizeof(re_brace))); |
|
|
1890 |
return false; |
1880 |
pb->index = markid; |
1891 |
pb->index = markid; |
1881 |
this->m_paren_start = last_paren_start; |
1892 |
this->m_paren_start = last_paren_start; |
1882 |
// |
1893 |
// |