}
// Add multiple matches, if necessary.
- UCS2CanonicalizationRange* info = rangeInfoFor(ch);
+ const UCS2CanonicalizationRange* info = rangeInfoFor(ch);
if (info->type == CanonicalizeUnique)
addSorted(m_matchesUnicode, ch);
else
putUnicodeIgnoreCase(ch, info);
}
- void putUnicodeIgnoreCase(UChar ch, UCS2CanonicalizationRange* info)
+ void putUnicodeIgnoreCase(UChar ch, const UCS2CanonicalizationRange* info)
{
ASSERT(m_isCaseInsensitive);
ASSERT(ch > 0x7f);
ASSERT(ch >= info->begin && ch <= info->end);
ASSERT(info->type != CanonicalizeUnique);
if (info->type == CanonicalizeSet) {
- for (uint16_t* set = characterSetInfo[info->value]; (ch = *set); ++set)
+ for (const uint16_t* set = characterSetInfo[info->value]; (ch = *set); ++set)
addSorted(m_matchesUnicode, ch);
} else {
addSorted(m_matchesUnicode, ch);
if (!m_isCaseInsensitive)
return;
- UCS2CanonicalizationRange* info = rangeInfoFor(lo);
+ const UCS2CanonicalizationRange* info = rangeInfoFor(lo);
while (true) {
// Handle the range [lo .. end]
UChar end = std::min<UChar>(info->end, hi);
break;
case CanonicalizeSet: {
UChar ch;
- for (uint16_t* set = characterSetInfo[info->value]; (ch = *set); ++set)
+ for (const uint16_t* set = characterSetInfo[info->value]; (ch = *set); ++set)
addSorted(m_matchesUnicode, ch);
break;
}
return;
}
- UCS2CanonicalizationRange* info = rangeInfoFor(ch);
+ const UCS2CanonicalizationRange* info = rangeInfoFor(ch);
if (info->type == CanonicalizeUnique) {
m_alternative->m_terms.append(PatternTerm(ch));
return;
minimumInputSize = std::min(minimumInputSize, alternative->m_minimumSize);
maximumCallFrameSize = std::max(maximumCallFrameSize, currentAlternativeCallFrameSize);
hasFixedSize &= alternative->m_hasFixedSize;
+ if (alternative->m_minimumSize > INT_MAX)
+ m_pattern.m_containsUnsignedLengthPattern = true;
}
ASSERT(minimumInputSize != UINT_MAX);
if (m_pattern.m_numSubpatterns)
return;
- Vector<OwnPtr<PatternAlternative> >& alternatives = m_pattern.m_body->m_alternatives;
+ Vector<OwnPtr<PatternAlternative>>& alternatives = m_pattern.m_body->m_alternatives;
for (size_t i = 0; i < alternatives.size(); ++i) {
Vector<PatternTerm>& terms = alternatives[i]->m_terms;
if (terms.size()) {
// beginning and the end of the match.
void optimizeDotStarWrappedExpressions()
{
- Vector<OwnPtr<PatternAlternative> >& alternatives = m_pattern.m_body->m_alternatives;
+ Vector<OwnPtr<PatternAlternative>>& alternatives = m_pattern.m_body->m_alternatives;
if (alternatives.size() != 1)
return;
, m_multiline(multiline)
, m_containsBackreferences(false)
, m_containsBOL(false)
+ , m_containsUnsignedLengthPattern(false)
, m_numSubpatterns(0)
, m_maxBackReference(0)
, newlineCached(0)