[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-changes
Subject:    [perl.git]  branch smoke-me/khw-anyof updated. v5.29.5-44-gb62dd61400
From:       Karl Williamson <public () khwilliamson ! com>
Date:       2018-11-26 5:25:30
Message-ID: E1gR9Ok-0003jk-Ua () git ! dc ! perl ! space
[Download RAW message or body]

In perl.git, the branch smoke-me/khw-anyof has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/b62dd61400d43376339e189604baa4b6220d3726?hp=9463cdbd32557b042145892e2c345d2b08a0591f>


- Log -----------------------------------------------------------------
commit b62dd61400d43376339e189604baa4b6220d3726
Author: Karl Williamson <khw@cpan.org>
Date:   Sun Nov 25 22:25:02 2018 -0700

    smoke2

-----------------------------------------------------------------------

Summary of changes:
 regcomp.c    | 13 ++++---------
 t/re/anyof.t | 16 +++++++++++++++-
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/regcomp.c b/regcomp.c
index 0446a8798b..7567911cfb 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -18143,11 +18143,6 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 \
depth,  has_d_runtime_depencies = TRUE;
         RExC_seen_d_op = TRUE;
         has_runtime_dependencies = TRUE;
-
-        if (anyof_flags & \
                ANYOF_SHARED_d_MATCHES_ALL_NON_UTF8_NON_ASCII_non_d_WARN_SUPER)
-        {
-            //optimizable = FALSE;
-        }
     }
 
     /* Optimize inverted patterns (e.g. [^a-z]) when everything is known at
@@ -18315,7 +18310,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 \
depth,  if (   ! posixl
             && ! invert
             && ((start0 < 256 && LIKELY(start0 != MICRO_SIGN)) || UTF)
-            &&   cp_count > 0 && cp_count < MAX_FOLD_FROMS + 1)
+            &&   cp_count > 0 && cp_count <= MAX_FOLD_FROMS + 1)
         {
             if (cp_count == 1) {
 
@@ -18368,7 +18363,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 \
depth,  || HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(start0))
                          ? EXACTFAA
                          : EXACTFU;
-                    value = start0;
+                    value = toFOLD(start0);
                 }
                 else {
                     Size_t foldlen;
@@ -18590,8 +18585,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 \
depth,  our_code_points = &d_invlist;
                         }
                         else {  /* POSIXD, inverted. */
-                            //if (invlist_highest(only_utf8_locale) >= \
                NUM_ANYOF_CODE_POINTS) {
-                            /* XXX not true for ascii, cntrl */
+                            /*if (invlist_highest(only_utf8_locale) >= \
NUM_ANYOF_CODE_POINTS) { +                            * XXX not true for ascii, cntrl \
                */
                             if (! (anyof_flags & \
ANYOF_SHARED_d_MATCHES_ALL_NON_UTF8_NON_ASCII_non_d_WARN_SUPER))  {
                                 continue;
diff --git a/t/re/anyof.t b/t/re/anyof.t
index cd5f7f7142..d97b0d4c27 100644
--- a/t/re/anyof.t
+++ b/t/re/anyof.t
@@ -29,8 +29,17 @@ BEGIN {
 # differences are skipped on EBCDIC.  They are all at the beginning of the
 # array, and a special marker entry is used to delmit the boundary between
 # skipped and not skipped.
+#
+# NOTE:  If the pattern contains (?8) it will be upgraded to UTF-8 after
+#        stripping that
 
 my @tests = (
+    '[b]' => 'EXACT <b>',
+    '(?i)[b]' => 'EXACTFU <b>',
+    '(?i)[k]' => 'EXACTFU <k>',
+    '[kK]' => 'EXACTFAA <k>',
+    '(?i)[\xe0]' => 'EXACTF <\\x{e0}>',
+    '[\xe0\xc0]' => 'EXACTFU <\\x{e0}>',
     '[[{]' => 'ANYOFM[\[\{]',
     '[^\S ]' => 'ANYOFD[\t\n\x0B\f\r{utf8}\x85\xA0][1680 2000-200A 2028-2029 202F \
205F 3000]',  '[^\n\r]' => 'ANYOF[^\n\r][0100-INFINITY]',
@@ -307,6 +316,8 @@ my @tests = (
     '[\x{10C}-{INFINITY}\x{102}-\x{104}\x{104}]' => 'ANYOFH[0102-0104 \
                010C-INFINITY]',
     '[\x{10C}-{INFINITY}\x{102}-\x{104}\x{105}]' => 'ANYOFH[0102-0105 \
                010C-INFINITY]',
     '[\x{10C}-{INFINITY}\x{102}-\x{104}\x{106}]' => 'ANYOFH[0102-0104 0106 \
010C-INFINITY]', +    '(?8)(?i)[\x{399}]' => 'EXACTFU <\x{3b9}>',
+    '(?8)(?i)[\x{345}\x{399}\x{3B9}\x{1FBE}]' => 'EXACTFU <\x{3b9}>',
 );
 
 # 2**32-1 or 2**64-1
@@ -339,8 +350,11 @@ while (defined (my $test = shift @tests)) {
         # platform
         $test =~ s/\{INFINITY\}/$highest_cp/g;
         $test =~ s/\{INFINITY_minus_1\}/$next_highest_cp/g;
+        my $use_utf8 = ($test =~ s/\Q(?8)//);
 
-        $test = "qr/$test/";
+        $test = "my \$a = '$test';";
+        $test .= "utf8::upgrade(\$a);" if $use_utf8;
+        $test .= "qr/\$a/";
         my $actual_test = "use re qw(Debug COMPILE); $test";
 
         my $result = fresh_perl($actual_test);

-- 
Perl5 Master Repository


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic