diff options
author | Simon Cozens <simon@netthink.co.uk> | 2000-08-09 04:49:20 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-11 01:12:39 +0000 |
commit | 6aaf4108701d03e3663ab149b084be98635a4897 (patch) | |
tree | ba778aa0a848717ee591eae6d1488a5776cb7757 /ext | |
parent | bbdae7b29367ab5f4679c8f66f10c445d0daa657 (diff) | |
download | perl-6aaf4108701d03e3663ab149b084be98635a4897.tar.gz |
B::Deparse didn't do sub attributes.
Subject: B::Deparse was Re: [ID 20000808.005] refs to returned lvalues are lvalues??
Message-ID: <slrn8p1omg.beq.simon@justanother.perlhacker.org>
p4raw-id: //depot/perl@6589
Diffstat (limited to 'ext')
-rw-r--r-- | ext/B/B.xs | 2 | ||||
-rw-r--r-- | ext/B/B/Deparse.pm | 8 | ||||
-rw-r--r-- | ext/B/defsubs_h.PL | 1 |
3 files changed, 10 insertions, 1 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs index 9e2985582a..7704ccdd2f 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1210,7 +1210,7 @@ CvXSUBANY(cv) MODULE = B PACKAGE = B::CV -U8 +U16 CvFLAGS(cv) B::CV cv diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index b6e1097593..0e876400f2 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -14,6 +14,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber OPpLVAL_INTRO OPpENTERSUB_AMPER OPpSLICE OPpCONST_BARE OPpTRANS_SQUASH OPpTRANS_DELETE OPpTRANS_COMPLEMENT OPpTARGET_MY SVf_IOK SVf_NOK SVf_ROK SVf_POK + CVf_METHOD CVf_LOCKED CVf_LVALUE PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED); $VERSION = 0.591; @@ -432,6 +433,13 @@ sub deparse_sub { if ($cv->FLAGS & SVf_POK) { $proto = "(". $cv->PV . ") "; } + if ($cv->CvFLAGS & (CVf_METHOD|CVf_LOCKED|CVf_LVALUE)) { + $proto .= ": "; + $proto .= "lvalue " if $cv->CvFLAGS & CVf_LVALUE; + $proto .= "locked " if $cv->CvFLAGS & CVf_LOCKED; + $proto .= "method " if $cv->CvFLAGS & CVf_METHOD; + } + local($self->{'curcv'}) = $cv; local($self->{'curstash'}) = $self->{'curstash'}; if (not null $cv->ROOT) { diff --git a/ext/B/defsubs_h.PL b/ext/B/defsubs_h.PL index 80ef936fce..759013bbcc 100644 --- a/ext/B/defsubs_h.PL +++ b/ext/B/defsubs_h.PL @@ -8,6 +8,7 @@ open(OUT,">$out") || die "Cannot open $file:$!"; print "Extracting $out...\n"; foreach my $const (qw(AVf_REAL HEf_SVKEY + CVf_METHOD CVf_LOCKED CVf_LVALUE SVf_IOK SVf_IVisUV SVf_NOK SVf_POK SVf_ROK SVp_IOK SVp_POK )) { |