Ignore:
Timestamp:
Dec 9, 2008, 11:54:04 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-12-09 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Added WREC support for an assertion followed by a quantifier. Fixed
PCRE to match.

  • wrec/WRECParser.cpp: (JSC::WREC::Parser::parseParentheses): Throw away the quantifier, since it's meaningless. (Firefox does the same.)
  • pcre/pcre_compile.cpp: (compileBranch): ditto.

LayoutTests:

2008-12-09 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Added a test for an assertion followed by a quantifier.

  • fast/regex/quantified-assertions-expected.txt: Added.
  • fast/regex/quantified-assertions.html: Added.
  • fast/regex/resources/quantified-assertions.js: Copied from fast/regex/resources/alternative-length-miscalculation.js.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/pcre/pcre_compile.cpp

    r39162 r39164  
    10591059                reqvary = (repeatMin == repeat_max) ? 0 : REQ_VARY;
    10601060               
     1061                // A quantifier after an assertion is meaningless, since assertions
     1062                // don't move index forward. So, we discard it.
     1063                if (*previous == OP_ASSERT || *previous == OP_ASSERT_NOT)
     1064                    goto END_REPEAT;
     1065               
    10611066                opType = 0;                    /* Default single-char op codes */
    10621067               
     
    14781483                }
    14791484               
    1480                 /* Process nested bracketed re. Assertions may not be repeated, but other
    1481                  kinds can be. We copy code into a non-variable in order to be able
    1482                  to pass its address because some compilers complain otherwise. Pass in a
    1483                  new setting for the ims options if they have changed. */
    1484                
    1485                 previous = (bravalue >= OP_BRAZERO) ? code : 0;
     1485                /* Process nested bracketed re. We copy code into a non-variable
     1486                 in order to be able to pass its address because some compilers
     1487                 complain otherwise. Pass in a new setting for the ims options
     1488                 if they have changed. */
     1489               
     1490                previous = code;
    14861491                *code = bravalue;
    14871492                tempcode = code;
Note: See TracChangeset for help on using the changeset viewer.