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
From:
Stephen McCamant
Date:
January 12, 2001 21:45
Subject:
[PATCH @8429] Re: B::Concise -- an improved replacement for B::Terse
Message ID:
14943.59712.993695.180189@soda.csua.berkeley.edu
>>>>> "JHI" == Jarkko Hietaniemi <jhi@iki.fi> 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 
change:

--- ext/B/B/Concise.pm.orig	Fri Jan 12 19:29:57 2001
+++ ext/B/B/Concise.pm	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
 	 SVf_IOK SVf_NOK SVf_POK OPf_KIDS);
 
 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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About