diff options
author | Zefram <zefram@fysh.org> | 2017-11-22 17:57:26 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-11-22 18:02:00 +0000 |
commit | ab179ac766f9eda4c7f539d09c43b02b45938b5c (patch) | |
tree | bdb6ba14ff905f0de54dc644a39b41e8ed03b945 /lib | |
parent | 8a0ed425bf56098485707c69bba62ee2404bef3f (diff) | |
download | perl-ab179ac766f9eda4c7f539d09c43b02b45938b5c.tar.gz |
drop op flag for implicit smartmatch
OPf_SPECIAL on a smartmatch op used to indicate that it was an implicit
smartmatch in a "when" construct. "when" no longer implies smartmatch, so
drop the comment about this flag and the special handling in B::Deparse.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/B/Deparse.pm | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm index 33b9b1e283..c2dc591f5d 100644 --- a/lib/B/Deparse.pm +++ b/lib/B/Deparse.pm @@ -51,7 +51,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring MDEREF_SHIFT ); -$VERSION = '1.45'; +$VERSION = '1.46'; use strict; our $AUTOLOAD; use warnings (); @@ -3001,6 +3001,7 @@ sub pp_i_ge { binop(@_, ">=", 15) } sub pp_i_le { binop(@_, "<=", 15) } sub pp_i_ncmp { maybe_targmy(@_, \&binop, "<=>", 14) } +sub pp_smartmatch { binop(@_, "~~", 14) } sub pp_seq { binop(@_, "eq", 14) } sub pp_sne { binop(@_, "ne", 14) } sub pp_slt { binop(@_, "lt", 15) } @@ -3012,16 +3013,6 @@ sub pp_scmp { maybe_targmy(@_, \&binop, "cmp", 14) } sub pp_sassign { binop(@_, "=", 7, SWAP_CHILDREN) } sub pp_aassign { binop(@_, "=", 7, SWAP_CHILDREN | LIST_CONTEXT) } -sub pp_smartmatch { - my ($self, $op, $cx) = @_; - if (($op->flags & OPf_SPECIAL) && $self->{expand} < 2) { - return $self->deparse($op->last, $cx); - } - else { - binop(@_, "~~", 14); - } -} - # '.' is special because concats-of-concats are optimized to save copying # by making all but the first concat stacked. The effect is as if the # programmer had written '($a . $b) .= $c', except legal. |