Ignore:
Timestamp:
May 19, 2010, 8:20:05 AM (15 years ago)
Author:
[email protected]
Message:

The backtrackParenthesesOnceEnd function should store the start position
of the subpattern's non-greedy match at the place of the subpattern's
start index in the output array instead of the place of the
subpattern's end index.
Add layout test for checking of non-greedy matching of subpattern in
regular expressions.
https://bugs.webkit.org/show_bug.cgi?id=39289

Patch by Peter Varga <[email protected]> on 2010-05-19
Reviewed by Darin Adler.

JavaScriptCore:

  • yarr/RegexInterpreter.cpp:

(JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):

LayoutTests:

  • fast/js/regexp-non-greedy-parentheses-expected.txt: Added.
  • fast/js/regexp-non-greedy-parentheses.html: Added.
  • fast/js/script-tests/regexp-non-greedy-parentheses.js: Added.
File:
1 edited

Legend:

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

    r55900 r59766  
    675675                if (term.capture()) {
    676676                    unsigned subpatternId = term.atom.subpatternId;
    677                     output[(subpatternId << 1) + 1] = input.getPos() + term.inputPosition;
     677                    output[subpatternId << 1] = input.getPos() + term.inputPosition;
    678678                }
    679679                context->term -= term.atom.parenthesesWidth;
Note: See TracChangeset for help on using the changeset viewer.