develooper Front page | perl.perl5.porters | Postings from January 2001

[PATCH @8429] Re: B::Concise -- an improved replacement for B::Terse

Thread Previous | Thread Next
Stephen McCamant
January 12, 2001 21:45
[PATCH @8429] Re: B::Concise -- an improved replacement for B::Terse
Message ID:
>>>>> "JHI" == Jarkko Hietaniemi <> writes:

JHI> On Fri, Jan 12, 2001 at 02:04:11PM -0600, Jarkko Hietaniemi wrote:
SMcC> command line options and a little documentation. What I'm
SMcC> wondering now is whether this should go in the core (to either
SMcC> supplement or
JHI> I added it now to the core.

JHI> ...but had to revert the B::Terse replacement, since the lib/b test
JHI> didn't work any more.

Oops; I hadn't realized the extent to which other modules (B::Bblock
and B::Showlex) depended on B::Terse's module interface. I had been
thinking of the replacement as working for Terse called from the
command line, but since B::Concise uses different internal interfaces, 
it doesn't look there's an easy way to make it handle the way other
modules use Terse; forget I ever mentioned the wrapper module idea.

Test 12 did however reveal two areas in which B::Concise,-terse's
output was different from B::Terse's, which are fixed in the following 

--- ext/B/B/	Fri Jan 12 19:29:57 2001
+++ ext/B/B/	Fri Jan 12 21:31:15 2001
@@ -3,15 +3,15 @@
 # This program is free software; you can redistribute and/or modify it
 # under the same terms as Perl itself.
-our $VERSION = "0.50";
+our $VERSION = "0.51";
 use strict;
 use B qw(class ppname main_start main_root main_cv cstring svref_2object
 my %style = 
   ("terse" =>
-   ["(?(#label =>\n)?)(*(    )*)#class (#addr) pp_#name "
-    . "(?([#targ])?) #svclass~(?((#svaddr))?)~#svval\n",
+   ["(?(#label =>\n)?)(*(    )*)#class (#addr) #name (?([#targ])?) "
+    . "#svclass~(?((#svaddr))?)~#svval~(?(label \"#coplabel\")?)\n",
     "(*(    )*)goto #class (#addr)\n",
     "#class pp_#name"],
    "concise" =>
@@ -352,6 +352,7 @@
 	$h{svval} = '"' . $op->pv . '"';
     } elsif ($h{class} eq "COP") {
 	my $label = $op->label;
+	$h{coplabel} = $label;
 	$label = $label ? "$label: " : "";
 	my $loc = $op->file;
 	$loc =~ s[.*/][];
@@ -666,6 +667,10 @@
 =item B<#classym>
 A single symbol abbreviating the class of the OP.
+=item B<#coplabel>
+The label of the statement or block the OP is the start of, if any.
 =item B<#exname>
 -- Stephen McC

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About