From: Vincent Pit Date: Sun, 27 Feb 2011 00:55:51 +0000 (+0100) Subject: Switch to qw<> X-Git-Tag: rt63842~6 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=f0596ac13a537630fc7421d5d21249a603bd0375;p=perl%2Fmodules%2FB-RecDeparse.git Switch to qw<> --- diff --git a/lib/B/RecDeparse.pm b/lib/B/RecDeparse.pm index c5c5fa9..213b640 100644 --- a/lib/B/RecDeparse.pm +++ b/lib/B/RecDeparse.pm @@ -9,7 +9,7 @@ use B (); use Config; -use base qw/B::Deparse/; +use base qw; =head1 NAME @@ -187,7 +187,7 @@ sub pp_gv { $body = $self->SUPER::pp_gv(@_); } else { $body = do { - local @{$self}{qw/brd_sub brd_cur/} = (0, $self->{brd_cur} + 1); + local @{$self}{qw} = (0, $self->{brd_cur} + 1); local $seen->{$name} = 1; 'sub ' . $self->indent($self->deparse_sub($gv->CV)); }; diff --git a/samples/brd.pl b/samples/brd.pl index bd0f7e3..f49a8eb 100755 --- a/samples/brd.pl +++ b/samples/brd.pl @@ -3,7 +3,7 @@ use strict; use warnings; -use lib qw{blib/lib}; +use lib qw; use B::RecDeparse; my $deparser = B::RecDeparse->new(deparse => [ '-sCi0v1' ], level => 1); diff --git a/t/02-can.t b/t/02-can.t index b2ba12a..8edd47d 100644 --- a/t/02-can.t +++ b/t/02-can.t @@ -7,6 +7,6 @@ use Test::More tests => 6; require B::RecDeparse; -for (qw/new init pp_gv pp_entersub pp_const coderef2text/) { +for (qw) { ok(B::RecDeparse->can($_), 'BRD can ' . $_); } diff --git a/t/10-obj.t b/t/10-obj.t index 1a2695e..49f3dc7 100644 --- a/t/10-obj.t +++ b/t/10-obj.t @@ -22,5 +22,5 @@ ok(defined $brd3, 'BRD::new called as a function works '); is(ref $brd3, 'B::RecDeparse', 'BRD::new called as a functions returns a B::RecDeparse object'); ok($brd3->isa('B::Deparse'), 'BRD is a BD'); -eval { $brd2 = new B::RecDeparse qw/a b c/ }; +eval { $brd2 = new B::RecDeparse qw }; like($@, qr/Optional\s+arguments/, 'BRD::new gets parameters as key => value pairs'); diff --git a/t/12-level.t b/t/12-level.t index 9ac53b4..4d4a5a7 100644 --- a/t/12-level.t +++ b/t/12-level.t @@ -30,19 +30,19 @@ sub which { my $br_args = '-sCi0v1'; my $brd = B::RecDeparse->new(deparse => [ $br_args ], level => -1); -which $brd, [ ], [ qw/add mul fma/ ], -1; +which $brd, [ ], [ qw ], -1; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 0); -which $brd, [ qw/fma/ ], [ qw/add mul/ ], 0; +which $brd, [ qw ], [ qw ], 0; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 1); -which $brd, [ qw/add mul/ ], [ qw/fma/ ], 1; +which $brd, [ qw ], [ qw ], 1; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 2); -which $brd, [ ], [ qw/add mul fma/ ], 2; +which $brd, [ ], [ qw ], 2; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 3); -which $brd, [ ], [ qw/add mul fma/ ], 2; +which $brd, [ ], [ qw ], 2; sub fakegv { return @_ } eval { $brd->coderef2text(sub { return fakegv() }) }; diff --git a/t/13-prototypes.t b/t/13-prototypes.t index f33d81d..970c8a5 100644 --- a/t/13-prototypes.t +++ b/t/13-prototypes.t @@ -30,16 +30,16 @@ sub which { my $br_args = '-sCi0v1'; my $brd = B::RecDeparse->new(deparse => [ $br_args ], level => -1); -which $brd, [ ], [ qw/add mul fma/ ], -1; +which $brd, [ ], [ qw ], -1; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 0); -which $brd, [ qw/fma/ ], [ qw/add mul/ ], 0; +which $brd, [ qw ], [ qw ], 0; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 1); -which $brd, [ qw/add mul/ ], [ qw/fma/ ], 1; +which $brd, [ qw ], [ qw ], 1; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 2); -which $brd, [ ], [ qw/add mul fma/ ], 2; +which $brd, [ ], [ qw ], 2; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 3); -which $brd, [ ], [ qw/add mul fma/ ], 2; +which $brd, [ ], [ qw ], 2; diff --git a/t/14-refs.t b/t/14-refs.t index 21c4607..33dc86a 100644 --- a/t/14-refs.t +++ b/t/14-refs.t @@ -37,17 +37,17 @@ sub which { my $br_args = '-sCi0v1'; my $brd = B::RecDeparse->new(deparse => $br_args, level => -1); -which $brd, \&foo, [ ], [ qw/add dummy/ ], [ qw/add call/ ], [ ], -1; -which $brd, \&bar, [ ], [ qw/add call/ ], [ qw/add call/ ], [ ], -1; +which $brd, \&foo, [ ], [ qw ], [ qw ], [ ], -1; +which $brd, \&bar, [ ], [ qw ], [ qw ], [ ], -1; $brd = B::RecDeparse->new(deparse => $br_args, level => 0); -which $brd, \&foo, [ qw/call/ ], [ qw/add/ ], [ qw/add/ ], [ qw/dummy/ ], 0; -which $brd, \&bar, [ ], [ qw/add call/ ], [ qw/add/ ], [ qw/dummy/ ], 0; +which $brd, \&foo, [ qw ], [ qw ], [ qw ], [ qw ], 0; +which $brd, \&bar, [ ], [ qw ], [ qw ], [ qw ], 0; $brd = B::RecDeparse->new(deparse => $br_args, level => 1); -which $brd, \&foo, [ ], [ qw/add dummy/ ], [ qw/add call/ ], [ ], 1; -which $brd, \&bar, [ ], [ qw/add call/ ], [ qw/add call/ ], [ ], 1; +which $brd, \&foo, [ ], [ qw ], [ qw ], [ ], 1; +which $brd, \&bar, [ ], [ qw ], [ qw ], [ ], 1; $brd = B::RecDeparse->new(deparse => $br_args, level => 2); -which $brd, \&foo, [ ], [ qw/add dummy/ ], [ qw/add call/ ], [ ], 2; -which $brd, \&bar, [ ], [ qw/add call/ ], [ qw/add call/ ], [ ], 2; +which $brd, \&foo, [ ], [ qw ], [ qw ], [ ], 2; +which $brd, \&bar, [ ], [ qw ], [ qw ], [ ], 2; diff --git a/t/15-pkg.t b/t/15-pkg.t index ac1c241..3195d65 100644 --- a/t/15-pkg.t +++ b/t/15-pkg.t @@ -30,16 +30,16 @@ sub which { my $br_args = '-sCi0v1'; my $brd = B::RecDeparse->new(deparse => [ $br_args ], level => -1); -which $brd, [ ], [ qw/Hlagh::add mul Dongs::fma/ ], -1; +which $brd, [ ], [ qw ], -1; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 0); -which $brd, [ qw/fma/ ], [ qw/Hlagh::add mul/ ], 0; +which $brd, [ qw ], [ qw ], 0; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 1); -which $brd, [ qw/add mul/ ], [ qw/Dongs::fma/ ], 1; +which $brd, [ qw ], [ qw ], 1; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 2); -which $brd, [ ], [ qw/Hlagh::add mul Dongs::fma/ ], 2; +which $brd, [ ], [ qw ], 2; $brd = B::RecDeparse->new(deparse => [ $br_args ], level => 3); -which $brd, [ ], [ qw/Hlagh::add mul Dongs::fma/ ], 2; +which $brd, [ ], [ qw ], 2;