diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-05 17:15:30 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-05 17:15:30 +0000 |
commit | 8f6ae13c8af6db5c57cde14346d77d89a10817d3 (patch) | |
tree | 07bc1e8a370597d168d8d4aa82f3569b6dbce71b | |
parent | b9ad30b40cf004f5ea6fd7a945a950cf873aed7b (diff) | |
download | perl-8f6ae13c8af6db5c57cde14346d77d89a10817d3.tar.gz |
Abolish RXf_UTF8. Store the UTF-8-ness of the pattern with SvUTF8().
p4raw-id: //depot/perl@32852
-rw-r--r-- | op.c | 1 | ||||
-rw-r--r-- | pp_ctl.c | 1 | ||||
-rw-r--r-- | regcomp.c | 7 | ||||
-rw-r--r-- | regexec.c | 1 | ||||
-rw-r--r-- | regexp.h | 3 | ||||
-rw-r--r-- | regnodes.h | 4 |
6 files changed, 6 insertions, 11 deletions
@@ -3449,7 +3449,6 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg) const char *const p = SvPV(pat, len); pat = newSVpvn_flags(p, len, SVs_TEMP); } - assert(!(pm_flags & RXf_UTF8)); PM_SETRE(pm, CALLREGCOMP(pat, pm_flags)); @@ -159,7 +159,6 @@ PP(pp_regcomp) const char *const p = SvPV(tmpstr, len); tmpstr = newSVpvn_flags(p, len, SVs_TEMP); } - assert(!(pm_flags & RXf_UTF8)); if (eng) PM_SETRE(pm, CALLREGCOMP_ENG(eng, tmpstr, pm_flags)); @@ -4176,9 +4176,6 @@ Perl_re_compile(pTHX_ const SV * const pattern, U32 pm_flags) DEBUG_r(if (!PL_colorset) reginitcolors()); RExC_utf8 = RExC_orig_utf8 = SvUTF8(pattern); - assert(!(pm_flags & RXf_UTF8)); - if (RExC_utf8) - pm_flags |= RXf_UTF8; DEBUG_COMPILE_r({ SV *dsv= sv_newmortal(); @@ -4300,6 +4297,7 @@ redo_first_pass: p = sv_grow(rx, wraplen + 1); SvCUR_set(rx, wraplen); SvPOK_on(rx); + SvFLAGS(rx) |= SvUTF8(pattern); *p++='('; *p++='?'; if (has_p) *p++ = KEEPCOPY_PAT_MOD; /*'p'*/ @@ -4413,7 +4411,7 @@ reStudy: /*dmq: removed as part of de-PMOP: pm->op_pmflags = RExC_flags; */ if (UTF) - r->extflags |= RXf_UTF8; /* Unicode in it? */ + SvUTF8_on(rx); /* Unicode in it? */ ri->regstclass = NULL; if (RExC_naughty >= 10) /* Probably an expensive pattern. */ r->intflags |= PREGf_NAUGHTY; @@ -9214,6 +9212,7 @@ Perl_reg_temp_copy (pTHX_ REGEXP *rx) { space in the copy is zero. As we've just done a struct copy, it's now a case of zero-ing that, rather than copying the current length. */ SvPV_set(ret_x, RX_WRAPPED(rx)); + SvFLAGS(ret_x) |= SvFLAGS(rx) & (SVf_POK|SVp_POK|SVf_UTF8); StructCopy(r, ret, regexp); SvLEN_set(ret_x, 0); Newx(ret->offs, npar, regexp_paren_pair); @@ -3767,7 +3767,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog) const char *const p = SvPV(ret, len); ret = newSVpvn_flags(p, len, SVs_TEMP); } - assert(!(pm_flags & RXf_UTF8)); rx = CALLREGCOMP(ret, pm_flags); if (!(SvFLAGS(ret) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY @@ -302,7 +302,6 @@ and check for NULL. #define RXf_CHECK_ALL 0x00040000 /* UTF8 related */ -#define RXf_UTF8 0x00080000 #define RXf_MATCH_UTF8 0x00100000 /* Intuit related */ @@ -412,7 +411,7 @@ and check for NULL. : (RX_MATCH_UTF8_off(prog), (PL_reg_match_utf8 = 0))) /* Whether the pattern stored at RX_WRAPPED is in UTF-8 */ -#define RX_UTF8(prog) (RX_EXTFLAGS(prog) & RXf_UTF8) +#define RX_UTF8(prog) SvUTF8(prog) #define REXEC_COPY_STR 0x01 /* Need to copy the string. */ #define REXEC_CHECKED 0x02 /* check_substr already checked. */ diff --git a/regnodes.h b/regnodes.h index b47e450e1d..79de061fb6 100644 --- a/regnodes.h +++ b/regnodes.h @@ -625,7 +625,7 @@ EXTCONST char * const PL_reg_name[] = { EXTCONST char * PL_reg_extflags_name[]; #else EXTCONST char * const PL_reg_extflags_name[] = { - /* Bits in extflags defined: 11111111111111111111111100111111 */ + /* Bits in extflags defined: 11111111111101111111111100111111 */ "MULTILINE", /* 0x00000001 */ "SINGLELINE", /* 0x00000002 */ "FOLD", /* 0x00000004 */ @@ -645,7 +645,7 @@ EXTCONST char * const PL_reg_extflags_name[] = { "CANY_SEEN", /* 0x00010000 */ "NOSCAN", /* 0x00020000 */ "CHECK_ALL", /* 0x00040000 */ - "UTF8", /* 0x00080000 */ + "UNUSED_BIT_19", /* 0x00080000 */ "MATCH_UTF8", /* 0x00100000 */ "USE_INTUIT_NOML", /* 0x00200000 */ "USE_INTUIT_ML", /* 0x00400000 */ |