Changeset 72999 in webkit for trunk/JavaScriptCore/yarr/RegexCompiler.cpp
- Timestamp:
- Nov 30, 2010, 6:46:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/yarr/RegexCompiler.cpp
r72781 r72999 596 596 m_alternative->m_terms.append(copyTerm(term)); 597 597 // NOTE: this term is interesting from an analysis perspective, in that it can be ignored..... 598 m_alternative->lastTerm().quantify((max == UINT_MAX) ? max : max - min, greedy ? QuantifierGreedy : QuantifierNonGreedy);598 m_alternative->lastTerm().quantify((max == quantifyInfinite) ? max : max - min, greedy ? QuantifierGreedy : QuantifierNonGreedy); 599 599 if (m_alternative->lastTerm().type == PatternTerm::TypeParenthesesSubpattern) 600 600 m_alternative->lastTerm().parentheses.isCopy = true; … … 735 735 // In these cases we do not need to store state from prior iterations. 736 736 // We can presently avoid backtracking for: 737 // * a set of parens at the end of the regular expression (last term in any of the alternatives of the main body disjunction). 737 // * where the parens are at the end of the regular expression (last term in any of the 738 // alternatives of the main body disjunction). 738 739 // * where the parens are non-capturing, and quantified unbounded greedy (*). 739 740 // * where the parens do not contain any capturing subpatterns. … … 746 747 747 748 Vector<PatternAlternative*>& alternatives = m_pattern.m_body->m_alternatives; 748 for ( unsigned i =0; i < alternatives.size(); ++i) {749 for (size_t i = 0; i < alternatives.size(); ++i) { 749 750 Vector<PatternTerm>& terms = alternatives[i]->m_terms; 750 751 if (terms.size()) { … … 752 753 if (term.type == PatternTerm::TypeParenthesesSubpattern 753 754 && term.quantityType == QuantifierGreedy 754 && term.quantityCount == UINT_MAX755 && term.quantityCount == quantifyInfinite 755 756 && !term.capture()) 756 757 term.parentheses.isTerminal = true;
Note:
See TracChangeset
for help on using the changeset viewer.