[Jifty-commit] r5346 - in B-Decompile: . C hints lib lib/B ramblings t

Jifty commits jifty-commit at lists.jifty.org
Wed Apr 30 05:04:45 EDT 2008


Author: clkao
Date: Wed Apr 30 05:04:31 2008
New Revision: 5346

Added:
   B-Decompile/lib/
   B-Decompile/lib/B/
   B-Decompile/lib/B/Decompile.pm
      - copied, changed from r5345, /B-Decompile/B/Deparse.pm
   B-Decompile/t/decompile.t
      - copied, changed from r5345, /B-Decompile/t/deparse.t
Removed:
   B-Decompile/B/
   B-Decompile/B.pm
   B-Decompile/B.xs
   B-Decompile/C/
   B-Decompile/NOTES
   B-Decompile/O.pm
   B-Decompile/README
   B-Decompile/TESTS
   B-Decompile/Todo
   B-Decompile/defsubs_h.PL
   B-Decompile/hints/
   B-Decompile/ramblings/
   B-Decompile/t/OptreeCheck.pm
   B-Decompile/t/asmdata.t
   B-Decompile/t/assembler.t
   B-Decompile/t/b.t
   B-Decompile/t/bblock.t
   B-Decompile/t/bytecode.t
   B-Decompile/t/concise-xs.t
   B-Decompile/t/concise.t
   B-Decompile/t/debug.t
   B-Decompile/t/deparse.t
   B-Decompile/t/f_map
   B-Decompile/t/f_map.t
   B-Decompile/t/f_sort
   B-Decompile/t/f_sort.t
   B-Decompile/t/lint.t
   B-Decompile/t/o.t
   B-Decompile/t/optree_check.t
   B-Decompile/t/optree_concise.t
   B-Decompile/t/optree_samples.t
   B-Decompile/t/optree_sort.t
   B-Decompile/t/optree_specials.t
   B-Decompile/t/optree_varinit.t
   B-Decompile/t/showlex.t
   B-Decompile/t/stash.t
   B-Decompile/t/terse.t
   B-Decompile/t/xref.t
   B-Decompile/typemap
Modified:
   B-Decompile/Makefile.PL

Log:
redist B::Deparse to B::Decompile.

Modified: B-Decompile/Makefile.PL
==============================================================================
--- B-Decompile/Makefile.PL	(original)
+++ B-Decompile/Makefile.PL	Wed Apr 30 05:04:31 2008
@@ -1,65 +1,8 @@
-use ExtUtils::MakeMaker;
-use Config;
-use File::Spec;
+use strict;
+use lib '.';
+use inc::Module::Install;
 
-my $e = $Config{'exe_ext'};
-my $o = $Config{'obj_ext'};
-my $exeout_flag = '-o ';
-my $core = grep { $_ eq 'PERL_CORE=1' } @ARGV;
-if ($^O eq 'MSWin32') {
-    if ($Config{'cc'} =~ /^cl/i) {
-	$exeout_flag = '-Fe';
-    }
-    elsif ($Config{'cc'} =~ /^bcc/i) {
-	$exeout_flag = '-e';
-    }
-}
+name        'B-Decompile';
+all_from    'lib/B/Decompile.pm';
 
