This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rename RXf_CANY_SEEN to PREGf_CANY_SEEN and move from extflags to intflags
authorYves Orton <yves.orton@booking.com>
Thu, 30 Jan 2014 10:07:36 +0000 (18:07 +0800)
committerYves Orton <yves.orton@booking.com>
Thu, 30 Jan 2014 17:45:34 +0000 (01:45 +0800)
dump.c
regcomp.c
regcomp.h
regexec.c
regexp.h
regnodes.h

diff --git a/dump.c b/dump.c
index 9c2f5fc..ab0f595 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -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
index 87e6dd8..894cb59 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -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)) )
index d8f60db..5dbc1f3 100644 (file)
--- a/regcomp.h
+++ b/regcomp.h
 #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 */
index ffa3b0c..cc09994 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -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 {
index aa1a2d0..24a874f 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -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_UNUSED             (1<<(RXf_BASE_SHIFT+9))
+#define RXf_UNUSED2             (1<<(RXf_BASE_SHIFT+9))
 #define RXf_CHECK_ALL          (1<<(RXf_BASE_SHIFT+10))
 
 /* UTF8 related */
index 0af89b9..82b3f98 100644 (file)
@@ -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 */