Change 13705 by jhi@alpha on 2001/12/15 22:17:10
Subject: [PATCH B::Deparse] rcatline support ($_.=<ARGV>)
From: Rafael Garcia-Suarez <[EMAIL PROTECTED]>
Date: Sat, 15 Dec 2001 23:21:43 +0100
Message-ID: <20011215232143.A11790@rafael>
Affected files ...
.... //depot/perl/ext/B/B/Deparse.pm#96 edit
.... //depot/perl/ext/B/t/deparse.t#3 edit
Differences ...
==== //depot/perl/ext/B/B/Deparse.pm#96 (text) ====
Index: perl/ext/B/B/Deparse.pm
--- perl/ext/B/B/Deparse.pm.~1~ Sat Dec 15 15:30:05 2001
+++ perl/ext/B/B/Deparse.pm Sat Dec 15 15:30:05 2001
@@ -942,7 +942,6 @@
# The following OPs don't have functions:
# pp_padany -- does not exist after parsing
-# pp_rcatline -- does not exist
sub pp_enter { # see also leave
cluck "unexpected OP_ENTER";
@@ -1668,6 +1667,12 @@
return $self->unop($op, $cx, "readline");
}
+sub pp_rcatline {
+ my $self = shift;
+ my($op) = @_;
+ return "<" . $self->gv_name($op->gv) . ">";
+}
+
# Unary operators that can occur as pseudo-listops inside double quotes
sub dq_unop {
my $self = shift;
@@ -2491,6 +2496,14 @@
$cx, 20);
} elsif ($op->flags & OPf_SPECIAL && $cx == 0 && !$op->targ) {
return "do {\n\t". $self->deparse($op->first, $cx) ."\n\b};";
+ } elsif (!null($op->first->sibling) and
+ $op->first->sibling->name eq "null" and
+ class($op->first->sibling) eq "UNOP" and
+ $op->first->sibling->first->flags & OPf_STACKED and
+ $op->first->sibling->first->name eq "rcatline") {
+ return $self->maybe_parens($self->deparse($op->first, 18) . " .= "
+ . $self->deparse($op->first->sibling, 18),
+ $cx, 18);
} else {
return $self->deparse($op->first, $cx);
}
@@ -4201,6 +4214,7 @@
Stephen McCamant <[EMAIL PROTECTED]>, based on an earlier
version by Malcolm Beattie <[EMAIL PROTECTED]>, with
contributions from Gisle Aas, James Duncan, Albert Dvornik, Robin
-Houston, Hugo van der Sanden, Gurusamy Sarathy, and Nick Ing-Simmons.
+Houston, Hugo van der Sanden, Gurusamy Sarathy, Nick Ing-Simmons,
+and Rafael Garcia-Suarez.
=cut
==== //depot/perl/ext/B/t/deparse.t#3 (text) ====
Index: perl/ext/B/t/deparse.t
--- perl/ext/B/t/deparse.t.~1~ Sat Dec 15 15:30:05 2001
+++ perl/ext/B/t/deparse.t Sat Dec 15 15:30:05 2001
@@ -15,7 +15,7 @@
use strict;
use Config;
-print "1..15\n";
+print "1..16\n";
use B::Deparse;
my $deparse = B::Deparse->new() or print "not ";
@@ -180,3 +180,7 @@
# 12
my %x;
$x{warn()};
+####
+# 13
+my $foo;
+$_ .= <ARGV> . <$foo>;
End of Patch.