/src/boost/boost/regex/v5/perl_matcher_common.hpp
Line | Count | Source |
1 | | /* |
2 | | * |
3 | | * Copyright (c) 2002 |
4 | | * John Maddock |
5 | | * |
6 | | * Use, modification and distribution are subject to the |
7 | | * Boost Software License, Version 1.0. (See accompanying file |
8 | | * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
9 | | * |
10 | | */ |
11 | | |
12 | | /* |
13 | | * LOCATION: see http://www.boost.org for most recent version. |
14 | | * FILE perl_matcher_common.cpp |
15 | | * VERSION see <boost/version.hpp> |
16 | | * DESCRIPTION: Definitions of perl_matcher member functions that are |
17 | | * common to both the recursive and non-recursive versions. |
18 | | */ |
19 | | |
20 | | #ifndef BOOST_REGEX_V5_PERL_MATCHER_COMMON_HPP |
21 | | #define BOOST_REGEX_V5_PERL_MATCHER_COMMON_HPP |
22 | | |
23 | | #include <boost/regex/config.hpp> |
24 | | |
25 | | #ifndef BOOST_REGEX_STANDALONE |
26 | | |
27 | | #include <boost/config.hpp> |
28 | | #if defined(BOOST_HAS_PRAGMA_ONCE) |
29 | | #pragma once |
30 | | #include <boost/regex/v5/perl_matcher.hpp> |
31 | | #endif |
32 | | |
33 | | #endif |
34 | | |
35 | | #include <boost/regex/v5/basic_regex.hpp> |
36 | | #include <boost/regex/v5/match_flags.hpp> |
37 | | #include <boost/regex/v5/match_results.hpp> |
38 | | |
39 | | #ifdef BOOST_REGEX_MSVC |
40 | | # pragma warning(push) |
41 | | #pragma warning(disable:4459) |
42 | | #if BOOST_REGEX_MSVC < 1910 |
43 | | #pragma warning(disable:4800) |
44 | | #endif |
45 | | #endif |
46 | | |
47 | | namespace boost{ |
48 | | namespace BOOST_REGEX_DETAIL_NS{ |
49 | | |
50 | | #ifdef BOOST_REGEX_MSVC |
51 | | # pragma warning(push) |
52 | | #pragma warning(disable:26812) |
53 | | #endif |
54 | | template <class BidiIterator, class Allocator, class traits> |
55 | | void perl_matcher<BidiIterator, Allocator, traits>::construct_init(const basic_regex<char_type, traits>& e, match_flag_type f) |
56 | 21.0M | { |
57 | 21.0M | typedef typename std::iterator_traits<BidiIterator>::iterator_category category; |
58 | 21.0M | typedef typename basic_regex<char_type, traits>::flag_type expression_flag_type; |
59 | | |
60 | 21.0M | if(e.empty()) |
61 | 0 | { |
62 | | // precondition failure: e is not a valid regex. |
63 | 0 | BOOST_REGEX_DETAIL_THROW(std::invalid_argument("Invalid regular expression object")); |
64 | 0 | } |
65 | 21.0M | pstate = 0; |
66 | 21.0M | m_match_flags = f; |
67 | 21.0M | estimate_max_state_count(static_cast<category*>(0)); |
68 | 21.0M | expression_flag_type re_f = re.flags(); |
69 | 21.0M | icase = re_f & regex_constants::icase; |
70 | 21.0M | if(!(m_match_flags & (match_perl|match_posix))) |
71 | 21.0M | { |
72 | 21.0M | if((re_f & (regbase::main_option_type|regbase::no_perl_ex)) == 0) |
73 | 21.0M | m_match_flags |= match_perl; |
74 | 0 | else if((re_f & (regbase::main_option_type|regbase::emacs_ex)) == (regbase::basic_syntax_group|regbase::emacs_ex)) |
75 | 0 | m_match_flags |= match_perl; |
76 | 0 | else if((re_f & (regbase::main_option_type|regbase::literal)) == (regbase::literal)) |
77 | 0 | m_match_flags |= match_perl; |
78 | 0 | else |
79 | 0 | m_match_flags |= match_posix; |
80 | 21.0M | } |
81 | 21.0M | if(m_match_flags & match_posix) |
82 | 19.8k | { |
83 | 19.8k | m_temp_match.reset(new match_results<BidiIterator, Allocator>()); |
84 | 19.8k | m_presult = m_temp_match.get(); |
85 | 19.8k | } |
86 | 21.0M | else |
87 | 21.0M | m_presult = &m_result; |
88 | 21.0M | m_stack_base = 0; |
89 | 21.0M | m_backup_state = 0; |
90 | | // find the value to use for matching word boundaries: |
91 | 21.0M | m_word_mask = re.get_data().m_word_mask; |
92 | | // find bitmask to use for matching '.': |
93 | 21.0M | match_any_mask = static_cast<unsigned char>((f & match_not_dot_newline) ? BOOST_REGEX_DETAIL_NS::test_not_newline : BOOST_REGEX_DETAIL_NS::test_newline); |
94 | | // Disable match_any if requested in the state machine: |
95 | 21.0M | if(e.get_data().m_disable_match_any) |
96 | 3.07k | { |
97 | 3.07k | if (m_match_flags & match_posix) |
98 | 1.39k | BOOST_REGEX_DETAIL_THROW(std::logic_error("Invalid regex for POSIX-style matching")); |
99 | 1.68k | m_match_flags &= regex_constants::match_not_any; |
100 | 1.68k | } |
101 | 21.0M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags) Line | Count | Source | 56 | 21.0M | { | 57 | 21.0M | typedef typename std::iterator_traits<BidiIterator>::iterator_category category; | 58 | 21.0M | typedef typename basic_regex<char_type, traits>::flag_type expression_flag_type; | 59 | | | 60 | 21.0M | if(e.empty()) | 61 | 0 | { | 62 | | // precondition failure: e is not a valid regex. | 63 | 0 | BOOST_REGEX_DETAIL_THROW(std::invalid_argument("Invalid regular expression object")); | 64 | 0 | } | 65 | 21.0M | pstate = 0; | 66 | 21.0M | m_match_flags = f; | 67 | 21.0M | estimate_max_state_count(static_cast<category*>(0)); | 68 | 21.0M | expression_flag_type re_f = re.flags(); | 69 | 21.0M | icase = re_f & regex_constants::icase; | 70 | 21.0M | if(!(m_match_flags & (match_perl|match_posix))) | 71 | 20.9M | { | 72 | 20.9M | if((re_f & (regbase::main_option_type|regbase::no_perl_ex)) == 0) | 73 | 20.9M | m_match_flags |= match_perl; | 74 | 0 | else if((re_f & (regbase::main_option_type|regbase::emacs_ex)) == (regbase::basic_syntax_group|regbase::emacs_ex)) | 75 | 0 | m_match_flags |= match_perl; | 76 | 0 | else if((re_f & (regbase::main_option_type|regbase::literal)) == (regbase::literal)) | 77 | 0 | m_match_flags |= match_perl; | 78 | 0 | else | 79 | 0 | m_match_flags |= match_posix; | 80 | 20.9M | } | 81 | 21.0M | if(m_match_flags & match_posix) | 82 | 19.8k | { | 83 | 19.8k | m_temp_match.reset(new match_results<BidiIterator, Allocator>()); | 84 | 19.8k | m_presult = m_temp_match.get(); | 85 | 19.8k | } | 86 | 20.9M | else | 87 | 20.9M | m_presult = &m_result; | 88 | 21.0M | m_stack_base = 0; | 89 | 21.0M | m_backup_state = 0; | 90 | | // find the value to use for matching word boundaries: | 91 | 21.0M | m_word_mask = re.get_data().m_word_mask; | 92 | | // find bitmask to use for matching '.': | 93 | 21.0M | match_any_mask = static_cast<unsigned char>((f & match_not_dot_newline) ? BOOST_REGEX_DETAIL_NS::test_not_newline : BOOST_REGEX_DETAIL_NS::test_newline); | 94 | | // Disable match_any if requested in the state machine: | 95 | 21.0M | if(e.get_data().m_disable_match_any) | 96 | 3.07k | { | 97 | 3.07k | if (m_match_flags & match_posix) | 98 | 1.39k | BOOST_REGEX_DETAIL_THROW(std::logic_error("Invalid regex for POSIX-style matching")); | 99 | 1.68k | m_match_flags &= regex_constants::match_not_any; | 100 | 1.68k | } | 101 | 21.0M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::construct_init(boost::basic_regex<char, boost::c_regex_traits<char> > const&, boost::regex_constants::_match_flags) Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::construct_init(boost::basic_regex<wchar_t, boost::c_regex_traits<wchar_t> > const&, boost::regex_constants::_match_flags) boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags) Line | Count | Source | 56 | 55.9k | { | 57 | 55.9k | typedef typename std::iterator_traits<BidiIterator>::iterator_category category; | 58 | 55.9k | typedef typename basic_regex<char_type, traits>::flag_type expression_flag_type; | 59 | | | 60 | 55.9k | if(e.empty()) | 61 | 0 | { | 62 | | // precondition failure: e is not a valid regex. | 63 | 0 | BOOST_REGEX_DETAIL_THROW(std::invalid_argument("Invalid regular expression object")); | 64 | 0 | } | 65 | 55.9k | pstate = 0; | 66 | 55.9k | m_match_flags = f; | 67 | 55.9k | estimate_max_state_count(static_cast<category*>(0)); | 68 | 55.9k | expression_flag_type re_f = re.flags(); | 69 | 55.9k | icase = re_f & regex_constants::icase; | 70 | 55.9k | if(!(m_match_flags & (match_perl|match_posix))) | 71 | 55.9k | { | 72 | 55.9k | if((re_f & (regbase::main_option_type|regbase::no_perl_ex)) == 0) | 73 | 55.9k | m_match_flags |= match_perl; | 74 | 0 | else if((re_f & (regbase::main_option_type|regbase::emacs_ex)) == (regbase::basic_syntax_group|regbase::emacs_ex)) | 75 | 0 | m_match_flags |= match_perl; | 76 | 0 | else if((re_f & (regbase::main_option_type|regbase::literal)) == (regbase::literal)) | 77 | 0 | m_match_flags |= match_perl; | 78 | 0 | else | 79 | 0 | m_match_flags |= match_posix; | 80 | 55.9k | } | 81 | 55.9k | if(m_match_flags & match_posix) | 82 | 0 | { | 83 | 0 | m_temp_match.reset(new match_results<BidiIterator, Allocator>()); | 84 | 0 | m_presult = m_temp_match.get(); | 85 | 0 | } | 86 | 55.9k | else | 87 | 55.9k | m_presult = &m_result; | 88 | 55.9k | m_stack_base = 0; | 89 | 55.9k | m_backup_state = 0; | 90 | | // find the value to use for matching word boundaries: | 91 | 55.9k | m_word_mask = re.get_data().m_word_mask; | 92 | | // find bitmask to use for matching '.': | 93 | 55.9k | match_any_mask = static_cast<unsigned char>((f & match_not_dot_newline) ? BOOST_REGEX_DETAIL_NS::test_not_newline : BOOST_REGEX_DETAIL_NS::test_newline); | 94 | | // Disable match_any if requested in the state machine: | 95 | 55.9k | if(e.get_data().m_disable_match_any) | 96 | 0 | { | 97 | 0 | if (m_match_flags & match_posix) | 98 | 0 | BOOST_REGEX_DETAIL_THROW(std::logic_error("Invalid regex for POSIX-style matching")); | 99 | 0 | m_match_flags &= regex_constants::match_not_any; | 100 | 0 | } | 101 | 55.9k | } |
|
102 | | #ifdef BOOST_REGEX_MSVC |
103 | | # pragma warning(pop) |
104 | | #endif |
105 | | |
106 | | template <class BidiIterator, class Allocator, class traits> |
107 | | void perl_matcher<BidiIterator, Allocator, traits>::estimate_max_state_count(std::random_access_iterator_tag*) |
108 | 21.0M | { |
109 | | // |
110 | | // How many states should we allow our machine to visit before giving up? |
111 | | // This is a heuristic: it takes the greater of O(N^2) and O(NS^2) |
112 | | // where N is the length of the string, and S is the number of states |
113 | | // in the machine. It's tempting to up this to O(N^2S) or even O(N^2S^2) |
114 | | // but these take unreasonably amounts of time to bale out in pathological |
115 | | // cases. |
116 | | // |
117 | | // Calculate NS^2 first: |
118 | | // |
119 | 21.0M | static const std::ptrdiff_t k = 100000; |
120 | 21.0M | std::ptrdiff_t dist = std::distance(base, last); |
121 | 21.0M | if(dist == 0) |
122 | 21.2k | dist = 1; |
123 | 21.0M | std::ptrdiff_t states = re.size(); |
124 | 21.0M | if(states == 0) |
125 | 144 | states = 1; |
126 | 21.0M | if ((std::numeric_limits<std::ptrdiff_t>::max)() / states < states) |
127 | 0 | { |
128 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); |
129 | 0 | return; |
130 | 0 | } |
131 | 21.0M | states *= states; |
132 | 21.0M | if((std::numeric_limits<std::ptrdiff_t>::max)() / dist < states) |
133 | 0 | { |
134 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); |
135 | 0 | return; |
136 | 0 | } |
137 | 21.0M | states *= dist; |
138 | 21.0M | if((std::numeric_limits<std::ptrdiff_t>::max)() - k < states) |
139 | 0 | { |
140 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); |
141 | 0 | return; |
142 | 0 | } |
143 | 21.0M | states += k; |
144 | | |
145 | 21.0M | max_state_count = states; |
146 | | |
147 | | // |
148 | | // Now calculate N^2: |
149 | | // |
150 | 21.0M | states = dist; |
151 | 21.0M | if((std::numeric_limits<std::ptrdiff_t>::max)() / dist < states) |
152 | 0 | { |
153 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); |
154 | 0 | return; |
155 | 0 | } |
156 | 21.0M | states *= dist; |
157 | 21.0M | if((std::numeric_limits<std::ptrdiff_t>::max)() - k < states) |
158 | 0 | { |
159 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); |
160 | 0 | return; |
161 | 0 | } |
162 | 21.0M | states += k; |
163 | | // |
164 | | // N^2 can be a very large number indeed, to prevent things getting out |
165 | | // of control, cap the max states: |
166 | | // |
167 | 21.0M | if(states > BOOST_REGEX_MAX_STATE_COUNT) |
168 | 19.3M | states = BOOST_REGEX_MAX_STATE_COUNT; |
169 | | // |
170 | | // If (the possibly capped) N^2 is larger than our first estimate, |
171 | | // use this instead: |
172 | | // |
173 | 21.0M | if(states > max_state_count) |
174 | 7.32M | max_state_count = states; |
175 | 21.0M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::estimate_max_state_count(std::__1::random_access_iterator_tag*) Line | Count | Source | 108 | 21.0M | { | 109 | | // | 110 | | // How many states should we allow our machine to visit before giving up? | 111 | | // This is a heuristic: it takes the greater of O(N^2) and O(NS^2) | 112 | | // where N is the length of the string, and S is the number of states | 113 | | // in the machine. It's tempting to up this to O(N^2S) or even O(N^2S^2) | 114 | | // but these take unreasonably amounts of time to bale out in pathological | 115 | | // cases. | 116 | | // | 117 | | // Calculate NS^2 first: | 118 | | // | 119 | 21.0M | static const std::ptrdiff_t k = 100000; | 120 | 21.0M | std::ptrdiff_t dist = std::distance(base, last); | 121 | 21.0M | if(dist == 0) | 122 | 21.2k | dist = 1; | 123 | 21.0M | std::ptrdiff_t states = re.size(); | 124 | 21.0M | if(states == 0) | 125 | 144 | states = 1; | 126 | 21.0M | if ((std::numeric_limits<std::ptrdiff_t>::max)() / states < states) | 127 | 0 | { | 128 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 129 | 0 | return; | 130 | 0 | } | 131 | 21.0M | states *= states; | 132 | 21.0M | if((std::numeric_limits<std::ptrdiff_t>::max)() / dist < states) | 133 | 0 | { | 134 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 135 | 0 | return; | 136 | 0 | } | 137 | 21.0M | states *= dist; | 138 | 21.0M | if((std::numeric_limits<std::ptrdiff_t>::max)() - k < states) | 139 | 0 | { | 140 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 141 | 0 | return; | 142 | 0 | } | 143 | 21.0M | states += k; | 144 | | | 145 | 21.0M | max_state_count = states; | 146 | | | 147 | | // | 148 | | // Now calculate N^2: | 149 | | // | 150 | 21.0M | states = dist; | 151 | 21.0M | if((std::numeric_limits<std::ptrdiff_t>::max)() / dist < states) | 152 | 0 | { | 153 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 154 | 0 | return; | 155 | 0 | } | 156 | 21.0M | states *= dist; | 157 | 21.0M | if((std::numeric_limits<std::ptrdiff_t>::max)() - k < states) | 158 | 0 | { | 159 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 160 | 0 | return; | 161 | 0 | } | 162 | 21.0M | states += k; | 163 | | // | 164 | | // N^2 can be a very large number indeed, to prevent things getting out | 165 | | // of control, cap the max states: | 166 | | // | 167 | 21.0M | if(states > BOOST_REGEX_MAX_STATE_COUNT) | 168 | 19.3M | states = BOOST_REGEX_MAX_STATE_COUNT; | 169 | | // | 170 | | // If (the possibly capped) N^2 is larger than our first estimate, | 171 | | // use this instead: | 172 | | // | 173 | 21.0M | if(states > max_state_count) | 174 | 7.28M | max_state_count = states; | 175 | 21.0M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::estimate_max_state_count(std::__1::random_access_iterator_tag*) Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::estimate_max_state_count(std::__1::random_access_iterator_tag*) boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::estimate_max_state_count(std::__1::random_access_iterator_tag*) Line | Count | Source | 108 | 55.9k | { | 109 | | // | 110 | | // How many states should we allow our machine to visit before giving up? | 111 | | // This is a heuristic: it takes the greater of O(N^2) and O(NS^2) | 112 | | // where N is the length of the string, and S is the number of states | 113 | | // in the machine. It's tempting to up this to O(N^2S) or even O(N^2S^2) | 114 | | // but these take unreasonably amounts of time to bale out in pathological | 115 | | // cases. | 116 | | // | 117 | | // Calculate NS^2 first: | 118 | | // | 119 | 55.9k | static const std::ptrdiff_t k = 100000; | 120 | 55.9k | std::ptrdiff_t dist = std::distance(base, last); | 121 | 55.9k | if(dist == 0) | 122 | 0 | dist = 1; | 123 | 55.9k | std::ptrdiff_t states = re.size(); | 124 | 55.9k | if(states == 0) | 125 | 0 | states = 1; | 126 | 55.9k | if ((std::numeric_limits<std::ptrdiff_t>::max)() / states < states) | 127 | 0 | { | 128 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 129 | 0 | return; | 130 | 0 | } | 131 | 55.9k | states *= states; | 132 | 55.9k | if((std::numeric_limits<std::ptrdiff_t>::max)() / dist < states) | 133 | 0 | { | 134 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 135 | 0 | return; | 136 | 0 | } | 137 | 55.9k | states *= dist; | 138 | 55.9k | if((std::numeric_limits<std::ptrdiff_t>::max)() - k < states) | 139 | 0 | { | 140 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 141 | 0 | return; | 142 | 0 | } | 143 | 55.9k | states += k; | 144 | | | 145 | 55.9k | max_state_count = states; | 146 | | | 147 | | // | 148 | | // Now calculate N^2: | 149 | | // | 150 | 55.9k | states = dist; | 151 | 55.9k | if((std::numeric_limits<std::ptrdiff_t>::max)() / dist < states) | 152 | 0 | { | 153 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 154 | 0 | return; | 155 | 0 | } | 156 | 55.9k | states *= dist; | 157 | 55.9k | if((std::numeric_limits<std::ptrdiff_t>::max)() - k < states) | 158 | 0 | { | 159 | 0 | max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2); | 160 | 0 | return; | 161 | 0 | } | 162 | 55.9k | states += k; | 163 | | // | 164 | | // N^2 can be a very large number indeed, to prevent things getting out | 165 | | // of control, cap the max states: | 166 | | // | 167 | 55.9k | if(states > BOOST_REGEX_MAX_STATE_COUNT) | 168 | 0 | states = BOOST_REGEX_MAX_STATE_COUNT; | 169 | | // | 170 | | // If (the possibly capped) N^2 is larger than our first estimate, | 171 | | // use this instead: | 172 | | // | 173 | 55.9k | if(states > max_state_count) | 174 | 36.7k | max_state_count = states; | 175 | 55.9k | } |
|
176 | | |
177 | | template <class BidiIterator, class Allocator, class traits> |
178 | | inline void perl_matcher<BidiIterator, Allocator, traits>::estimate_max_state_count(void*) |
179 | | { |
180 | | // we don't know how long the sequence is: |
181 | | max_state_count = BOOST_REGEX_MAX_STATE_COUNT; |
182 | | } |
183 | | |
184 | | template <class BidiIterator, class Allocator, class traits> |
185 | | inline bool perl_matcher<BidiIterator, Allocator, traits>::match() |
186 | 45.6k | { |
187 | 45.6k | return match_imp(); |
188 | 45.6k | } |
189 | | |
190 | | template <class BidiIterator, class Allocator, class traits> |
191 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_imp() |
192 | 45.6k | { |
193 | | // initialise our stack if we are non-recursive: |
194 | 45.6k | save_state_init init(&m_stack_base, &m_backup_state); |
195 | 45.6k | used_block_count = BOOST_REGEX_MAX_BLOCKS; |
196 | 45.6k | #if !defined(BOOST_NO_EXCEPTIONS) |
197 | 45.6k | try{ |
198 | 45.6k | #endif |
199 | | |
200 | | // reset our state machine: |
201 | 45.6k | position = base; |
202 | 45.6k | search_base = base; |
203 | 45.6k | state_count = 0; |
204 | 45.6k | m_match_flags |= regex_constants::match_all; |
205 | 45.6k | m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast<typename results_type::size_type>(1u + re.mark_count()), search_base, last); |
206 | 45.6k | m_presult->set_base(base); |
207 | 45.6k | m_presult->set_named_subs(this->re.get_named_subs()); |
208 | 45.6k | if(m_match_flags & match_posix) |
209 | 18.4k | m_result = *m_presult; |
210 | 45.6k | verify_options(re.flags(), m_match_flags); |
211 | 45.6k | if(0 == match_prefix()) |
212 | 30.5k | return false; |
213 | 15.1k | return (m_result[0].second == last) && (m_result[0].first == base); |
214 | | |
215 | 45.6k | #if !defined(BOOST_NO_EXCEPTIONS) |
216 | 45.6k | } |
217 | 45.6k | catch(...) |
218 | 45.6k | { |
219 | | // unwind all pushed states, apart from anything else this |
220 | | // ensures that all the states are correctly destructed |
221 | | // not just the memory freed. |
222 | 13.4k | while(unwind(true)){} |
223 | 1.71k | throw; |
224 | 1.71k | } |
225 | 45.6k | #endif |
226 | 45.6k | } |
227 | | |
228 | | template <class BidiIterator, class Allocator, class traits> |
229 | | inline bool perl_matcher<BidiIterator, Allocator, traits>::find() |
230 | 21.0M | { |
231 | 21.0M | return find_imp(); |
232 | 21.0M | } Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::find() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::find() boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find() Line | Count | Source | 230 | 55.9k | { | 231 | 55.9k | return find_imp(); | 232 | 55.9k | } |
boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find() Line | Count | Source | 230 | 20.9M | { | 231 | 20.9M | return find_imp(); | 232 | 20.9M | } |
|
233 | | |
234 | | template <class BidiIterator, class Allocator, class traits> |
235 | | bool perl_matcher<BidiIterator, Allocator, traits>::find_imp() |
236 | 21.0M | { |
237 | 21.0M | static matcher_proc_type const s_find_vtable[7] = |
238 | 21.0M | { |
239 | 21.0M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_any, |
240 | 21.0M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_word, |
241 | 21.0M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_line, |
242 | 21.0M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_buf, |
243 | 21.0M | &perl_matcher<BidiIterator, Allocator, traits>::match_prefix, |
244 | 21.0M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit, |
245 | 21.0M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit, |
246 | 21.0M | }; |
247 | | |
248 | | // initialise our stack if we are non-recursive: |
249 | 21.0M | save_state_init init(&m_stack_base, &m_backup_state); |
250 | 21.0M | used_block_count = BOOST_REGEX_MAX_BLOCKS; |
251 | 21.0M | #if !defined(BOOST_NO_EXCEPTIONS) |
252 | 21.0M | try{ |
253 | 21.0M | #endif |
254 | | |
255 | 21.0M | state_count = 0; |
256 | 21.0M | if((m_match_flags & regex_constants::match_init) == 0) |
257 | 21.0M | { |
258 | | // reset our state machine: |
259 | 21.0M | search_base = position = base; |
260 | 21.0M | pstate = re.get_first_state(); |
261 | 21.0M | m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast<typename results_type::size_type>(1u + re.mark_count()), base, last); |
262 | 21.0M | m_presult->set_base(base); |
263 | 21.0M | m_presult->set_named_subs(this->re.get_named_subs()); |
264 | 21.0M | m_match_flags |= regex_constants::match_init; |
265 | 21.0M | } |
266 | 0 | else |
267 | 0 | { |
268 | | // start again: |
269 | 0 | search_base = position = m_result[0].second; |
270 | | // If last match was null and match_not_null was not set then increment |
271 | | // our start position, otherwise we go into an infinite loop: |
272 | 0 | if(((m_match_flags & match_not_null) == 0) && (m_result.length() == 0)) |
273 | 0 | { |
274 | 0 | if(position == last) |
275 | 0 | return false; |
276 | 0 | else |
277 | 0 | ++position; |
278 | 0 | } |
279 | | // reset $` start: |
280 | 0 | m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast<typename results_type::size_type>(1u + re.mark_count()), search_base, last); |
281 | | //if((base != search_base) && (base == backstop)) |
282 | | // m_match_flags |= match_prev_avail; |
283 | 0 | } |
284 | 21.0M | if(m_match_flags & match_posix) |
285 | 0 | { |
286 | 0 | m_result.set_size(static_cast<typename results_type::size_type>(1u + re.mark_count()), base, last); |
287 | 0 | m_result.set_base(base); |
288 | 0 | } |
289 | | |
290 | 21.0M | verify_options(re.flags(), m_match_flags); |
291 | | // find out what kind of expression we have: |
292 | 21.0M | unsigned type = (m_match_flags & match_continuous) ? |
293 | 0 | static_cast<unsigned int>(regbase::restart_continue) |
294 | 21.0M | : static_cast<unsigned int>(re.get_restart_type()); |
295 | | |
296 | | // call the appropriate search routine: |
297 | 21.0M | matcher_proc_type proc = s_find_vtable[type]; |
298 | 21.0M | return (this->*proc)(); |
299 | | |
300 | 21.0M | #if !defined(BOOST_NO_EXCEPTIONS) |
301 | 21.0M | } |
302 | 21.0M | catch(...) |
303 | 21.0M | { |
304 | | // unwind all pushed states, apart from anything else this |
305 | | // ensures that all the states are correctly destructed |
306 | | // not just the memory freed. |
307 | 11 | while(unwind(true)){} |
308 | 11 | throw; |
309 | 11 | } |
310 | 21.0M | #endif |
311 | 21.0M | } Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::find_imp() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::find_imp() boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp() Line | Count | Source | 236 | 55.9k | { | 237 | 55.9k | static matcher_proc_type const s_find_vtable[7] = | 238 | 55.9k | { | 239 | 55.9k | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_any, | 240 | 55.9k | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_word, | 241 | 55.9k | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_line, | 242 | 55.9k | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_buf, | 243 | 55.9k | &perl_matcher<BidiIterator, Allocator, traits>::match_prefix, | 244 | 55.9k | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit, | 245 | 55.9k | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit, | 246 | 55.9k | }; | 247 | | | 248 | | // initialise our stack if we are non-recursive: | 249 | 55.9k | save_state_init init(&m_stack_base, &m_backup_state); | 250 | 55.9k | used_block_count = BOOST_REGEX_MAX_BLOCKS; | 251 | 55.9k | #if !defined(BOOST_NO_EXCEPTIONS) | 252 | 55.9k | try{ | 253 | 55.9k | #endif | 254 | | | 255 | 55.9k | state_count = 0; | 256 | 55.9k | if((m_match_flags & regex_constants::match_init) == 0) | 257 | 55.9k | { | 258 | | // reset our state machine: | 259 | 55.9k | search_base = position = base; | 260 | 55.9k | pstate = re.get_first_state(); | 261 | 55.9k | m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast<typename results_type::size_type>(1u + re.mark_count()), base, last); | 262 | 55.9k | m_presult->set_base(base); | 263 | 55.9k | m_presult->set_named_subs(this->re.get_named_subs()); | 264 | 55.9k | m_match_flags |= regex_constants::match_init; | 265 | 55.9k | } | 266 | 0 | else | 267 | 0 | { | 268 | | // start again: | 269 | 0 | search_base = position = m_result[0].second; | 270 | | // If last match was null and match_not_null was not set then increment | 271 | | // our start position, otherwise we go into an infinite loop: | 272 | 0 | if(((m_match_flags & match_not_null) == 0) && (m_result.length() == 0)) | 273 | 0 | { | 274 | 0 | if(position == last) | 275 | 0 | return false; | 276 | 0 | else | 277 | 0 | ++position; | 278 | 0 | } | 279 | | // reset $` start: | 280 | 0 | m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast<typename results_type::size_type>(1u + re.mark_count()), search_base, last); | 281 | | //if((base != search_base) && (base == backstop)) | 282 | | // m_match_flags |= match_prev_avail; | 283 | 0 | } | 284 | 55.9k | if(m_match_flags & match_posix) | 285 | 0 | { | 286 | 0 | m_result.set_size(static_cast<typename results_type::size_type>(1u + re.mark_count()), base, last); | 287 | 0 | m_result.set_base(base); | 288 | 0 | } | 289 | | | 290 | 55.9k | verify_options(re.flags(), m_match_flags); | 291 | | // find out what kind of expression we have: | 292 | 55.9k | unsigned type = (m_match_flags & match_continuous) ? | 293 | 0 | static_cast<unsigned int>(regbase::restart_continue) | 294 | 55.9k | : static_cast<unsigned int>(re.get_restart_type()); | 295 | | | 296 | | // call the appropriate search routine: | 297 | 55.9k | matcher_proc_type proc = s_find_vtable[type]; | 298 | 55.9k | return (this->*proc)(); | 299 | | | 300 | 55.9k | #if !defined(BOOST_NO_EXCEPTIONS) | 301 | 55.9k | } | 302 | 55.9k | catch(...) | 303 | 55.9k | { | 304 | | // unwind all pushed states, apart from anything else this | 305 | | // ensures that all the states are correctly destructed | 306 | | // not just the memory freed. | 307 | 0 | while(unwind(true)){} | 308 | 0 | throw; | 309 | 0 | } | 310 | 55.9k | #endif | 311 | 55.9k | } |
boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_imp() Line | Count | Source | 236 | 20.9M | { | 237 | 20.9M | static matcher_proc_type const s_find_vtable[7] = | 238 | 20.9M | { | 239 | 20.9M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_any, | 240 | 20.9M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_word, | 241 | 20.9M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_line, | 242 | 20.9M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_buf, | 243 | 20.9M | &perl_matcher<BidiIterator, Allocator, traits>::match_prefix, | 244 | 20.9M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit, | 245 | 20.9M | &perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit, | 246 | 20.9M | }; | 247 | | | 248 | | // initialise our stack if we are non-recursive: | 249 | 20.9M | save_state_init init(&m_stack_base, &m_backup_state); | 250 | 20.9M | used_block_count = BOOST_REGEX_MAX_BLOCKS; | 251 | 20.9M | #if !defined(BOOST_NO_EXCEPTIONS) | 252 | 20.9M | try{ | 253 | 20.9M | #endif | 254 | | | 255 | 20.9M | state_count = 0; | 256 | 20.9M | if((m_match_flags & regex_constants::match_init) == 0) | 257 | 20.9M | { | 258 | | // reset our state machine: | 259 | 20.9M | search_base = position = base; | 260 | 20.9M | pstate = re.get_first_state(); | 261 | 20.9M | m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast<typename results_type::size_type>(1u + re.mark_count()), base, last); | 262 | 20.9M | m_presult->set_base(base); | 263 | 20.9M | m_presult->set_named_subs(this->re.get_named_subs()); | 264 | 20.9M | m_match_flags |= regex_constants::match_init; | 265 | 20.9M | } | 266 | 0 | else | 267 | 0 | { | 268 | | // start again: | 269 | 0 | search_base = position = m_result[0].second; | 270 | | // If last match was null and match_not_null was not set then increment | 271 | | // our start position, otherwise we go into an infinite loop: | 272 | 0 | if(((m_match_flags & match_not_null) == 0) && (m_result.length() == 0)) | 273 | 0 | { | 274 | 0 | if(position == last) | 275 | 0 | return false; | 276 | 0 | else | 277 | 0 | ++position; | 278 | 0 | } | 279 | | // reset $` start: | 280 | 0 | m_presult->set_size((m_match_flags & match_nosubs) ? 1u : static_cast<typename results_type::size_type>(1u + re.mark_count()), search_base, last); | 281 | | //if((base != search_base) && (base == backstop)) | 282 | | // m_match_flags |= match_prev_avail; | 283 | 0 | } | 284 | 20.9M | if(m_match_flags & match_posix) | 285 | 0 | { | 286 | 0 | m_result.set_size(static_cast<typename results_type::size_type>(1u + re.mark_count()), base, last); | 287 | 0 | m_result.set_base(base); | 288 | 0 | } | 289 | | | 290 | 20.9M | verify_options(re.flags(), m_match_flags); | 291 | | // find out what kind of expression we have: | 292 | 20.9M | unsigned type = (m_match_flags & match_continuous) ? | 293 | 0 | static_cast<unsigned int>(regbase::restart_continue) | 294 | 20.9M | : static_cast<unsigned int>(re.get_restart_type()); | 295 | | | 296 | | // call the appropriate search routine: | 297 | 20.9M | matcher_proc_type proc = s_find_vtable[type]; | 298 | 20.9M | return (this->*proc)(); | 299 | | | 300 | 20.9M | #if !defined(BOOST_NO_EXCEPTIONS) | 301 | 20.9M | } | 302 | 20.9M | catch(...) | 303 | 20.9M | { | 304 | | // unwind all pushed states, apart from anything else this | 305 | | // ensures that all the states are correctly destructed | 306 | | // not just the memory freed. | 307 | 11 | while(unwind(true)){} | 308 | 11 | throw; | 309 | 11 | } | 310 | 20.9M | #endif | 311 | 20.9M | } |
|
312 | | |
313 | | template <class BidiIterator, class Allocator, class traits> |
314 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_prefix() |
315 | 21.0M | { |
316 | 21.0M | m_has_partial_match = false; |
317 | 21.0M | m_has_found_match = false; |
318 | 21.0M | pstate = re.get_first_state(); |
319 | 21.0M | m_presult->set_first(position); |
320 | 21.0M | restart = position; |
321 | 21.0M | match_all_states(); |
322 | 21.0M | if(!m_has_found_match && m_has_partial_match && (m_match_flags & match_partial)) |
323 | 5.28k | { |
324 | 5.28k | m_has_found_match = true; |
325 | 5.28k | m_presult->set_second(last, 0, false); |
326 | 5.28k | position = last; |
327 | 5.28k | if((m_match_flags & match_posix) == match_posix) |
328 | 1.87k | { |
329 | 1.87k | m_result.maybe_assign(*m_presult); |
330 | 1.87k | } |
331 | 5.28k | } |
332 | | #ifdef BOOST_REGEX_MATCH_EXTRA |
333 | | if(m_has_found_match && (match_extra & m_match_flags)) |
334 | | { |
335 | | // |
336 | | // we have a match, reverse the capture information: |
337 | | // |
338 | | for(unsigned i = 0; i < m_presult->size(); ++i) |
339 | | { |
340 | | typename sub_match<BidiIterator>::capture_sequence_type & seq = ((*m_presult)[i]).get_captures(); |
341 | | std::reverse(seq.begin(), seq.end()); |
342 | | } |
343 | | } |
344 | | #endif |
345 | 21.0M | if(!m_has_found_match) |
346 | 11.7M | position = restart; // reset search postion |
347 | 21.0M | return m_has_found_match; |
348 | 21.0M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_prefix() Line | Count | Source | 315 | 21.0M | { | 316 | 21.0M | m_has_partial_match = false; | 317 | 21.0M | m_has_found_match = false; | 318 | 21.0M | pstate = re.get_first_state(); | 319 | 21.0M | m_presult->set_first(position); | 320 | 21.0M | restart = position; | 321 | 21.0M | match_all_states(); | 322 | 21.0M | if(!m_has_found_match && m_has_partial_match && (m_match_flags & match_partial)) | 323 | 5.28k | { | 324 | 5.28k | m_has_found_match = true; | 325 | 5.28k | m_presult->set_second(last, 0, false); | 326 | 5.28k | position = last; | 327 | 5.28k | if((m_match_flags & match_posix) == match_posix) | 328 | 1.87k | { | 329 | 1.87k | m_result.maybe_assign(*m_presult); | 330 | 1.87k | } | 331 | 5.28k | } | 332 | | #ifdef BOOST_REGEX_MATCH_EXTRA | 333 | | if(m_has_found_match && (match_extra & m_match_flags)) | 334 | | { | 335 | | // | 336 | | // we have a match, reverse the capture information: | 337 | | // | 338 | | for(unsigned i = 0; i < m_presult->size(); ++i) | 339 | | { | 340 | | typename sub_match<BidiIterator>::capture_sequence_type & seq = ((*m_presult)[i]).get_captures(); | 341 | | std::reverse(seq.begin(), seq.end()); | 342 | | } | 343 | | } | 344 | | #endif | 345 | 21.0M | if(!m_has_found_match) | 346 | 11.7M | position = restart; // reset search postion | 347 | 21.0M | return m_has_found_match; | 348 | 21.0M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_prefix() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_prefix() boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_prefix() Line | Count | Source | 315 | 54.1k | { | 316 | 54.1k | m_has_partial_match = false; | 317 | 54.1k | m_has_found_match = false; | 318 | 54.1k | pstate = re.get_first_state(); | 319 | 54.1k | m_presult->set_first(position); | 320 | 54.1k | restart = position; | 321 | 54.1k | match_all_states(); | 322 | 54.1k | if(!m_has_found_match && m_has_partial_match && (m_match_flags & match_partial)) | 323 | 0 | { | 324 | 0 | m_has_found_match = true; | 325 | 0 | m_presult->set_second(last, 0, false); | 326 | 0 | position = last; | 327 | 0 | if((m_match_flags & match_posix) == match_posix) | 328 | 0 | { | 329 | 0 | m_result.maybe_assign(*m_presult); | 330 | 0 | } | 331 | 0 | } | 332 | | #ifdef BOOST_REGEX_MATCH_EXTRA | 333 | | if(m_has_found_match && (match_extra & m_match_flags)) | 334 | | { | 335 | | // | 336 | | // we have a match, reverse the capture information: | 337 | | // | 338 | | for(unsigned i = 0; i < m_presult->size(); ++i) | 339 | | { | 340 | | typename sub_match<BidiIterator>::capture_sequence_type & seq = ((*m_presult)[i]).get_captures(); | 341 | | std::reverse(seq.begin(), seq.end()); | 342 | | } | 343 | | } | 344 | | #endif | 345 | 54.1k | if(!m_has_found_match) | 346 | 0 | position = restart; // reset search postion | 347 | 54.1k | return m_has_found_match; | 348 | 54.1k | } |
|
349 | | |
350 | | template <class BidiIterator, class Allocator, class traits> |
351 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_literal() |
352 | 95.4M | { |
353 | 95.4M | unsigned int len = static_cast<const re_literal*>(pstate)->length; |
354 | 95.4M | const char_type* what = reinterpret_cast<const char_type*>(static_cast<const re_literal*>(pstate) + 1); |
355 | | // |
356 | | // compare string with what we stored in |
357 | | // our records: |
358 | 205M | for(unsigned int i = 0; i < len; ++i, ++position) |
359 | 178M | { |
360 | 178M | if((position == last) || (traits_inst.translate(*position, icase) != what[i])) |
361 | 67.5M | return false; |
362 | 178M | } |
363 | 27.8M | pstate = pstate->next.p; |
364 | 27.8M | return true; |
365 | 95.4M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_literal() Line | Count | Source | 352 | 95.3M | { | 353 | 95.3M | unsigned int len = static_cast<const re_literal*>(pstate)->length; | 354 | 95.3M | const char_type* what = reinterpret_cast<const char_type*>(static_cast<const re_literal*>(pstate) + 1); | 355 | | // | 356 | | // compare string with what we stored in | 357 | | // our records: | 358 | 205M | for(unsigned int i = 0; i < len; ++i, ++position) | 359 | 178M | { | 360 | 178M | if((position == last) || (traits_inst.translate(*position, icase) != what[i])) | 361 | 67.5M | return false; | 362 | 178M | } | 363 | 27.7M | pstate = pstate->next.p; | 364 | 27.7M | return true; | 365 | 95.3M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_literal() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_literal() boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_literal() Line | Count | Source | 352 | 54.1k | { | 353 | 54.1k | unsigned int len = static_cast<const re_literal*>(pstate)->length; | 354 | 54.1k | const char_type* what = reinterpret_cast<const char_type*>(static_cast<const re_literal*>(pstate) + 1); | 355 | | // | 356 | | // compare string with what we stored in | 357 | | // our records: | 358 | 108k | for(unsigned int i = 0; i < len; ++i, ++position) | 359 | 54.1k | { | 360 | 54.1k | if((position == last) || (traits_inst.translate(*position, icase) != what[i])) | 361 | 0 | return false; | 362 | 54.1k | } | 363 | 54.1k | pstate = pstate->next.p; | 364 | 54.1k | return true; | 365 | 54.1k | } |
|
366 | | |
367 | | template <class BidiIterator, class Allocator, class traits> |
368 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_start_line() |
369 | 35.5M | { |
370 | 35.5M | if(position == backstop) |
371 | 191k | { |
372 | 191k | if((m_match_flags & match_prev_avail) == 0) |
373 | 191k | { |
374 | 191k | if((m_match_flags & match_not_bol) == 0) |
375 | 191k | { |
376 | 191k | pstate = pstate->next.p; |
377 | 191k | return true; |
378 | 191k | } |
379 | 0 | return false; |
380 | 191k | } |
381 | 191k | } |
382 | 35.4M | else if(m_match_flags & match_single_line) |
383 | 0 | return false; |
384 | | |
385 | | // check the previous value character: |
386 | 35.4M | BidiIterator t(position); |
387 | 35.4M | --t; |
388 | 35.4M | if(position != last) |
389 | 35.0M | { |
390 | 35.0M | if(is_separator(*t) && !((*t == static_cast<char_type>('\r')) && (*position == static_cast<char_type>('\n'))) ) |
391 | 565k | { |
392 | 565k | pstate = pstate->next.p; |
393 | 565k | return true; |
394 | 565k | } |
395 | 35.0M | } |
396 | 361k | else if(is_separator(*t)) |
397 | 442 | { |
398 | 442 | pstate = pstate->next.p; |
399 | 442 | return true; |
400 | 442 | } |
401 | 34.8M | return false; |
402 | 35.4M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_start_line() Line | Count | Source | 369 | 35.5M | { | 370 | 35.5M | if(position == backstop) | 371 | 191k | { | 372 | 191k | if((m_match_flags & match_prev_avail) == 0) | 373 | 191k | { | 374 | 191k | if((m_match_flags & match_not_bol) == 0) | 375 | 191k | { | 376 | 191k | pstate = pstate->next.p; | 377 | 191k | return true; | 378 | 191k | } | 379 | 0 | return false; | 380 | 191k | } | 381 | 191k | } | 382 | 35.4M | else if(m_match_flags & match_single_line) | 383 | 0 | return false; | 384 | | | 385 | | // check the previous value character: | 386 | 35.4M | BidiIterator t(position); | 387 | 35.4M | --t; | 388 | 35.4M | if(position != last) | 389 | 35.0M | { | 390 | 35.0M | if(is_separator(*t) && !((*t == static_cast<char_type>('\r')) && (*position == static_cast<char_type>('\n'))) ) | 391 | 565k | { | 392 | 565k | pstate = pstate->next.p; | 393 | 565k | return true; | 394 | 565k | } | 395 | 35.0M | } | 396 | 361k | else if(is_separator(*t)) | 397 | 442 | { | 398 | 442 | pstate = pstate->next.p; | 399 | 442 | return true; | 400 | 442 | } | 401 | 34.8M | return false; | 402 | 35.4M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_start_line() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_start_line() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_start_line() |
403 | | |
404 | | template <class BidiIterator, class Allocator, class traits> |
405 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_end_line() |
406 | 2.65M | { |
407 | 2.65M | if(position != last) |
408 | 688k | { |
409 | 688k | if(m_match_flags & match_single_line) |
410 | 0 | return false; |
411 | | // we're not yet at the end so *first is always valid: |
412 | 688k | if(is_separator(*position)) |
413 | 553k | { |
414 | 553k | if((position != backstop) || (m_match_flags & match_prev_avail)) |
415 | 536k | { |
416 | | // check that we're not in the middle of \r\n sequence |
417 | 536k | BidiIterator t(position); |
418 | 536k | --t; |
419 | 536k | if((*t == static_cast<char_type>('\r')) && (*position == static_cast<char_type>('\n'))) |
420 | 278 | { |
421 | 278 | return false; |
422 | 278 | } |
423 | 536k | } |
424 | 553k | pstate = pstate->next.p; |
425 | 553k | return true; |
426 | 553k | } |
427 | 688k | } |
428 | 1.96M | else if((m_match_flags & match_not_eol) == 0) |
429 | 1.96M | { |
430 | 1.96M | pstate = pstate->next.p; |
431 | 1.96M | return true; |
432 | 1.96M | } |
433 | 135k | return false; |
434 | 2.65M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_end_line() Line | Count | Source | 406 | 2.65M | { | 407 | 2.65M | if(position != last) | 408 | 688k | { | 409 | 688k | if(m_match_flags & match_single_line) | 410 | 0 | return false; | 411 | | // we're not yet at the end so *first is always valid: | 412 | 688k | if(is_separator(*position)) | 413 | 553k | { | 414 | 553k | if((position != backstop) || (m_match_flags & match_prev_avail)) | 415 | 536k | { | 416 | | // check that we're not in the middle of \r\n sequence | 417 | 536k | BidiIterator t(position); | 418 | 536k | --t; | 419 | 536k | if((*t == static_cast<char_type>('\r')) && (*position == static_cast<char_type>('\n'))) | 420 | 278 | { | 421 | 278 | return false; | 422 | 278 | } | 423 | 536k | } | 424 | 553k | pstate = pstate->next.p; | 425 | 553k | return true; | 426 | 553k | } | 427 | 688k | } | 428 | 1.96M | else if((m_match_flags & match_not_eol) == 0) | 429 | 1.96M | { | 430 | 1.96M | pstate = pstate->next.p; | 431 | 1.96M | return true; | 432 | 1.96M | } | 433 | 135k | return false; | 434 | 2.65M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_end_line() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_end_line() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_end_line() |
435 | | |
436 | | template <class BidiIterator, class Allocator, class traits> |
437 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_wild() |
438 | 314M | { |
439 | 314M | if(position == last) |
440 | 3.53M | return false; |
441 | 310M | if(is_separator(*position) && ((match_any_mask & static_cast<const re_dot*>(pstate)->mask) == 0)) |
442 | 38.5k | return false; |
443 | 310M | if((*position == char_type(0)) && (m_match_flags & match_not_dot_null)) |
444 | 0 | return false; |
445 | 310M | pstate = pstate->next.p; |
446 | 310M | ++position; |
447 | 310M | return true; |
448 | 310M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_wild() Line | Count | Source | 438 | 314M | { | 439 | 314M | if(position == last) | 440 | 3.53M | return false; | 441 | 310M | if(is_separator(*position) && ((match_any_mask & static_cast<const re_dot*>(pstate)->mask) == 0)) | 442 | 38.5k | return false; | 443 | 310M | if((*position == char_type(0)) && (m_match_flags & match_not_dot_null)) | 444 | 0 | return false; | 445 | 310M | pstate = pstate->next.p; | 446 | 310M | ++position; | 447 | 310M | return true; | 448 | 310M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_wild() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_wild() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_wild() |
449 | | |
450 | | template <class BidiIterator, class Allocator, class traits> |
451 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_word_boundary() |
452 | 205k | { |
453 | 205k | bool b; // indcates whether next character is a word character |
454 | 205k | if(position != last) |
455 | 169k | { |
456 | | // prev and this character must be opposites: |
457 | 169k | b = traits_inst.isctype(*position, m_word_mask); |
458 | 169k | } |
459 | 35.5k | else |
460 | 35.5k | { |
461 | 35.5k | if (m_match_flags & match_not_eow) |
462 | 0 | return false; |
463 | 35.5k | b = false; |
464 | 35.5k | } |
465 | 205k | if((position == backstop) && ((m_match_flags & match_prev_avail) == 0)) |
466 | 21.2k | { |
467 | 21.2k | if(m_match_flags & match_not_bow) |
468 | 0 | return false; |
469 | 21.2k | else |
470 | 21.2k | b ^= false; |
471 | 21.2k | } |
472 | 184k | else |
473 | 184k | { |
474 | 184k | --position; |
475 | 184k | b ^= traits_inst.isctype(*position, m_word_mask); |
476 | 184k | ++position; |
477 | 184k | } |
478 | 205k | if(b) |
479 | 93.6k | { |
480 | 93.6k | pstate = pstate->next.p; |
481 | 93.6k | return true; |
482 | 93.6k | } |
483 | 111k | return false; // no match if we get to here... |
484 | 205k | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_word_boundary() Line | Count | Source | 452 | 205k | { | 453 | 205k | bool b; // indcates whether next character is a word character | 454 | 205k | if(position != last) | 455 | 169k | { | 456 | | // prev and this character must be opposites: | 457 | 169k | b = traits_inst.isctype(*position, m_word_mask); | 458 | 169k | } | 459 | 35.5k | else | 460 | 35.5k | { | 461 | 35.5k | if (m_match_flags & match_not_eow) | 462 | 0 | return false; | 463 | 35.5k | b = false; | 464 | 35.5k | } | 465 | 205k | if((position == backstop) && ((m_match_flags & match_prev_avail) == 0)) | 466 | 21.2k | { | 467 | 21.2k | if(m_match_flags & match_not_bow) | 468 | 0 | return false; | 469 | 21.2k | else | 470 | 21.2k | b ^= false; | 471 | 21.2k | } | 472 | 184k | else | 473 | 184k | { | 474 | 184k | --position; | 475 | 184k | b ^= traits_inst.isctype(*position, m_word_mask); | 476 | 184k | ++position; | 477 | 184k | } | 478 | 205k | if(b) | 479 | 93.6k | { | 480 | 93.6k | pstate = pstate->next.p; | 481 | 93.6k | return true; | 482 | 93.6k | } | 483 | 111k | return false; // no match if we get to here... | 484 | 205k | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_word_boundary() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_word_boundary() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_word_boundary() |
485 | | |
486 | | template <class BidiIterator, class Allocator, class traits> |
487 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_within_word() |
488 | 194k | { |
489 | 194k | bool b = !match_word_boundary(); |
490 | 194k | if(b) |
491 | 102k | pstate = pstate->next.p; |
492 | 194k | return b; |
493 | | /* |
494 | | if(position == last) |
495 | | return false; |
496 | | // both prev and this character must be m_word_mask: |
497 | | bool prev = traits_inst.isctype(*position, m_word_mask); |
498 | | { |
499 | | bool b; |
500 | | if((position == backstop) && ((m_match_flags & match_prev_avail) == 0)) |
501 | | return false; |
502 | | else |
503 | | { |
504 | | --position; |
505 | | b = traits_inst.isctype(*position, m_word_mask); |
506 | | ++position; |
507 | | } |
508 | | if(b == prev) |
509 | | { |
510 | | pstate = pstate->next.p; |
511 | | return true; |
512 | | } |
513 | | } |
514 | | return false; |
515 | | */ |
516 | 194k | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_within_word() Line | Count | Source | 488 | 194k | { | 489 | 194k | bool b = !match_word_boundary(); | 490 | 194k | if(b) | 491 | 102k | pstate = pstate->next.p; | 492 | 194k | return b; | 493 | | /* | 494 | | if(position == last) | 495 | | return false; | 496 | | // both prev and this character must be m_word_mask: | 497 | | bool prev = traits_inst.isctype(*position, m_word_mask); | 498 | | { | 499 | | bool b; | 500 | | if((position == backstop) && ((m_match_flags & match_prev_avail) == 0)) | 501 | | return false; | 502 | | else | 503 | | { | 504 | | --position; | 505 | | b = traits_inst.isctype(*position, m_word_mask); | 506 | | ++position; | 507 | | } | 508 | | if(b == prev) | 509 | | { | 510 | | pstate = pstate->next.p; | 511 | | return true; | 512 | | } | 513 | | } | 514 | | return false; | 515 | | */ | 516 | 194k | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_within_word() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_within_word() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_within_word() |
517 | | |
518 | | template <class BidiIterator, class Allocator, class traits> |
519 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_word_start() |
520 | 19.7k | { |
521 | 19.7k | if(position == last) |
522 | 5.58k | return false; // can't be starting a word if we're already at the end of input |
523 | 14.1k | if(!traits_inst.isctype(*position, m_word_mask)) |
524 | 4.05k | return false; // next character isn't a word character |
525 | 10.1k | if((position == backstop) && ((m_match_flags & match_prev_avail) == 0)) |
526 | 6.92k | { |
527 | 6.92k | if(m_match_flags & match_not_bow) |
528 | 0 | return false; // no previous input |
529 | 6.92k | } |
530 | 3.20k | else |
531 | 3.20k | { |
532 | | // otherwise inside buffer: |
533 | 3.20k | BidiIterator t(position); |
534 | 3.20k | --t; |
535 | 3.20k | if(traits_inst.isctype(*t, m_word_mask)) |
536 | 2.73k | return false; // previous character not non-word |
537 | 3.20k | } |
538 | | // OK we have a match: |
539 | 7.38k | pstate = pstate->next.p; |
540 | 7.38k | return true; |
541 | 10.1k | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_word_start() Line | Count | Source | 520 | 19.7k | { | 521 | 19.7k | if(position == last) | 522 | 5.58k | return false; // can't be starting a word if we're already at the end of input | 523 | 14.1k | if(!traits_inst.isctype(*position, m_word_mask)) | 524 | 4.05k | return false; // next character isn't a word character | 525 | 10.1k | if((position == backstop) && ((m_match_flags & match_prev_avail) == 0)) | 526 | 6.92k | { | 527 | 6.92k | if(m_match_flags & match_not_bow) | 528 | 0 | return false; // no previous input | 529 | 6.92k | } | 530 | 3.20k | else | 531 | 3.20k | { | 532 | | // otherwise inside buffer: | 533 | 3.20k | BidiIterator t(position); | 534 | 3.20k | --t; | 535 | 3.20k | if(traits_inst.isctype(*t, m_word_mask)) | 536 | 2.73k | return false; // previous character not non-word | 537 | 3.20k | } | 538 | | // OK we have a match: | 539 | 7.38k | pstate = pstate->next.p; | 540 | 7.38k | return true; | 541 | 10.1k | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_word_start() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_word_start() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_word_start() |
542 | | |
543 | | template <class BidiIterator, class Allocator, class traits> |
544 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_word_end() |
545 | 35.2k | { |
546 | 35.2k | if((position == backstop) && ((m_match_flags & match_prev_avail) == 0)) |
547 | 5.07k | return false; // start of buffer can't be end of word |
548 | 30.2k | BidiIterator t(position); |
549 | 30.2k | --t; |
550 | 30.2k | if(traits_inst.isctype(*t, m_word_mask) == false) |
551 | 17.3k | return false; // previous character wasn't a word character |
552 | | |
553 | 12.8k | if(position == last) |
554 | 7.65k | { |
555 | 7.65k | if(m_match_flags & match_not_eow) |
556 | 0 | return false; // end of buffer but not end of word |
557 | 7.65k | } |
558 | 5.17k | else |
559 | 5.17k | { |
560 | | // otherwise inside buffer: |
561 | 5.17k | if(traits_inst.isctype(*position, m_word_mask)) |
562 | 4.77k | return false; // next character is a word character |
563 | 5.17k | } |
564 | 8.05k | pstate = pstate->next.p; |
565 | 8.05k | return true; // if we fall through to here then we've succeeded |
566 | 12.8k | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_word_end() Line | Count | Source | 545 | 35.2k | { | 546 | 35.2k | if((position == backstop) && ((m_match_flags & match_prev_avail) == 0)) | 547 | 5.07k | return false; // start of buffer can't be end of word | 548 | 30.2k | BidiIterator t(position); | 549 | 30.2k | --t; | 550 | 30.2k | if(traits_inst.isctype(*t, m_word_mask) == false) | 551 | 17.3k | return false; // previous character wasn't a word character | 552 | | | 553 | 12.8k | if(position == last) | 554 | 7.65k | { | 555 | 7.65k | if(m_match_flags & match_not_eow) | 556 | 0 | return false; // end of buffer but not end of word | 557 | 7.65k | } | 558 | 5.17k | else | 559 | 5.17k | { | 560 | | // otherwise inside buffer: | 561 | 5.17k | if(traits_inst.isctype(*position, m_word_mask)) | 562 | 4.77k | return false; // next character is a word character | 563 | 5.17k | } | 564 | 8.05k | pstate = pstate->next.p; | 565 | 8.05k | return true; // if we fall through to here then we've succeeded | 566 | 12.8k | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_word_end() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_word_end() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_word_end() |
567 | | |
568 | | template <class BidiIterator, class Allocator, class traits> |
569 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_buffer_start() |
570 | 26.7M | { |
571 | 26.7M | if((position != backstop) || (m_match_flags & match_not_bob)) |
572 | 5.67M | return false; |
573 | | // OK match: |
574 | 21.0M | pstate = pstate->next.p; |
575 | 21.0M | return true; |
576 | 26.7M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_buffer_start() Line | Count | Source | 570 | 26.7M | { | 571 | 26.7M | if((position != backstop) || (m_match_flags & match_not_bob)) | 572 | 5.67M | return false; | 573 | | // OK match: | 574 | 21.0M | pstate = pstate->next.p; | 575 | 21.0M | return true; | 576 | 26.7M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_buffer_start() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_buffer_start() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_buffer_start() |
577 | | |
578 | | template <class BidiIterator, class Allocator, class traits> |
579 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_buffer_end() |
580 | 387k | { |
581 | 387k | if((position != last) || (m_match_flags & match_not_eob)) |
582 | 20.9k | return false; |
583 | | // OK match: |
584 | 366k | pstate = pstate->next.p; |
585 | 366k | return true; |
586 | 387k | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_buffer_end() Line | Count | Source | 580 | 387k | { | 581 | 387k | if((position != last) || (m_match_flags & match_not_eob)) | 582 | 20.9k | return false; | 583 | | // OK match: | 584 | 366k | pstate = pstate->next.p; | 585 | 366k | return true; | 586 | 387k | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_buffer_end() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_buffer_end() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_buffer_end() |
587 | | |
588 | | template <class BidiIterator, class Allocator, class traits> |
589 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_backref() |
590 | 7.56M | { |
591 | | // |
592 | | // Compare with what we previously matched. |
593 | | // Note that this succeeds if the backref did not partisipate |
594 | | // in the match, this is in line with ECMAScript, but not Perl |
595 | | // or PCRE. |
596 | | // |
597 | 7.56M | int index = static_cast<const re_brace*>(pstate)->index; |
598 | 7.56M | if(index >= hash_value_mask) |
599 | 2.36M | { |
600 | 2.36M | named_subexpressions::range_type r = re.get_data().equal_range(index); |
601 | 2.36M | BOOST_REGEX_ASSERT(r.first != r.second); |
602 | 2.36M | do |
603 | 2.63M | { |
604 | 2.63M | index = r.first->index; |
605 | 2.63M | ++r.first; |
606 | 2.63M | }while((r.first != r.second) && ((*m_presult)[index].matched != true)); |
607 | 2.36M | } |
608 | | |
609 | 7.56M | if((m_match_flags & match_perl) && !(*m_presult)[index].matched) |
610 | 1.31M | return false; |
611 | | |
612 | 6.24M | BidiIterator i = (*m_presult)[index].first; |
613 | 6.24M | BidiIterator j = (*m_presult)[index].second; |
614 | 7.32M | while(i != j) |
615 | 2.00M | { |
616 | 2.00M | if((position == last) || (traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase))) |
617 | 925k | return false; |
618 | 1.08M | ++i; |
619 | 1.08M | ++position; |
620 | 1.08M | } |
621 | 5.32M | pstate = pstate->next.p; |
622 | 5.32M | return true; |
623 | 6.24M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_backref() Line | Count | Source | 590 | 7.56M | { | 591 | | // | 592 | | // Compare with what we previously matched. | 593 | | // Note that this succeeds if the backref did not partisipate | 594 | | // in the match, this is in line with ECMAScript, but not Perl | 595 | | // or PCRE. | 596 | | // | 597 | 7.56M | int index = static_cast<const re_brace*>(pstate)->index; | 598 | 7.56M | if(index >= hash_value_mask) | 599 | 2.36M | { | 600 | 2.36M | named_subexpressions::range_type r = re.get_data().equal_range(index); | 601 | 2.36M | BOOST_REGEX_ASSERT(r.first != r.second); | 602 | 2.36M | do | 603 | 2.63M | { | 604 | 2.63M | index = r.first->index; | 605 | 2.63M | ++r.first; | 606 | 2.63M | }while((r.first != r.second) && ((*m_presult)[index].matched != true)); | 607 | 2.36M | } | 608 | | | 609 | 7.56M | if((m_match_flags & match_perl) && !(*m_presult)[index].matched) | 610 | 1.31M | return false; | 611 | | | 612 | 6.24M | BidiIterator i = (*m_presult)[index].first; | 613 | 6.24M | BidiIterator j = (*m_presult)[index].second; | 614 | 7.32M | while(i != j) | 615 | 2.00M | { | 616 | 2.00M | if((position == last) || (traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase))) | 617 | 925k | return false; | 618 | 1.08M | ++i; | 619 | 1.08M | ++position; | 620 | 1.08M | } | 621 | 5.32M | pstate = pstate->next.p; | 622 | 5.32M | return true; | 623 | 6.24M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_backref() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_backref() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_backref() |
624 | | |
625 | | template <class BidiIterator, class Allocator, class traits> |
626 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set() |
627 | 2.09M | { |
628 | 2.09M | typedef typename traits::char_class_type char_class_type; |
629 | | // let the traits class do the work: |
630 | 2.09M | if(position == last) |
631 | 56.8k | return false; |
632 | 2.03M | BidiIterator t = re_is_set_member(position, last, static_cast<const re_set_long<char_class_type>*>(pstate), re.get_data(), icase); |
633 | 2.03M | if(t != position) |
634 | 681k | { |
635 | 681k | pstate = pstate->next.p; |
636 | 681k | position = t; |
637 | 681k | return true; |
638 | 681k | } |
639 | 1.35M | return false; |
640 | 2.03M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_long_set() Line | Count | Source | 627 | 2.09M | { | 628 | 2.09M | typedef typename traits::char_class_type char_class_type; | 629 | | // let the traits class do the work: | 630 | 2.09M | if(position == last) | 631 | 56.8k | return false; | 632 | 2.03M | BidiIterator t = re_is_set_member(position, last, static_cast<const re_set_long<char_class_type>*>(pstate), re.get_data(), icase); | 633 | 2.03M | if(t != position) | 634 | 681k | { | 635 | 681k | pstate = pstate->next.p; | 636 | 681k | position = t; | 637 | 681k | return true; | 638 | 681k | } | 639 | 1.35M | return false; | 640 | 2.03M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_long_set() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_long_set() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_long_set() |
641 | | |
642 | | template <class BidiIterator, class Allocator, class traits> |
643 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_set() |
644 | 82.2M | { |
645 | 82.2M | if(position == last) |
646 | 121k | return false; |
647 | 82.1M | if(static_cast<const re_set*>(pstate)->_map[static_cast<unsigned char>(traits_inst.translate(*position, icase))]) |
648 | 77.7M | { |
649 | 77.7M | pstate = pstate->next.p; |
650 | 77.7M | ++position; |
651 | 77.7M | return true; |
652 | 77.7M | } |
653 | 4.37M | return false; |
654 | 82.1M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_set() Line | Count | Source | 644 | 82.2M | { | 645 | 82.2M | if(position == last) | 646 | 121k | return false; | 647 | 82.1M | if(static_cast<const re_set*>(pstate)->_map[static_cast<unsigned char>(traits_inst.translate(*position, icase))]) | 648 | 77.7M | { | 649 | 77.7M | pstate = pstate->next.p; | 650 | 77.7M | ++position; | 651 | 77.7M | return true; | 652 | 77.7M | } | 653 | 4.37M | return false; | 654 | 82.1M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_set() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_set() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_set() |
655 | | |
656 | | template <class BidiIterator, class Allocator, class traits> |
657 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_jump() |
658 | 326M | { |
659 | 326M | pstate = static_cast<const re_jump*>(pstate)->alt.p; |
660 | 326M | return true; |
661 | 326M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_jump() Line | Count | Source | 658 | 326M | { | 659 | 326M | pstate = static_cast<const re_jump*>(pstate)->alt.p; | 660 | 326M | return true; | 661 | 326M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_jump() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_jump() boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_jump() Line | Count | Source | 658 | 54.1k | { | 659 | 54.1k | pstate = static_cast<const re_jump*>(pstate)->alt.p; | 660 | 54.1k | return true; | 661 | 54.1k | } |
|
662 | | |
663 | | template <class BidiIterator, class Allocator, class traits> |
664 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_combining() |
665 | 7.89M | { |
666 | 7.89M | if(position == last) |
667 | 3.05M | return false; |
668 | 4.84M | if(is_combining(traits_inst.translate(*position, icase))) |
669 | 0 | return false; |
670 | 4.84M | ++position; |
671 | 4.84M | while((position != last) && is_combining(traits_inst.translate(*position, icase))) |
672 | 0 | ++position; |
673 | 4.84M | pstate = pstate->next.p; |
674 | 4.84M | return true; |
675 | 4.84M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_combining() Line | Count | Source | 665 | 7.89M | { | 666 | 7.89M | if(position == last) | 667 | 3.05M | return false; | 668 | 4.84M | if(is_combining(traits_inst.translate(*position, icase))) | 669 | 0 | return false; | 670 | 4.84M | ++position; | 671 | 4.84M | while((position != last) && is_combining(traits_inst.translate(*position, icase))) | 672 | 0 | ++position; | 673 | 4.84M | pstate = pstate->next.p; | 674 | 4.84M | return true; | 675 | 4.84M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_combining() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_combining() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_combining() |
676 | | |
677 | | template <class BidiIterator, class Allocator, class traits> |
678 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_soft_buffer_end() |
679 | 446k | { |
680 | 446k | if(m_match_flags & match_not_eob) |
681 | 0 | return false; |
682 | 446k | BidiIterator p(position); |
683 | 447k | while((p != last) && is_separator(traits_inst.translate(*p, icase)))++p; |
684 | 446k | if(p != last) |
685 | 5.66k | return false; |
686 | 440k | pstate = pstate->next.p; |
687 | 440k | return true; |
688 | 446k | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_soft_buffer_end() Line | Count | Source | 679 | 446k | { | 680 | 446k | if(m_match_flags & match_not_eob) | 681 | 0 | return false; | 682 | 446k | BidiIterator p(position); | 683 | 447k | while((p != last) && is_separator(traits_inst.translate(*p, icase)))++p; | 684 | 446k | if(p != last) | 685 | 5.66k | return false; | 686 | 440k | pstate = pstate->next.p; | 687 | 440k | return true; | 688 | 446k | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_soft_buffer_end() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_soft_buffer_end() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_soft_buffer_end() |
689 | | |
690 | | template <class BidiIterator, class Allocator, class traits> |
691 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_restart_continue() |
692 | 2.74k | { |
693 | 2.74k | if(position == search_base) |
694 | 2.00k | { |
695 | 2.00k | pstate = pstate->next.p; |
696 | 2.00k | return true; |
697 | 2.00k | } |
698 | 738 | return false; |
699 | 2.74k | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_restart_continue() Line | Count | Source | 692 | 2.74k | { | 693 | 2.74k | if(position == search_base) | 694 | 2.00k | { | 695 | 2.00k | pstate = pstate->next.p; | 696 | 2.00k | return true; | 697 | 2.00k | } | 698 | 738 | return false; | 699 | 2.74k | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_restart_continue() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_restart_continue() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_restart_continue() |
700 | | |
701 | | template <class BidiIterator, class Allocator, class traits> |
702 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_backstep() |
703 | 8.57M | { |
704 | | #ifdef BOOST_REGEX_MSVC |
705 | | #pragma warning(push) |
706 | | #pragma warning(disable:4127) |
707 | | #endif |
708 | 8.57M | if( ::boost::is_random_access_iterator<BidiIterator>::value) |
709 | 8.57M | { |
710 | 8.57M | std::ptrdiff_t maxlen = std::distance(backstop, position); |
711 | 8.57M | if(maxlen < static_cast<const re_brace*>(pstate)->index) |
712 | 66.6k | return false; |
713 | 8.51M | std::advance(position, -static_cast<const re_brace*>(pstate)->index); |
714 | 8.51M | } |
715 | 0 | else |
716 | 0 | { |
717 | 0 | int c = static_cast<const re_brace*>(pstate)->index; |
718 | 0 | while(c--) |
719 | 0 | { |
720 | 0 | if(position == backstop) |
721 | 0 | return false; |
722 | 0 | --position; |
723 | 0 | } |
724 | 0 | } |
725 | 8.51M | pstate = pstate->next.p; |
726 | 8.51M | return true; |
727 | | #ifdef BOOST_REGEX_MSVC |
728 | | #pragma warning(pop) |
729 | | #endif |
730 | 8.57M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_backstep() Line | Count | Source | 703 | 8.57M | { | 704 | | #ifdef BOOST_REGEX_MSVC | 705 | | #pragma warning(push) | 706 | | #pragma warning(disable:4127) | 707 | | #endif | 708 | 8.57M | if( ::boost::is_random_access_iterator<BidiIterator>::value) | 709 | 8.57M | { | 710 | 8.57M | std::ptrdiff_t maxlen = std::distance(backstop, position); | 711 | 8.57M | if(maxlen < static_cast<const re_brace*>(pstate)->index) | 712 | 66.6k | return false; | 713 | 8.51M | std::advance(position, -static_cast<const re_brace*>(pstate)->index); | 714 | 8.51M | } | 715 | 0 | else | 716 | 0 | { | 717 | 0 | int c = static_cast<const re_brace*>(pstate)->index; | 718 | 0 | while(c--) | 719 | 0 | { | 720 | 0 | if(position == backstop) | 721 | 0 | return false; | 722 | 0 | --position; | 723 | 0 | } | 724 | 0 | } | 725 | 8.51M | pstate = pstate->next.p; | 726 | 8.51M | return true; | 727 | | #ifdef BOOST_REGEX_MSVC | 728 | | #pragma warning(pop) | 729 | | #endif | 730 | 8.57M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_backstep() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_backstep() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_backstep() |
731 | | |
732 | | template <class BidiIterator, class Allocator, class traits> |
733 | | inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref() |
734 | 1.11M | { |
735 | | // return true if marked sub-expression N has been matched: |
736 | 1.11M | int index = static_cast<const re_brace*>(pstate)->index; |
737 | 1.11M | bool result = false; |
738 | 1.11M | if(index == 9999) |
739 | 2.43k | { |
740 | | // Magic value for a (DEFINE) block: |
741 | 2.43k | return false; |
742 | 2.43k | } |
743 | 1.11M | else if(index > 0) |
744 | 130k | { |
745 | | // Have we matched subexpression "index"? |
746 | | // Check if index is a hash value: |
747 | 130k | if(index >= hash_value_mask) |
748 | 83.3k | { |
749 | 83.3k | named_subexpressions::range_type r = re.get_data().equal_range(index); |
750 | 300k | while(r.first != r.second) |
751 | 221k | { |
752 | 221k | if((*m_presult)[r.first->index].matched) |
753 | 4.37k | { |
754 | 4.37k | result = true; |
755 | 4.37k | break; |
756 | 4.37k | } |
757 | 217k | ++r.first; |
758 | 217k | } |
759 | 83.3k | } |
760 | 47.1k | else |
761 | 47.1k | { |
762 | 47.1k | result = (*m_presult)[index].matched; |
763 | 47.1k | } |
764 | 130k | pstate = pstate->next.p; |
765 | 130k | } |
766 | 981k | else |
767 | 981k | { |
768 | | // Have we recursed into subexpression "index"? |
769 | | // If index == 0 then check for any recursion at all, otherwise for recursion to -index-1. |
770 | 981k | int idx = -(index+1); |
771 | 981k | if(idx >= hash_value_mask) |
772 | 785k | { |
773 | 785k | named_subexpressions::range_type r = re.get_data().equal_range(idx); |
774 | 785k | int stack_index = recursion_stack.empty() ? -1 : recursion_stack.back().idx; |
775 | 3.30M | while(r.first != r.second) |
776 | 2.52M | { |
777 | 2.52M | result |= (stack_index == r.first->index); |
778 | 2.52M | if(result)break; |
779 | 2.51M | ++r.first; |
780 | 2.51M | } |
781 | 785k | } |
782 | 195k | else |
783 | 195k | { |
784 | 195k | result = !recursion_stack.empty() && ((recursion_stack.back().idx == idx) || (index == 0)); |
785 | 195k | } |
786 | 981k | pstate = pstate->next.p; |
787 | 981k | } |
788 | 1.11M | return result; |
789 | 1.11M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_assert_backref() Line | Count | Source | 734 | 1.11M | { | 735 | | // return true if marked sub-expression N has been matched: | 736 | 1.11M | int index = static_cast<const re_brace*>(pstate)->index; | 737 | 1.11M | bool result = false; | 738 | 1.11M | if(index == 9999) | 739 | 2.43k | { | 740 | | // Magic value for a (DEFINE) block: | 741 | 2.43k | return false; | 742 | 2.43k | } | 743 | 1.11M | else if(index > 0) | 744 | 130k | { | 745 | | // Have we matched subexpression "index"? | 746 | | // Check if index is a hash value: | 747 | 130k | if(index >= hash_value_mask) | 748 | 83.3k | { | 749 | 83.3k | named_subexpressions::range_type r = re.get_data().equal_range(index); | 750 | 300k | while(r.first != r.second) | 751 | 221k | { | 752 | 221k | if((*m_presult)[r.first->index].matched) | 753 | 4.37k | { | 754 | 4.37k | result = true; | 755 | 4.37k | break; | 756 | 4.37k | } | 757 | 217k | ++r.first; | 758 | 217k | } | 759 | 83.3k | } | 760 | 47.1k | else | 761 | 47.1k | { | 762 | 47.1k | result = (*m_presult)[index].matched; | 763 | 47.1k | } | 764 | 130k | pstate = pstate->next.p; | 765 | 130k | } | 766 | 981k | else | 767 | 981k | { | 768 | | // Have we recursed into subexpression "index"? | 769 | | // If index == 0 then check for any recursion at all, otherwise for recursion to -index-1. | 770 | 981k | int idx = -(index+1); | 771 | 981k | if(idx >= hash_value_mask) | 772 | 785k | { | 773 | 785k | named_subexpressions::range_type r = re.get_data().equal_range(idx); | 774 | 785k | int stack_index = recursion_stack.empty() ? -1 : recursion_stack.back().idx; | 775 | 3.30M | while(r.first != r.second) | 776 | 2.52M | { | 777 | 2.52M | result |= (stack_index == r.first->index); | 778 | 2.52M | if(result)break; | 779 | 2.51M | ++r.first; | 780 | 2.51M | } | 781 | 785k | } | 782 | 195k | else | 783 | 195k | { | 784 | 195k | result = !recursion_stack.empty() && ((recursion_stack.back().idx == idx) || (index == 0)); | 785 | 195k | } | 786 | 981k | pstate = pstate->next.p; | 787 | 981k | } | 788 | 1.11M | return result; | 789 | 1.11M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_assert_backref() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_assert_backref() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_assert_backref() |
790 | | |
791 | | template <class BidiIterator, class Allocator, class traits> |
792 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_fail() |
793 | 942 | { |
794 | | // Just force a backtrack: |
795 | 942 | return false; |
796 | 942 | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_fail() Line | Count | Source | 793 | 942 | { | 794 | | // Just force a backtrack: | 795 | 942 | return false; | 796 | 942 | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_fail() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_fail() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_fail() |
797 | | |
798 | | template <class BidiIterator, class Allocator, class traits> |
799 | | bool perl_matcher<BidiIterator, Allocator, traits>::match_accept() |
800 | 1.49M | { |
801 | 1.49M | if(!recursion_stack.empty()) |
802 | 363k | { |
803 | 363k | return skip_until_paren(recursion_stack.back().idx); |
804 | 363k | } |
805 | 1.12M | else |
806 | 1.12M | { |
807 | 1.12M | return skip_until_paren(INT_MAX); |
808 | 1.12M | } |
809 | 1.49M | } boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_accept() Line | Count | Source | 800 | 1.49M | { | 801 | 1.49M | if(!recursion_stack.empty()) | 802 | 363k | { | 803 | 363k | return skip_until_paren(recursion_stack.back().idx); | 804 | 363k | } | 805 | 1.12M | else | 806 | 1.12M | { | 807 | | return skip_until_paren(INT_MAX); | 808 | 1.12M | } | 809 | 1.49M | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::match_accept() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::match_accept() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_accept() |
810 | | |
811 | | template <class BidiIterator, class Allocator, class traits> |
812 | | bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_any() |
813 | 55.9k | { |
814 | | #ifdef BOOST_REGEX_MSVC |
815 | | #pragma warning(push) |
816 | | #pragma warning(disable:4127) |
817 | | #endif |
818 | 55.9k | const unsigned char* _map = re.get_map(); |
819 | 55.9k | while(true) |
820 | 55.9k | { |
821 | | // skip everything we can't match: |
822 | 1.45M | while((position != last) && !can_start(*position, _map, (unsigned char)mask_any) ) |
823 | 1.39M | ++position; |
824 | 55.9k | if(position == last) |
825 | 1.74k | { |
826 | | // run out of characters, try a null match if possible: |
827 | 1.74k | if(re.can_be_null()) |
828 | 0 | return match_prefix(); |
829 | 1.74k | break; |
830 | 1.74k | } |
831 | | // now try and obtain a match: |
832 | 54.1k | if(match_prefix()) |
833 | 54.1k | return true; |
834 | 0 | if(position == last) |
835 | 0 | return false; |
836 | 0 | ++position; |
837 | 0 | } |
838 | 1.74k | return false; |
839 | | #ifdef BOOST_REGEX_MSVC |
840 | | #pragma warning(pop) |
841 | | #endif |
842 | 55.9k | } Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::find_restart_any() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::find_restart_any() boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_any() Line | Count | Source | 813 | 55.9k | { | 814 | | #ifdef BOOST_REGEX_MSVC | 815 | | #pragma warning(push) | 816 | | #pragma warning(disable:4127) | 817 | | #endif | 818 | 55.9k | const unsigned char* _map = re.get_map(); | 819 | 55.9k | while(true) | 820 | 55.9k | { | 821 | | // skip everything we can't match: | 822 | 1.45M | while((position != last) && !can_start(*position, _map, (unsigned char)mask_any) ) | 823 | 1.39M | ++position; | 824 | 55.9k | if(position == last) | 825 | 1.74k | { | 826 | | // run out of characters, try a null match if possible: | 827 | 1.74k | if(re.can_be_null()) | 828 | 0 | return match_prefix(); | 829 | 1.74k | break; | 830 | 1.74k | } | 831 | | // now try and obtain a match: | 832 | 54.1k | if(match_prefix()) | 833 | 54.1k | return true; | 834 | 0 | if(position == last) | 835 | 0 | return false; | 836 | 0 | ++position; | 837 | 0 | } | 838 | 1.74k | return false; | 839 | | #ifdef BOOST_REGEX_MSVC | 840 | | #pragma warning(pop) | 841 | | #endif | 842 | 55.9k | } |
Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_any() |
843 | | |
844 | | template <class BidiIterator, class Allocator, class traits> |
845 | | bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_word() |
846 | 0 | { |
847 | | #ifdef BOOST_REGEX_MSVC |
848 | | #pragma warning(push) |
849 | | #pragma warning(disable:4127) |
850 | | #endif |
851 | | // do search optimised for word starts: |
852 | 0 | const unsigned char* _map = re.get_map(); |
853 | 0 | if((m_match_flags & match_prev_avail) || (position != base)) |
854 | 0 | --position; |
855 | 0 | else if(match_prefix()) |
856 | 0 | return true; |
857 | 0 | do |
858 | 0 | { |
859 | 0 | while((position != last) && traits_inst.isctype(*position, m_word_mask)) |
860 | 0 | ++position; |
861 | 0 | while((position != last) && !traits_inst.isctype(*position, m_word_mask)) |
862 | 0 | ++position; |
863 | 0 | if(position == last) |
864 | 0 | break; |
865 | | |
866 | 0 | if(can_start(*position, _map, (unsigned char)mask_any) ) |
867 | 0 | { |
868 | 0 | if(match_prefix()) |
869 | 0 | return true; |
870 | 0 | } |
871 | 0 | if(position == last) |
872 | 0 | break; |
873 | 0 | } while(true); |
874 | 0 | return false; |
875 | | #ifdef BOOST_REGEX_MSVC |
876 | | #pragma warning(pop) |
877 | | #endif |
878 | 0 | } Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::find_restart_word() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::find_restart_word() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_word() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_word() |
879 | | |
880 | | template <class BidiIterator, class Allocator, class traits> |
881 | | bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_line() |
882 | 0 | { |
883 | | // do search optimised for line starts: |
884 | 0 | const unsigned char* _map = re.get_map(); |
885 | 0 | if(match_prefix()) |
886 | 0 | return true; |
887 | 0 | while(position != last) |
888 | 0 | { |
889 | 0 | while((position != last) && !is_separator(*position)) |
890 | 0 | ++position; |
891 | 0 | if(position == last) |
892 | 0 | return false; |
893 | 0 | ++position; |
894 | 0 | if(position == last) |
895 | 0 | { |
896 | 0 | if(re.can_be_null() && match_prefix()) |
897 | 0 | return true; |
898 | 0 | return false; |
899 | 0 | } |
900 | | |
901 | 0 | if( can_start(*position, _map, (unsigned char)mask_any) ) |
902 | 0 | { |
903 | 0 | if(match_prefix()) |
904 | 0 | return true; |
905 | 0 | } |
906 | 0 | if(position == last) |
907 | 0 | return false; |
908 | | //++position; |
909 | 0 | } |
910 | 0 | return false; |
911 | 0 | } Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::find_restart_line() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::find_restart_line() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_line() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_line() |
912 | | |
913 | | template <class BidiIterator, class Allocator, class traits> |
914 | | bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_buf() |
915 | 20.9M | { |
916 | 20.9M | if((position == base) && ((m_match_flags & match_not_bob) == 0)) |
917 | 20.9M | return match_prefix(); |
918 | 0 | return false; |
919 | 20.9M | } Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::find_restart_buf() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::find_restart_buf() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_buf() boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_buf() Line | Count | Source | 915 | 20.9M | { | 916 | 20.9M | if((position == base) && ((m_match_flags & match_not_bob) == 0)) | 917 | 20.9M | return match_prefix(); | 918 | 0 | return false; | 919 | 20.9M | } |
|
920 | | |
921 | | template <class BidiIterator, class Allocator, class traits> |
922 | | bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit() |
923 | 0 | { |
924 | 0 | return false; |
925 | 0 | } Unexecuted instantiation: boost::re_detail_600::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::c_regex_traits<char> >::find_restart_lit() Unexecuted instantiation: boost::re_detail_600::perl_matcher<wchar_t const*, std::__1::allocator<boost::sub_match<wchar_t const*> >, boost::c_regex_traits<wchar_t> >::find_restart_lit() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_lit() Unexecuted instantiation: boost::re_detail_600::perl_matcher<std::__1::__wrap_iter<char const*>, std::__1::allocator<boost::sub_match<std::__1::__wrap_iter<char const*> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find_restart_lit() |
926 | | |
927 | | } // namespace BOOST_REGEX_DETAIL_NS |
928 | | |
929 | | } // namespace boost |
930 | | |
931 | | #ifdef BOOST_REGEX_MSVC |
932 | | # pragma warning(pop) |
933 | | #endif |
934 | | |
935 | | #endif |
936 | | |