develooper Front page | perl.perl5.porters | Postings from December 2000

[PATCH blead] Fix B::Terse indentation

Thread Next
From:
Daniel Chetlin
Date:
December 27, 2000 06:43
Subject:
[PATCH blead] Fix B::Terse indentation
Message ID:
20001227064329.B9573@darkstar
Simon noticed yesterday that the indentation for B::Terse is broken. It
appears that B::Terse used walkoptree_slow() for a reason: it provides
the levels necessary for indentation. Change #8072 switched Terse (and
B::Lint) to using the fast XS version of walkoptree().

After trawling through Lint, I can't find any good reason it can't be
using the fast version (is anyone using Lint, anyways?), but Terse
definitely needs the slow one, unless we want to change the call
signature of walkoptree(). Plus, who the heck needs the extra speed
increase when running Terse?

At any rate, the good thing about all of this is that I now understand
B. B::Deparse, however, remains a terrifying monster.

-dlc

--- ./ext/B/B/Terse.pm	2000/12/27 13:59:39	1.1
+++ ./ext/B/B/Terse.pm	2000/12/27 14:11:29
@@ -1,6 +1,6 @@
 package B::Terse;
 use strict;
-use B qw(peekop class walkoptree walkoptree_exec
+use B qw(peekop class walkoptree walkoptree_exec walkoptree_slow
 	 main_start main_root cstring svref_2object);
 use B::Asmdata qw(@specialsv_name);
 
@@ -10,7 +10,7 @@
     if ($order eq "exec") {
 	walkoptree_exec($cv->START, "terse");
     } else {
-	walkoptree($cv->ROOT, "terse");
+	walkoptree_slow($cv->ROOT, "terse");
     }
 }
 
@@ -31,7 +31,7 @@
 	if ($order eq "exec") {
 	    return sub { walkoptree_exec(main_start, "terse") }
 	} else {
-	    return sub { walkoptree(main_root, "terse") }
+	    return sub { walkoptree_slow(main_root, "terse") }
 	}
     }
 }
--- ./ext/B/B.pm	2000/12/27 14:34:26	1.1
+++ ./ext/B/B.pm	2000/12/27 14:37:10
@@ -10,7 +10,8 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-# walkoptree comes from B.pm (you are there), walkoptree comes from B.xs
+# walkoptree_slow comes from B.pm (you are there),
+# walkoptree comes from B.xs
 @EXPORT_OK = qw(minus_c ppname save_BEGINs
 		class peekop cast_I32 cstring cchar hash threadsv_names
 		main_root main_start main_cv svref_2object opnumber
--- ./t/lib/b.t	2000/12/27 14:08:26	1.1
+++ ./t/lib/b.t	2000/12/27 14:14:31
@@ -90,7 +90,7 @@
 
 $a = `$^X "-I../lib" "-MO=Terse" -e 1 2>&1`;
 print "not " unless $a =~
-/\bLISTOP\b.*leave.*\bOP\b.*enter.*\bCOP\b.*nextstate.*\bOP\b.*null/s;
+/\bLISTOP\b.*leave.*\n    OP\b.*enter.*\n    COP\b.*nextstate.*\n    OP\b.*null/s;
 ok;
 
 $a = `$^X "-I../lib" "-MO=Terse" -ane "s/foo/bar/" 2>&1`;

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