Ignore:
Timestamp:
Nov 30, 2010, 6:46:28 PM (15 years ago)
Author:
[email protected]
Message:

JavaScriptCore: Fixed review comments following bug #48101.
Mostly typos, plus gave quantifyInfinite a symbolic name.

Reviewed by Darin Adler.

  • yarr/RegexCompiler.cpp:

(JSC::Yarr::RegexPatternConstructor::quantifyAtom):
(JSC::Yarr::RegexPatternConstructor::checkForTerminalParentheses):

  • yarr/RegexInterpreter.cpp:

(JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
(JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
(JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
(JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):

  • yarr/RegexJIT.cpp:

(JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
(JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
(JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):

  • yarr/RegexParser.h:

(JSC::Yarr::Parser::parseTokens):
(JSC::Yarr::parse):

LayoutTests: Ooops, file checked in with incorrect properties.

Reviewed by Darin Adler.

  • fast/regex/script-tests/repeat-match-waldemar.js: Removed property svn:executable.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/yarr/RegexCompiler.cpp

    r72781 r72999  
    596596            m_alternative->m_terms.append(copyTerm(term));
    597597            // 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);
    599599            if (m_alternative->lastTerm().type == PatternTerm::TypeParenthesesSubpattern)
    600600                m_alternative->lastTerm().parentheses.isCopy = true;
     
    735735    // In these cases we do not need to store state from prior iterations.
    736736    // 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).
    738739    //   * where the parens are non-capturing, and quantified unbounded greedy (*).
    739740    //   * where the parens do not contain any capturing subpatterns.
     
    746747
    747748        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) {
    749750            Vector<PatternTerm>& terms = alternatives[i]->m_terms;
    750751            if (terms.size()) {
     
    752753                if (term.type == PatternTerm::TypeParenthesesSubpattern
    753754                    && term.quantityType == QuantifierGreedy
    754                     && term.quantityCount == UINT_MAX
     755                    && term.quantityCount == quantifyInfinite
    755756                    && !term.capture())
    756757                    term.parentheses.isTerminal = true;
Note: See TracChangeset for help on using the changeset viewer.