1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 18:35:49 -04:00

make deparse do more for me

This commit is contained in:
Ryan Voots 2017-04-14 17:33:43 -04:00
parent 661de2e297
commit a386dd2c5e

View file

@ -180,7 +180,7 @@ no warnings;
if( $@ ) { print STDOUT "Error: $@"; return } if( $@ ) { print STDOUT "Error: $@"; return }
my $dp = B::Deparse->new("-p", "-q", "-x7", "-d"); my $dp = B::Deparse->new("-p", "-q", "-x7", "-d");
local *B::Deparse::declare_hints = sub { '' };
my @out; my @out;
my $clean_out = sub { my $clean_out = sub {
@ -190,11 +190,9 @@ no warnings;
$ret =~ s/no warnings;//; $ret =~ s/no warnings;//;
$ret =~ s/\s+/ /g; $ret =~ s/\s+/ /g;
$ret =~ s/\s*\}\s*$//; $ret =~ s/\s*\}\s*$//;
$ret =~ s/\s*\$\^H\{[^}]+\}(\s+=\s+[^;]+;?)?\s*//g;
$ret =~ s/\s*BEGIN\s*\{\s*[^}]*\s*\}\s*/ /;
$ret =~ s/package botdeparse;//;
$ret =~ s/no feature ':all';//; $ret =~ s/no feature ':all';//;
$ret =~ s/use feature [^;]+;//; $ret =~ s/use feature [^;]+;//;
$ret =~ s/^\(\)//g;
$ret =~ s/^\s+|\s+$//g; $ret =~ s/^\s+|\s+$//g;
return $ret; return $ret;
}; };