diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-04-16 11:32:43 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-05-23 17:34:35 -0600 |
commit | 1285127e601d14da808e2a7afcf2326fe7336bad (patch) | |
tree | 360a2098129e5c6a3f6bf70057b72d90ca5faeb7 | |
parent | 5bfb176298d0c97bf748d42cb50b0b40fa236b70 (diff) | |
download | perl-1285127e601d14da808e2a7afcf2326fe7336bad.tar.gz |
mktables: Add overloaded .=
This was automatically getting generated due to a bug in perl which
ignored fallback=>0, but that has been fixed by commit
f041cf0f9c6469c41de8b73d5f7b426710c3ff8b, so we have to have our own
operator.
-rw-r--r-- | lib/unicore/mktables | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables index b97b11f3d7..59d11f52a4 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -2174,6 +2174,7 @@ sub trace { return main::trace(@_); } fallback => 0, qw("") => "_operator_stringify", "." => \&main::_operator_dot, + ".=" => \&main::_operator_dot_equal, ; sub _operator_stringify { @@ -2851,6 +2852,7 @@ sub trace { return main::trace(@_); } fallback => 0, qw("") => "_operator_stringify", "." => \&main::_operator_dot, + ".=" => \&main::_operator_dot_equal, ; sub _operator_stringify { @@ -3001,6 +3003,7 @@ sub trace { return main::trace(@_); } fallback => 0, qw("") => "_operator_stringify", "." => \&main::_operator_dot, + ".=" => \&main::_operator_dot_equal, ; sub _operator_stringify { @@ -4875,6 +4878,7 @@ END use overload fallback => 0, "." => \&main::_operator_dot, + ".=" => \&main::_operator_dot_equal, '!=' => \&main::_operator_not_equal, '==' => \&main::_operator_equal, ; @@ -7686,6 +7690,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } fallback => 0, qw("") => "_operator_stringify", "." => \&main::_operator_dot, + ".=" => \&main::_operator_dot_equal, '==' => \&main::_operator_equal, '!=' => \&main::_operator_not_equal, '=' => sub { return shift }, @@ -8777,6 +8782,24 @@ sub _operator_dot { : "$self$other"; } +sub _operator_dot_equal { + # Overloaded '.=' method that is common to all packages. + + my $self = shift; + my $other = shift; + my $reversed = shift; + Carp::carp_extra_args(\@_) if main::DEBUG && @_; + + $other = "" unless defined $other; + + if ($reversed) { + return $other .= "$self"; + } + else { + return "$self" . "$other"; + } +} + sub _operator_equal { # Generic overloaded '==' routine. To be equal, they must be the exact # same object |