Tidy up code, add test.

This commit is contained in:
jzmaddock
2024-11-04 17:05:08 +00:00
parent 39ee6e36b0
commit be12f75b22
3 changed files with 21 additions and 2 deletions

View File

@ -1204,7 +1204,6 @@ bool perl_matcher<BidiIterator, Allocator, traits>::skip_until_paren(int index,
else if(pstate->type == syntax_element_startmark) else if(pstate->type == syntax_element_startmark)
{ {
int idx = static_cast<const re_brace*>(pstate)->index; int idx = static_cast<const re_brace*>(pstate)->index;
//if (idx == -5)
match_startmark(); match_startmark();
pstate = pstate->next.p; pstate = pstate->next.p;
skip_until_paren(idx, false); skip_until_paren(idx, false);

View File

@ -135,3 +135,4 @@ compile test_windows_defs_3.cpp ;
compile test_windows_defs_4.cpp ; compile test_windows_defs_4.cpp ;
run issue153.cpp : : : "<toolset>msvc:<linkflags>-STACK:2097152" ; run issue153.cpp : : : "<toolset>msvc:<linkflags>-STACK:2097152" ;
run issue227.cpp ;

19
test/issue227.cpp Normal file
View File

@ -0,0 +1,19 @@
/*
* Copyright (c) 2024
* Christian Mazakas
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <boost/regex.hpp>
#include <string>
int main() {
boost::regex rx("(*ACCEPT)*+\\1((*ACCEPT)*+\\K)");
std::string str = "Z";
boost::smatch what;
boost::regex_search(str, what, rx, boost::match_default | boost::match_partial);
}