diff options
author | Karl Williamson <public@khwilliamson.com> | 2010-11-30 22:35:13 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-12-01 18:18:38 -0800 |
commit | 4444fd9fcde4c2a822a058883c6dc4fd29359931 (patch) | |
tree | d7362b8522e917d9eb7429e35de8b157fc1379cf /regcomp.c | |
parent | d7ef4b7364482c4749537ca35a54bca0956e5709 (diff) | |
download | perl-4444fd9fcde4c2a822a058883c6dc4fd29359931.tar.gz |
regcomp.c: Generate REFFU and NREFFU
This causes the new nodes that denote Unicode semantics in
backreferences to be generated when appropriate.
Because the addition of these nodes was at the end of the node list, the
arithmetic relation that previously was valid no longer is.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 34 |
1 files changed, 26 insertions, 8 deletions
@@ -5849,9 +5849,15 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth) SvREFCNT_inc_simple_void(sv_dat); } RExC_sawback = 1; - ret = reganode(pRExC_state, - (U8)(FOLD ? (LOC ? NREFFL : NREFF) : NREF), - num); + ret = reganode(pRExC_state, + ((! FOLD) + ? NREF + : (UNI_SEMANTICS) + ? NREFFU + : (LOC) + ? NREFFL + : NREFF), + num); *flagp |= HASWIDTH; Set_Node_Offset(ret, parse_start+1); @@ -7531,8 +7537,14 @@ tryagain: RExC_sawback = 1; ret = reganode(pRExC_state, - (U8)(FOLD ? (LOC ? NREFFL : NREFF) : NREF), - num); + ((! FOLD) + ? NREF + : (UNI_SEMANTICS) + ? NREFFU + : (LOC) + ? NREFFL + : NREFF), + num); *flagp |= HASWIDTH; /* override incorrect value set in reganode MJD */ @@ -7593,8 +7605,14 @@ tryagain: } RExC_sawback = 1; ret = reganode(pRExC_state, - (U8)(FOLD ? (LOC ? REFFL : REFF) : REF), - num); + ((! FOLD) + ? REF + : (UNI_SEMANTICS) + ? REFFU + : (LOC) + ? REFFL + : REFF), + num); *flagp |= HASWIDTH; /* override incorrect value set in reganode MJD */ @@ -9594,7 +9612,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o) else if (k == REF || k == OPEN || k == CLOSE || k == GROUPP || OP(o)==ACCEPT) { Perl_sv_catpvf(aTHX_ sv, "%d", (int)ARG(o)); /* Parenth number */ if ( RXp_PAREN_NAMES(prog) ) { - if ( k != REF || OP(o) < NREF) { + if ( k != REF || (OP(o) != NREF && OP(o) != NREFF && OP(o) != NREFFL && OP(o) != NREFFU)) { AV *list= MUTABLE_AV(progi->data->data[progi->name_list_idx]); SV **name= av_fetch(list, ARG(o), 0 ); if (name) |