Change name of PL_utf8_foldable variable
authorKarl Williamson <khw@cpan.org>
Wed, 19 Dec 2018 17:13:27 +0000 (10:13 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 25 Dec 2018 16:08:10 +0000 (09:08 -0700)
This variable's name was out-of-date and misleading.  It is the name of
an inversion list that contains all the code points in the current
version of Unicode that participate in any way in a /i type of fold.

embedvar.h
perlapi.h
perlvars.h
regcomp.c

index 8743da7..db3e8aa 100644 (file)
 #define PL_Ghash_state         (my_vars->Ghash_state)
 #define PL_hints_mutex         (my_vars->Ghints_mutex)
 #define PL_Ghints_mutex                (my_vars->Ghints_mutex)
+#define PL_in_some_fold                (my_vars->Gin_some_fold)
+#define PL_Gin_some_fold       (my_vars->Gin_some_fold)
 #define PL_keyword_plugin      (my_vars->Gkeyword_plugin)
 #define PL_Gkeyword_plugin     (my_vars->Gkeyword_plugin)
 #define PL_keyword_plugin_mutex        (my_vars->Gkeyword_plugin_mutex)
 #define PL_Gutf8_charname_begin        (my_vars->Gutf8_charname_begin)
 #define PL_utf8_charname_continue      (my_vars->Gutf8_charname_continue)
 #define PL_Gutf8_charname_continue     (my_vars->Gutf8_charname_continue)
-#define PL_utf8_foldable       (my_vars->Gutf8_foldable)
-#define PL_Gutf8_foldable      (my_vars->Gutf8_foldable)
 #define PL_utf8_foldclosures   (my_vars->Gutf8_foldclosures)
 #define PL_Gutf8_foldclosures  (my_vars->Gutf8_foldclosures)
 #define PL_utf8_idcont         (my_vars->Gutf8_idcont)
index bd1d434..e8df69b 100644 (file)
--- a/perlapi.h
+++ b/perlapi.h
@@ -157,6 +157,8 @@ END_EXTERN_C
 #define PL_hash_state          (*Perl_Ghash_state_ptr(NULL))
 #undef  PL_hints_mutex
 #define PL_hints_mutex         (*Perl_Ghints_mutex_ptr(NULL))
+#undef  PL_in_some_fold
+#define PL_in_some_fold                (*Perl_Gin_some_fold_ptr(NULL))
 #undef  PL_keyword_plugin
 #define PL_keyword_plugin      (*Perl_Gkeyword_plugin_ptr(NULL))
 #undef  PL_keyword_plugin_mutex
@@ -215,8 +217,6 @@ END_EXTERN_C
 #define PL_utf8_charname_begin (*Perl_Gutf8_charname_begin_ptr(NULL))
 #undef  PL_utf8_charname_continue
 #define PL_utf8_charname_continue      (*Perl_Gutf8_charname_continue_ptr(NULL))
-#undef  PL_utf8_foldable
-#define PL_utf8_foldable       (*Perl_Gutf8_foldable_ptr(NULL))
 #undef  PL_utf8_foldclosures
 #define PL_utf8_foldclosures   (*Perl_Gutf8_foldclosures_ptr(NULL))
 #undef  PL_utf8_idcont
index 4f0b6c0..b94bf33 100644 (file)
@@ -284,9 +284,8 @@ PERLVAR(G, SB_invlist, SV *)
 PERLVAR(G, SCX_invlist, SV *)
 PERLVAR(G, UpperLatin1,        SV *)   /* Code points 128 - 255 */
 
-/* List of characters that participate in folds (except marks, etc in
- * multi-char folds) */
-PERLVARI(G, utf8_foldable, SV *, NULL)
+/* List of characters that participate in any fold defined by Unicode */
+PERLVARI(G, in_some_fold, SV *, NULL)
 
 PERLVAR(G, utf8_idcont,        SV *)
 PERLVAR(G, utf8_idstart, SV *)
index f12c295..8cf7de4 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13049,7 +13049,7 @@ S_alloc_maybe_populate_EXACT(pTHX_ RExC_state_t *pRExC_state,
                                                cases, avoiding the
                                                _invlist_contains_cp() overhead
                                                for those.  */
-                    && ! _invlist_contains_cp(PL_utf8_foldable, code_point))
+                    && ! _invlist_contains_cp(PL_in_some_fold, code_point))
                 {
                     OP(REGNODE_p(node)) = (LOC)
                                ? EXACTL
@@ -14345,7 +14345,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
                 else /* regular fold; see if actually is in a fold */
                      if (   (ender < 256 && ! IS_IN_SOME_FOLD_L1(ender))
                          || (ender > 255
-                            && ! _invlist_contains_cp(PL_utf8_foldable, ender)))
+                            && ! _invlist_contains_cp(PL_in_some_fold, ender)))
                 {
                     /* Here, folding, but the character isn't in a fold.
                      *
@@ -17979,7 +17979,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
              * be checked.  Get the intersection of this class and all the
              * possible characters that are foldable.  This can quickly narrow
              * down a large class */
-            _invlist_intersection(PL_utf8_foldable, cp_foldable_list,
+            _invlist_intersection(PL_in_some_fold, cp_foldable_list,
                                   &fold_intersection);
 
             /* Now look at the foldable characters in this class individually */
@@ -18408,7 +18408,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
                             }
                         }
                         else {
-                            if (_invlist_contains_cp(PL_utf8_foldable, value)) {
+                            if (_invlist_contains_cp(PL_in_some_fold, value)) {
                                 op = EXACT;
                             }
                         }
@@ -21618,7 +21618,7 @@ Perl_init_uniprops(pTHX)
     PL_utf8_charname_begin = _new_invlist_C_array(uni_prop_ptrs[UNI__PERL_CHARNAME_BEGIN]);
     PL_utf8_charname_continue = _new_invlist_C_array(uni_prop_ptrs[UNI__PERL_CHARNAME_CONTINUE]);
 
-    PL_utf8_foldable = _new_invlist_C_array(uni_prop_ptrs[UNI__PERL_ANY_FOLDS]);
+    PL_in_some_fold = _new_invlist_C_array(uni_prop_ptrs[UNI__PERL_ANY_FOLDS]);
     PL_HasMultiCharFold = _new_invlist_C_array(uni_prop_ptrs[
                                             UNI__PERL_FOLDS_TO_MULTI_CHAR]);
     PL_InMultiCharFold = _new_invlist_C_array(_Perl_Is_In_Multi_Char_Fold_invlist);