| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/3rdparty/masm/yarr/YarrParser.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | namespace JSC { namespace Yarr { | - | ||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||
| 5 | enum BuiltInCharacterClassID { | - | ||||||||||||||||||||||||||||||
| 6 | DigitClassID, | - | ||||||||||||||||||||||||||||||
| 7 | SpaceClassID, | - | ||||||||||||||||||||||||||||||
| 8 | WordClassID, | - | ||||||||||||||||||||||||||||||
| 9 | NewlineClassID, | - | ||||||||||||||||||||||||||||||
| 10 | }; | - | ||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||||||||
| 13 | template<class Delegate, typename CharType> | - | ||||||||||||||||||||||||||||||
| 14 | class Parser { | - | ||||||||||||||||||||||||||||||
| 15 | private: | - | ||||||||||||||||||||||||||||||
| 16 | template<class FriendDelegate> | - | ||||||||||||||||||||||||||||||
| 17 | friend const char* parse(FriendDelegate&, const String& pattern, unsigned backReferenceLimit); | - | ||||||||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||||||||
| 19 | enum ErrorCode { | - | ||||||||||||||||||||||||||||||
| 20 | NoError, | - | ||||||||||||||||||||||||||||||
| 21 | PatternTooLarge, | - | ||||||||||||||||||||||||||||||
| 22 | QuantifierOutOfOrder, | - | ||||||||||||||||||||||||||||||
| 23 | QuantifierWithoutAtom, | - | ||||||||||||||||||||||||||||||
| 24 | QuantifierTooLarge, | - | ||||||||||||||||||||||||||||||
| 25 | MissingParentheses, | - | ||||||||||||||||||||||||||||||
| 26 | ParenthesesUnmatched, | - | ||||||||||||||||||||||||||||||
| 27 | ParenthesesTypeInvalid, | - | ||||||||||||||||||||||||||||||
| 28 | CharacterClassUnmatched, | - | ||||||||||||||||||||||||||||||
| 29 | CharacterClassOutOfOrder, | - | ||||||||||||||||||||||||||||||
| 30 | EscapeUnterminated, | - | ||||||||||||||||||||||||||||||
| 31 | NumberOfErrorCodes | - | ||||||||||||||||||||||||||||||
| 32 | }; | - | ||||||||||||||||||||||||||||||
| 33 | class CharacterClassParserDelegate { | - | ||||||||||||||||||||||||||||||
| 34 | public: | - | ||||||||||||||||||||||||||||||
| 35 | CharacterClassParserDelegate(Delegate& delegate, ErrorCode& err) | - | ||||||||||||||||||||||||||||||
| 36 | : m_delegate(delegate) | - | ||||||||||||||||||||||||||||||
| 37 | , m_err(err) | - | ||||||||||||||||||||||||||||||
| 38 | , m_state(Empty) | - | ||||||||||||||||||||||||||||||
| 39 | , m_character(0) | - | ||||||||||||||||||||||||||||||
| 40 | { | - | ||||||||||||||||||||||||||||||
| 41 | } executed 3557 times by 6 tests: end of blockExecuted by:
| 3557 | ||||||||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||||||||
| 43 | - | |||||||||||||||||||||||||||||||
| 44 | - | |||||||||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||||||||
| 46 | - | |||||||||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||||||||
| 48 | void begin(bool invert) | - | ||||||||||||||||||||||||||||||
| 49 | { | - | ||||||||||||||||||||||||||||||
| 50 | m_delegate.atomCharacterClassBegin(invert); | - | ||||||||||||||||||||||||||||||
| 51 | } executed 3558 times by 6 tests: end of blockExecuted by:
| 3558 | ||||||||||||||||||||||||||||||
| 52 | void atomPatternCharacter(UChar ch, bool hyphenIsRange = false) | - | ||||||||||||||||||||||||||||||
| 53 | { | - | ||||||||||||||||||||||||||||||
| 54 | switch (m_state) { | - | ||||||||||||||||||||||||||||||
| 55 | case executed 32 times by 1 test: AfterCharacterClass:case AfterCharacterClass:Executed by:
executed 32 times by 1 test: case AfterCharacterClass:Executed by:
| 32 | ||||||||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||||||||
| 61 | - | |||||||||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||||||||
| 63 | if (hyphenIsRange
| 0-28 | ||||||||||||||||||||||||||||||
| 64 | m_delegate.atomCharacterClassAtom('-'); | - | ||||||||||||||||||||||||||||||
| 65 | m_state = AfterCharacterClassHyphen; | - | ||||||||||||||||||||||||||||||
| 66 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
| 67 | } | - | ||||||||||||||||||||||||||||||
| 68 | (void)0; | - | ||||||||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||||||||
| 70 | case executed 2847 times by 6 tests: Empty:case Empty:Executed by:
executed 2847 times by 6 tests: case Empty:Executed by:
code before this statement executed 32 times by 1 test: case Empty:Executed by:
| 32-2847 | ||||||||||||||||||||||||||||||
| 71 | m_character = ch; | - | ||||||||||||||||||||||||||||||
| 72 | m_state = CachedCharacter; | - | ||||||||||||||||||||||||||||||
| 73 | return; executed 2880 times by 6 tests: return;Executed by:
| 2880 | ||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||
| 75 | case executed 3808 times by 6 tests: CachedCharacter:case CachedCharacter:Executed by:
executed 3808 times by 6 tests: case CachedCharacter:Executed by:
| 3808 | ||||||||||||||||||||||||||||||
| 76 | if (hyphenIsRange
| 628-3180 | ||||||||||||||||||||||||||||||
| 77 | m_state = CachedCharacterHyphen; executed 1682 times by 5 tests: m_state = CachedCharacterHyphen;Executed by:
| 1682 | ||||||||||||||||||||||||||||||
| 78 | else { | - | ||||||||||||||||||||||||||||||
| 79 | m_delegate.atomCharacterClassAtom(m_character); | - | ||||||||||||||||||||||||||||||
| 80 | m_character = ch; | - | ||||||||||||||||||||||||||||||
| 81 | } executed 2126 times by 3 tests: end of blockExecuted by:
| 2126 | ||||||||||||||||||||||||||||||
| 82 | return; executed 3806 times by 6 tests: return;Executed by:
| 3806 | ||||||||||||||||||||||||||||||
| 83 | - | |||||||||||||||||||||||||||||||
| 84 | case executed 1535 times by 5 tests: CachedCharacterHyphen:case CachedCharacterHyphen:Executed by:
executed 1535 times by 5 tests: case CachedCharacterHyphen:Executed by:
| 1535 | ||||||||||||||||||||||||||||||
| 85 | if (ch < m_character
| 176-1359 | ||||||||||||||||||||||||||||||
| 86 | m_err = CharacterClassOutOfOrder; | - | ||||||||||||||||||||||||||||||
| 87 | return; executed 176 times by 1 test: return;Executed by:
| 176 | ||||||||||||||||||||||||||||||
| 88 | } | - | ||||||||||||||||||||||||||||||
| 89 | m_delegate.atomCharacterClassRange(m_character, ch); | - | ||||||||||||||||||||||||||||||
| 90 | m_state = Empty; | - | ||||||||||||||||||||||||||||||
| 91 | return; executed 1359 times by 5 tests: return;Executed by:
| 1359 | ||||||||||||||||||||||||||||||
| 92 | case never executed: AfterCharacterClassHyphen:case AfterCharacterClassHyphen:never executed: case AfterCharacterClassHyphen: | 0 | ||||||||||||||||||||||||||||||
| 93 | m_delegate.atomCharacterClassAtom(ch); | - | ||||||||||||||||||||||||||||||
| 94 | m_state = Empty; | - | ||||||||||||||||||||||||||||||
| 95 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
| 96 | } | - | ||||||||||||||||||||||||||||||
| 97 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||||||||
| 99 | - | |||||||||||||||||||||||||||||||
| 100 | - | |||||||||||||||||||||||||||||||
| 101 | - | |||||||||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||||||||
| 104 | void atomBuiltInCharacterClass(BuiltInCharacterClassID classID, bool invert) | - | ||||||||||||||||||||||||||||||
| 105 | { | - | ||||||||||||||||||||||||||||||
| 106 | switch (m_state) { | - | ||||||||||||||||||||||||||||||
| 107 | case never executed: CachedCharacter:case CachedCharacter:never executed: case CachedCharacter: | 0 | ||||||||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||||||||
| 109 | m_delegate.atomCharacterClassAtom(m_character); | - | ||||||||||||||||||||||||||||||
| 110 | (void)0; | - | ||||||||||||||||||||||||||||||
| 111 | - | |||||||||||||||||||||||||||||||
| 112 | case executed 1407 times by 1 test: case Empty:Executed by:
code before this statement never executed: case Empty:executed 1407 times by 1 test: Empty:case Empty:Executed by:
code before this statement never executed: case Empty:executed 1407 times by 1 test: case Empty:Executed by:
| 0-1407 | ||||||||||||||||||||||||||||||
| 113 | case executed 1248 times by 1 test: AfterCharacterClass:case AfterCharacterClass:Executed by:
executed 1248 times by 1 test: case AfterCharacterClass:Executed by:
| 1248 | ||||||||||||||||||||||||||||||
| 114 | m_state = AfterCharacterClass; | - | ||||||||||||||||||||||||||||||
| 115 | m_delegate.atomCharacterClassBuiltIn(classID, invert); | - | ||||||||||||||||||||||||||||||
| 116 | return; executed 2656 times by 1 test: return;Executed by:
| 2656 | ||||||||||||||||||||||||||||||
| 117 | case never executed: CachedCharacterHyphen:case CachedCharacterHyphen:never executed: case CachedCharacterHyphen: | 0 | ||||||||||||||||||||||||||||||
| 118 | m_delegate.atomCharacterClassAtom(m_character); | - | ||||||||||||||||||||||||||||||
| 119 | m_delegate.atomCharacterClassAtom('-'); | - | ||||||||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||||||||
| 121 | case never executed: AfterCharacterClassHyphen:case AfterCharacterClassHyphen:never executed: case AfterCharacterClassHyphen:code before this statement never executed: case AfterCharacterClassHyphen: | 0 | ||||||||||||||||||||||||||||||
| 122 | m_delegate.atomCharacterClassBuiltIn(classID, invert); | - | ||||||||||||||||||||||||||||||
| 123 | m_state = Empty; | - | ||||||||||||||||||||||||||||||
| 124 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
| 125 | } | - | ||||||||||||||||||||||||||||||
| 126 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||||||||
| 130 | - | |||||||||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||||||||
| 133 | void end() | - | ||||||||||||||||||||||||||||||
| 134 | { | - | ||||||||||||||||||||||||||||||
| 135 | if (m_state == CachedCharacter
| 1202-2182 | ||||||||||||||||||||||||||||||
| 136 | m_delegate.atomCharacterClassAtom(m_character); executed 1202 times by 3 tests: m_delegate.atomCharacterClassAtom(m_character);Executed by:
| 1202 | ||||||||||||||||||||||||||||||
| 137 | else if (m_state == CachedCharacterHyphen
| 146-2036 | ||||||||||||||||||||||||||||||
| 138 | m_delegate.atomCharacterClassAtom(m_character); | - | ||||||||||||||||||||||||||||||
| 139 | m_delegate.atomCharacterClassAtom('-'); | - | ||||||||||||||||||||||||||||||
| 140 | } executed 146 times by 2 tests: end of blockExecuted by:
| 146 | ||||||||||||||||||||||||||||||
| 141 | m_delegate.atomCharacterClassEnd(); | - | ||||||||||||||||||||||||||||||
| 142 | } executed 3384 times by 6 tests: end of blockExecuted by:
| 3384 | ||||||||||||||||||||||||||||||
| 143 | - | |||||||||||||||||||||||||||||||
| 144 | - | |||||||||||||||||||||||||||||||
| 145 | - | |||||||||||||||||||||||||||||||
| 146 | void assertionWordBoundary(bool) { do { qmlWTFReportAssertionFailure(__FILE__, 216, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0); } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 147 | void atomBackReference(unsigned) { do { qmlWTFReportAssertionFailure(__FILE__, 217, __PRETTY_FUNCTION__, 0); (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap()); } while (0); } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 148 | - | |||||||||||||||||||||||||||||||
| 149 | private: | - | ||||||||||||||||||||||||||||||
| 150 | Delegate& m_delegate; | - | ||||||||||||||||||||||||||||||
| 151 | ErrorCode& m_err; | - | ||||||||||||||||||||||||||||||
| 152 | enum CharacterClassConstructionState { | - | ||||||||||||||||||||||||||||||
| 153 | Empty, | - | ||||||||||||||||||||||||||||||
| 154 | CachedCharacter, | - | ||||||||||||||||||||||||||||||
| 155 | CachedCharacterHyphen, | - | ||||||||||||||||||||||||||||||
| 156 | AfterCharacterClass, | - | ||||||||||||||||||||||||||||||
| 157 | AfterCharacterClassHyphen, | - | ||||||||||||||||||||||||||||||
| 158 | } m_state; | - | ||||||||||||||||||||||||||||||
| 159 | UChar m_character; | - | ||||||||||||||||||||||||||||||
| 160 | }; | - | ||||||||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||||||||
| 162 | Parser(Delegate& delegate, const String& pattern, unsigned backReferenceLimit) | - | ||||||||||||||||||||||||||||||
| 163 | : m_delegate(delegate) | - | ||||||||||||||||||||||||||||||
| 164 | , m_backReferenceLimit(backReferenceLimit) | - | ||||||||||||||||||||||||||||||
| 165 | , m_err(NoError) | - | ||||||||||||||||||||||||||||||
| 166 | , m_data(pattern.getCharacters<CharType>()) | - | ||||||||||||||||||||||||||||||
| 167 | , m_size(pattern.length()) | - | ||||||||||||||||||||||||||||||
| 168 | , m_index(0) | - | ||||||||||||||||||||||||||||||
| 169 | , m_parenthesesNestingDepth(0) | - | ||||||||||||||||||||||||||||||
| 170 | { | - | ||||||||||||||||||||||||||||||
| 171 | } executed 1149133 times by 153 tests: end of blockExecuted by:
| 1149133 | ||||||||||||||||||||||||||||||
| 172 | template<bool inCharacterClass, class EscapeDelegate> | - | ||||||||||||||||||||||||||||||
| 173 | bool parseEscape(EscapeDelegate& delegate) | - | ||||||||||||||||||||||||||||||
| 174 | { | - | ||||||||||||||||||||||||||||||
| 175 | (!(!m_err) ? (qmlWTFReportAssertionFailure(__FILE__, 266, __PRETTY_FUNCTION__, "!m_err"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 176 | (!(peek() == '\\') ? (qmlWTFReportAssertionFailure(__FILE__, 267, __PRETTY_FUNCTION__, "peek() == '\\\\'"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 177 | consume(); | - | ||||||||||||||||||||||||||||||
| 178 | - | |||||||||||||||||||||||||||||||
| 179 | if (atEndOfPattern()
| 4-532695 | ||||||||||||||||||||||||||||||
| 180 | m_err = EscapeUnterminated; | - | ||||||||||||||||||||||||||||||
| 181 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 182 | } | - | ||||||||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||||||||
| 184 | switch (peek()) { | - | ||||||||||||||||||||||||||||||
| 185 | - | |||||||||||||||||||||||||||||||
| 186 | case executed 1076 times by 1 test: 'b':case 'b':Executed by:
executed 1076 times by 1 test: case 'b':Executed by:
| 1076 | ||||||||||||||||||||||||||||||
| 187 | consume(); | - | ||||||||||||||||||||||||||||||
| 188 | if (inCharacterClass
| 24-1052 | ||||||||||||||||||||||||||||||
| 189 | delegate. executed 24 times by 1 test: atomPatternCharacter('\b');delegate.atomPatternCharacter('\b');Executed by:
executed 24 times by 1 test: delegate.atomPatternCharacter('\b');Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 190 | else { | - | ||||||||||||||||||||||||||||||
| 191 | delegate.assertionWordBoundary(false); | - | ||||||||||||||||||||||||||||||
| 192 | return executed 1052 times by 1 test: false;return false;Executed by:
executed 1052 times by 1 test: return false;Executed by:
| 1052 | ||||||||||||||||||||||||||||||
| 193 | } | - | ||||||||||||||||||||||||||||||
| 194 | break; executed 24 times by 1 test: break;Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 195 | case executed 87 times by 1 test: 'B':case 'B':Executed by:
executed 87 times by 1 test: case 'B':Executed by:
| 87 | ||||||||||||||||||||||||||||||
| 196 | consume(); | - | ||||||||||||||||||||||||||||||
| 197 | if (inCharacterClass
| 4-83 | ||||||||||||||||||||||||||||||
| 198 | delegate. executed 4 times by 1 test: atomPatternCharacter('B');delegate.atomPatternCharacter('B');Executed by:
executed 4 times by 1 test: delegate.atomPatternCharacter('B');Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 199 | else { | - | ||||||||||||||||||||||||||||||
| 200 | delegate.assertionWordBoundary(true); | - | ||||||||||||||||||||||||||||||
| 201 | return executed 84 times by 1 test: false;return false;Executed by:
executed 84 times by 1 test: return false;Executed by:
| 84 | ||||||||||||||||||||||||||||||
| 202 | } | - | ||||||||||||||||||||||||||||||
| 203 | break; executed 4 times by 1 test: break;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 204 | - | |||||||||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||||||||
| 206 | case executed 370 times by 3 tests: 'd':case 'd':Executed by:
executed 370 times by 3 tests: case 'd':Executed by:
| 370 | ||||||||||||||||||||||||||||||
| 207 | consume(); | - | ||||||||||||||||||||||||||||||
| 208 | delegate.atomBuiltInCharacterClass(DigitClassID, false); | - | ||||||||||||||||||||||||||||||
| 209 | break; executed 369 times by 3 tests: break;Executed by:
| 369 | ||||||||||||||||||||||||||||||
| 210 | case executed 1390 times by 3 tests: 's':case 's':Executed by:
executed 1390 times by 3 tests: case 's':Executed by:
| 1390 | ||||||||||||||||||||||||||||||
| 211 | consume(); | - | ||||||||||||||||||||||||||||||
| 212 | delegate.atomBuiltInCharacterClass(SpaceClassID, false); | - | ||||||||||||||||||||||||||||||
| 213 | break; executed 1390 times by 3 tests: break;Executed by:
| 1390 | ||||||||||||||||||||||||||||||
| 214 | case executed 104 times by 1 test: 'w':case 'w':Executed by:
executed 104 times by 1 test: case 'w':Executed by:
| 104 | ||||||||||||||||||||||||||||||
| 215 | consume(); | - | ||||||||||||||||||||||||||||||
| 216 | delegate.atomBuiltInCharacterClass(WordClassID, false); | - | ||||||||||||||||||||||||||||||
| 217 | break; executed 104 times by 1 test: break;Executed by:
| 104 | ||||||||||||||||||||||||||||||
| 218 | case executed 36 times by 1 test: 'D':case 'D':Executed by:
executed 36 times by 1 test: case 'D':Executed by:
| 36 | ||||||||||||||||||||||||||||||
| 219 | consume(); | - | ||||||||||||||||||||||||||||||
| 220 | delegate.atomBuiltInCharacterClass(DigitClassID, true); | - | ||||||||||||||||||||||||||||||
| 221 | break; executed 36 times by 1 test: break;Executed by:
| 36 | ||||||||||||||||||||||||||||||
| 222 | case executed 1304 times by 1 test: 'S':case 'S':Executed by:
executed 1304 times by 1 test: case 'S':Executed by:
| 1304 | ||||||||||||||||||||||||||||||
| 223 | consume(); | - | ||||||||||||||||||||||||||||||
| 224 | delegate.atomBuiltInCharacterClass(SpaceClassID, true); | - | ||||||||||||||||||||||||||||||
| 225 | break; executed 1304 times by 1 test: break;Executed by:
| 1304 | ||||||||||||||||||||||||||||||
| 226 | case executed 36 times by 1 test: 'W':case 'W':Executed by:
executed 36 times by 1 test: case 'W':Executed by:
| 36 | ||||||||||||||||||||||||||||||
| 227 | consume(); | - | ||||||||||||||||||||||||||||||
| 228 | delegate.atomBuiltInCharacterClass(WordClassID, true); | - | ||||||||||||||||||||||||||||||
| 229 | break; executed 36 times by 1 test: break;Executed by:
| 36 | ||||||||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||||||||
| 231 | - | |||||||||||||||||||||||||||||||
| 232 | case executed 116 times by 1 test: '1':case '1':Executed by:
executed 116 times by 1 test: case '1':Executed by:
| 116 | ||||||||||||||||||||||||||||||
| 233 | case executed 48 times by 1 test: '2':case '2':Executed by:
executed 48 times by 1 test: case '2':Executed by:
| 48 | ||||||||||||||||||||||||||||||
| 234 | case executed 24 times by 1 test: '3':case '3':Executed by:
executed 24 times by 1 test: case '3':Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 235 | case executed 24 times by 1 test: '4':case '4':Executed by:
executed 24 times by 1 test: case '4':Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 236 | case executed 28 times by 1 test: '5':case '5':Executed by:
executed 28 times by 1 test: case '5':Executed by:
| 28 | ||||||||||||||||||||||||||||||
| 237 | case executed 24 times by 1 test: '6':case '6':Executed by:
executed 24 times by 1 test: case '6':Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 238 | case executed 24 times by 1 test: '7':case '7':Executed by:
executed 24 times by 1 test: case '7':Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 239 | case executed 24 times by 1 test: '8':case '8':Executed by:
executed 24 times by 1 test: case '8':Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 240 | case executed 24 times by 1 test: '9':case '9':Executed by:
executed 24 times by 1 test: {case '9':Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||||||||
| 243 | if (!inCharacterClass
| 4-332 | ||||||||||||||||||||||||||||||
| 244 | ParseState state = saveState(); | - | ||||||||||||||||||||||||||||||
| 245 | - | |||||||||||||||||||||||||||||||
| 246 | unsigned backReference = consumeNumber(); | - | ||||||||||||||||||||||||||||||
| 247 | if (backReference <= m_backReferenceLimit
| 72-260 | ||||||||||||||||||||||||||||||
| 248 | delegate.atomBackReference(backReference); | - | ||||||||||||||||||||||||||||||
| 249 | break; executed 260 times by 1 test: break;Executed by:
| 260 | ||||||||||||||||||||||||||||||
| 250 | } | - | ||||||||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||||||||
| 252 | restoreState(state); | - | ||||||||||||||||||||||||||||||
| 253 | } executed 72 times by 1 test: end of blockExecuted by:
| 72 | ||||||||||||||||||||||||||||||
| 254 | - | |||||||||||||||||||||||||||||||
| 255 | - | |||||||||||||||||||||||||||||||
| 256 | if (peek() >= '8'
| 16-60 | ||||||||||||||||||||||||||||||
| 257 | delegate.atomPatternCharacter('\\'); | - | ||||||||||||||||||||||||||||||
| 258 | break; executed 16 times by 1 test: break;Executed by:
| 16 | ||||||||||||||||||||||||||||||
| 259 | } | - | ||||||||||||||||||||||||||||||
| 260 | } | - | ||||||||||||||||||||||||||||||
| 261 | (void)0; | - | ||||||||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||||||||
| 264 | case executed 16 times by 1 test: '0':case '0':Executed by:
executed 16 times by 1 test: case '0':Executed by:
code before this statement executed 60 times by 1 test: case '0':Executed by:
| 16-60 | ||||||||||||||||||||||||||||||
| 265 | delegate.atomPatternCharacter(consumeOctal()); | - | ||||||||||||||||||||||||||||||
| 266 | break; executed 76 times by 1 test: break;Executed by:
| 76 | ||||||||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||||||||
| 269 | case executed 24 times by 1 test: 'f':case 'f':Executed by:
executed 24 times by 1 test: case 'f':Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 270 | consume(); | - | ||||||||||||||||||||||||||||||
| 271 | delegate.atomPatternCharacter('\f'); | - | ||||||||||||||||||||||||||||||
| 272 | break; executed 24 times by 1 test: break;Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 273 | case executed 232 times by 1 test: 'n':case 'n':Executed by:
executed 232 times by 1 test: case 'n':Executed by:
| 232 | ||||||||||||||||||||||||||||||
| 274 | consume(); | - | ||||||||||||||||||||||||||||||
| 275 | delegate.atomPatternCharacter('\n'); | - | ||||||||||||||||||||||||||||||
| 276 | break; executed 232 times by 1 test: break;Executed by:
| 232 | ||||||||||||||||||||||||||||||
| 277 | case executed 220 times by 1 test: 'r':case 'r':Executed by:
executed 220 times by 1 test: case 'r':Executed by:
| 220 | ||||||||||||||||||||||||||||||
| 278 | consume(); | - | ||||||||||||||||||||||||||||||
| 279 | delegate.atomPatternCharacter('\r'); | - | ||||||||||||||||||||||||||||||
| 280 | break; executed 220 times by 1 test: break;Executed by:
| 220 | ||||||||||||||||||||||||||||||
| 281 | case executed 236 times by 1 test: 't':case 't':Executed by:
executed 236 times by 1 test: case 't':Executed by:
| 236 | ||||||||||||||||||||||||||||||
| 282 | consume(); | - | ||||||||||||||||||||||||||||||
| 283 | delegate.atomPatternCharacter('\t'); | - | ||||||||||||||||||||||||||||||
| 284 | break; executed 236 times by 1 test: break;Executed by:
| 236 | ||||||||||||||||||||||||||||||
| 285 | case executed 24 times by 1 test: 'v':case 'v':Executed by:
executed 24 times by 1 test: case 'v':Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 286 | consume(); | - | ||||||||||||||||||||||||||||||
| 287 | delegate.atomPatternCharacter('\v'); | - | ||||||||||||||||||||||||||||||
| 288 | break; executed 24 times by 1 test: break;Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 289 | - | |||||||||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||||||||
| 291 | case executed 220 times by 1 test: 'c':case 'c':Executed by:
executed 220 times by 1 test: {case 'c':Executed by:
| 220 | ||||||||||||||||||||||||||||||
| 292 | ParseState state = saveState(); | - | ||||||||||||||||||||||||||||||
| 293 | consume(); | - | ||||||||||||||||||||||||||||||
| 294 | if (!atEndOfPattern()
| 8-212 | ||||||||||||||||||||||||||||||
| 295 | int control = consume(); | - | ||||||||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||||||||
| 298 | if (inCharacterClass
| 0-212 | ||||||||||||||||||||||||||||||
| 299 | delegate.atomPatternCharacter(control & 0x1f); | - | ||||||||||||||||||||||||||||||
| 300 | break; executed 212 times by 1 test: break;Executed by:
| 212 | ||||||||||||||||||||||||||||||
| 301 | } | - | ||||||||||||||||||||||||||||||
| 302 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 303 | restoreState(state); | - | ||||||||||||||||||||||||||||||
| 304 | delegate.atomPatternCharacter('\\'); | - | ||||||||||||||||||||||||||||||
| 305 | break; executed 8 times by 1 test: break;Executed by:
| 8 | ||||||||||||||||||||||||||||||
| 306 | } | - | ||||||||||||||||||||||||||||||
| 307 | - | |||||||||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||||||||
| 309 | case executed 788 times by 1 test: 'x':case 'x':Executed by:
executed 788 times by 1 test: {case 'x':Executed by:
| 788 | ||||||||||||||||||||||||||||||
| 310 | consume(); | - | ||||||||||||||||||||||||||||||
| 311 | int x = tryConsumeHex(2); | - | ||||||||||||||||||||||||||||||
| 312 | if (x == -1
| 8-780 | ||||||||||||||||||||||||||||||
| 313 | delegate. executed 8 times by 1 test: atomPatternCharacter('x');delegate.atomPatternCharacter('x');Executed by:
executed 8 times by 1 test: delegate.atomPatternCharacter('x');Executed by:
| 8 | ||||||||||||||||||||||||||||||
| 314 | else | - | ||||||||||||||||||||||||||||||
| 315 | delegate. executed 780 times by 1 test: atomPatternCharacter(x);delegate.atomPatternCharacter(x);Executed by:
executed 780 times by 1 test: delegate.atomPatternCharacter(x);Executed by:
| 780 | ||||||||||||||||||||||||||||||
| 316 | break; executed 788 times by 1 test: break;Executed by:
| 788 | ||||||||||||||||||||||||||||||
| 317 | } | - | ||||||||||||||||||||||||||||||
| 318 | - | |||||||||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||||||||
| 320 | case executed 539 times by 1 test: 'u':case 'u':Executed by:
executed 539 times by 1 test: {case 'u':Executed by:
| 539 | ||||||||||||||||||||||||||||||
| 321 | consume(); | - | ||||||||||||||||||||||||||||||
| 322 | int u = tryConsumeHex(4); | - | ||||||||||||||||||||||||||||||
| 323 | if (u == -1
| 8-531 | ||||||||||||||||||||||||||||||
| 324 | delegate. executed 8 times by 1 test: atomPatternCharacter('u');delegate.atomPatternCharacter('u');Executed by:
executed 8 times by 1 test: delegate.atomPatternCharacter('u');Executed by:
| 8 | ||||||||||||||||||||||||||||||
| 325 | else | - | ||||||||||||||||||||||||||||||
| 326 | delegate. executed 531 times by 1 test: atomPatternCharacter(u);delegate.atomPatternCharacter(u);Executed by:
executed 531 times by 1 test: delegate.atomPatternCharacter(u);Executed by:
| 531 | ||||||||||||||||||||||||||||||
| 327 | break; executed 540 times by 1 test: break;Executed by:
| 540 | ||||||||||||||||||||||||||||||
| 328 | } | - | ||||||||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||||||||
| 331 | default executed 525653 times by 3 tests: :default:Executed by:
executed 525653 times by 3 tests: default:Executed by:
| 525653 | ||||||||||||||||||||||||||||||
| 332 | delegate.atomPatternCharacter(consume()); | - | ||||||||||||||||||||||||||||||
| 333 | } executed 525668 times by 3 tests: end of blockExecuted by:
| 525668 | ||||||||||||||||||||||||||||||
| 334 | - | |||||||||||||||||||||||||||||||
| 335 | return executed 531567 times by 5 tests: true;return true;Executed by:
executed 531567 times by 5 tests: return true;Executed by:
| 531567 | ||||||||||||||||||||||||||||||
| 336 | } | - | ||||||||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||||||||
| 338 | - | |||||||||||||||||||||||||||||||
| 339 | - | |||||||||||||||||||||||||||||||
| 340 | - | |||||||||||||||||||||||||||||||
| 341 | - | |||||||||||||||||||||||||||||||
| 342 | - | |||||||||||||||||||||||||||||||
| 343 | bool parseAtomEscape() | - | ||||||||||||||||||||||||||||||
| 344 | { | - | ||||||||||||||||||||||||||||||
| 345 | return executed 528636 times by 5 tests: parseEscape<false>(m_delegate);return parseEscape<false>(m_delegate);Executed by:
executed 528636 times by 5 tests: return parseEscape<false>(m_delegate);Executed by:
| 528636 | ||||||||||||||||||||||||||||||
| 346 | } | - | ||||||||||||||||||||||||||||||
| 347 | void parseCharacterClassEscape(CharacterClassParserDelegate& delegate) | - | ||||||||||||||||||||||||||||||
| 348 | { | - | ||||||||||||||||||||||||||||||
| 349 | parseEscape<true>(delegate); | - | ||||||||||||||||||||||||||||||
| 350 | } executed 4068 times by 1 test: end of blockExecuted by:
| 4068 | ||||||||||||||||||||||||||||||
| 351 | void parseCharacterClass() | - | ||||||||||||||||||||||||||||||
| 352 | { | - | ||||||||||||||||||||||||||||||
| 353 | (!(!m_err) ? (qmlWTFReportAssertionFailure(__FILE__, 452, __PRETTY_FUNCTION__, "!m_err"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 354 | (!(peek() == '[') ? (qmlWTFReportAssertionFailure(__FILE__, 453, __PRETTY_FUNCTION__, "peek() == '['"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 355 | consume(); | - | ||||||||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||||||||
| 357 | CharacterClassParserDelegate characterClassConstructor(m_delegate, m_err); | - | ||||||||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||||||||
| 359 | characterClassConstructor.begin(tryConsume('^')); | - | ||||||||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||||||||
| 361 | while (!atEndOfPattern()
| 0-14263 | ||||||||||||||||||||||||||||||
| 362 | switch (peek()) { | - | ||||||||||||||||||||||||||||||
| 363 | case executed 3384 times by 6 tests: ']':case ']':Executed by:
executed 3384 times by 6 tests: case ']':Executed by:
| 3384 | ||||||||||||||||||||||||||||||
| 364 | consume(); | - | ||||||||||||||||||||||||||||||
| 365 | characterClassConstructor.end(); | - | ||||||||||||||||||||||||||||||
| 366 | return; executed 3384 times by 6 tests: return;Executed by:
| 3384 | ||||||||||||||||||||||||||||||
| 367 | - | |||||||||||||||||||||||||||||||
| 368 | case executed 4068 times by 1 test: '\\':case '\\':Executed by:
executed 4068 times by 1 test: case '\\':Executed by:
| 4068 | ||||||||||||||||||||||||||||||
| 369 | parseCharacterClassEscape(characterClassConstructor); | - | ||||||||||||||||||||||||||||||
| 370 | break; executed 4068 times by 1 test: break;Executed by:
| 4068 | ||||||||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||||||||
| 372 | default executed 6809 times by 6 tests: :default:Executed by:
executed 6809 times by 6 tests: default:Executed by:
| 6809 | ||||||||||||||||||||||||||||||
| 373 | characterClassConstructor.atomPatternCharacter(consume(), true); | - | ||||||||||||||||||||||||||||||
| 374 | } executed 6810 times by 6 tests: end of blockExecuted by:
| 6810 | ||||||||||||||||||||||||||||||
| 375 | - | |||||||||||||||||||||||||||||||
| 376 | if (m_err
| 176-10703 | ||||||||||||||||||||||||||||||
| 377 | return; executed 176 times by 1 test: return;Executed by:
| 176 | ||||||||||||||||||||||||||||||
| 378 | } executed 10705 times by 6 tests: end of blockExecuted by:
| 10705 | ||||||||||||||||||||||||||||||
| 379 | - | |||||||||||||||||||||||||||||||
| 380 | m_err = CharacterClassUnmatched; | - | ||||||||||||||||||||||||||||||
| 381 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 382 | - | |||||||||||||||||||||||||||||||
| 383 | - | |||||||||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||||||||
| 385 | - | |||||||||||||||||||||||||||||||
| 386 | - | |||||||||||||||||||||||||||||||
| 387 | - | |||||||||||||||||||||||||||||||
| 388 | void parseParenthesesBegin() | - | ||||||||||||||||||||||||||||||
| 389 | { | - | ||||||||||||||||||||||||||||||
| 390 | (!(!m_err) ? (qmlWTFReportAssertionFailure(__FILE__, 489, __PRETTY_FUNCTION__, "!m_err"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 391 | (!(peek() == '(') ? (qmlWTFReportAssertionFailure(__FILE__, 490, __PRETTY_FUNCTION__, "peek() == '('"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 392 | consume(); | - | ||||||||||||||||||||||||||||||
| 393 | - | |||||||||||||||||||||||||||||||
| 394 | if (tryConsume('?')
| 1027-2548 | ||||||||||||||||||||||||||||||
| 395 | if (atEndOfPattern()
| 0-1027 | ||||||||||||||||||||||||||||||
| 396 | m_err = ParenthesesTypeInvalid; | - | ||||||||||||||||||||||||||||||
| 397 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
| 398 | } | - | ||||||||||||||||||||||||||||||
| 399 | - | |||||||||||||||||||||||||||||||
| 400 | switch (consume()) { | - | ||||||||||||||||||||||||||||||
| 401 | case executed 951 times by 1 test: ':':case ':':Executed by:
executed 951 times by 1 test: case ':':Executed by:
| 951 | ||||||||||||||||||||||||||||||
| 402 | m_delegate.atomParenthesesSubpatternBegin(false); | - | ||||||||||||||||||||||||||||||
| 403 | break; executed 952 times by 1 test: break;Executed by:
| 952 | ||||||||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||||||||
| 405 | case executed 32 times by 1 test: '=':case '=':Executed by:
executed 32 times by 1 test: case '=':Executed by:
| 32 | ||||||||||||||||||||||||||||||
| 406 | m_delegate.atomParentheticalAssertionBegin(); | - | ||||||||||||||||||||||||||||||
| 407 | break; executed 32 times by 1 test: break;Executed by:
| 32 | ||||||||||||||||||||||||||||||
| 408 | - | |||||||||||||||||||||||||||||||
| 409 | case executed 44 times by 1 test: '!':case '!':Executed by:
executed 44 times by 1 test: case '!':Executed by:
| 44 | ||||||||||||||||||||||||||||||
| 410 | m_delegate.atomParentheticalAssertionBegin(true); | - | ||||||||||||||||||||||||||||||
| 411 | break; executed 44 times by 1 test: break;Executed by:
| 44 | ||||||||||||||||||||||||||||||
| 412 | - | |||||||||||||||||||||||||||||||
| 413 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||
| 414 | m_err = ParenthesesTypeInvalid; | - | ||||||||||||||||||||||||||||||
| 415 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 416 | } else | - | ||||||||||||||||||||||||||||||
| 417 | m_delegate.atomParenthesesSubpatternBegin(); executed 2548 times by 3 tests: m_delegate.atomParenthesesSubpatternBegin();Executed by:
| 2548 | ||||||||||||||||||||||||||||||
| 418 | - | |||||||||||||||||||||||||||||||
| 419 | ++m_parenthesesNestingDepth; | - | ||||||||||||||||||||||||||||||
| 420 | } executed 3577 times by 3 tests: end of blockExecuted by:
| 3577 | ||||||||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||||||||
| 423 | - | |||||||||||||||||||||||||||||||
| 424 | - | |||||||||||||||||||||||||||||||
| 425 | - | |||||||||||||||||||||||||||||||
| 426 | - | |||||||||||||||||||||||||||||||
| 427 | void parseParenthesesEnd() | - | ||||||||||||||||||||||||||||||
| 428 | { | - | ||||||||||||||||||||||||||||||
| 429 | (!(!m_err) ? (qmlWTFReportAssertionFailure(__FILE__, 528, __PRETTY_FUNCTION__, "!m_err"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 430 | (!(peek() == ')') ? (qmlWTFReportAssertionFailure(__FILE__, 529, __PRETTY_FUNCTION__, "peek() == ')'"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 431 | consume(); | - | ||||||||||||||||||||||||||||||
| 432 | - | |||||||||||||||||||||||||||||||
| 433 | if (m_parenthesesNestingDepth > 0
| 0-3577 | ||||||||||||||||||||||||||||||
| 434 | m_delegate.atomParenthesesEnd(); executed 3577 times by 3 tests: m_delegate.atomParenthesesEnd();Executed by:
| 3577 | ||||||||||||||||||||||||||||||
| 435 | else | - | ||||||||||||||||||||||||||||||
| 436 | m_err = ParenthesesUnmatched; never executed: m_err = ParenthesesUnmatched; | 0 | ||||||||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||||||||
| 438 | --m_parenthesesNestingDepth; | - | ||||||||||||||||||||||||||||||
| 439 | } executed 3575 times by 3 tests: end of blockExecuted by:
| 3575 | ||||||||||||||||||||||||||||||
| 440 | - | |||||||||||||||||||||||||||||||
| 441 | - | |||||||||||||||||||||||||||||||
| 442 | - | |||||||||||||||||||||||||||||||
| 443 | - | |||||||||||||||||||||||||||||||
| 444 | - | |||||||||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||||||||
| 446 | void parseQuantifier(bool lastTokenWasAnAtom, unsigned min, unsigned max) | - | ||||||||||||||||||||||||||||||
| 447 | { | - | ||||||||||||||||||||||||||||||
| 448 | (!(!m_err) ? (qmlWTFReportAssertionFailure(__FILE__, 547, __PRETTY_FUNCTION__, "!m_err"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 449 | (!(min <= max) ? (qmlWTFReportAssertionFailure(__FILE__, 548, __PRETTY_FUNCTION__, "min <= max"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||||||||
| 451 | if (min ==
| 0-4209 | ||||||||||||||||||||||||||||||
| 452 | (0x7fffffff * 2U + 1U)
| 0-4209 | ||||||||||||||||||||||||||||||
| 453 | ) { | - | ||||||||||||||||||||||||||||||
| 454 | m_err = QuantifierTooLarge; | - | ||||||||||||||||||||||||||||||
| 455 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
| 456 | } | - | ||||||||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||||||||
| 458 | if (lastTokenWasAnAtom
| 66-4144 | ||||||||||||||||||||||||||||||
| 459 | m_delegate.quantifyAtom(min, max, !tryConsume('?')); executed 4143 times by 8 tests: m_delegate.quantifyAtom(min, max, !tryConsume('?'));Executed by:
| 4143 | ||||||||||||||||||||||||||||||
| 460 | else | - | ||||||||||||||||||||||||||||||
| 461 | m_err = QuantifierWithoutAtom; executed 66 times by 1 test: m_err = QuantifierWithoutAtom;Executed by:
| 66 | ||||||||||||||||||||||||||||||
| 462 | } | - | ||||||||||||||||||||||||||||||
| 463 | void parseTokens() | - | ||||||||||||||||||||||||||||||
| 464 | { | - | ||||||||||||||||||||||||||||||
| 465 | bool lastTokenWasAnAtom = false; | - | ||||||||||||||||||||||||||||||
| 466 | - | |||||||||||||||||||||||||||||||
| 467 | while (!atEndOfPattern()
| 1150925-2386463 | ||||||||||||||||||||||||||||||
| 468 | switch (peek()) { | - | ||||||||||||||||||||||||||||||
| 469 | case executed 1163 times by 4 tests: '|':case '|':Executed by:
executed 1163 times by 4 tests: case '|':Executed by:
| 1163 | ||||||||||||||||||||||||||||||
| 470 | consume(); | - | ||||||||||||||||||||||||||||||
| 471 | m_delegate.disjunction(); | - | ||||||||||||||||||||||||||||||
| 472 | lastTokenWasAnAtom = false; | - | ||||||||||||||||||||||||||||||
| 473 | break; executed 1164 times by 4 tests: break;Executed by:
| 1164 | ||||||||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||||||||
| 475 | case executed 3574 times by 3 tests: '(':case '(':Executed by:
executed 3574 times by 3 tests: case '(':Executed by:
| 3574 | ||||||||||||||||||||||||||||||
| 476 | parseParenthesesBegin(); | - | ||||||||||||||||||||||||||||||
| 477 | lastTokenWasAnAtom = false; | - | ||||||||||||||||||||||||||||||
| 478 | break; executed 3577 times by 3 tests: break;Executed by:
| 3577 | ||||||||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||||||||
| 480 | case executed 3578 times by 3 tests: ')':case ')':Executed by:
executed 3578 times by 3 tests: case ')':Executed by:
| 3578 | ||||||||||||||||||||||||||||||
| 481 | parseParenthesesEnd(); | - | ||||||||||||||||||||||||||||||
| 482 | lastTokenWasAnAtom = true; | - | ||||||||||||||||||||||||||||||
| 483 | break; executed 3575 times by 3 tests: break;Executed by:
| 3575 | ||||||||||||||||||||||||||||||
| 484 | - | |||||||||||||||||||||||||||||||
| 485 | case executed 180 times by 5 tests: '^':case '^':Executed by:
executed 180 times by 5 tests: case '^':Executed by:
| 180 | ||||||||||||||||||||||||||||||
| 486 | consume(); | - | ||||||||||||||||||||||||||||||
| 487 | m_delegate.assertionBOL(); | - | ||||||||||||||||||||||||||||||
| 488 | lastTokenWasAnAtom = false; | - | ||||||||||||||||||||||||||||||
| 489 | break; executed 181 times by 5 tests: break;Executed by:
| 181 | ||||||||||||||||||||||||||||||
| 490 | - | |||||||||||||||||||||||||||||||
| 491 | case executed 178 times by 5 tests: '$':case '$':Executed by:
executed 178 times by 5 tests: case '$':Executed by:
| 178 | ||||||||||||||||||||||||||||||
| 492 | consume(); | - | ||||||||||||||||||||||||||||||
| 493 | m_delegate.assertionEOL(); | - | ||||||||||||||||||||||||||||||
| 494 | lastTokenWasAnAtom = false; | - | ||||||||||||||||||||||||||||||
| 495 | break; executed 178 times by 5 tests: break;Executed by:
| 178 | ||||||||||||||||||||||||||||||
| 496 | - | |||||||||||||||||||||||||||||||
| 497 | case executed 627 times by 3 tests: '.':case '.':Executed by:
executed 627 times by 3 tests: case '.':Executed by:
| 627 | ||||||||||||||||||||||||||||||
| 498 | consume(); | - | ||||||||||||||||||||||||||||||
| 499 | m_delegate.atomBuiltInCharacterClass(NewlineClassID, true); | - | ||||||||||||||||||||||||||||||
| 500 | lastTokenWasAnAtom = true; | - | ||||||||||||||||||||||||||||||
| 501 | break; executed 626 times by 3 tests: break;Executed by:
| 626 | ||||||||||||||||||||||||||||||
| 502 | - | |||||||||||||||||||||||||||||||
| 503 | case executed 3556 times by 6 tests: '[':case '[':Executed by:
executed 3556 times by 6 tests: case '[':Executed by:
| 3556 | ||||||||||||||||||||||||||||||
| 504 | parseCharacterClass(); | - | ||||||||||||||||||||||||||||||
| 505 | lastTokenWasAnAtom = true; | - | ||||||||||||||||||||||||||||||
| 506 | break; executed 3559 times by 6 tests: break;Executed by:
| 3559 | ||||||||||||||||||||||||||||||
| 507 | - | |||||||||||||||||||||||||||||||
| 508 | case executed 528641 times by 5 tests: '\\':case '\\':Executed by:
executed 528641 times by 5 tests: case '\\':Executed by:
| 528641 | ||||||||||||||||||||||||||||||
| 509 | lastTokenWasAnAtom = parseAtomEscape(); | - | ||||||||||||||||||||||||||||||
| 510 | break; executed 528635 times by 5 tests: break;Executed by:
| 528635 | ||||||||||||||||||||||||||||||
| 511 | - | |||||||||||||||||||||||||||||||
| 512 | case executed 2086 times by 3 tests: '*':case '*':Executed by:
executed 2086 times by 3 tests: case '*':Executed by:
| 2086 | ||||||||||||||||||||||||||||||
| 513 | consume(); | - | ||||||||||||||||||||||||||||||
| 514 | parseQuantifier(lastTokenWasAnAtom, 0, quantifyInfinite); | - | ||||||||||||||||||||||||||||||
| 515 | lastTokenWasAnAtom = false; | - | ||||||||||||||||||||||||||||||
| 516 | break; executed 2087 times by 3 tests: break;Executed by:
| 2087 | ||||||||||||||||||||||||||||||
| 517 | - | |||||||||||||||||||||||||||||||
| 518 | case executed 958 times by 6 tests: '+':case '+':Executed by:
executed 958 times by 6 tests: case '+':Executed by:
| 958 | ||||||||||||||||||||||||||||||
| 519 | consume(); | - | ||||||||||||||||||||||||||||||
| 520 | parseQuantifier(lastTokenWasAnAtom, 1, quantifyInfinite); | - | ||||||||||||||||||||||||||||||
| 521 | lastTokenWasAnAtom = false; | - | ||||||||||||||||||||||||||||||
| 522 | break; executed 957 times by 6 tests: break;Executed by:
| 957 | ||||||||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||||||||
| 524 | case executed 718 times by 4 tests: '?':case '?':Executed by:
executed 718 times by 4 tests: case '?':Executed by:
| 718 | ||||||||||||||||||||||||||||||
| 525 | consume(); | - | ||||||||||||||||||||||||||||||
| 526 | parseQuantifier(lastTokenWasAnAtom, 0, 1); | - | ||||||||||||||||||||||||||||||
| 527 | lastTokenWasAnAtom = false; | - | ||||||||||||||||||||||||||||||
| 528 | break; executed 718 times by 4 tests: break;Executed by:
| 718 | ||||||||||||||||||||||||||||||
| 529 | - | |||||||||||||||||||||||||||||||
| 530 | case executed 450 times by 3 tests: '{':case '{':Executed by:
executed 450 times by 3 tests: {case '{':Executed by:
| 450 | ||||||||||||||||||||||||||||||
| 531 | ParseState state = saveState(); | - | ||||||||||||||||||||||||||||||
| 532 | - | |||||||||||||||||||||||||||||||
| 533 | consume(); | - | ||||||||||||||||||||||||||||||
| 534 | if (peekIsDigit()
| 0-450 | ||||||||||||||||||||||||||||||
| 535 | unsigned min = consumeNumber(); | - | ||||||||||||||||||||||||||||||
| 536 | unsigned max = min; | - | ||||||||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||||||||
| 538 | if (tryConsume(',')
| 154-298 | ||||||||||||||||||||||||||||||
| 539 | max = peekIsDigit()
executed 154 times by 3 tests: max = peekIsDigit() ? consumeNumber() : quantifyInfinite;Executed by:
| 48-154 | ||||||||||||||||||||||||||||||
| 540 | - | |||||||||||||||||||||||||||||||
| 541 | if (tryConsume('}')
| 2-450 | ||||||||||||||||||||||||||||||
| 542 | if (min <= max
| 4-446 | ||||||||||||||||||||||||||||||
| 543 | parseQuantifier(lastTokenWasAnAtom, min, max); executed 446 times by 3 tests: parseQuantifier(lastTokenWasAnAtom, min, max);Executed by:
| 446 | ||||||||||||||||||||||||||||||
| 544 | else | - | ||||||||||||||||||||||||||||||
| 545 | m_err = QuantifierOutOfOrder; executed 4 times by 1 test: m_err = QuantifierOutOfOrder;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 546 | lastTokenWasAnAtom = false; | - | ||||||||||||||||||||||||||||||
| 547 | break; executed 450 times by 3 tests: break;Executed by:
| 450 | ||||||||||||||||||||||||||||||
| 548 | } | - | ||||||||||||||||||||||||||||||
| 549 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||||||||
| 551 | restoreState(state); | - | ||||||||||||||||||||||||||||||
| 552 | } | - | ||||||||||||||||||||||||||||||
| 553 | (void)0; | - | ||||||||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||||||||
| 555 | default executed 1842410 times by 6 tests: :default:Executed by:
executed 1842410 times by 6 tests: default:Executed by:
code before this statement executed 2 times by 1 test: default:Executed by:
| 2-1842410 | ||||||||||||||||||||||||||||||
| 556 | m_delegate.atomPatternCharacter(consume()); | - | ||||||||||||||||||||||||||||||
| 557 | lastTokenWasAnAtom = true; | - | ||||||||||||||||||||||||||||||
| 558 | } executed 1843164 times by 6 tests: end of blockExecuted by:
| 1843164 | ||||||||||||||||||||||||||||||
| 559 | - | |||||||||||||||||||||||||||||||
| 560 | if (m_err
| 252-2388738 | ||||||||||||||||||||||||||||||
| 561 | return; executed 252 times by 1 test: return;Executed by:
| 252 | ||||||||||||||||||||||||||||||
| 562 | } executed 2389130 times by 9 tests: end of blockExecuted by:
| 2389130 | ||||||||||||||||||||||||||||||
| 563 | - | |||||||||||||||||||||||||||||||
| 564 | if (m_parenthesesNestingDepth > 0
| 0-1150894 | ||||||||||||||||||||||||||||||
| 565 | m_err = MissingParentheses; never executed: m_err = MissingParentheses; | 0 | ||||||||||||||||||||||||||||||
| 566 | } executed 1150738 times by 153 tests: end of blockExecuted by:
| 1150738 | ||||||||||||||||||||||||||||||
| 567 | - | |||||||||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||||||||
| 569 | - | |||||||||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||||||||
| 572 | - | |||||||||||||||||||||||||||||||
| 573 | - | |||||||||||||||||||||||||||||||
| 574 | const char* parse() | - | ||||||||||||||||||||||||||||||
| 575 | { | - | ||||||||||||||||||||||||||||||
| 576 | if (m_size > MAX_PATTERN_SIZE
| 0-1148700 | ||||||||||||||||||||||||||||||
| 577 | m_err = PatternTooLarge; never executed: m_err = PatternTooLarge; | 0 | ||||||||||||||||||||||||||||||
| 578 | else | - | ||||||||||||||||||||||||||||||
| 579 | parseTokens(); executed 1148062 times by 153 tests: parseTokens();Executed by:
| 1148062 | ||||||||||||||||||||||||||||||
| 580 | (!(atEndOfPattern() || m_err) ? (qmlWTFReportAssertionFailure(__FILE__, 687, __PRETTY_FUNCTION__, "atEndOfPattern() || m_err"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||||||||
| 582 | - | |||||||||||||||||||||||||||||||
| 583 | static const char* errorMessages[NumberOfErrorCodes] = { | - | ||||||||||||||||||||||||||||||
| 584 | 0, | - | ||||||||||||||||||||||||||||||
| 585 | "Invalid regular expression: " "regular expression too large", | - | ||||||||||||||||||||||||||||||
| 586 | "Invalid regular expression: " "numbers out of order in {} quantifier", | - | ||||||||||||||||||||||||||||||
| 587 | "Invalid regular expression: " "nothing to repeat", | - | ||||||||||||||||||||||||||||||
| 588 | "Invalid regular expression: " "number too large in {} quantifier", | - | ||||||||||||||||||||||||||||||
| 589 | "Invalid regular expression: " "missing )", | - | ||||||||||||||||||||||||||||||
| 590 | "Invalid regular expression: " "unmatched parentheses", | - | ||||||||||||||||||||||||||||||
| 591 | "Invalid regular expression: " "unrecognized character after (?", | - | ||||||||||||||||||||||||||||||
| 592 | "Invalid regular expression: " "missing terminating ] for character class", | - | ||||||||||||||||||||||||||||||
| 593 | "Invalid regular expression: " "range out of order in character class", | - | ||||||||||||||||||||||||||||||
| 594 | "Invalid regular expression: " "\\ at end of pattern" | - | ||||||||||||||||||||||||||||||
| 595 | }; | - | ||||||||||||||||||||||||||||||
| 596 | - | |||||||||||||||||||||||||||||||
| 597 | return executed 1151300 times by 153 tests: errorMessages[m_err];return errorMessages[m_err];Executed by:
executed 1151300 times by 153 tests: return errorMessages[m_err];Executed by:
| 1151300 | ||||||||||||||||||||||||||||||
| 598 | } | - | ||||||||||||||||||||||||||||||
| 599 | - | |||||||||||||||||||||||||||||||
| 600 | - | |||||||||||||||||||||||||||||||
| 601 | - | |||||||||||||||||||||||||||||||
| 602 | typedef unsigned ParseState; | - | ||||||||||||||||||||||||||||||
| 603 | - | |||||||||||||||||||||||||||||||
| 604 | ParseState saveState() | - | ||||||||||||||||||||||||||||||
| 605 | { | - | ||||||||||||||||||||||||||||||
| 606 | return executed 2331 times by 3 tests: m_index;return m_index;Executed by:
executed 2331 times by 3 tests: return m_index;Executed by:
| 2331 | ||||||||||||||||||||||||||||||
| 607 | } | - | ||||||||||||||||||||||||||||||
| 608 | - | |||||||||||||||||||||||||||||||
| 609 | void restoreState(ParseState state) | - | ||||||||||||||||||||||||||||||
| 610 | { | - | ||||||||||||||||||||||||||||||
| 611 | m_index = state; | - | ||||||||||||||||||||||||||||||
| 612 | } executed 98 times by 2 tests: end of blockExecuted by:
| 98 | ||||||||||||||||||||||||||||||
| 613 | - | |||||||||||||||||||||||||||||||
| 614 | bool atEndOfPattern() | - | ||||||||||||||||||||||||||||||
| 615 | { | - | ||||||||||||||||||||||||||||||
| 616 | (!(m_index <= m_size) ? (qmlWTFReportAssertionFailure(__FILE__, 723, __PRETTY_FUNCTION__, "m_index <= m_size"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 617 | return executed 5254373 times by 153 tests: m_index == m_size;return m_index == m_size;Executed by:
executed 5254373 times by 153 tests: return m_index == m_size;Executed by:
| 5254373 | ||||||||||||||||||||||||||||||
| 618 | } | - | ||||||||||||||||||||||||||||||
| 619 | - | |||||||||||||||||||||||||||||||
| 620 | int peek() | - | ||||||||||||||||||||||||||||||
| 621 | { | - | ||||||||||||||||||||||||||||||
| 622 | (!(m_index < m_size) ? (qmlWTFReportAssertionFailure(__FILE__, 729, __PRETTY_FUNCTION__, "m_index < m_size"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 623 | return executed 3484021 times by 9 tests: m_data[m_index];return m_data[m_index];Executed by:
executed 3484021 times by 9 tests: return m_data[m_index];Executed by:
| 3484021 | ||||||||||||||||||||||||||||||
| 624 | } | - | ||||||||||||||||||||||||||||||
| 625 | - | |||||||||||||||||||||||||||||||
| 626 | bool peekIsDigit() | - | ||||||||||||||||||||||||||||||
| 627 | { | - | ||||||||||||||||||||||||||||||
| 628 | return executed 2519 times by 3 tests: !atEndOfPattern() && WTF::isASCIIDigit(peek());return !atEndOfPattern() && WTF::isASCIIDigit(peek());Executed by:
executed 2519 times by 3 tests: return !atEndOfPattern() && WTF::isASCIIDigit(peek());Executed by:
| 2519 | ||||||||||||||||||||||||||||||
| 629 | } | - | ||||||||||||||||||||||||||||||
| 630 | - | |||||||||||||||||||||||||||||||
| 631 | unsigned peekDigit() | - | ||||||||||||||||||||||||||||||
| 632 | { | - | ||||||||||||||||||||||||||||||
| 633 | (!(peekIsDigit()) ? (qmlWTFReportAssertionFailure(__FILE__, 740, __PRETTY_FUNCTION__, "peekIsDigit()"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 634 | return executed 28 times by 1 test: peek() - '0';return peek() - '0';Executed by:
executed 28 times by 1 test: return peek() - '0';Executed by:
| 28 | ||||||||||||||||||||||||||||||
| 635 | } | - | ||||||||||||||||||||||||||||||
| 636 | - | |||||||||||||||||||||||||||||||
| 637 | int consume() | - | ||||||||||||||||||||||||||||||
| 638 | { | - | ||||||||||||||||||||||||||||||
| 639 | (!(m_index < m_size) ? (qmlWTFReportAssertionFailure(__FILE__, 746, __PRETTY_FUNCTION__, "m_index < m_size"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 640 | return executed 2942087 times by 9 tests: m_data[m_index++];return m_data[m_index++];Executed by:
executed 2942087 times by 9 tests: return m_data[m_index++];Executed by:
| 2942087 | ||||||||||||||||||||||||||||||
| 641 | } | - | ||||||||||||||||||||||||||||||
| 642 | - | |||||||||||||||||||||||||||||||
| 643 | unsigned consumeDigit() | - | ||||||||||||||||||||||||||||||
| 644 | { | - | ||||||||||||||||||||||||||||||
| 645 | (!(peekIsDigit()) ? (qmlWTFReportAssertionFailure(__FILE__, 752, __PRETTY_FUNCTION__, "peekIsDigit()"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 646 | return executed 969 times by 3 tests: consume() - '0';return consume() - '0';Executed by:
executed 969 times by 3 tests: return consume() - '0';Executed by:
| 969 | ||||||||||||||||||||||||||||||
| 647 | } | - | ||||||||||||||||||||||||||||||
| 648 | - | |||||||||||||||||||||||||||||||
| 649 | unsigned consumeNumber() | - | ||||||||||||||||||||||||||||||
| 650 | { | - | ||||||||||||||||||||||||||||||
| 651 | unsigned n = consumeDigit(); | - | ||||||||||||||||||||||||||||||
| 652 | - | |||||||||||||||||||||||||||||||
| 653 | for (unsigned newValue; peekIsDigit()
| 0-888 | ||||||||||||||||||||||||||||||
| 654 | n = newValue; | - | ||||||||||||||||||||||||||||||
| 655 | consume(); | - | ||||||||||||||||||||||||||||||
| 656 | } executed 28 times by 1 test: end of blockExecuted by:
| 28 | ||||||||||||||||||||||||||||||
| 657 | return executed 890 times by 3 tests: n;return n;Executed by:
executed 890 times by 3 tests: return n;Executed by:
| 890 | ||||||||||||||||||||||||||||||
| 658 | } | - | ||||||||||||||||||||||||||||||
| 659 | - | |||||||||||||||||||||||||||||||
| 660 | unsigned consumeOctal() | - | ||||||||||||||||||||||||||||||
| 661 | { | - | ||||||||||||||||||||||||||||||
| 662 | (!(WTF::isASCIIOctalDigit(peek())) ? (qmlWTFReportAssertionFailure(__FILE__, 769, __PRETTY_FUNCTION__, "WTF::isASCIIOctalDigit(peek())"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||||||||||||||||||||||||||
| 663 | - | |||||||||||||||||||||||||||||||
| 664 | unsigned n = consumeDigit(); | - | ||||||||||||||||||||||||||||||
| 665 | while (n < 32
| 0-80 | ||||||||||||||||||||||||||||||
| 666 | n = n * 8 + consumeDigit(); executed 4 times by 1 test: n = n * 8 + consumeDigit();Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 667 | return executed 76 times by 1 test: n;return n;Executed by:
executed 76 times by 1 test: return n;Executed by:
| 76 | ||||||||||||||||||||||||||||||
| 668 | } | - | ||||||||||||||||||||||||||||||
| 669 | - | |||||||||||||||||||||||||||||||
| 670 | bool tryConsume(UChar ch) | - | ||||||||||||||||||||||||||||||
| 671 | { | - | ||||||||||||||||||||||||||||||
| 672 | if (atEndOfPattern()
| 537-11637 | ||||||||||||||||||||||||||||||
| 673 | return executed 9607 times by 9 tests: false;return false;Executed by:
executed 9607 times by 9 tests: return false;Executed by:
| 9607 | ||||||||||||||||||||||||||||||
| 674 | ++m_index; | - | ||||||||||||||||||||||||||||||
| 675 | return executed 2569 times by 3 tests: true;return true;Executed by:
executed 2569 times by 3 tests: return true;Executed by:
| 2569 | ||||||||||||||||||||||||||||||
| 676 | } | - | ||||||||||||||||||||||||||||||
| 677 | - | |||||||||||||||||||||||||||||||
| 678 | int tryConsumeHex(int count) | - | ||||||||||||||||||||||||||||||
| 679 | { | - | ||||||||||||||||||||||||||||||
| 680 | ParseState state = saveState(); | - | ||||||||||||||||||||||||||||||
| 681 | - | |||||||||||||||||||||||||||||||
| 682 | int n = 0; | - | ||||||||||||||||||||||||||||||
| 683 | while (count--
| 1312-3701 | ||||||||||||||||||||||||||||||
| 684 | if (atEndOfPattern()
| 0-3688 | ||||||||||||||||||||||||||||||
| 685 | restoreState(state); | - | ||||||||||||||||||||||||||||||
| 686 | return executed 16 times by 1 test: -1;return -1;Executed by:
executed 16 times by 1 test: return -1;Executed by:
| 16 | ||||||||||||||||||||||||||||||
| 687 | } | - | ||||||||||||||||||||||||||||||
| 688 | n = (n << 4) | WTF::toASCIIHexValue(consume()); | - | ||||||||||||||||||||||||||||||
| 689 | } executed 3686 times by 1 test: end of blockExecuted by:
| 3686 | ||||||||||||||||||||||||||||||
| 690 | return executed 1312 times by 1 test: n;return n;Executed by:
executed 1312 times by 1 test: return n;Executed by:
| 1312 | ||||||||||||||||||||||||||||||
| 691 | } | - | ||||||||||||||||||||||||||||||
| 692 | - | |||||||||||||||||||||||||||||||
| 693 | Delegate& m_delegate; | - | ||||||||||||||||||||||||||||||
| 694 | unsigned m_backReferenceLimit; | - | ||||||||||||||||||||||||||||||
| 695 | ErrorCode m_err; | - | ||||||||||||||||||||||||||||||
| 696 | const CharType* m_data; | - | ||||||||||||||||||||||||||||||
| 697 | unsigned m_size; | - | ||||||||||||||||||||||||||||||
| 698 | unsigned m_index; | - | ||||||||||||||||||||||||||||||
| 699 | unsigned m_parenthesesNestingDepth; | - | ||||||||||||||||||||||||||||||
| 700 | - | |||||||||||||||||||||||||||||||
| 701 | - | |||||||||||||||||||||||||||||||
| 702 | static const unsigned MAX_PATTERN_SIZE = 1024 * 1024; | - | ||||||||||||||||||||||||||||||
| 703 | }; | - | ||||||||||||||||||||||||||||||
| 704 | template<class Delegate> | - | ||||||||||||||||||||||||||||||
| 705 | const char* parse(Delegate& delegate, const String& pattern, unsigned backReferenceLimit = quantifyInfinite) | - | ||||||||||||||||||||||||||||||
| 706 | { | - | ||||||||||||||||||||||||||||||
| 707 | if (pattern.is8Bit()
| 0-1148413 | ||||||||||||||||||||||||||||||
| 708 | return never executed: Parser<Delegate, LChar>(delegate, pattern, backReferenceLimit).parse();return Parser<Delegate, LChar>(delegate, pattern, backReferenceLimit).parse();never executed: return Parser<Delegate, LChar>(delegate, pattern, backReferenceLimit).parse(); | 0 | ||||||||||||||||||||||||||||||
| 709 | return executed 1148419 times by 153 tests: Parser<Delegate, UChar>(delegate, pattern, backReferenceLimit).parse();return Parser<Delegate, UChar>(delegate, pattern, backReferenceLimit).parse();Executed by:
executed 1148419 times by 153 tests: return Parser<Delegate, UChar>(delegate, pattern, backReferenceLimit).parse();Executed by:
| 1148419 | ||||||||||||||||||||||||||||||
| 710 | } | - | ||||||||||||||||||||||||||||||
| 711 | - | |||||||||||||||||||||||||||||||
| 712 | } } | - | ||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |