diff options
author | Yves Orton <yves.orton@booking.com> | 2014-01-30 18:07:36 +0800 |
---|---|---|
committer | Yves Orton <yves.orton@booking.com> | 2014-01-31 01:45:34 +0800 |
commit | 0d331aaf61fba3b76c8d35852b94950c028661de (patch) | |
tree | 35935a21266f1e7f4ef0d2f1534a25a21f31da32 | |
parent | e3e400ec345b9fd8b4129bb36c3d0b73c95cadcd (diff) | |
download | perl-0d331aaf61fba3b76c8d35852b94950c028661de.tar.gz |
Rename RXf_CANY_SEEN to PREGf_CANY_SEEN and move from extflags to intflags
-rw-r--r-- | dump.c | 14 | ||||
-rw-r--r-- | regcomp.c | 4 | ||||
-rw-r--r-- | regcomp.h | 1 | ||||
-rw-r--r-- | regexec.c | 4 | ||||
-rw-r--r-- | regexp.h | 4 | ||||
-rw-r--r-- | regnodes.h | 6 |
6 files changed, 21 insertions, 12 deletions
@@ -1542,6 +1542,9 @@ const struct flag_to_name gp_flags_imported_names[] = { {GVf_IMPORTED_CV, " CV"}, }; +/* NOTE: this structure is mostly duplicative of one generated by + * 'make regen' in regnodes.h - perhaps we should somehow integrate + * the two. - Yves */ const struct flag_to_name regexp_extflags_names[] = { {RXf_PMf_MULTILINE, "PMf_MULTILINE,"}, {RXf_PMf_SINGLELINE, "PMf_SINGLELINE,"}, @@ -1556,7 +1559,6 @@ const struct flag_to_name regexp_extflags_names[] = { {RXf_GPOS_FLOAT, "GPOS_FLOAT,"}, {RXf_NO_INPLACE_SUBST, "NO_INPLACE_SUBST,"}, {RXf_EVAL_SEEN, "EVAL_SEEN,"}, - {RXf_CANY_SEEN, "CANY_SEEN,"}, {RXf_CHECK_ALL, "CHECK_ALL,"}, {RXf_MATCH_UTF8, "MATCH_UTF8,"}, {RXf_USE_INTUIT_NOML, "USE_INTUIT_NOML,"}, @@ -1572,14 +1574,18 @@ const struct flag_to_name regexp_extflags_names[] = { {RXf_NULL, "NULL,"}, }; +/* NOTE: this structure is mostly duplicative of one generated by + * 'make regen' in regnodes.h - perhaps we should somehow integrate + * the two. - Yves */ const struct flag_to_name regexp_core_intflags_names[] = { {PREGf_SKIP, "SKIP,"}, - {PREGf_IMPLICIT, "IMPLICIT,"}, - {PREGf_NAUGHTY, "NAUGHTY,"}, + {PREGf_IMPLICIT, "IMPLICIT,"}, + {PREGf_NAUGHTY, "NAUGHTY,"}, {PREGf_VERBARG_SEEN, "VERBARG_SEEN,"}, {PREGf_CUTGROUP_SEEN, "CUTGROUP_SEEN,"}, - {PREGf_USE_RE_EVAL, "USE_RE_EVAL,"}, + {PREGf_USE_RE_EVAL, "USE_RE_EVAL,"}, {PREGf_NOSCAN, "NOSCAN,"}, + {PREGf_CANY_SEEN, "CANY_SEEN,"}, }; void @@ -7023,7 +7023,7 @@ reStudy: if (pRExC_state->num_code_blocks) r->extflags |= RXf_EVAL_SEEN; if (RExC_seen & REG_SEEN_CANY) - r->extflags |= RXf_CANY_SEEN; + r->intflags |= PREGf_CANY_SEEN; if (RExC_seen & REG_SEEN_VERBARG) { r->intflags |= PREGf_VERBARG_SEEN; @@ -7409,7 +7409,7 @@ Perl_reg_numbered_buff_fetch(pTHX_ REGEXP * const r, const I32 paren, sv_setpvn(sv, s, i); TAINT_set(oldtainted); #endif - if ( (rx->extflags & RXf_CANY_SEEN) + if ( (rx->intflags & PREGf_CANY_SEEN) ? (RXp_MATCH_UTF8(rx) && (!i || is_utf8_string((U8*)s, i))) : (RXp_MATCH_UTF8(rx)) ) @@ -136,6 +136,7 @@ #define PREGf_USE_RE_EVAL 0x00000020 /* compiled with "use re 'eval'" */ /* these used to be extflags, but are now intflags */ #define PREGf_NOSCAN 0x00000040 +#define PREGf_CANY_SEEN 0x00000080 /* this is where the old regcomp.h started */ @@ -699,7 +699,7 @@ Perl_re_intuit_start(pTHX_ goto fail; } if (prog->check_offset_min == prog->check_offset_max - && !(prog->extflags & RXf_CANY_SEEN) + && !(prog->intflags & PREGf_CANY_SEEN) && ! multiline) /* /m can cause \n's to match that aren't accounted for in the string max length. See [perl #115242] */ @@ -785,7 +785,7 @@ Perl_re_intuit_start(pTHX_ (IV)prog->check_end_shift); }); - if (prog->extflags & RXf_CANY_SEEN) { + if (prog->intflags & PREGf_CANY_SEEN) { start_point= (U8*)(s + srch_start_shift); end_point= (U8*)(strend - srch_end_shift); } else { @@ -399,10 +399,10 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp) /* What we have seen */ #define RXf_NO_INPLACE_SUBST (1<<(RXf_BASE_SHIFT+6)) #define RXf_EVAL_SEEN (1<<(RXf_BASE_SHIFT+7)) -#define RXf_CANY_SEEN (1<<(RXf_BASE_SHIFT+8)) +#define RXf_UNUSED1 (1<<(RXf_BASE_SHIFT+8)) /* Special */ -#define RXf_UNUSED1 (1<<(RXf_BASE_SHIFT+9)) +#define RXf_UNUSED2 (1<<(RXf_BASE_SHIFT+9)) #define RXf_CHECK_ALL (1<<(RXf_BASE_SHIFT+10)) /* UTF8 related */ diff --git a/regnodes.h b/regnodes.h index 0af89b90f9..82b3f98d13 100644 --- a/regnodes.h +++ b/regnodes.h @@ -658,8 +658,8 @@ EXTCONST char * const PL_reg_extflags_name[] = { "GPOS_FLOAT", /* 0x00004000 */ "NO_INPLACE_SUBST", /* 0x00008000 */ "EVAL_SEEN", /* 0x00010000 */ - "CANY_SEEN", /* 0x00020000 */ - "NOSCAN", /* 0x00040000 */ + "UNUSED1", /* 0x00020000 */ + "UNUSED2", /* 0x00040000 */ "CHECK_ALL", /* 0x00080000 */ "MATCH_UTF8", /* 0x00100000 */ "USE_INTUIT_NOML", /* 0x00200000 */ @@ -688,6 +688,8 @@ EXTCONST char * const PL_reg_intflags_name[] = { "VERBARG_SEEN", /* 0x00000008 - PREGf_VERBARG_SEEN */ "CUTGROUP_SEEN", /* 0x00000010 - PREGf_CUTGROUP_SEEN */ "USE_RE_EVAL", /* 0x00000020 - PREGf_USE_RE_EVAL - compiled with "use re 'eval'" */ + "NOSCAN", /* 0x00000040 - PREGf_NOSCAN */ + "CANY_SEEN", /* 0x00000080 - PREGf_CANY_SEEN */ }; #endif /* DOINIT */ |