Define RXf_SPLIT and RXf_SKIPWHITE as 0
authorFather Chrysostomos <sprout@cpan.org>
Thu, 11 Oct 2012 16:27:18 +0000 (09:27 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 12 Oct 2012 06:07:35 +0000 (23:07 -0700)
They are on longer used in core, and we need room for more flags.

The only CPAN modules that use them check whether RXf_SPLIT is set
(which no longer happens) before setting RXf_SKIPWHITE (which is
ignored).

dump.c
regexp.h
regnodes.h

diff --git a/dump.c b/dump.c
index 830ab4b..72f7c4e 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -672,8 +672,6 @@ S_pm_description(pTHX_ const PMOP *pm)
             if (RX_EXTFLAGS(regex) & RXf_CHECK_ALL)
                 sv_catpv(desc, ",ALL");
         }
-        if (RX_EXTFLAGS(regex) & RXf_SKIPWHITE)
-            sv_catpv(desc, ",SKIPWHITE");
     }
 
     append_flags(desc, pmflags, pmflags_flags_names);
@@ -1417,12 +1415,10 @@ const struct flag_to_name regexp_flags_names[] = {
     {RXf_USE_INTUIT_NOML, "USE_INTUIT_NOML,"},
     {RXf_USE_INTUIT_ML,   "USE_INTUIT_ML,"},
     {RXf_INTUIT_TAIL,     "INTUIT_TAIL,"},
-    {RXf_SPLIT,           "SPLIT,"},
     {RXf_COPY_DONE,       "COPY_DONE,"},
     {RXf_TAINTED_SEEN,    "TAINTED_SEEN,"},
     {RXf_TAINTED,         "TAINTED,"},
     {RXf_START_ONLY,      "START_ONLY,"},
-    {RXf_SKIPWHITE,       "SKIPWHITE,"},
     {RXf_WHITE,           "WHITE,"},
     {RXf_NULL,            "NULL,"},
 };
index c515667..8f43d19 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -365,6 +365,19 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp)
     }
 }
 
+/*
+  Two flags no longer used.
+  RXf_SPLIT used to be set in Perl_pmruntime if op_flags & OPf_SPECIAL,
+  i.e., split.  It was used by the regex engine to check whether it should
+  set RXf_SKIPWHITE.  Regexp plugins on CPAN also have done the same thing
+  historically, so we leave these flags defined.
+*/
+#ifndef PERL_CORE
+# define RXf_SPLIT             0
+# define RXf_SKIPWHITE         0
+#endif
+
+
 /* Anchor and GPOS related stuff */
 #define RXf_ANCH_BOL           (1<<(RXf_BASE_SHIFT+0))
 #define RXf_ANCH_MBOL          (1<<(RXf_BASE_SHIFT+1))
@@ -393,17 +406,6 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp)
 #define RXf_USE_INTUIT_NOML    (1<<(RXf_BASE_SHIFT+12))
 #define RXf_USE_INTUIT_ML      (1<<(RXf_BASE_SHIFT+13))
 #define RXf_INTUIT_TAIL        (1<<(RXf_BASE_SHIFT+14))
-
-/*
-  This used to be set in Perl_pmruntime if op_flags & OPf_SPECIAL, i.e.
-  split.  It was used by the regex engine to check whether it should set
-  RXf_SKIPWHITE.  Regexp plugins on CPAN also have done the same thing
-  historically, so we leave this flag defined, even though it is never set.
-*/
-#if !defined(PERL_CORE) || defined(PERL_IN_DUMP_C)
-# define RXf_SPLIT             (1<<(RXf_BASE_SHIFT+15))
-#endif
-
 #define RXf_USE_INTUIT         (RXf_USE_INTUIT_NOML|RXf_USE_INTUIT_ML)
 
 /* Copy and tainted info */
@@ -417,10 +419,6 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp)
 
 /* Flags indicating special patterns */
 #define RXf_START_ONLY         (1<<(RXf_BASE_SHIFT+19)) /* Pattern is /^/ */
-/* No longer used, but CPAN modules still mention it. */
-#if !defined(PERL_CORE) || defined(PERL_IN_DUMP_C)
-# define RXf_SKIPWHITE         (1<<(RXf_BASE_SHIFT+20)) /* Pattern is for a split " " */
-#endif
 #define RXf_WHITE              (1<<(RXf_BASE_SHIFT+21)) /* Pattern is /\s+/ */
 #define RXf_NULL               (1U<<(RXf_BASE_SHIFT+22)) /* Pattern is // */
 #if RXf_BASE_SHIFT+22 > 31
index 42f2452..d411b00 100644 (file)
@@ -785,7 +785,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: 11111111111111111111111011111111 */
+       /* Bits in extflags defined: 11011110111111111111111011111111 */
        "MULTILINE",        /* 0x00000001 */
        "SINGLELINE",       /* 0x00000002 */
        "FOLD",             /* 0x00000004 */
@@ -810,12 +810,12 @@ EXTCONST char * const PL_reg_extflags_name[] = {
        "USE_INTUIT_NOML",  /* 0x00200000 */
        "USE_INTUIT_ML",    /* 0x00400000 */
        "INTUIT_TAIL",      /* 0x00800000 */
-       "SPLIT",            /* 0x01000000 */
+       "UNUSED_BIT_24",    /* 0x01000000 */
        "COPY_DONE",        /* 0x02000000 */
        "TAINTED_SEEN",     /* 0x04000000 */
        "TAINTED",          /* 0x08000000 */
        "START_ONLY",       /* 0x10000000 */
-       "SKIPWHITE",        /* 0x20000000 */
+       "UNUSED_BIT_29",    /* 0x20000000 */
        "WHITE",            /* 0x40000000 */
        "NULL",             /* 0x80000000 */
 };