In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/0a520fced6c7f8a21494d4e9c42cd89f3a8ff5a5?hp=1b59ab5f69dd4e996646d7ac3fe2a7197899b078>

- Log -----------------------------------------------------------------
commit 0a520fced6c7f8a21494d4e9c42cd89f3a8ff5a5
Author: Brian Fraser <[email protected]>
Date:   Sat Mar 9 15:36:34 2013 -0700

    PATCH: [perl #117101] toke.c: Make \$$1 work again.
    
    Commit 3283393 replaced the use of isWORDCHAR (\p{Word}) in scan_ident
    with isIDFIRST (\p{XIDS}). Generally this was not troublesome, since
    there are other places that deal with variables matching \d, but
    one use of isWORDCHAR had given digit variables an unintended special
    case:
    $$1 meant ${$1}, whereas $$@ or $$* were syntax errors.
    
    This commit restores the special case for \p{POSIX_Digit} variables.
-----------------------------------------------------------------------

Summary of changes:
 t/uni/variables.t |   37 +++++++++++++++++++++++++++++++++++--
 toke.c            |    6 +++++-
 2 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/t/uni/variables.t b/t/uni/variables.t
index 0e810a4..9a469d6 100644
--- a/t/uni/variables.t
+++ b/t/uni/variables.t
@@ -12,7 +12,7 @@ use utf8;
 use open qw( :utf8 :std );
 no warnings qw(misc reserved);
 
-plan (tests => 65850);
+plan (tests => 65856);
 
 # ${single:colon} should not be valid syntax
 {
@@ -167,4 +167,37 @@ for my $i (0x100..0xffff) {
            "\\x{$esc} isn't XIDS, illegal as a length-1 variable",
           )
    }
-}
\ No newline at end of file
+}
+
+{
+    # Bleadperl v5.17.9-109-g3283393 breaks ZEFRAM/Module-Runtime-0.013.tar.gz
+    # https://rt.perl.org/rt3/Public/Bug/Display.html?id=117101
+    no strict;
+
+    local $@;
+    eval <<'EOP';
+    q{$} =~ /(.)/;
+    is($$1, $$, q{$$1 parses as ${$1}});
+
+    $doof = "test";
+    $test = "Got here";
+    $::{+$$} = *doof;
+
+    is( $$$$1, $test, q{$$$$1 parses as ${${${$1}}}} );
+EOP
+    is($@, '', q{$$1 parses correctly});
+
+    for my $chr ( q{@}, "\N{U+FF10}", "\N{U+0300}" ) {
+        my $esc = sprintf("\\x{%x}", ord $chr);
+        local $@;
+        eval <<"    EOP";
+            \$$chr = q{\$};
+            \$\$$chr;
+    EOP
+
+        like($@,
+             qr/syntax error|Unrecognized character/,
+             qq{\$\$$esc is a syntax error}
+        );
+    }
+}
diff --git a/toke.c b/toke.c
index 4579e63..332f653 100644
--- a/toke.c
+++ b/toke.c
@@ -9281,7 +9281,11 @@ S_scan_ident(pTHX_ char *s, const char *send, char 
*dest, STRLEN destlen, I32 ck
        return s;
     }
     if (*s == '$' && s[1] &&
-       (isIDFIRST_lazy_if(s+1,is_utf8) || s[1] == '$' || s[1] == '{' || 
strnEQ(s+1,"::",2)) )
+      (isIDFIRST_lazy_if(s+1,is_utf8)
+         || isDIGIT_A((U8)s[1])
+         || s[1] == '$'
+         || s[1] == '{'
+         || strnEQ(s+1,"::",2)) )
     {
        return s;
     }

--
Perl5 Master Repository

Reply via email to