Change 14440 by jhi@alpha on 2002/01/27 15:20:52

        Subject: [PATCH B::Deparse] new switch: don't check prototypes while deparsing
        From: Rafael Garcia-Suarez <[EMAIL PROTECTED]>
        Date: Sun, 27 Jan 2002 14:51:10 +0100
        Message-ID: <20020127145110.A16332@rafael>

Affected files ...

.... //depot/perl/ext/B/B/Deparse.pm#104 edit

Differences ...

==== //depot/perl/ext/B/B/Deparse.pm#104 (text) ====
Index: perl/ext/B/B/Deparse.pm
--- perl/ext/B/B/Deparse.pm.~1~ Sun Jan 27 08:30:05 2002
+++ perl/ext/B/B/Deparse.pm     Sun Jan 27 08:30:05 2002
@@ -490,6 +490,8 @@
            $self->{'files'}{$1} = 1;
        } elsif ($arg eq "-p") {
            $self->{'parens'} = 1;
+       } elsif ($arg eq "-P") {
+           $self->{'noproto'} = 1;
        } elsif ($arg eq "-l") {
            $self->{'linenums'} = 1;
        } elsif ($arg eq "-q") {
@@ -2779,6 +2781,7 @@
 # or ("", $args_after_prototype_demunging) if it does.
 sub check_proto {
     my $self = shift;
+    return "&" if $self->{'noproto'};
     my($proto, @args) = @_;
     my($arg, $real);
     my $doneok = 0;
@@ -3781,6 +3784,22 @@
 which probably isn't what you intended (the C<'???'> is a sign that
 perl optimized away a constant value).
 
+=item B<-P>
+
+Disable prototype checking. With this option, all function calls are
+deparsed as if no prototype was defined for them. In other words,
+
+    perl -MO=Deparse,-P -e 'sub foo (\@) { 1 } foo @x'
+
+will print
+
+    sub foo (\@) {
+       1;
+    }
+    &foo(\@x);
+
+making clear how the parameters are actually passed to C<foo>.
+
 =item B<-q>
 
 Expand double-quoted strings into the corresponding combinations of
End of Patch.

Reply via email to