In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/af352bf2fad22f15849580c84ed131e70e025d43?hp=83a85f49e265a458a481a9dc402dd3bdd30ae457>

- Log -----------------------------------------------------------------
commit af352bf2fad22f15849580c84ed131e70e025d43
Author: Karl Williamson <[email protected]>
Date:   Sun Feb 1 21:28:54 2015 -0700

    "A" =~ '\N{U+41}' (partial) should be true on all platforms
    
    The code for handling this only worked in double-quotish contexts.  To
    make it work in single-quotish areas as well, it needs to be moved out
    of toke.c, and corresponding code added to regcomp.c.  This commit does
    just the portion that removes the code from toke.c.  The other portion
    hasn't been fully debugged yet.  This means that blead will now fail on
    EBCDIC platforms in double-quotish contexts.  But EBCDIC platforms
    aren't fully supported in blead currently anyway.
    
    The reason this partial commit is being pushed to blead now is that its
    absence is blocking other work in toke.c
    
    Spotted by Father Chrysostomos

M       toke.c

commit 6bc3569fe6275067040e4614905f35d4a60b241c
Author: Karl Williamson <[email protected]>
Date:   Fri Jan 23 09:18:09 2015 -0700

    regcomp.c: Fix typos in variable name
    
    This caused EBCDIC builds to fail

M       regcomp.c
-----------------------------------------------------------------------

Summary of changes:
 regcomp.c |  4 ++--
 toke.c    | 40 ++++++----------------------------------
 2 files changed, 8 insertions(+), 36 deletions(-)

diff --git a/regcomp.c b/regcomp.c
index b0686c4..edab543 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -14981,7 +14981,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, 
U32 depth,
                 if (prevvalue == 'A') {
                     if (value == 'Z'
 #ifdef EBCDIC
-                        && ! non_portable_end_point
+                        && ! non_portable_endpoint
 #endif
                     ) {
                         arg = (FOLD) ? _CC_ALPHA : _CC_UPPER;
@@ -14991,7 +14991,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, 
U32 depth,
                 else if (prevvalue == 'a') {
                     if (value == 'z'
 #ifdef EBCDIC
-                        && ! non_portable_end_point
+                        && ! non_portable_endpoint
 #endif
                     ) {
                         arg = (FOLD) ? _CC_ALPHA : _CC_LOWER;
diff --git a/toke.c b/toke.c
index fb9db0f..67b6096 100644
--- a/toke.c
+++ b/toke.c
@@ -3307,38 +3307,8 @@ S_scan_const(pTHX_ char *start)
                    }
 
                    if (PL_lex_inpat) {
-#ifdef EBCDIC
-                       s -= 5;     /* Include the '\N{U+' */
-                        /* On EBCDIC platforms, in \N{U+...}, the '...' is a
-                         * Unicode value, so convert to native so downstream
-                         * code can continue to assume it's native */
-                        /* XXX This should be in the regexp parser,
-                               because doing it here makes /\N{U+41}/ and
-                               =~ '\N{U+41}' do different things.  */
-                       d += my_snprintf(d, e - s + 1 + 1,  /* includes the '}'
-                                                              and the \0 */
-                                         "\\N{U+%X",
-                                         (unsigned int) UNI_TO_NATIVE(uv));
-                        s += 5 + len;
-                        while (*s == '.') {
-                            s++;
-                            len = e - s;
-                            uv = grok_hex(s, &len, &flags, NULL);
-                            if (!len
-                             || (len != (STRLEN)(e - s) && s[len] != '.'))
-                                goto bad_NU;
-                            s--;
-                            d += my_snprintf(
-                                     d, e - s + 1 + 1, ".%X",
-                                     (unsigned int)UNI_TO_NATIVE(uv)
-                                 );
-                            s += len + 1;
-                        }
-                        *(d++) = '}';
-#else
-                        /* On non-EBCDIC platforms, pass it through unchanged.
-                         * The reason we evaluate the numbers is to make
-                         * sure there wasn't a syntax error. */
+
+                        /* In patterns, we can have \N{U+xxxx.yyyy.zzzz...} */
                         const char * const orig_s = s - 5;
                         while (*s == '.') {
                             s++;
@@ -3348,10 +3318,12 @@ S_scan_const(pTHX_ char *start)
                              || (len != (STRLEN)(e - s) && s[len] != '.'))
                                 goto bad_NU;
                         }
-                        /* +1 is for the '}' */
+
+                        /* Pass everything through unchanged.  The reason we
+                         * evaluate the numbers is to make sure there wasn't a
+                         * syntax error.  +1 is for the '}' */
                         Copy(orig_s, d, e - orig_s + 1, char);
                         d += e - orig_s + 1;
-#endif
                    }
                    else {  /* Not a pattern: convert the hex to string */
 

--
Perl5 Master Repository

Reply via email to