use namespace::clean -except => [ 'meta' ];
-with qw(Devel::REPL::Plugin::Turtles);
+sub BEFORE_PLUGIN {
+ my $self = shift;
+ $self->load_plugin('Turtles');
+}
sub AFTER_PLUGIN {
my $self = shift;
die unless $code;
- my $sub = $self->compile($code, no_mangling => 1);
+ my %opts = map { $_ => 1 } (split /\s+/, $opts);
- open my $fh, ">", \my $out;
- {
- local *STDOUT = $fh;
- B::Concise::compile((split /\s+/, $opts), $sub)->();
- }
+ my $sub = $self->compile($code, no_mangling => !delete($opts{"-mangle"}) );
- return $out;
+ if ( $self->is_error($sub) ) {
+ return $self->format($sub);
+ } else {
+ open my $fh, ">", \my $out;
+ {
+ local *STDOUT = $fh;
+ B::Concise::compile(keys %opts, $sub)->();
+ }
+
+ return $out;
+ }
}
__PACKAGE__
optrees of expressions.
The code is not actually executed, which means that when used with
-L<Deve::REPL::Plugin::OutputCache> there is .
+L<Deve::REPL::Plugin::OutputCache> there is no new value in C<_>.
The command takes the same options as L<B::Concise/compile>, e.g. C<-basic> or
C<-exec> to determine the dump order, C<-debug>, C<-concise> and C<-terse> to