X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FB%2FConcise.pm;h=fe2fc3742187b5adeab6564bf51bbaca1f3a4971;hb=refs%2Fheads%2Fmoo;hp=b26216460667094036996155ae256d0e7a1e371e;hpb=3d22167c1a074925fcfc1d69b31b4d27b358195e;p=p5sagit%2FDevel-REPL.git diff --git a/lib/Devel/REPL/Plugin/B/Concise.pm b/lib/Devel/REPL/Plugin/B/Concise.pm index b262164..fe2fc37 100644 --- a/lib/Devel/REPL/Plugin/B/Concise.pm +++ b/lib/Devel/REPL/Plugin/B/Concise.pm @@ -7,9 +7,12 @@ use B::Concise (); B::Concise::compileOpts(qw(-nobanner)); -use namespace::clean -except => [ 'meta' ]; +use namespace::sweep; -with qw(Devel::REPL::Plugin::Turtles); +sub BEFORE_PLUGIN { + my $self = shift; + $self->load_plugin('Turtles'); +} sub AFTER_PLUGIN { my $self = shift; @@ -28,7 +31,9 @@ sub expr_command_concise { die unless $code; - my $sub = $self->compile($code, no_mangling => 1); + my %opts = map { $_ => 1 } (split /\s+/, $opts); + + my $sub = $self->compile($code, no_mangling => !delete($opts{"-mangle"}) ); if ( $self->is_error($sub) ) { return $self->format($sub); @@ -36,7 +41,7 @@ sub expr_command_concise { open my $fh, ">", \my $out; { local *STDOUT = $fh; - B::Concise::compile((split /\s+/, $opts), $sub)->(); + B::Concise::compile(keys %opts, $sub)->(); } return $out; @@ -73,7 +78,7 @@ This plugin provides a C command that uses L to dump optrees of expressions. The code is not actually executed, which means that when used with -L there is . +L there is no new value in C<_>. The command takes the same options as L, e.g. C<-basic> or C<-exec> to determine the dump order, C<-debug>, C<-concise> and C<-terse> to