In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/d52196e1e0cc54a6dcfbb4b4bc58bf6f939156ad?hp=452466a503257b1012694b0d3a3cbf260e409d18>
- Log ----------------------------------------------------------------- commit d52196e1e0cc54a6dcfbb4b4bc58bf6f939156ad Author: Father Chrysostomos <[email protected]> Date: Tue Dec 2 06:06:05 2014 -0800 Deparse FOO =~ y///r correctly Apparently anything =~ y///r with the /r never deparsed properly (just the lhs deparsed) until 05a502dc, when lexicals on the lhs started being emitted. M lib/B/Deparse.pm M lib/B/Deparse.t commit 9e32885aec635971fc615833b86a648a39d78173 Author: Father Chrysostomos <[email protected]> Date: Tue Dec 2 05:57:40 2014 -0800 Fix deparsing of $lexical =~ // I broke this in 05a502dc. M lib/B/Deparse.pm M lib/B/Deparse.t commit f752c06316a1cd1fe9c2b2aada55fb069b36a5a3 Author: Father Chrysostomos <[email protected]> Date: Tue Dec 2 05:51:36 2014 -0800 Deparse: matchop: Remove double method+function call M lib/B/Deparse.pm ----------------------------------------------------------------------- Summary of changes: lib/B/Deparse.pm | 7 ++++--- lib/B/Deparse.t | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm index 7feb52b..6c83d94 100644 --- a/lib/B/Deparse.pm +++ b/lib/B/Deparse.pm @@ -3546,7 +3546,7 @@ sub pp_null { . $self->deparse($op->first->sibling, 7), $cx, 7); } elsif (!null($op->first->sibling) and - $op->first->sibling->name eq "trans" and + $op->first->sibling->name =~ /^transr?\z/ and $op->first->sibling->flags & OPf_STACKED) { return $self->maybe_parens($self->deparse($op->first, 20) . " =~ " . $self->deparse($op->first->sibling, 20), @@ -5122,7 +5122,8 @@ sub matchop { $var = $self->deparse($kid, 20); $kid = $kid->sibling; } - elsif ($name eq 'match' and my $targ = $op->targ) { + # not $name; $name will be 'm' for both match and split + elsif ($op->name eq 'match' and my $targ = $op->targ) { $binop = 1; $var = $self->padname($targ); } @@ -5135,7 +5136,7 @@ sub matchop { if ($extended) { $re = re_uninterp_extended(escape_extended_re($unbacked)); } else { - $re = re_uninterp(escape_str(re_unback($op->precomp))); + $re = re_uninterp(escape_str($unbacked)); } } elsif ($kid->name ne 'regcomp') { carp("found ".$kid->name." where regcomp expected"); diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index 17b847b..9d2dd46 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -1098,6 +1098,10 @@ print /$s[1]/; # /$#a/ print /$#main::a/; #### +# $lexical =~ // +my $x; +$x =~ //; +#### # [perl #91318] /regexp/applaud print /a/a, s/b/c/a; print /a/aa, s/b/c/aa; @@ -1141,7 +1145,7 @@ print /a/u, s/b/c/u; s/foo/\(3);/eg; #### # y///r -tr/a/b/r; +tr/a/b/r + $a =~ tr/p/q/r; #### # y///d in list [perl #119815] () = tr/a//d; -- Perl5 Master Repository
