In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/2462c3ccada0e87002e4f7dc42bfcdfe36fe678a?hp=81bccfe42ad445b6e06432af7d7657baccd86a50>
- Log ----------------------------------------------------------------- commit 2462c3ccada0e87002e4f7dc42bfcdfe36fe678a Author: Father Chrysostomos <[email protected]> Date: Thu Dec 8 09:58:44 2011 -0800 [perl #63558] Deparse open local(*FH) correctly open FH and open local(*FH) compile down to the same structure (open *FH), but with a flag set on the rv2gv (*{}) op for the local case. B::Deparse was special-casing rv2gv for ops with * in their prototype, but without consideration for the flag. M dist/B-Deparse/Deparse.pm M dist/B-Deparse/t/deparse.t commit 266da3252fd9a9054350a8936e36633d634642a1 Author: Father Chrysostomos <[email protected]> Date: Thu Dec 8 09:34:04 2011 -0800 Deparse dump as CORE::dump Since dump() warns without CORE::, and since the two variants are indistinguishable after compilation, always deparse dump() as CORE::dump. M dist/B-Deparse/Deparse.pm M dist/B-Deparse/t/deparse.t commit 5830412df26e13be3cc236273645cb303514dae6 Author: Father Chrysostomos <[email protected]> Date: Thu Dec 8 09:30:31 2011 -0800 Deparse filetest ops without llafr Before this commit, (-e $_) + 72 deparsed incorrectly, because it became -e($_) + 72, equivalent to -e ($_+72). Concerning the removed comment, itâs more important to produce correct code than nice-looking code. M dist/B-Deparse/Deparse.pm M dist/B-Deparse/t/deparse.t ----------------------------------------------------------------------- Summary of changes: dist/B-Deparse/Deparse.pm | 10 +++++++--- dist/B-Deparse/t/deparse.t | 11 ++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index 2ca91f6..24b5606 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -2027,14 +2027,18 @@ sub pp_last { loopex(@_, "last") } sub pp_next { loopex(@_, "next") } sub pp_redo { loopex(@_, "redo") } sub pp_goto { loopex(@_, "goto") } -sub pp_dump { loopex(@_, $_[0]->keyword("dump")) } +sub pp_dump { loopex(@_, "CORE::dump") } sub ftst { my $self = shift; my($op, $cx, $name) = @_; if (class($op) eq "UNOP") { # Genuine '-X' filetests are exempt from the LLAFR, but not - # l?stat(); for the sake of clarity, give'em all parens + # l?stat() + if ($name =~ /^-/) { + (my $kid = $self->deparse($op->first, 16)) =~ s/^\cS//; + return $self->maybe_parens("$name $kid", $cx, 16); + } return $self->maybe_parens_unop($name, $op->first, $cx); } elsif (class($op) =~ /^(SV|PAD)OP$/) { return $self->maybe_parens_func($name, $self->pp_gv($op, 1), $cx, 16); @@ -2367,7 +2371,7 @@ sub listop { my $proto = prototype("CORE::$name"); if (defined $proto && $proto =~ /^;?\*/ - && $kid->name eq "rv2gv") { + && $kid->name eq "rv2gv" && !($kid->private & OPpLVAL_INTRO)) { $first = $self->deparse($kid->first, 6); } else { diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index de7b764..52a20d9 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -858,7 +858,16 @@ CORE::do({}); () = (goto 1) + 3; () = (require 'foo') + 3; () = (require foo) + 3; -() = (dump 1) + 3; +() = (CORE::dump 1) + 3; () = (last 1) + 3; () = (next 1) + 3; () = (redo 1) + 3; +() = (-R $_) + 3; +() = (-W $_) + 3; +() = (-X $_) + 3; +() = (-r $_) + 3; +() = (-w $_) + 3; +() = (-x $_) + 3; +#### +# [perl #63558] open local(*FH) +open local *FH; -- Perl5 Master Repository
