Re: B::Concise -- an improved replacement for B::Terse
authorStephen McCamant <smcc@mit.edu>
Fri, 12 Jan 2001 21:45:17 +0000 (13:45 -0800)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 13 Jan 2001 05:55:55 +0000 (05:55 +0000)
Message-ID: <14943.59712.993695.180189@soda.csua.berkeley.edu>

p4raw-id: //depot/perl@8431

ext/B/B/Concise.pm

index 9f53955..cc894d3 100644 (file)
@@ -3,15 +3,15 @@ package B::Concise;
 # 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 @@ sub concise_op {
        $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[.*/][];
@@ -667,6 +668,10 @@ The B-determined class of the OP, in all caps.
 
 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>
 
 The name of the OP, or 'ex-foo' if the OP is a null that used to be a foo.