From 071e98547d4dda83c29ea87cd4cff9115667bf24 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 30 May 2013 03:12:25 -0500 Subject: split evaluate into compile and execute --- lib/App/REPL/Plugin/Defaults.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/App/REPL/Plugin/Defaults.pm') diff --git a/lib/App/REPL/Plugin/Defaults.pm b/lib/App/REPL/Plugin/Defaults.pm index 23368e8..ab533b4 100644 --- a/lib/App/REPL/Plugin/Defaults.pm +++ b/lib/App/REPL/Plugin/Defaults.pm @@ -27,7 +27,7 @@ sub read_line { my $PREFIX = "package main; BEGIN { \$^H = \$" . __PACKAGE__ . "::default_hints; \%^H = \%\$" . __PACKAGE__ . "::default_hinthash; \${^WARNING_BITS} = \$" . __PACKAGE__ . "::default_warning_bits }"; -sub evaluate { +sub compile { my $self = shift; my ($next, $line, %args) = @_; @@ -35,7 +35,14 @@ sub evaluate { source => "sub { $PREFIX; $line }", terse_error => 1, %args, - )->(); + ); +} + +sub execute { + my $self = shift; + my ($next, $code) = @_; + + return $code->(); } sub print_error { -- cgit v1.2.3-54-g00ecf