From: Robin Edwards Date: Tue, 6 Apr 2010 15:53:37 +0000 (+0100) Subject: bump X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=67993fa62f074a51a88cc26a32af0a7645f3eb41;p=p5sagit%2FDevel-Declare-Keyword.git bump --- diff --git a/examples/SQL.pm b/examples/SQL.pm index 50a745e..1a7fb21 100644 --- a/examples/SQL.pm +++ b/examples/SQL.pm @@ -5,7 +5,7 @@ use DBI; use Carp; use Data::Dumper; -sub import { install_keyword_SELECT();}; +#sub import { install_keyword_SELECT();}; our $DBH; diff --git a/lib/Keyword/Declare.pm b/lib/Keyword/Declare.pm index a012799..dfa9d4b 100644 --- a/lib/Keyword/Declare.pm +++ b/lib/Keyword/Declare.pm @@ -23,9 +23,10 @@ Keyword::Declare - simple oo interface to Devel::Declare sub new { - my ($class) = @_; - my $self->{offset} = $_[2] || 0; - $self->{declarator} = $_[1]; + my ($class,$decl,$offset) = @_; + my $self = {}; + $self->{offset} = $offset || 0; + $self->{declarator} = $decl; bless($self,$class); } @@ -283,6 +284,8 @@ sub shadow { } Devel::Declare::shadow_sub($name, $sub); + + return $sub; } =head1 CODE diff --git a/lib/Keyword/Parse/Block.pm b/lib/Keyword/Parse/Block.pm index 67633ea..cc5ee17 100644 --- a/lib/Keyword/Parse/Block.pm +++ b/lib/Keyword/Parse/Block.pm @@ -4,7 +4,7 @@ use warnings; use B::Hooks::EndOfScope; use Data::Dumper; -#doesnt actualy 'parse' a block, just detects the start. +# doesnt actualy 'parse' a block, just detects the start. sub new { my ($parser) = @_; @@ -20,14 +20,13 @@ sub match { } } - sub inject_before { my ($self,$code) = @_; } sub code { inject_begin(@_); }; -#inject code into start of block +# inject code into start of block sub inject_begin { my ($self, $code) = @_; @@ -49,7 +48,7 @@ sub inject_begin { $self->{parser}->line($l); } -#injects code after the end of the block +# injects code after the end of the block sub inject_after { my ($self, $code) = @_; $code =~ s/\n/\ /g; @@ -62,11 +61,14 @@ sub name { no strict 'refs'; $name = $self->{parser}->package."::$name" if $name; $self->{name} = $name; - $self->{parser}->shadow($name); + return $self->{parser}->shadow($name); } +sub execute { + my ($self) = @_; +} -#set end of scope code +# set end of scope code # !! B:H:EOS won't allow you to inject code into the block sub terminate { my ($self) = @_;