This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regen/regcharclass.pl: Comment out obsolete code
authorKarl Williamson <public@khwilliamson.com>
Thu, 16 Aug 2012 04:48:47 +0000 (22:48 -0600)
committerKarl Williamson <public@khwilliamson.com>
Mon, 27 Aug 2012 17:49:07 +0000 (11:49 -0600)
Tricky folds have been removed from the code, so the removed #defines
are obsolete.  I'm leaving this in, in so it can conveniently be
referred to in case we ever need it again.

regcharclass.h
regen/regcharclass.pl

index 5e233ea..0399fca 100644 (file)
 ( 0x2028 == cp || ( 0x2028 < cp &&                                          \
 0x2029 == cp ) ) ) ) ) )
 
-/*
-       TRICKYFOLD: Problematic fold case letters.  When adding to this list, also should add them to regcomp.c and fold_grind.t
-
-       0x00DF  # LATIN SMALL LETTER SHARP S
-       0x0390  # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-       0x03B0  # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-       0x1E9E  # LATIN CAPITAL LETTER SHARP S, because maps to same as 00DF
-       0x1FD3  # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA; maps same as 0390
-       0x1FE3  # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA; maps same as 03B0
-*/
-/*** GENERATED CODE ***/
-#define is_TRICKYFOLD(s,is_utf8)                                            \
-( ( is_utf8 ) ?                                                             \
-    ( ( 0xC3 == ((U8*)s)[0] ) ?                                             \
-       ( ( 0x9F == ((U8*)s)[1] ) ? 2 : 0 )                                 \
-    : ( 0xCE == ((U8*)s)[0] ) ?                                             \
-       ( ( 0x90 == ((U8*)s)[1] || 0xB0 == ((U8*)s)[1] ) ? 2 : 0 )          \
-    : ( 0xE1 == ((U8*)s)[0] ) ?                                             \
-       ( ( 0xBA == ((U8*)s)[1] ) ?                                         \
-           ( ( 0x9E == ((U8*)s)[2] ) ? 3 : 0 )                             \
-       : ( 0xBF == ((U8*)s)[1] ) ?                                         \
-           ( ( 0x93 == ((U8*)s)[2] || 0xA3 == ((U8*)s)[2] ) ? 3 : 0 )      \
-       : 0 )                                                               \
-    : 0 )                                                                   \
-: ( 0xDF == ((U8*)s)[0] ) )
-
-/*** GENERATED CODE ***/
-#define is_TRICKYFOLD_safe(s,e,is_utf8)                                     \
-( ((e)-(s) > 2) ?                                                           \
-    ( ( is_utf8 ) ?                                                         \
-       ( ( 0xC3 == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x9F == ((U8*)s)[1] ) ? 2 : 0 )                             \
-       : ( 0xCE == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x90 == ((U8*)s)[1] || 0xB0 == ((U8*)s)[1] ) ? 2 : 0 )      \
-       : ( 0xE1 == ((U8*)s)[0] ) ?                                         \
-           ( ( 0xBA == ((U8*)s)[1] ) ?                                     \
-               ( ( 0x9E == ((U8*)s)[2] ) ? 3 : 0 )                         \
-           : ( 0xBF == ((U8*)s)[1] ) ?                                     \
-               ( ( 0x93 == ((U8*)s)[2] || 0xA3 == ((U8*)s)[2] ) ? 3 : 0 )  \
-           : 0 )                                                           \
-       : 0 )                                                               \
-    : ( 0xDF == ((U8*)s)[0] ) )                                             \
-: ((e)-(s) > 1) ?                                                           \
-    ( ( is_utf8 ) ?                                                         \
-       ( ( 0xC3 == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x9F == ((U8*)s)[1] ) ? 2 : 0 )                             \
-       : ( 0xCE == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x90 == ((U8*)s)[1] || 0xB0 == ((U8*)s)[1] ) ? 2 : 0 )      \
-       : 0 )                                                               \
-    : ( 0xDF == ((U8*)s)[0] ) )                                             \
-: ((e)-(s) > 0) ?                                                           \
-    ( ( !( is_utf8 ) ) ?                                                    \
-       ( 0xDF == ((U8*)s)[0] )                                             \
-    : 0 )                                                                   \
-: 0 )
-
-/*** GENERATED CODE ***/
-#define is_TRICKYFOLD_cp(cp)                                                \
-( 0xDF == cp || ( 0xDF < cp &&                                              \
-( 0x390 == cp || ( 0x390 < cp &&                                            \
-( 0x3B0 == cp || ( 0x3B0 < cp &&                                            \
-( 0x1E9E == cp || ( 0x1E9E < cp &&                                          \
-( 0x1FD3 == cp || ( 0x1FD3 < cp &&                                          \
-0x1FE3 == cp ) ) ) ) ) ) ) ) ) )
-
-/*** GENERATED CODE ***/
-#define what_TRICKYFOLD(s,is_utf8)                                          \
-( ( is_utf8 ) ?                                                             \
-    ( ( 0xC3 == ((U8*)s)[0] ) ?                                             \
-       ( ( 0x9F == ((U8*)s)[1] ) ? 0xDF : 0 )                              \
-    : ( 0xCE == ((U8*)s)[0] ) ?                                             \
-       ( ( 0x90 == ((U8*)s)[1] ) ? 0x390                                   \
-       : ( 0xB0 == ((U8*)s)[1] ) ? 0x3B0 : 0 )                             \
-    : ( 0xE1 == ((U8*)s)[0] ) ?                                             \
-       ( ( 0xBA == ((U8*)s)[1] ) ?                                         \
-           ( ( 0x9E == ((U8*)s)[2] ) ? 0x1E9E : 0 )                        \
-       : ( 0xBF == ((U8*)s)[1] ) ?                                         \
-           ( ( 0x93 == ((U8*)s)[2] ) ? 0x1FD3                              \
-           : ( 0xA3 == ((U8*)s)[2] ) ? 0x1FE3 : 0 )                        \
-       : 0 )                                                               \
-    : 0 )                                                                   \
-: ( 0xDF == ((U8*)s)[0] ) ? 0xDF : 0 )
-
-/*** GENERATED CODE ***/
-#define what_TRICKYFOLD_safe(s,e,is_utf8)                                   \
-( ((e)-(s) > 2) ?                                                           \
-    ( ( is_utf8 ) ?                                                         \
-       ( ( 0xC3 == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x9F == ((U8*)s)[1] ) ? 0xDF : 0 )                          \
-       : ( 0xCE == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x90 == ((U8*)s)[1] ) ? 0x390                               \
-           : ( 0xB0 == ((U8*)s)[1] ) ? 0x3B0 : 0 )                         \
-       : ( 0xE1 == ((U8*)s)[0] ) ?                                         \
-           ( ( 0xBA == ((U8*)s)[1] ) ?                                     \
-               ( ( 0x9E == ((U8*)s)[2] ) ? 0x1E9E : 0 )                    \
-           : ( 0xBF == ((U8*)s)[1] ) ?                                     \
-               ( ( 0x93 == ((U8*)s)[2] ) ? 0x1FD3                          \
-               : ( 0xA3 == ((U8*)s)[2] ) ? 0x1FE3 : 0 )                    \
-           : 0 )                                                           \
-       : 0 )                                                               \
-    : ( 0xDF == ((U8*)s)[0] ) ? 0xDF : 0 )                                  \
-: ((e)-(s) > 1) ?                                                           \
-    ( ( is_utf8 ) ?                                                         \
-       ( ( 0xC3 == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x9F == ((U8*)s)[1] ) ? 0xDF : 0 )                          \
-       : ( 0xCE == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x90 == ((U8*)s)[1] ) ? 0x390                               \
-           : ( 0xB0 == ((U8*)s)[1] ) ? 0x3B0 : 0 )                         \
-       : 0 )                                                               \
-    : ( 0xDF == ((U8*)s)[0] ) ? 0xDF : 0 )                                  \
-: ((e)-(s) > 0) ?                                                           \
-    ( ( ( !( is_utf8 ) ) && ( 0xDF == ((U8*)s)[0] ) ) ? 0xDF : 0 )          \
-: 0 )
-
-/*** GENERATED CODE ***/
-#define what_len_TRICKYFOLD(s,is_utf8,len)                                  \
-( ( is_utf8 ) ?                                                             \
-    ( ( 0xC3 == ((U8*)s)[0] ) ?                                             \
-       ( ( 0x9F == ((U8*)s)[1] ) ? len=2, 0xDF : 0 )                       \
-    : ( 0xCE == ((U8*)s)[0] ) ?                                             \
-       ( ( 0x90 == ((U8*)s)[1] ) ? len=2, 0x390                            \
-       : ( 0xB0 == ((U8*)s)[1] ) ? len=2, 0x3B0 : 0 )                      \
-    : ( 0xE1 == ((U8*)s)[0] ) ?                                             \
-       ( ( 0xBA == ((U8*)s)[1] ) ?                                         \
-           ( ( 0x9E == ((U8*)s)[2] ) ? len=3, 0x1E9E : 0 )                 \
-       : ( 0xBF == ((U8*)s)[1] ) ?                                         \
-           ( ( 0x93 == ((U8*)s)[2] ) ? len=3, 0x1FD3                       \
-           : ( 0xA3 == ((U8*)s)[2] ) ? len=3, 0x1FE3 : 0 )                 \
-       : 0 )                                                               \
-    : 0 )                                                                   \
-: ( 0xDF == ((U8*)s)[0] ) ? len=1, 0xDF : 0 )
-
-/*** GENERATED CODE ***/
-#define what_len_TRICKYFOLD_safe(s,e,is_utf8,len)                           \
-( ((e)-(s) > 2) ?                                                           \
-    ( ( is_utf8 ) ?                                                         \
-       ( ( 0xC3 == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x9F == ((U8*)s)[1] ) ? len=2, 0xDF : 0 )                   \
-       : ( 0xCE == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x90 == ((U8*)s)[1] ) ? len=2, 0x390                        \
-           : ( 0xB0 == ((U8*)s)[1] ) ? len=2, 0x3B0 : 0 )                  \
-       : ( 0xE1 == ((U8*)s)[0] ) ?                                         \
-           ( ( 0xBA == ((U8*)s)[1] ) ?                                     \
-               ( ( 0x9E == ((U8*)s)[2] ) ? len=3, 0x1E9E : 0 )             \
-           : ( 0xBF == ((U8*)s)[1] ) ?                                     \
-               ( ( 0x93 == ((U8*)s)[2] ) ? len=3, 0x1FD3                   \
-               : ( 0xA3 == ((U8*)s)[2] ) ? len=3, 0x1FE3 : 0 )             \
-           : 0 )                                                           \
-       : 0 )                                                               \
-    : ( 0xDF == ((U8*)s)[0] ) ? len=1, 0xDF : 0 )                           \
-: ((e)-(s) > 1) ?                                                           \
-    ( ( is_utf8 ) ?                                                         \
-       ( ( 0xC3 == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x9F == ((U8*)s)[1] ) ? len=2, 0xDF : 0 )                   \
-       : ( 0xCE == ((U8*)s)[0] ) ?                                         \
-           ( ( 0x90 == ((U8*)s)[1] ) ? len=2, 0x390                        \
-           : ( 0xB0 == ((U8*)s)[1] ) ? len=2, 0x3B0 : 0 )                  \
-       : 0 )                                                               \
-    : ( 0xDF == ((U8*)s)[0] ) ? len=1, 0xDF : 0 )                           \
-: ((e)-(s) > 0) ?                                                           \
-    ( ( ( !( is_utf8 ) ) && ( 0xDF == ((U8*)s)[0] ) ) ? len=1, 0xDF : 0 )   \
-: 0 )
-
 
 /* ex: set ro: */
