diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-05-30 03:12:25 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-05-30 03:12:25 -0500 |
commit | 071e98547d4dda83c29ea87cd4cff9115667bf24 (patch) | |
tree | 5b20f0019eb42b385f7a452c973991a1149ef625 /lib/App/REPL/Plugin/Defaults.pm | |
parent | 34218fd2af78b254dd424de2289981621ee85f94 (diff) | |
download | reply-071e98547d4dda83c29ea87cd4cff9115667bf24.tar.gz reply-071e98547d4dda83c29ea87cd4cff9115667bf24.zip |
split evaluate into compile and execute
Diffstat (limited to 'lib/App/REPL/Plugin/Defaults.pm')
-rw-r--r-- | lib/App/REPL/Plugin/Defaults.pm | 11 |
1 files changed, 9 insertions, 2 deletions
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 { |