#
# Normally a bunch of argelem ops will have been generated by the
# signature parsing, but it's possible that ops have been added manually
-# or altered. In this case we "return ()" and fall back to general
+# or altered. In this case we return "()" and fall back to general
# deparsing of the individual sigelems as 'my $x = $_[N]' etc.
#
# We're only called if the first two ops are nextstate and argcheck.
# Deparse a sub. Returns everything except the 'sub foo',
# e.g. ($$) : method { ...; }
-# or ($a, $b) : prototype($$) lvalue;
+# or : prototype($$) lvalue ($a, $b) { ...; };
sub deparse_sub {
my $self = shift;
my $cv = shift;
my @attrs;
- my $protosig; # prototype or signature (what goes in the (....))
+ my $proto;
+ my $sig;
Carp::confess("NULL in deparse_sub") if !defined($cv) || $cv->isa("B::NULL");
Carp::confess("SPECIAL in deparse_sub") if $cv->isa("B::SPECIAL");
my $has_sig = $self->{hinthash}{feature_signatures};
if ($cv->FLAGS & SVf_POK) {
- my $proto = $cv->PV;
+ my $myproto = $cv->PV;
if ($has_sig) {
- push @attrs, "prototype($proto)";
+ push @attrs, "prototype($myproto)";
}
else {
- $protosig = $proto;
+ $proto = $myproto;
}
}
if ($cv->CvFLAGS & (CVf_METHOD|CVf_LOCKED|CVf_LVALUE|CVf_ANONCONST)) {
and $$o2)
{
if ($o2->name eq 'argcheck') {
- my ($nexto, $sig) = $self->deparse_argops($firstop, $cv);
+ my ($nexto, $mysig) = $self->deparse_argops($firstop, $cv);
if (defined $nexto) {
$firstop = $nexto;
- $protosig = $sig;
+ $sig = $mysig;
}
}
}
$body = ';'
}
}
- $protosig = defined $protosig ? "($protosig) " : "";
+ $proto = defined $proto ? "($proto) " : "";
+ $sig = defined $sig ? "($sig) " : "";
my $attrs = '';
$attrs = ': ' . join('', map "$_ ", @attrs) if @attrs;
- return "$protosig$attrs$body\n";
+ return "$proto$attrs$sig$body\n";
}
sub deparse_format {