diff options
author | Karl Williamson <khw@cpan.org> | 2015-02-17 15:03:32 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-02-19 22:55:01 -0700 |
commit | 64935bc6975bb01af403817752e88d6540c8711d (patch) | |
tree | 6a1619ac46d1501a5b296a2b69d9af0b98db8c58 /perl.c | |
parent | 0e0b935601a8b7a2c56653412a94a36f986bc34f (diff) | |
download | perl-64935bc6975bb01af403817752e88d6540c8711d.tar.gz |
Add qr/\b{gcb}/
A function implements seeing if the space between any two characters is
a grapheme cluster break. Afer I wrote this, I realized that an array
lookup might be a better implementation, but the deadline for v5.22 was
too close to change it. I did see that my gcc optimized it down to
an array lookup.
This makes the implementation of \X go from being complicated to
trivial.
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -33,7 +33,6 @@ #include "perl.h" #include "patchlevel.h" /* for local_patches */ #include "XSUB.h" -#include "charclass_invlists.h" #ifdef NETWARE #include "nwutil.h" @@ -391,6 +390,7 @@ perl_construct(pTHXx) PL_XPosix_ptrs[_CC_VERTSPACE] = _new_invlist_C_array(VertSpace_invlist); PL_XPosix_ptrs[_CC_WORDCHAR] = _new_invlist_C_array(XPosixWord_invlist); PL_XPosix_ptrs[_CC_XDIGIT] = _new_invlist_C_array(XPosixXDigit_invlist); + PL_GCB_invlist = _new_invlist_C_array(Grapheme_Cluster_Break_invlist); ENTER; } @@ -1060,6 +1060,7 @@ perl_destruct(pTHXx) SvREFCNT_dec(PL_XPosix_ptrs[i]); PL_XPosix_ptrs[i] = NULL; } + PL_GCB_invlist = NULL; if (!specialWARN(PL_compiling.cop_warnings)) PerlMemShared_free(PL_compiling.cop_warnings); |