This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Remove duplicate inversion list
authorKarl Williamson <public@khwilliamson.com>
Fri, 10 Feb 2012 17:35:48 +0000 (10:35 -0700)
committerKarl Williamson <public@khwilliamson.com>
Sat, 11 Feb 2012 20:31:33 +0000 (13:31 -0700)
\h and \p{XPosixBlank} contain the same code points, so there is no need
to have both of them.

charclass_invlists.h
regcomp.c
regen/mk_invlists.pl
sv.c

index 2cfcac6..5d78219 100644 (file)
@@ -36,32 +36,6 @@ UV ASCII_invlist[] = {
        0
 };
 
-UV HorizSpace_invlist[] = {
-       18,     /* Number of elements */
-       0,      /* Current iteration position */
-       1064334010, /* Version and data structure type */
-       1,      /* 0 if this is the first element of the list proper;
-                  1 if the next element is the first */
-       9,
-       10,
-       32,
-       33,
-       160,
-       161,
-       5760,
-       5761,
-       6158,
-       6159,
-       8192,
-       8203,
-       8239,
-       8240,
-       8287,
-       8288,
-       12288,
-       12289
-};
-
 UV VertSpace_invlist[] = {
        6,      /* Number of elements */
        0,      /* Current iteration position */
index fb10fc3..23a2a3b 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4841,8 +4841,6 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 orig_pm_flags)
        PL_L1PosixAlnum = _new_invlist_C_array(L1PosixAlnum_invlist);
        PL_PosixAlnum = _new_invlist_C_array(PosixAlnum_invlist);
 
-       PL_HorizSpace = _new_invlist_C_array(HorizSpace_invlist);
-
        PL_L1PosixLower = _new_invlist_C_array(L1PosixLower_invlist);
        PL_PosixLower = _new_invlist_C_array(PosixLower_invlist);
 
@@ -10863,12 +10861,13 @@ parseit:
                    /* For these, we use the nonbitmap, as /d doesn't make a
                     * difference in what these match.  There would be problems
                     * if these characters had folds other than themselves, as
-                    * nonbitmap is subject to folding */
-                   _invlist_union(nonbitmap, PL_HorizSpace, &nonbitmap);
+                    * nonbitmap is subject to folding.  It turns out that \h
+                    * is just a synonym for XPosixBlank */
+                   _invlist_union(nonbitmap, PL_XPosixBlank, &nonbitmap);
                    break;
                case ANYOF_NHORIZWS:
                     _invlist_union_complement_2nd(nonbitmap,
-                                                 PL_HorizSpace, &nonbitmap);
+                                                 PL_XPosixBlank, &nonbitmap);
                    break;
                case ANYOF_LOWER:
                case ANYOF_NLOWER:
index 46114bc..31c77de 100644 (file)
@@ -93,7 +93,6 @@ output_invlist("AboveLatin1", [ 256 ]);
 
 for my $prop (qw(
                 ASCII
-               HorizSpace
                VertSpace
                 PerlSpace
                     XPerlSpace
diff --git a/sv.c b/sv.c
index 068be55..f02627b 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -13406,8 +13406,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_L1PosixGraph    = sv_dup_inc(proto_perl->IL1PosixGraph, param);
     PL_PosixGraph      = sv_dup_inc(proto_perl->IPosixGraph, param);
 
-    PL_HorizSpace      = sv_dup_inc(proto_perl->IHorizSpace, param);
-
     PL_L1PosixLower    = sv_dup_inc(proto_perl->IL1PosixLower, param);
     PL_PosixLower      = sv_dup_inc(proto_perl->IPosixLower, param);