From: Yitzchak Scott-Thoennes Date: Wed, 31 Aug 2005 14:18:00 +0000 (+0000) Subject: Re: Optree Generation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2db5ca0a86d6b3a21023f595f7a9ea5a35b63ed3;p=p5sagit%2Fp5-mst-13.2.git Re: Optree Generation Message-ID: <20050831121822.GA3464@efn.org> p4raw-id: //depot/perl@25352 --- diff --git a/ext/B/B/Concise.pm b/ext/B/B/Concise.pm index 20c443d..d24f857 100644 --- a/ext/B/B/Concise.pm +++ b/ext/B/B/Concise.pm @@ -627,7 +627,7 @@ sub private_flags { } sub concise_sv { - my($sv, $hr) = @_; + my($sv, $hr, $preferpv) = @_; $hr->{svclass} = class($sv); $hr->{svclass} = "UV" if $hr->{svclass} eq "IV" and $sv->FLAGS & SVf_IVisUV; @@ -650,6 +650,8 @@ sub concise_sv { } if (class($sv) eq "SPECIAL") { $hr->{svval} .= ["Null", "sv_undef", "sv_yes", "sv_no"]->[$$sv]; + } elsif ($preferpv && $sv->FLAGS & SVf_POK) { + $hr->{svval} .= cstring($sv->PV); } elsif ($sv->FLAGS & SVf_NOK) { $hr->{svval} .= $sv->NV; } elsif ($sv->FLAGS & SVf_IOK) { @@ -764,12 +766,13 @@ sub concise_op { elsif ($h{class} eq "SVOP" or $h{class} eq "PADOP") { unless ($h{name} eq 'aelemfast' and $op->flags & OPf_SPECIAL) { my $idx = ($h{class} eq "SVOP") ? $op->targ : $op->padix; + my $preferpv = $h{name} eq "method_named"; if ($h{class} eq "PADOP" or !${$op->sv}) { my $sv = (($curcv->PADLIST->ARRAY)[1]->ARRAY)[$idx]; - $h{arg} = "[" . concise_sv($sv, \%h) . "]"; + $h{arg} = "[" . concise_sv($sv, \%h, $preferpv) . "]"; $h{targarglife} = $h{targarg} = ""; } else { - $h{arg} = "(" . concise_sv($op->sv, \%h) . ")"; + $h{arg} = "(" . concise_sv($op->sv, \%h, $preferpv) . ")"; } } }