In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/1b38d782ea1355db1729183452181e75821f69b7?hp=843b15cc12d1b7f15c7624a8f097be474339d5a8>

- Log -----------------------------------------------------------------
commit 1b38d782ea1355db1729183452181e75821f69b7
Author: Father Chrysostomos <[email protected]>
Date:   Thu Dec 8 14:35:27 2011 -0800

    [perl #77172] Deparse &{&} as &{&}, not &&
    
    && is always tokenised as the logical-and operator, and never as the
    &{&} subroutine.  B::Deparse needs to know about this.
    
    (Oddly enough, ** can be exponentiation or the *{*} glob.)

M       dist/B-Deparse/Deparse.pm
M       dist/B-Deparse/t/deparse.t

commit 7bc8c9795bd669fcf05bd4a08bed3b162e859ddb
Author: Father Chrysostomos <[email protected]>
Date:   Thu Dec 8 14:27:15 2011 -0800

    More tests for deparsing warn()+1, etc.

M       dist/B-Deparse/t/deparse.t
-----------------------------------------------------------------------

Summary of changes:
 dist/B-Deparse/Deparse.pm  |    1 +
 dist/B-Deparse/t/deparse.t |    9 +++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm
index 10ab498..b751dc5 100644
--- a/dist/B-Deparse/Deparse.pm
+++ b/dist/B-Deparse/Deparse.pm
@@ -3531,6 +3531,7 @@ sub pp_entersub {
        $args = join(", ", map($self->deparse($_, 6), @exprs));
     }
     if ($prefix or $amper) {
+       if ($kid eq '&') { $kid = "{$kid}" } # &{&} cannot be written as &&
        if ($op->flags & OPf_STACKED) {
            return $prefix . $amper . $kid . "(" . $args . ")";
        } else {
diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t
index d71eeaa..b852a0c 100644
--- a/dist/B-Deparse/t/deparse.t
+++ b/dist/B-Deparse/t/deparse.t
@@ -399,6 +399,13 @@ my $f = sub {
 # bug #43010
 &::::;
 ####
+# [perl #77172]
+package rt77172;
+sub foo {} foo & & & foo;
+>>>>
+package rt77172;
+foo(&{&} & foo());
+####
 # variables as method names
 my $bar;
 'Foo'->$bar('orz');
@@ -873,6 +880,8 @@ CORE::do({});
 () = (eof) + 1;
 () = (return) + 1;
 () = (return, 1);
+() = warn;
+() = warn() + 1;
 () = setpgrp() + 1;
 ####
 # [perl #63558] open local(*FH)

--
Perl5 Master Repository

Reply via email to