index 42281ac..faf1572 100755 (executable)
@@ -682,6 +682,18 @@ if ( !caller ) {
 # modifiers come after the colon, valid possibilities
 # being 'fast' and 'safe'.
 #
+#
+# This is no longer used, but retained in case it is needed some day. Put the
+# lines below under __DATA__
+# TRICKYFOLD: Problematic fold case letters.  When adding to this list, also should add them to regcomp.c and fold_grind.t
+# => generic cp generic-cp generic-both :fast safe
+# 0x00DF       # LATIN SMALL LETTER SHARP S
+# 0x0390       # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+# 0x03B0       # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+# 0x1E9E  # LATIN CAPITAL LETTER SHARP S, because maps to same as 00DF
+# 0x1FD3  # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA; maps same as 0390
+# 0x1FE3  # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA; maps same as 03B0
+
 1; # in the unlikely case we are being used as a module
 
 __DATA__
@@ -727,13 +739,3 @@ VERTWS: Vertical Whitespace: \v \V
 0x85            # NEL
 0x2028          # LINE SEPARATOR
 0x2029          # PARAGRAPH SEPARATOR
-
-
-TRICKYFOLD: Problematic fold case letters.  When adding to this list, also should add them to regcomp.c and fold_grind.t
-=> generic cp generic-cp generic-both :fast safe
-0x00DF # LATIN SMALL LETTER SHARP S
-0x0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-0x03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-0x1E9E  # LATIN CAPITAL LETTER SHARP S, because maps to same as 00DF
-0x1FD3  # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA; maps same as 0390
-0x1FE3  # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA; maps same as 03B0