-WriteMakefile(
-    NAME	    => "B",
-    VERSION_FROM    => "B.pm",
-    PL_FILES	    => { 'defsubs_h.PL' => 'defsubs.h' },
-    MAN3PODS	    => {},
-    clean	    => {
-	FILES	    => "perl$e *$o B.c defsubs.h *~"
-    }
-);
-
-package MY;
-
-sub post_constants {
-    "\nLIBS = $Config::Config{libs}\n"
-}
-
-sub headerfilefile {
-    push @makefileopts, MAN3PODS => {};
-}
-
-sub headerpath {
-    if ($core) {
-	return File::Spec->catdir(File::Spec->updir,
-				   File::Spec->updir);
-    } else {
-	return File::Spec->catdir($Config::Config{archlibexp}, "CORE");
-    }
-}
-
-sub MY::postamble {
-    my $headerpath = headerpath();
-    my @headers = map { File::Spec->catfile($headerpath, $_) } qw(op.h cop.h);
-    my $noecho = shift->{NOECHO};
-
-"
-B\$(OBJ_EXT) : defsubs.h
-
-defsubs.h :: @headers defsubs_h.PL
-	\$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) defsubs_h.PL defsubs.h $headerpath
-"
-}
-
-sub MY::processPL {
-    my $text = shift->SUPER::processPL(@_);
-    # Append our extra parameter
-    $text =~ s/^\t.*defsubs_h\.PL.*/$& . ' ' . headerpath()/me;
-    $text;
-}
+sign; WriteAll;

Copied: B-Decompile/lib/B/Decompile.pm (from r5345, /B-Decompile/B/Deparse.pm)
==============================================================================
--- /B-Decompile/B/Deparse.pm	(original)
+++ B-Decompile/lib/B/Decompile.pm	Wed Apr 30 05:04:31 2008
@@ -6,7 +6,7 @@
 # This is based on the module of the same name by Malcolm Beattie,
 # but essentially none of his code remains.
 
-package B::Deparse;
+package B::Decompile;
 use Carp;
 use B qw(class main_root main_start main_cv svref_2object opnumber perlstring
 	 OPf_WANT OPf_WANT_VOID OPf_WANT_SCALAR OPf_WANT_LIST
@@ -610,7 +610,7 @@
 sub compile {
     my(@args) = @_;
     return sub {
-	my $self = B::Deparse->new(@args);
+	my $self = __PACKAGE__->new(@args);
 	# First deparse command-line args
 	if (defined $^I) { # deparse -i
 	    print q(BEGIN { $^I = ).perlstring($^I).qq(; }\n);

Copied: B-Decompile/t/decompile.t (from r5345, /B-Decompile/t/deparse.t)
==============================================================================
--- /B-Decompile/t/deparse.t	(original)
+++ B-Decompile/t/decompile.t	Wed Apr 30 05:04:31 2008
@@ -23,8 +23,8 @@
 use strict;
 use Test::More tests => 43;
 
-use B::Deparse;
-my $deparse = B::Deparse->new();
+use B::Decompile;
+my $deparse = B::Decompile->new();
 ok($deparse);
 
 # Tell B::Deparse about our ambient pragmas
@@ -84,7 +84,7 @@
 $path .= " -MMac::err=unix" if $Is_MacOS;
 my $redir = $Is_MacOS ? "" : "2>&1";
 
-$a = `$^X $path "-MO=Deparse" -anlwi.bak -e 1 $redir`;
+$a = `$^X $path "-MO=Decompile" -anlwi.bak -e 1 $redir`;
 $a =~ s/-e syntax OK\n//g;
 $a =~ s/.*possible typo.*\n//;	   # Remove warning line
 $a =~ s{\\340\\242}{\\s} if (ord("\\") == 224); # EBCDIC, cp 1047 or 037
@@ -109,12 +109,12 @@
 
 #Re: perlbug #35857, patch #24505
 #handle warnings::register-ed packages properly.
-package B::Deparse::Wrapper;
+package B::Decompile::Wrapper;
 use strict;
 use warnings;
 use warnings::register;
 sub getcode {
-   my $deparser = B::Deparse->new();
+   my $deparser = B::Decompile->new();
    return $deparser->coderef2text(shift);
 }
 
@@ -123,7 +123,7 @@
 use warnings;
 sub test {
    my $val = shift;
-   my $res = B::Deparse::Wrapper::getcode($val);
+   my $res = B::Decompile::Wrapper::getcode($val);
    like( $res, qr/use warnings/);
 }
 my ($q,$p);


More information about the Jifty-commit mailing list