| 1 | /* |
| 2 | * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #include "config.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/config.h`/ |
| 27 | #include "RegexCompiler.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexCompiler.h`/ |
| 28 | |
| 29 | #include "RegexInterpreter.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexInterpreter.h`/ |
| 30 | #include "RegexPattern.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexPattern.h`/ |
| 31 | #include <wtf/Vector.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h`/ |
| 32 | |
| 33 | #if ENABLEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:57:9`!(YARR) |
| 34 | |
| 35 | using namespace WTFcxx . . $ `<built-in>:467:9`!; |
| 36 | |
| 37 | namespace JSCcxx . . $ `<built-in>:463:9`! { namespace Yarrcxx . . $ QTJSC/Yarr/ { |
| 38 | |
| 39 | class CharacterClassConstructorcxx . . $ QTJSC/Yarr/CharacterClassConstructor# { |
| 40 | public: |
| 41 | CharacterClassConstructorcxx . . $ QTJSC/Yarr/CharacterClassConstructor#CharacterClassConstructor(b45ddcbc8423892c).(bool isCaseInsensitive = false) |
| 42 | : m_isCaseInsensitivecxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_isCaseInsensitive.(isCaseInsensitive) |
| 43 | { |
| 44 | } |
| 45 | |
| 46 | void resetcxx . . $ QTJSC/Yarr/CharacterClassConstructor#reset(49f6e7a06ebc5aa8).() |
| 47 | { |
| 48 | m_matches.clear(); |
| 49 | m_ranges.clear(); |
| 50 | m_matchesUnicode.clear(); |
| 51 | m_rangesUnicode.clear(); |
| 52 | } |
| 53 | |
| 54 | void appendcxx . . $ QTJSC/Yarr/CharacterClassConstructor#append(d02cc4268f2c09ec).(const CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* other) |
| 55 | { |
| 56 | for (size_t i = 0; i < other->m_matches.size(); ++i) |
| 57 | addSorted(m_matches, other->m_matches[i]); |
| 58 | for (size_t i = 0; i < other->m_ranges.size(); ++i) |
| 59 | addSortedRange(m_ranges, other->m_ranges[i].begin, other->m_ranges[i].end); |
| 60 | for (size_t i = 0; i < other->m_matchesUnicode.size(); ++i) |
| 61 | addSorted(m_matchesUnicode, other->m_matchesUnicode[i]); |
| 62 | for (size_t i = 0; i < other->m_rangesUnicode.size(); ++i) |
| 63 | addSortedRange(m_rangesUnicode, other->m_rangesUnicode[i].begin, other->m_rangesUnicode[i].end); |
| 64 | } |
| 65 | |
| 66 | void putCharcxx . . $ QTJSC/Yarr/CharacterClassConstructor#putChar(ed53e3bbd3fa2f69).(UCharcxx . . $ UChar# ch) |
| 67 | { |
| 68 | if (ch <= 0x7f) { |
| 69 | if (m_isCaseInsensitivecxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_isCaseInsensitive. && isASCIIAlphacxx . . $ isASCIIAlpha(3c978dac0e5ee2ad).(ch)) { |
| 70 | addSorted(m_matches, toASCIIUpper(ch)); |
| 71 | addSorted(m_matches, toASCIILower(ch)); |
| 72 | } else |
| 73 | addSorted(m_matches, ch); |
| 74 | } else { |
| 75 | UCharcxx . . $ UChar# upper, lower; |
| 76 | if (m_isCaseInsensitivecxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_isCaseInsensitive. && ((upper = Unicodecxx . . $ QTWTF/Unicode/::toUppercxx . . $ QTWTF/Unicode/toUpper(7864480464b09eea).(ch)) != (lower = Unicodecxx . . $ QTWTF/Unicode/::toLowercxx . . $ QTWTF/Unicode/toLower(7864480464b09eea).(ch)))) { |
| 77 | addSorted(m_matchesUnicode, upper); |
| 78 | addSorted(m_matchesUnicode, lower); |
| 79 | } else |
| 80 | addSorted(m_matchesUnicode, ch); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // returns true if this character has another case, and 'ch' is the upper case form. |
| 85 | static inline bool isUnicodeUppercxx . . $ QTJSC/Yarr/CharacterClassConstructor#isUnicodeUpper(3c978dac0e5ee2ad).(UCharcxx . . $ UChar# ch) |
| 86 | { |
| 87 | return ch != Unicodecxx . . $ QTWTF/Unicode/::toLowercxx . . $ QTWTF/Unicode/toLower(7864480464b09eea).(ch); |
| 88 | } |
| 89 | |
| 90 | // returns true if this character has another case, and 'ch' is the lower case form. |
| 91 | static inline bool isUnicodeLowercxx . . $ QTJSC/Yarr/CharacterClassConstructor#isUnicodeLower(3c978dac0e5ee2ad).(UCharcxx . . $ UChar# ch) |
| 92 | { |
| 93 | return ch != Unicodecxx . . $ QTWTF/Unicode/::toUppercxx . . $ QTWTF/Unicode/toUpper(7864480464b09eea).(ch); |
| 94 | } |
| 95 | |
| 96 | void putRangecxx . . $ QTJSC/Yarr/CharacterClassConstructor#putRange(161476d40f03fa8c).(UCharcxx . . $ UChar# lo, UCharcxx . . $ UChar# hi) |
| 97 | { |
| 98 | if (lo <= 0x7f) { |
| 99 | char asciiLo = lo; |
| 100 | char asciiHi = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(hi, (UCharcxx . . $ UChar#)0x7f); |
| 101 | addSortedRange(m_ranges, lo, asciiHi); |
| 102 | |
| 103 | if (m_isCaseInsensitivecxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_isCaseInsensitive.) { |
| 104 | if ((asciiLo <= 'Z') && (asciiHi >= 'A')) |
| 105 | addSortedRange(m_ranges, std::max(asciiLo, 'A')+('a'-'A'), std::min(asciiHi, 'Z')+('a'-'A')); |
| 106 | if ((asciiLo <= 'z') && (asciiHi >= 'a')) |
| 107 | addSortedRange(m_ranges, std::max(asciiLo, 'a')+('A'-'a'), std::min(asciiHi, 'z')+('A'-'a')); |
| 108 | } |
| 109 | } |
| 110 | if (hi >= 0x80) { |
| 111 | uint32_tcxx . . $ uint32_t# unicodeCurr = stdcxx . . $ std/::maxcxx . . $ std/max(2a338fce5842aa6a).(lo, (UCharcxx . . $ UChar#)0x80); |
| 112 | addSortedRange(m_rangesUnicode, unicodeCurr, hi); |
| 113 | |
| 114 | if (m_isCaseInsensitivecxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_isCaseInsensitive.) { |
| 115 | while (unicodeCurr <= hi) { |
| 116 | // If the upper bound of the range (hi) is 0xffff, the increments to |
| 117 | // unicodeCurr in this loop may take it to 0x10000. This is fine |
| 118 | // (if so we won't re-enter the loop, since the loop condition above |
| 119 | // will definitely fail) - but this does mean we cannot use a UChar |
| 120 | // to represent unicodeCurr, we must use a 32-bit value instead. |
| 121 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(unicodeCurr <= 0xffff); |
| 122 | |
| 123 | if (isUnicodeUppercxx . . $ QTJSC/Yarr/CharacterClassConstructor#isUnicodeUpper(3c978dac0e5ee2ad).(unicodeCurr)) { |
| 124 | UCharcxx . . $ UChar# lowerCaseRangeBegin = Unicodecxx . . $ QTWTF/Unicode/::toLowercxx . . $ QTWTF/Unicode/toLower(7864480464b09eea).(unicodeCurr); |
| 125 | UCharcxx . . $ UChar# lowerCaseRangeEnd = lowerCaseRangeBegin; |
| 126 | while ((++unicodeCurr <= hi) && isUnicodeUppercxx . . $ QTJSC/Yarr/CharacterClassConstructor#isUnicodeUpper(3c978dac0e5ee2ad).(unicodeCurr) && (Unicodecxx . . $ QTWTF/Unicode/::toLowercxx . . $ QTWTF/Unicode/toLower(7864480464b09eea).(unicodeCurr) == (lowerCaseRangeEnd + 1))) |
| 127 | lowerCaseRangeEnd++; |
| 128 | addSortedRange(m_rangesUnicode, lowerCaseRangeBegin, lowerCaseRangeEnd); |
| 129 | } else if (isUnicodeLowercxx . . $ QTJSC/Yarr/CharacterClassConstructor#isUnicodeLower(3c978dac0e5ee2ad).(unicodeCurr)) { |
| 130 | UCharcxx . . $ UChar# upperCaseRangeBegin = Unicodecxx . . $ QTWTF/Unicode/::toUppercxx . . $ QTWTF/Unicode/toUpper(7864480464b09eea).(unicodeCurr); |
| 131 | UCharcxx . . $ UChar# upperCaseRangeEnd = upperCaseRangeBegin; |
| 132 | while ((++unicodeCurr <= hi) && isUnicodeLowercxx . . $ QTJSC/Yarr/CharacterClassConstructor#isUnicodeLower(3c978dac0e5ee2ad).(unicodeCurr) && (Unicodecxx . . $ QTWTF/Unicode/::toUppercxx . . $ QTWTF/Unicode/toUpper(7864480464b09eea).(unicodeCurr) == (upperCaseRangeEnd + 1))) |
| 133 | upperCaseRangeEnd++; |
| 134 | addSortedRange(m_rangesUnicode, upperCaseRangeBegin, upperCaseRangeEnd); |
| 135 | } else |
| 136 | ++unicodeCurr; |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* charClasscxx . . $ QTJSC/Yarr/CharacterClassConstructor#charClass(fd2c3252af01ae8b).() |
| 143 | { |
| 144 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* characterClass = new CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#(); |
| 145 | |
| 146 | characterClass->m_matches.append(m_matches); |
| 147 | characterClass->m_ranges.append(m_ranges); |
| 148 | characterClass->m_matchesUnicode.append(m_matchesUnicode); |
| 149 | characterClass->m_rangesUnicode.append(m_rangesUnicode); |
| 150 | |
| 151 | resetcxx . . $ QTJSC/Yarr/CharacterClassConstructor#reset(49f6e7a06ebc5aa8).(); |
| 152 | |
| 153 | return characterClass; |
| 154 | } |
| 155 | |
| 156 | private: |
| 157 | void addSortedcxx . . $ QTJSC/Yarr/CharacterClassConstructor#addSorted(32a53b3f1b1b305c).(Vector<UChar>& matches, UCharcxx . . $ UChar# ch) |
| 158 | { |
| 159 | unsigned pos = 0; |
| 160 | unsigned range = matches.size(); |
| 161 | |
| 162 | // binary chop, find position to insert char. |
| 163 | while (range) { |
| 164 | unsigned index = range >> 1; |
| 165 | |
| 166 | int val = matches[pos+index] - ch; |
| 167 | if (!val) |
| 168 | return; |
| 169 | else if (val > 0) |
| 170 | range = index; |
| 171 | else { |
| 172 | pos += (index+1); |
| 173 | range -= (index+1); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | if (pos ==cxx . . $ QTJSC/`operator==`(e9142ab59ce7dac8). matches.size()) |
| 178 | matches.append(ch); |
| 179 | else |
| 180 | matches.insert(pos, ch); |
| 181 | } |
| 182 | |
| 183 | void addSortedRangecxx . . $ QTJSC/Yarr/CharacterClassConstructor#addSortedRange(c159fb7de2bb19cb).(Vector<CharacterRange>& ranges, UCharcxx . . $ UChar# lo, UCharcxx . . $ UChar# hi) |
| 184 | { |
| 185 | unsigned end = ranges.size(); |
| 186 | |
| 187 | // Simple linear scan - I doubt there are that many ranges anyway... |
| 188 | // feel free to fix this with something faster (eg binary chop). |
| 189 | for (unsigned i = 0; i < end; ++i) { |
| 190 | // does the new range fall before the current position in the array |
| 191 | if (hi <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). ranges[i].begin) { |
| 192 | // optional optimization: concatenate appending ranges? - may not be worthwhile. |
| 193 | if (hi ==cxx . . $ QTJSC/`operator==`(e9142ab59ce7dac8). (ranges[i].begin - 1)) { |
| 194 | ranges[i].begin = lo; |
| 195 | return; |
| 196 | } |
| 197 | ranges.insert(i, CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(lo, hi)); |
| 198 | return; |
| 199 | } |
| 200 | // Okay, since we didn't hit the last case, the end of the new range is definitely at or after the begining |
| 201 | // If the new range start at or before the end of the last range, then the overlap (if it starts one after the |
| 202 | // end of the last range they concatenate, which is just as good. |
| 203 | if (lo <=cxx . . $ `operator<=`(8f8a8e6a6f1fc74b). (ranges[i].end +cxx . . $ operator+(f3789794639247d3). 1)) { |
| 204 | // found an intersect! we'll replace this entry in the array. |
| 205 | ranges[i].begin = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(ranges[i].begin, lo); |
| 206 | ranges[i].end = stdcxx . . $ std/::maxcxx . . $ std/max(2a338fce5842aa6a).(ranges[i].end, hi); |
| 207 | |
| 208 | // now check if the new range can subsume any subsequent ranges. |
| 209 | unsigned next = i+1; |
| 210 | // each iteration of the loop we will either remove something from the list, or break the loop. |
| 211 | while (next <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). ranges.size()) { |
| 212 | if (ranges[next].begin <=cxx . . $ `operator<=`(8f8a8e6a6f1fc74b). (ranges[i].end +cxx . . $ operator+(f3789794639247d3). 1)) { |
| 213 | // the next entry now overlaps / concatenates this one. |
| 214 | ranges[i].end = stdcxx . . $ std/::maxcxx . . $ std/max(2a338fce5842aa6a).(ranges[i].end, ranges[next].end); |
| 215 | ranges.remove(next); |
| 216 | } else |
| 217 | break; |
| 218 | } |
| 219 | |
| 220 | return; |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | // CharacterRange comes after all existing ranges. |
| 225 | ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(lo, hi)); |
| 226 | } |
| 227 | |
| 228 | bool m_isCaseInsensitivecxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_isCaseInsensitive.; |
| 229 | |
| 230 | Vector<UChar> m_matchescxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_matches.; |
| 231 | Vector<CharacterRange> m_rangescxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_ranges.; |
| 232 | Vector<UChar> m_matchesUnicodecxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_matchesUnicode.; |
| 233 | Vector<CharacterRange> m_rangesUnicodecxx . . $ QTJSC/Yarr/CharacterClassConstructor#m_rangesUnicode.; |
| 234 | }; |
| 235 | |
| 236 | |
| 237 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* newlineCreatecxx . . $ QTJSC/Yarr/newlineCreate(fd2c3252af01ae8b).() |
| 238 | { |
| 239 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* characterClass = new CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#(); |
| 240 | |
| 241 | characterClass->m_matches.append('\n'); |
| 242 | characterClass->m_matches.append('\r'); |
| 243 | characterClass->m_matchesUnicode.append(0x2028); |
| 244 | characterClass->m_matchesUnicode.append(0x2029); |
| 245 | |
| 246 | return characterClass; |
| 247 | } |
| 248 | |
| 249 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* digitsCreatecxx . . $ QTJSC/Yarr/digitsCreate(fd2c3252af01ae8b).() |
| 250 | { |
| 251 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* characterClass = new CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#(); |
| 252 | |
| 253 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('0', '9')); |
| 254 | |
| 255 | return characterClass; |
| 256 | } |
| 257 | |
| 258 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* spacesCreatecxx . . $ QTJSC/Yarr/spacesCreate(fd2c3252af01ae8b).() |
| 259 | { |
| 260 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* characterClass = new CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#(); |
| 261 | |
| 262 | characterClass->m_matches.append(' '); |
| 263 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('\t', '\r')); |
| 264 | characterClass->m_matchesUnicode.append(0x00a0); |
| 265 | characterClass->m_matchesUnicode.append(0x1680); |
| 266 | characterClass->m_matchesUnicode.append(0x180e); |
| 267 | characterClass->m_matchesUnicode.append(0x2028); |
| 268 | characterClass->m_matchesUnicode.append(0x2029); |
| 269 | characterClass->m_matchesUnicode.append(0x202f); |
| 270 | characterClass->m_matchesUnicode.append(0x205f); |
| 271 | characterClass->m_matchesUnicode.append(0x3000); |
| 272 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x2000, 0x200a)); |
| 273 | |
| 274 | return characterClass; |
| 275 | } |
| 276 | |
| 277 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* wordcharCreatecxx . . $ QTJSC/Yarr/wordcharCreate(fd2c3252af01ae8b).() |
| 278 | { |
| 279 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* characterClass = new CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#(); |
| 280 | |
| 281 | characterClass->m_matches.append('_'); |
| 282 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('0', '9')); |
| 283 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('A', 'Z')); |
| 284 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('a', 'z')); |
| 285 | |
| 286 | return characterClass; |
| 287 | } |
| 288 | |
| 289 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* nondigitsCreatecxx . . $ QTJSC/Yarr/nondigitsCreate(fd2c3252af01ae8b).() |
| 290 | { |
| 291 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* characterClass = new CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#(); |
| 292 | |
| 293 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0, '0' - 1)); |
| 294 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('9' + 1, 0x7f)); |
| 295 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x80, 0xffff)); |
| 296 | |
| 297 | return characterClass; |
| 298 | } |
| 299 | |
| 300 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* nonspacesCreatecxx . . $ QTJSC/Yarr/nonspacesCreate(fd2c3252af01ae8b).() |
| 301 | { |
| 302 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* characterClass = new CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#(); |
| 303 | |
| 304 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0, '\t' - 1)); |
| 305 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('\r' + 1, ' ' - 1)); |
| 306 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(' ' + 1, 0x7f)); |
| 307 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x0080, 0x009f)); |
| 308 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x00a1, 0x167f)); |
| 309 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x1681, 0x180d)); |
| 310 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x180f, 0x1fff)); |
| 311 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x200b, 0x2027)); |
| 312 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x202a, 0x202e)); |
| 313 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x2030, 0x205e)); |
| 314 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x2060, 0x2fff)); |
| 315 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x3001, 0xffff)); |
| 316 | |
| 317 | return characterClass; |
| 318 | } |
| 319 | |
| 320 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* nonwordcharCreatecxx . . $ QTJSC/Yarr/nonwordcharCreate(fd2c3252af01ae8b).() |
| 321 | { |
| 322 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* characterClass = new CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#(); |
| 323 | |
| 324 | characterClass->m_matches.append('`'); |
| 325 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0, '0' - 1)); |
| 326 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('9' + 1, 'A' - 1)); |
| 327 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('Z' + 1, '_' - 1)); |
| 328 | characterClass->m_ranges.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).('z' + 1, 0x7f)); |
| 329 | characterClass->m_rangesUnicode.append(CharacterRangecxx . . $ QTJSC/Yarr/CharacterRange#CharacterRange(161476d40f03fa8c).(0x80, 0xffff)); |
| 330 | |
| 331 | return characterClass; |
| 332 | } |
| 333 | |
| 334 | |
| 335 | class RegexPatternConstructorcxx . . $ QTJSC/Yarr/RegexPatternConstructor# { |
| 336 | public: |
| 337 | RegexPatternConstructorcxx . . $ QTJSC/Yarr/RegexPatternConstructor#RegexPatternConstructor(42309c613cd95058).(RegexPatterncxx . . $ QTJSC/Yarr/RegexPattern#& pattern) |
| 338 | : m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern.(pattern) |
| 339 | , m_characterClassConstructor(pattern.m_ignoreCase) |
| 340 | { |
| 341 | } |
| 342 | |
| 343 | ~cxx . . $ QTJSC/Yarr/RegexPatternConstructor#`~RegexPatternConstructor`(49f6e7a06ebc5aa8).RegexPatternConstructorcxx . . $ QTJSC/Yarr/RegexPatternConstructor#() |
| 344 | { |
| 345 | } |
| 346 | |
| 347 | void resetcxx . . $ QTJSC/Yarr/RegexPatternConstructor#reset(49f6e7a06ebc5aa8).() |
| 348 | { |
| 349 | m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..resetcxx . . $ QTJSC/Yarr/RegexPattern#reset(49f6e7a06ebc5aa8).(); |
| 350 | m_characterClassConstructor.reset(); |
| 351 | } |
| 352 | |
| 353 | void assertionBOLcxx . . $ QTJSC/Yarr/RegexPatternConstructor#assertionBOL(49f6e7a06ebc5aa8).() |
| 354 | { |
| 355 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::BOLcxx . . $ QTJSC/Yarr/PatternTerm#BOL(3eed2cd0f4bcf4e9).()); |
| 356 | } |
| 357 | void assertionEOLcxx . . $ QTJSC/Yarr/RegexPatternConstructor#assertionEOL(49f6e7a06ebc5aa8).() |
| 358 | { |
| 359 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::EOLcxx . . $ QTJSC/Yarr/PatternTerm#EOL(3eed2cd0f4bcf4e9).()); |
| 360 | } |
| 361 | void assertionWordBoundarycxx . . $ QTJSC/Yarr/RegexPatternConstructor#assertionWordBoundary(b45ddcbc8423892c).(bool invert) |
| 362 | { |
| 363 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::WordBoundarycxx . . $ QTJSC/Yarr/PatternTerm#WordBoundary(fc0d572e1b31c37).(invert)); |
| 364 | } |
| 365 | |
| 366 | void atomPatternCharactercxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomPatternCharacter(ed53e3bbd3fa2f69).(UCharcxx . . $ UChar# ch) |
| 367 | { |
| 368 | // We handle case-insensitive checking of unicode characters which do have both |
| 369 | // cases by handling them as if they were defined using a CharacterClass. |
| 370 | if (m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_ignoreCasecxx . . $ QTJSC/Yarr/RegexPattern#m_ignoreCase. && !isASCIIcxx . . $ isASCII(3c978dac0e5ee2ad).(ch) && (Unicodecxx . . $ QTWTF/Unicode/::toUppercxx . . $ QTWTF/Unicode/toUpper(7864480464b09eea).(ch) != Unicodecxx . . $ QTWTF/Unicode/::toLowercxx . . $ QTWTF/Unicode/toLower(7864480464b09eea).(ch))) { |
| 371 | atomCharacterClassBegincxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomCharacterClassBegin(b45ddcbc8423892c).(); |
| 372 | atomCharacterClassAtomcxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomCharacterClassAtom(ed53e3bbd3fa2f69).(ch); |
| 373 | atomCharacterClassEndcxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomCharacterClassEnd(49f6e7a06ebc5aa8).(); |
| 374 | } else |
| 375 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#(ch)); |
| 376 | } |
| 377 | |
| 378 | void atomBuiltInCharacterClasscxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomBuiltInCharacterClass(a31f650bd0823a02).(BuiltInCharacterClassIDcxx . . $ QTJSC/Yarr/BuiltInCharacterClassID# classID, bool invert) |
| 379 | { |
| 380 | switch (classID) { |
| 381 | case DigitClassIDcxx . . $ QTJSC/Yarr/DigitClassID.: |
| 382 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#PatternTerm(2984df8ae88d9ce2).(m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..digitsCharacterClasscxx . . $ QTJSC/Yarr/RegexPattern#digitsCharacterClass(fd2c3252af01ae8b).(), invert)); |
| 383 | break; |
| 384 | case SpaceClassIDcxx . . $ QTJSC/Yarr/SpaceClassID.: |
| 385 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#PatternTerm(2984df8ae88d9ce2).(m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..spacesCharacterClasscxx . . $ QTJSC/Yarr/RegexPattern#spacesCharacterClass(fd2c3252af01ae8b).(), invert)); |
| 386 | break; |
| 387 | case WordClassIDcxx . . $ QTJSC/Yarr/WordClassID.: |
| 388 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#PatternTerm(2984df8ae88d9ce2).(m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..wordcharCharacterClasscxx . . $ QTJSC/Yarr/RegexPattern#wordcharCharacterClass(fd2c3252af01ae8b).(), invert)); |
| 389 | break; |
| 390 | case NewlineClassIDcxx . . $ QTJSC/Yarr/NewlineClassID.: |
| 391 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#PatternTerm(2984df8ae88d9ce2).(m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..newlineCharacterClasscxx . . $ QTJSC/Yarr/RegexPattern#newlineCharacterClass(fd2c3252af01ae8b).(), invert)); |
| 392 | break; |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | void atomCharacterClassBegincxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomCharacterClassBegin(b45ddcbc8423892c).(bool invert = false) |
| 397 | { |
| 398 | m_invertCharacterClasscxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_invertCharacterClass. = invert; |
| 399 | } |
| 400 | |
| 401 | void atomCharacterClassAtomcxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomCharacterClassAtom(ed53e3bbd3fa2f69).(UCharcxx . . $ UChar# ch) |
| 402 | { |
| 403 | m_characterClassConstructor.putChar(ch); |
| 404 | } |
| 405 | |
| 406 | void atomCharacterClassRangecxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomCharacterClassRange(161476d40f03fa8c).(UCharcxx . . $ UChar# begin, UCharcxx . . $ UChar# end) |
| 407 | { |
| 408 | m_characterClassConstructor.putRange(begin, end); |
| 409 | } |
| 410 | |
| 411 | void atomCharacterClassBuiltIncxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomCharacterClassBuiltIn(a31f650bd0823a02).(BuiltInCharacterClassIDcxx . . $ QTJSC/Yarr/BuiltInCharacterClassID# classID, bool invert) |
| 412 | { |
| 413 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(classID != NewlineClassID); |
| 414 | |
| 415 | switch (classID) { |
| 416 | case DigitClassIDcxx . . $ QTJSC/Yarr/DigitClassID.: |
| 417 | m_characterClassConstructor.append(invert ? m_pattern.nondigitsCharacterClass() : m_pattern.digitsCharacterClass()); |
| 418 | break; |
| 419 | |
| 420 | case SpaceClassIDcxx . . $ QTJSC/Yarr/SpaceClassID.: |
| 421 | m_characterClassConstructor.append(invert ? m_pattern.nonspacesCharacterClass() : m_pattern.spacesCharacterClass()); |
| 422 | break; |
| 423 | |
| 424 | case WordClassIDcxx . . $ QTJSC/Yarr/WordClassID.: |
| 425 | m_characterClassConstructor.append(invert ? m_pattern.nonwordcharCharacterClass() : m_pattern.wordcharCharacterClass()); |
| 426 | break; |
| 427 | |
| 428 | default: |
| 429 | ASSERT_NOT_REACHEDcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:185:9`!(); |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | void atomCharacterClassEndcxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomCharacterClassEnd(49f6e7a06ebc5aa8).() |
| 434 | { |
| 435 | CharacterClasscxx . . $ QTJSC/Yarr/CharacterClass#* newCharacterClass = m_characterClassConstructor.charClass(); |
| 436 | m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_userCharacterClasses.append(newCharacterClass); |
| 437 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#PatternTerm(2984df8ae88d9ce2).(newCharacterClass, m_invertCharacterClasscxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_invertCharacterClass.)); |
| 438 | } |
| 439 | |
| 440 | void atomParenthesesSubpatternBegincxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomParenthesesSubpatternBegin(b45ddcbc8423892c).(bool capture = true) |
| 441 | { |
| 442 | unsigned subpatternId = m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_numSubpatternscxx . . $ QTJSC/Yarr/RegexPattern#m_numSubpatterns. + 1; |
| 443 | if (capture) |
| 444 | m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_numSubpatternscxx . . $ QTJSC/Yarr/RegexPattern#m_numSubpatterns.++; |
| 445 | |
| 446 | PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#* parenthesesDisjunction = new PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#PatternDisjunction(8a910acb71f34a04).(m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.); |
| 447 | m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_disjunctions.append(parenthesesDisjunction); |
| 448 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#PatternTerm(346a90e93e252d33).(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeParenthesesSubpatterncxx . . $ QTJSC/Yarr/PatternTerm#TypeParenthesesSubpattern., subpatternId, parenthesesDisjunction, capture)); |
| 449 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative. = parenthesesDisjunction->addNewAlternativecxx . . $ QTJSC/Yarr/PatternDisjunction#addNewAlternative(b7c439e3c6b41127).(); |
| 450 | } |
| 451 | |
| 452 | void atomParentheticalAssertionBegincxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomParentheticalAssertionBegin(b45ddcbc8423892c).(bool invert = false) |
| 453 | { |
| 454 | PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#* parenthesesDisjunction = new PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#PatternDisjunction(8a910acb71f34a04).(m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.); |
| 455 | m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_disjunctions.append(parenthesesDisjunction); |
| 456 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#PatternTerm(346a90e93e252d33).(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeParentheticalAssertioncxx . . $ QTJSC/Yarr/PatternTerm#TypeParentheticalAssertion., m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_numSubpatternscxx . . $ QTJSC/Yarr/RegexPattern#m_numSubpatterns. + 1, parenthesesDisjunction, invert)); |
| 457 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative. = parenthesesDisjunction->addNewAlternativecxx . . $ QTJSC/Yarr/PatternDisjunction#addNewAlternative(b7c439e3c6b41127).(); |
| 458 | } |
| 459 | |
| 460 | void atomParenthesesEndcxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomParenthesesEnd(49f6e7a06ebc5aa8).() |
| 461 | { |
| 462 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_alternative->m_parent); |
| 463 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_alternative->m_parent->m_parent); |
| 464 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative. = m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_parentcxx . . $ QTJSC/Yarr/PatternAlternative#m_parent.->m_parentcxx . . $ QTJSC/Yarr/PatternDisjunction#m_parent.; |
| 465 | |
| 466 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->lastTermcxx . . $ QTJSC/Yarr/PatternAlternative#lastTerm(6889087f3753b497).().parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..lastSubpatternIdcxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#lastSubpatternId. = m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_numSubpatternscxx . . $ QTJSC/Yarr/RegexPattern#m_numSubpatterns.; |
| 467 | } |
| 468 | |
| 469 | void atomBackReferencecxx . . $ QTJSC/Yarr/RegexPatternConstructor#atomBackReference(cb2f890c2fdad230).(unsigned subpatternId) |
| 470 | { |
| 471 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(subpatternId); |
| 472 | m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_maxBackReferencecxx . . $ QTJSC/Yarr/RegexPattern#m_maxBackReference. = stdcxx . . $ std/::maxcxx . . $ std/max(2a338fce5842aa6a).(m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_maxBackReferencecxx . . $ QTJSC/Yarr/RegexPattern#m_maxBackReference., subpatternId); |
| 473 | |
| 474 | if (subpatternId > m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_numSubpatternscxx . . $ QTJSC/Yarr/RegexPattern#m_numSubpatterns.) { |
| 475 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::ForwardReferencecxx . . $ QTJSC/Yarr/PatternTerm#ForwardReference(3eed2cd0f4bcf4e9).()); |
| 476 | return; |
| 477 | } |
| 478 | |
| 479 | PatternAlternativecxx . . $ QTJSC/Yarr/PatternAlternative#* currentAlternative = m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.; |
| 480 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(currentAlternative); |
| 481 | |
| 482 | // Note to self: if we waited until the AST was baked, we could also remove forwards refs |
| 483 | while ((currentAlternative = currentAlternative->m_parentcxx . . $ QTJSC/Yarr/PatternAlternative#m_parent.->m_parentcxx . . $ QTJSC/Yarr/PatternDisjunction#m_parent.)) { |
| 484 | PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#& term = currentAlternative->lastTermcxx . . $ QTJSC/Yarr/PatternAlternative#lastTerm(6889087f3753b497).(); |
| 485 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!((term.type == PatternTerm::TypeParenthesesSubpattern) || (term.type == PatternTerm::TypeParentheticalAssertion)); |
| 486 | |
| 487 | if ((term.typecxx . . $ QTJSC/Yarr/PatternTerm#type. == PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeParenthesesSubpatterncxx . . $ QTJSC/Yarr/PatternTerm#TypeParenthesesSubpattern.) && term.invertOrCapturecxx . . $ QTJSC/Yarr/PatternTerm#invertOrCapture. && (subpatternId == term.subpatternIdcxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#subpatternId.)) { |
| 488 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::ForwardReferencecxx . . $ QTJSC/Yarr/PatternTerm#ForwardReference(3eed2cd0f4bcf4e9).()); |
| 489 | return; |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#(subpatternId)); |
| 494 | } |
| 495 | |
| 496 | PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#* copyDisjunctioncxx . . $ QTJSC/Yarr/RegexPatternConstructor#copyDisjunction(b936b69486086cea).(PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#* disjunction) |
| 497 | { |
| 498 | PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#* newDisjunction = new PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#PatternDisjunction(8a910acb71f34a04).(); |
| 499 | |
| 500 | newDisjunction->m_parentcxx . . $ QTJSC/Yarr/PatternDisjunction#m_parent. = disjunction->m_parentcxx . . $ QTJSC/Yarr/PatternDisjunction#m_parent.; |
| 501 | for (unsigned alt = 0; alt <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). disjunction->m_alternatives.size(); ++alt) { |
| 502 | PatternAlternativecxx . . $ QTJSC/Yarr/PatternAlternative#* alternative = disjunction->m_alternatives[alt]; |
| 503 | PatternAlternativecxx . . $ QTJSC/Yarr/PatternAlternative#* newAlternative = newDisjunction->addNewAlternativecxx . . $ QTJSC/Yarr/PatternDisjunction#addNewAlternative(b7c439e3c6b41127).(); |
| 504 | for (unsigned i = 0; i <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). alternative->m_terms.size(); ++i) |
| 505 | newAlternative->m_terms.append(copyTermcxx . . $ QTJSC/Yarr/RegexPatternConstructor#copyTerm(52f10a416deeb2bd).(alternative->m_terms[i])); |
| 506 | } |
| 507 | |
| 508 | m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_disjunctions.append(newDisjunction); |
| 509 | return newDisjunction; |
| 510 | } |
| 511 | |
| 512 | PatternTermcxx . . $ QTJSC/Yarr/PatternTerm# copyTermcxx . . $ QTJSC/Yarr/RegexPatternConstructor#copyTerm(52f10a416deeb2bd).(PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#& term) |
| 513 | { |
| 514 | if ((term.typecxx . . $ QTJSC/Yarr/PatternTerm#type. != PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeParenthesesSubpatterncxx . . $ QTJSC/Yarr/PatternTerm#TypeParenthesesSubpattern.) && (term.typecxx . . $ QTJSC/Yarr/PatternTerm#type. != PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeParentheticalAssertioncxx . . $ QTJSC/Yarr/PatternTerm#TypeParentheticalAssertion.)) |
| 515 | return PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#(term); |
| 516 | |
| 517 | PatternTermcxx . . $ QTJSC/Yarr/PatternTerm# termCopy = term; |
| 518 | termCopy.parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..disjunctioncxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#disjunction. = copyDisjunctioncxx . . $ QTJSC/Yarr/RegexPatternConstructor#copyDisjunction(b936b69486086cea).(termCopy.parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..disjunctioncxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#disjunction.); |
| 519 | return termCopy; |
| 520 | } |
| 521 | |
| 522 | void quantifyAtomcxx . . $ QTJSC/Yarr/RegexPatternConstructor#quantifyAtom(fe16132ef69503ce).(unsigned min, unsigned max, bool greedy) |
| 523 | { |
| 524 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(min <= max); |
| 525 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_alternative->m_terms.size()); |
| 526 | |
| 527 | if (!max) { |
| 528 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->removeLastTermcxx . . $ QTJSC/Yarr/PatternAlternative#removeLastTerm(49f6e7a06ebc5aa8).(); |
| 529 | return; |
| 530 | } |
| 531 | |
| 532 | PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#& term = m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->lastTermcxx . . $ QTJSC/Yarr/PatternAlternative#lastTerm(6889087f3753b497).(); |
| 533 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(term.type > PatternTerm::TypeAssertionWordBoundary); |
| 534 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!((term.quantityCount == 1) && (term.quantityType == QuantifierFixedCount)); |
| 535 | |
| 536 | // For any assertion with a zero minimum, not matching is valid and has no effect, |
| 537 | // remove it. Otherwise, we need to match as least once, but there is no point |
| 538 | // matching more than once, so remove the quantifier. It is not entirely clear |
| 539 | // from the spec whether or not this behavior is correct, but I believe this |
| 540 | // matches Firefox. :-/ |
| 541 | if (term.typecxx . . $ QTJSC/Yarr/PatternTerm#type. == PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeParentheticalAssertioncxx . . $ QTJSC/Yarr/PatternTerm#TypeParentheticalAssertion.) { |
| 542 | if (!min) |
| 543 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->removeLastTermcxx . . $ QTJSC/Yarr/PatternAlternative#removeLastTerm(49f6e7a06ebc5aa8).(); |
| 544 | return; |
| 545 | } |
| 546 | |
| 547 | if (min == 0) |
| 548 | term.quantifycxx . . $ QTJSC/Yarr/PatternTerm#quantify(cc5af27742e52699).(max, greedy ? QuantifierGreedycxx . . $ QTJSC/Yarr/QuantifierGreedy. : QuantifierNonGreedycxx . . $ QTJSC/Yarr/QuantifierNonGreedy.); |
| 549 | else if (min == max) |
| 550 | term.quantifycxx . . $ QTJSC/Yarr/PatternTerm#quantify(cc5af27742e52699).(min, QuantifierFixedCountcxx . . $ QTJSC/Yarr/QuantifierFixedCount.); |
| 551 | else { |
| 552 | term.quantifycxx . . $ QTJSC/Yarr/PatternTerm#quantify(cc5af27742e52699).(min, QuantifierFixedCountcxx . . $ QTJSC/Yarr/QuantifierFixedCount.); |
| 553 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_terms.append(copyTermcxx . . $ QTJSC/Yarr/RegexPatternConstructor#copyTerm(52f10a416deeb2bd).(term)); |
| 554 | // NOTE: this term is interesting from an analysis perspective, in that it can be ignored..... |
| 555 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->lastTermcxx . . $ QTJSC/Yarr/PatternAlternative#lastTerm(6889087f3753b497).().quantifycxx . . $ QTJSC/Yarr/PatternTerm#quantify(cc5af27742e52699).((max == UINT_MAXcxx . . $ `<external>/67164224788392828/limits.h:124:9`!) ? max : max - min, greedy ? QuantifierGreedycxx . . $ QTJSC/Yarr/QuantifierGreedy. : QuantifierNonGreedycxx . . $ QTJSC/Yarr/QuantifierNonGreedy.); |
| 556 | if (m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->lastTermcxx . . $ QTJSC/Yarr/PatternAlternative#lastTerm(6889087f3753b497).().typecxx . . $ QTJSC/Yarr/PatternTerm#type. == PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeParenthesesSubpatterncxx . . $ QTJSC/Yarr/PatternTerm#TypeParenthesesSubpattern.) |
| 557 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->lastTermcxx . . $ QTJSC/Yarr/PatternAlternative#lastTerm(6889087f3753b497).().parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..isCopycxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#isCopy. = true; |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | void disjunctioncxx . . $ QTJSC/Yarr/RegexPatternConstructor#disjunction(49f6e7a06ebc5aa8).() |
| 562 | { |
| 563 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative. = m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.->m_parentcxx . . $ QTJSC/Yarr/PatternAlternative#m_parent.->addNewAlternativecxx . . $ QTJSC/Yarr/PatternDisjunction#addNewAlternative(b7c439e3c6b41127).(); |
| 564 | } |
| 565 | |
| 566 | void regexBegincxx . . $ QTJSC/Yarr/RegexPatternConstructor#regexBegin(49f6e7a06ebc5aa8).() |
| 567 | { |
| 568 | m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_bodycxx . . $ QTJSC/Yarr/RegexPattern#m_body. = new PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#PatternDisjunction(8a910acb71f34a04).(); |
| 569 | m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative. = m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_bodycxx . . $ QTJSC/Yarr/RegexPattern#m_body.->addNewAlternativecxx . . $ QTJSC/Yarr/PatternDisjunction#addNewAlternative(b7c439e3c6b41127).(); |
| 570 | m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_disjunctions.append(m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_bodycxx . . $ QTJSC/Yarr/RegexPattern#m_body.); |
| 571 | } |
| 572 | void regexEndcxx . . $ QTJSC/Yarr/RegexPatternConstructor#regexEnd(49f6e7a06ebc5aa8).() |
| 573 | { |
| 574 | } |
| 575 | void regexErrorcxx . . $ QTJSC/Yarr/RegexPatternConstructor#regexError(49f6e7a06ebc5aa8).() |
| 576 | { |
| 577 | } |
| 578 | |
| 579 | unsigned setupAlternativeOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupAlternativeOffsets(6bc1df41da8da74d).(PatternAlternativecxx . . $ QTJSC/Yarr/PatternAlternative#* alternative, unsigned currentCallFrameSize, unsigned initialInputPosition) |
| 580 | { |
| 581 | alternative->m_hasFixedSizecxx . . $ QTJSC/Yarr/PatternAlternative#m_hasFixedSize. = true; |
| 582 | unsigned currentInputPosition = initialInputPosition; |
| 583 | |
| 584 | for (unsigned i = 0; i <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). alternative->m_terms.size(); ++i) { |
| 585 | PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#& term = alternative->m_terms[i]; |
| 586 | |
| 587 | switch (term.typecxx . . $ QTJSC/Yarr/PatternTerm#type.) { |
| 588 | case PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeAssertionBOLcxx . . $ QTJSC/Yarr/PatternTerm#TypeAssertionBOL.: |
| 589 | case PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeAssertionEOLcxx . . $ QTJSC/Yarr/PatternTerm#TypeAssertionEOL.: |
| 590 | case PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeAssertionWordBoundarycxx . . $ QTJSC/Yarr/PatternTerm#TypeAssertionWordBoundary.: |
| 591 | term.inputPositioncxx . . $ QTJSC/Yarr/PatternTerm#inputPosition. = currentInputPosition; |
| 592 | break; |
| 593 | |
| 594 | case PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeBackReferencecxx . . $ QTJSC/Yarr/PatternTerm#TypeBackReference.: |
| 595 | term.inputPositioncxx . . $ QTJSC/Yarr/PatternTerm#inputPosition. = currentInputPosition; |
| 596 | term.frameLocationcxx . . $ QTJSC/Yarr/PatternTerm#frameLocation. = currentCallFrameSize; |
| 597 | currentCallFrameSize += RegexStackSpaceForBackTrackInfoBackReferencecxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexPattern.h:41:9`!; |
| 598 | alternative->m_hasFixedSizecxx . . $ QTJSC/Yarr/PatternAlternative#m_hasFixedSize. = false; |
| 599 | break; |
| 600 | |
| 601 | case PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeForwardReferencecxx . . $ QTJSC/Yarr/PatternTerm#TypeForwardReference.: |
| 602 | break; |
| 603 | |
| 604 | case PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypePatternCharactercxx . . $ QTJSC/Yarr/PatternTerm#TypePatternCharacter.: |
| 605 | term.inputPositioncxx . . $ QTJSC/Yarr/PatternTerm#inputPosition. = currentInputPosition; |
| 606 | if (term.quantityTypecxx . . $ QTJSC/Yarr/PatternTerm#quantityType. != QuantifierFixedCountcxx . . $ QTJSC/Yarr/QuantifierFixedCount.) { |
| 607 | term.frameLocationcxx . . $ QTJSC/Yarr/PatternTerm#frameLocation. = currentCallFrameSize; |
| 608 | currentCallFrameSize += RegexStackSpaceForBackTrackInfoPatternCharactercxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexPattern.h:39:9`!; |
| 609 | alternative->m_hasFixedSizecxx . . $ QTJSC/Yarr/PatternAlternative#m_hasFixedSize. = false; |
| 610 | } else |
| 611 | currentInputPosition += term.quantityCountcxx . . $ QTJSC/Yarr/PatternTerm#quantityCount.; |
| 612 | break; |
| 613 | |
| 614 | case PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeCharacterClasscxx . . $ QTJSC/Yarr/PatternTerm#TypeCharacterClass.: |
| 615 | term.inputPositioncxx . . $ QTJSC/Yarr/PatternTerm#inputPosition. = currentInputPosition; |
| 616 | if (term.quantityTypecxx . . $ QTJSC/Yarr/PatternTerm#quantityType. != QuantifierFixedCountcxx . . $ QTJSC/Yarr/QuantifierFixedCount.) { |
| 617 | term.frameLocationcxx . . $ QTJSC/Yarr/PatternTerm#frameLocation. = currentCallFrameSize; |
| 618 | currentCallFrameSize += RegexStackSpaceForBackTrackInfoCharacterClasscxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexPattern.h:40:9`!; |
| 619 | alternative->m_hasFixedSizecxx . . $ QTJSC/Yarr/PatternAlternative#m_hasFixedSize. = false; |
| 620 | } else |
| 621 | currentInputPosition += term.quantityCountcxx . . $ QTJSC/Yarr/PatternTerm#quantityCount.; |
| 622 | break; |
| 623 | |
| 624 | case PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeParenthesesSubpatterncxx . . $ QTJSC/Yarr/PatternTerm#TypeParenthesesSubpattern.: |
| 625 | // Note: for fixed once parentheses we will ensure at least the minimum is available; others are on their own. |
| 626 | term.frameLocationcxx . . $ QTJSC/Yarr/PatternTerm#frameLocation. = currentCallFrameSize; |
| 627 | if ((term.quantityCountcxx . . $ QTJSC/Yarr/PatternTerm#quantityCount. == 1) && !term.parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..isCopycxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#isCopy.) { |
| 628 | if (term.quantityTypecxx . . $ QTJSC/Yarr/PatternTerm#quantityType. == QuantifierFixedCountcxx . . $ QTJSC/Yarr/QuantifierFixedCount.) { |
| 629 | currentCallFrameSize = setupDisjunctionOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupDisjunctionOffsets(efe7b8322e673088).(term.parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..disjunctioncxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#disjunction., currentCallFrameSize, currentInputPosition); |
| 630 | currentInputPosition += term.parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..disjunctioncxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#disjunction.->m_minimumSizecxx . . $ QTJSC/Yarr/PatternDisjunction#m_minimumSize.; |
| 631 | } else { |
| 632 | currentCallFrameSize += RegexStackSpaceForBackTrackInfoParenthesesOncecxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexPattern.h:44:9`!; |
| 633 | currentCallFrameSize = setupDisjunctionOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupDisjunctionOffsets(efe7b8322e673088).(term.parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..disjunctioncxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#disjunction., currentCallFrameSize, currentInputPosition); |
| 634 | } |
| 635 | term.inputPositioncxx . . $ QTJSC/Yarr/PatternTerm#inputPosition. = currentInputPosition; |
| 636 | } else { |
| 637 | term.inputPositioncxx . . $ QTJSC/Yarr/PatternTerm#inputPosition. = currentInputPosition; |
| 638 | setupDisjunctionOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupDisjunctionOffsets(efe7b8322e673088).(term.parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..disjunctioncxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#disjunction., 0, currentInputPosition); |
| 639 | currentCallFrameSize += RegexStackSpaceForBackTrackInfoParenthesescxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexPattern.h:45:9`!; |
| 640 | } |
| 641 | // Fixed count of 1 could be accepted, if they have a fixed size *AND* if all alternatives are of the same length. |
| 642 | alternative->m_hasFixedSizecxx . . $ QTJSC/Yarr/PatternAlternative#m_hasFixedSize. = false; |
| 643 | break; |
| 644 | |
| 645 | case PatternTermcxx . . $ QTJSC/Yarr/PatternTerm#::TypeParentheticalAssertioncxx . . $ QTJSC/Yarr/PatternTerm#TypeParentheticalAssertion.: |
| 646 | term.inputPositioncxx . . $ QTJSC/Yarr/PatternTerm#inputPosition. = currentInputPosition; |
| 647 | term.frameLocationcxx . . $ QTJSC/Yarr/PatternTerm#frameLocation. = currentCallFrameSize; |
| 648 | currentCallFrameSize = setupDisjunctionOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupDisjunctionOffsets(efe7b8322e673088).(term.parenthesescxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#parentheses..disjunctioncxx . . $ QTJSC/Yarr/PatternTerm#$anonymous_type_0#$anonymous_type_1#disjunction., currentCallFrameSize + RegexStackSpaceForBackTrackInfoParentheticalAssertioncxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexPattern.h:43:9`!, currentInputPosition); |
| 649 | break; |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | alternative->m_minimumSizecxx . . $ QTJSC/Yarr/PatternAlternative#m_minimumSize. = currentInputPosition - initialInputPosition; |
| 654 | return currentCallFrameSize; |
| 655 | } |
| 656 | |
| 657 | unsigned setupDisjunctionOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupDisjunctionOffsets(efe7b8322e673088).(PatternDisjunctioncxx . . $ QTJSC/Yarr/PatternDisjunction#* disjunction, unsigned initialCallFrameSize, unsigned initialInputPosition) |
| 658 | { |
| 659 | if ((disjunction != m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_bodycxx . . $ QTJSC/Yarr/RegexPattern#m_body.) && (disjunction->m_alternatives.size() >cxx . . $ QTJSC/`operator>`(11610d830df66bbf). 1)) |
| 660 | initialCallFrameSize += RegexStackSpaceForBackTrackInfoAlternativecxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexPattern.h:42:9`!; |
| 661 | |
| 662 | unsigned minimumInputSize = UINT_MAXcxx . . $ `<external>/67164224788392828/limits.h:124:9`!; |
| 663 | unsigned maximumCallFrameSize = 0; |
| 664 | bool hasFixedSize = true; |
| 665 | |
| 666 | for (unsigned alt = 0; alt <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). disjunction->m_alternatives.size(); ++alt) { |
| 667 | PatternAlternativecxx . . $ QTJSC/Yarr/PatternAlternative#* alternative = disjunction->m_alternatives[alt]; |
| 668 | unsigned currentAlternativeCallFrameSize = setupAlternativeOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupAlternativeOffsets(6bc1df41da8da74d).(alternative, initialCallFrameSize, initialInputPosition); |
| 669 | minimumInputSize = mincxx . . $ QTWTF/min(2a338fce5842aa6a).(minimumInputSize, alternative->m_minimumSizecxx . . $ QTJSC/Yarr/PatternAlternative#m_minimumSize.); |
| 670 | maximumCallFrameSize = maxcxx . . $ QTWTF/max(2a338fce5842aa6a).(maximumCallFrameSize, currentAlternativeCallFrameSize); |
| 671 | hasFixedSize &= alternative->m_hasFixedSizecxx . . $ QTJSC/Yarr/PatternAlternative#m_hasFixedSize.; |
| 672 | } |
| 673 | |
| 674 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(minimumInputSize != UINT_MAX); |
| 675 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(maximumCallFrameSize >= initialCallFrameSize); |
| 676 | |
| 677 | disjunction->m_hasFixedSizecxx . . $ QTJSC/Yarr/PatternDisjunction#m_hasFixedSize. = hasFixedSize; |
| 678 | disjunction->m_minimumSizecxx . . $ QTJSC/Yarr/PatternDisjunction#m_minimumSize. = minimumInputSize; |
| 679 | disjunction->m_callFrameSizecxx . . $ QTJSC/Yarr/PatternDisjunction#m_callFrameSize. = maximumCallFrameSize; |
| 680 | return maximumCallFrameSize; |
| 681 | } |
| 682 | |
| 683 | void setupOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupOffsets(49f6e7a06ebc5aa8).() |
| 684 | { |
| 685 | setupDisjunctionOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupDisjunctionOffsets(efe7b8322e673088).(m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern..m_bodycxx . . $ QTJSC/Yarr/RegexPattern#m_body., 0, 0); |
| 686 | } |
| 687 | |
| 688 | private: |
| 689 | RegexPatterncxx . . $ QTJSC/Yarr/RegexPattern#& m_patterncxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_pattern.; |
| 690 | PatternAlternativecxx . . $ QTJSC/Yarr/PatternAlternative#* m_alternativecxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_alternative.; |
| 691 | CharacterClassConstructorcxx . . $ QTJSC/Yarr/CharacterClassConstructor# m_characterClassConstructorcxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_characterClassConstructor.; |
| 692 | bool m_invertCharacterClasscxx . . $ QTJSC/Yarr/RegexPatternConstructor#m_invertCharacterClass.; |
| 693 | }; |
| 694 | |
| 695 | |
| 696 | const char* compileRegexcxx . . $ QTJSC/Yarr/compileRegex(d85ba63b80712db2).(const UStringcxx . . $ QTJSC/UString#& patternString, RegexPatterncxx . . $ QTJSC/Yarr/RegexPattern#& pattern) |
| 697 | { |
| 698 | RegexPatternConstructorcxx . . $ QTJSC/Yarr/RegexPatternConstructor# constructorcxx . . $ QTJSC/Yarr/RegexPatternConstructor#RegexPatternConstructor(42309c613cd95058).(pattern); |
| 699 | |
| 700 | if (const char* error = parsecxx . . $ QTJSC/Yarr/parse(8a54798a43a8c41c).(constructor, patternString)) |
| 701 | return error; |
| 702 | |
| 703 | // If the pattern contains illegal backreferences reset & reparse. |
| 704 | // Quoting Netscape's "What's new in JavaScript 1.2", |
| 705 | // "Note: if the number of left parentheses is less than the number specified |
| 706 | // in \#, the \# is taken as an octal escape as described in the next row." |
| 707 | if (pattern.containsIllegalBackReferencecxx . . $ QTJSC/Yarr/RegexPattern#containsIllegalBackReference(c9857a73d68e59ba).()) { |
| 708 | unsigned numSubpatterns = pattern.m_numSubpatternscxx . . $ QTJSC/Yarr/RegexPattern#m_numSubpatterns.; |
| 709 | |
| 710 | constructor.resetcxx . . $ QTJSC/Yarr/RegexPatternConstructor#reset(49f6e7a06ebc5aa8).(); |
| 711 | #if !ASSERT_DISABLEDcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:71:9`! |
| 712 | const char* error = |
| 713 | #endif |
| 714 | parsecxx . . $ QTJSC/Yarr/parse(8a54798a43a8c41c).(constructor, patternString, numSubpatterns); |
| 715 | |
| 716 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!error); |
| 717 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(numSubpatterns == pattern.m_numSubpatterns); |
| 718 | } |
| 719 | |
| 720 | constructor.setupOffsetscxx . . $ QTJSC/Yarr/RegexPatternConstructor#setupOffsets(49f6e7a06ebc5aa8).(); |
| 721 | |
| 722 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 723 | }; |
| 724 | |
| 725 | |
| 726 | } } |
| 727 | |
| 728 | #endif |