This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp: Change name of #define to better reflect its purpose
authorKarl Williamson <public@khwilliamson.com>
Thu, 16 Aug 2012 02:49:59 +0000 (20:49 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 20 Nov 2012 00:13:00 +0000 (17:13 -0700)
ANYOF_MAX is used for two different purposes; this separates them and
creates a separate #define for one of them.

regcomp.c
regcomp.h

index 6d868af..3a95ea9 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -11762,7 +11762,7 @@ parseit:
                    Safefree(name);
                }
                RExC_parse = e + 1;
-               namedclass = ANYOF_MAX;  /* no official name, but it's named */
+               namedclass = ANYOF_UNIPROP;  /* no official name, but it's named */
 
                /* \p means they want Unicode semantics */
                RExC_uni_semantics = 1;
@@ -12160,8 +12160,7 @@ parseit:
                     DO_N_POSIX(ret, namedclass, posixes,
                                             PL_PosixXDigit, PL_XPosixXDigit);
                    break;
-               case ANYOF_MAX:
-                   /* this is to handle \p and \P */
+               case ANYOF_UNIPROP: /* this is to handle \p and \P */
                    break;
                default:
                    vFAIL("Invalid [::] class");
@@ -12504,7 +12503,7 @@ parseit:
                     *flagp |= HASWIDTH|SIMPLE;
                     break;
 
-                case ANYOF_MAX:
+                case ANYOF_UNIPROP:
                     break;
 
                 case ANYOF_NBLANK:
index e9a64fe..1f6f765 100644 (file)
--- a/regcomp.h
+++ b/regcomp.h
@@ -428,6 +428,9 @@ struct regnode_charclass_class {
 #define ANYOF_HORIZWS  (ANYOF_MAX+3)
 #define ANYOF_NHORIZWS (ANYOF_MAX+4)
 
+#define ANYOF_UNIPROP   (ANYOF_MAX+5)  /* Used to indicate a Unicode property:
+                                          \p{} or \P{} */
+
 /* Backward source code compatibility. */
 
 #define ANYOF_ALNUML    ANYOF_ALNUM