From: Robin Edwards Date: Tue, 6 Apr 2010 17:01:24 +0000 (+0100) Subject: massive fix up for re-name X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b503dd6edccabd1287f28d9354047613ad62bded;p=p5sagit%2FDevel-Declare-Keyword.git massive fix up for re-name --- diff --git a/MANIFEST b/MANIFEST index 05b79ee..3f86aed 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2,12 +2,12 @@ Changes Makefile.PL MANIFEST README -lib/Keyword.pm -lib/Keyword/Declare.pm -lib/Keyword/Parser.pm -lib/Keyword/Parse/Ident.pm -lib/Keyword/Parse/Block.pm -lib/Keyword/Parse/Proto.pm +lib/Devel/Declare/Keyword.pm +lib/Devel/Declare/Keyword/Declare.pm +lib/Devel/Declare/Keyword/Parser.pm +lib/Devel/Declare/Keyword/Parse/Ident.pm +lib/Devel/Declare/Keyword/Parse/Block.pm +lib/Devel/Declare/Keyword/Parse/Proto.pm examples/DDExample.pm examples/Methods.pm examples/SQL.pm diff --git a/Makefile.PL b/Makefile.PL index 4842105..648bed8 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,7 +2,7 @@ use inc::Module::Install; # Define metadata name 'Keyword'; -all_from 'lib/Keyword.pm'; +all_from 'lib/Devel/Declare/Keyword.pm'; # Specific dependencies requires 'Devel::Declare' => '0.0'; diff --git a/examples/Methods.pm b/examples/Methods.pm index 19bb808..3c3c9f2 100644 --- a/examples/Methods.pm +++ b/examples/Methods.pm @@ -1,6 +1,6 @@ package Methods; use lib 'lib/'; -use Keyword qw/debug/; +use Devel::Declare::Keyword qw/debug/; use Data::Dumper; keyword method (ident?, proto?, block) { diff --git a/examples/SQL.pm b/examples/SQL.pm index 1a7fb21..82ceab8 100644 --- a/examples/SQL.pm +++ b/examples/SQL.pm @@ -1,12 +1,10 @@ package SQL; use lib 'lib/'; -use Keyword; +use Devel::Declare::Keyword; use DBI; use Carp; use Data::Dumper; -#sub import { install_keyword_SELECT();}; - our $DBH; keyword SELECT (sql) { diff --git a/lib/Devel/Declare/Keyword.pm b/lib/Devel/Declare/Keyword.pm index 586e52a..4c43bc2 100644 --- a/lib/Devel/Declare/Keyword.pm +++ b/lib/Devel/Declare/Keyword.pm @@ -1,4 +1,4 @@ -package Keyword; +package Devel::Declare::Keyword; use 5.008000; use strict; use warnings; @@ -6,11 +6,11 @@ use Carp; use Devel::Declare; use B::Hooks::EndOfScope; use Data::Dumper; -use Keyword::Declare; -use Keyword::Parser; -use Keyword::Parse::Block; -use Keyword::Parse::Proto 'parse_proto'; -use Keyword::Parse::Ident 'parse_ident'; +use Devel::Declare::Keyword::Declare; +use Devel::Declare::Keyword::Parser; +use Devel::Declare::Keyword::Parse::Block; +use Devel::Declare::Keyword::Parse::Proto 'parse_proto'; +use Devel::Declare::Keyword::Parse::Ident 'parse_ident'; our $VERSION = '0.03'; our $KW_MODULE = caller; @@ -30,7 +30,7 @@ sub import { no strict 'refs'; *{$KW_MODULE.'::keyword'} = sub (&) { - $Keyword::__keyword_block = shift; + $Devel::Declare::Keyword::__keyword_block = shift; }; *{$KW_MODULE.'::parse'} = sub (&) { }; *{$KW_MODULE.'::action'} = sub (&) { }; @@ -41,7 +41,7 @@ sub import { #parses keyword signature sub keyword_parser { - my $kd = Keyword::Declare->new(@_); + my $kd = Devel::Declare::Keyword::Declare->new(@_); $kd->next_token; $kd->skip_ws; @@ -56,7 +56,7 @@ sub keyword_parser { confess "expecting prototype for keyword at:\n".$kd->line; my $b = 1 if $proto =~ /block/i; - my $parser = Keyword::Parser->new({proto=>$proto, + my $parser = Devel::Declare::Keyword::Parser->new({proto=>$proto, module=>$KW_MODULE, block=>$b, keyword=>$keyword}); no strict 'refs'; @@ -64,7 +64,7 @@ sub keyword_parser { $kd->skip_ws; my $l = $kd->line; - my $code = "BEGIN { Keyword::eos()}; ".kw_proto_to_code($proto); + my $code = "BEGIN { Devel::Declare::Keyword::eos()}; ".kw_proto_to_code($proto); substr($l, $kd->offset+1, 0) = $code; $kd->line($l); @@ -74,7 +74,7 @@ sub keyword_parser { # parses the parse keyword sub parse_parser { - my $kd = Keyword::Declare->new(@_); + my $kd = Devel::Declare::Keyword::Declare->new(@_); $kd->next_token; $kd->skip_ws; @@ -88,7 +88,7 @@ sub parse_parser { $kd->skip_ws; my $l = $kd->line; - my $code = "BEGIN { Keyword::eos()}; my ($proto) = \@_;"; + my $code = "BEGIN { Devel::Declare::Keyword::eos()}; my ($proto) = \@_;"; substr($l, $kd->offset+1, 0) = $code; $kd->line($l); @@ -101,7 +101,7 @@ sub parse_parser { # parses the action keyword sub action_parser { - my $kd = Keyword::Declare->new(@_); + my $kd = Devel::Declare::Keyword::Declare->new(@_); $kd->next_token; $kd->skip_ws; @@ -115,7 +115,7 @@ sub action_parser { $kd->skip_ws; my $l = $kd->line; - my $code = "BEGIN { Keyword::eos()}; my ($proto) = \@_;"; + my $code = "BEGIN { Devel::Declare::Keyword::eos()}; my ($proto) = \@_;"; substr($l, $kd->offset+1, 0) = $code; $kd->line($l); @@ -128,7 +128,7 @@ sub action_parser { sub eos { on_scope_end { - my $kd = new Keyword::Declare; + my $kd = Devel::Declare::Keyword::Declare->new; my $l = $kd->line; my $loffset = $kd->line_offset; substr($l, $loffset, 0) = ';'; @@ -177,7 +177,7 @@ sub mk_import { else { no strict 'refs'; *{$module_user."::$keyword"} = sub { - &$Keyword::__keyword_block(@Keyword::__keyword_block_arg); + &$Devel::Declare::Keyword::__keyword_block(@Devel::Declare::Keyword::__keyword_block_arg); }; } }; @@ -189,14 +189,14 @@ __END__ =head1 NAME -Keyword - an easy way to declare keyword with custom parsers +Devel::Declare::Keyword - an easy way to declare keyword with custom parsers =cut =head1 SYNOPSIS package Method; - use Keyword 'debug'; + use Devel::Declare::Keyword; keyword method (ident?, proto?, block) { $block->name($ident); # assign the block to subroutine @@ -277,9 +277,7 @@ There job is to convert whatever is matched to injectable perl code. =head1 CODE -http://github.com/robinedwards/Keyword - -git@github.com:robinedwards/Keyword.git +git push p5sagit@git.shadowcat.co.uk:Devel-Declare-Keyword.git =head1 AUTHOR diff --git a/lib/Devel/Declare/Keyword/Declare.pm b/lib/Devel/Declare/Keyword/Declare.pm index dfa9d4b..62da055 100644 --- a/lib/Devel/Declare/Keyword/Declare.pm +++ b/lib/Devel/Declare/Keyword/Declare.pm @@ -1,4 +1,4 @@ -package Keyword::Declare; +package Devel::Declare::Keyword::Declare; use strict; use warnings; use Carp; @@ -16,7 +16,7 @@ Keyword::Declare - simple oo interface to Devel::Declare =head1 SYNOPSIS - my $kd = new Keyword::Declare; + my $kd = new Devel::Declare::Keyword::Declare; print $kd->line; =cut @@ -288,12 +288,6 @@ sub shadow { return $sub; } -=head1 CODE - -http://github.com/robinedwards/Keyword - -git@github.com:robinedwards/Keyword.git - =head1 AUTHOR Robin Edwards diff --git a/lib/Devel/Declare/Keyword/Parse/Block.pm b/lib/Devel/Declare/Keyword/Parse/Block.pm index cc5ee17..11980c4 100644 --- a/lib/Devel/Declare/Keyword/Parse/Block.pm +++ b/lib/Devel/Declare/Keyword/Parse/Block.pm @@ -1,4 +1,4 @@ -package Keyword::Parse::Block; +package Devel::Declare::Keyword::Parse::Block; use strict; use warnings; use B::Hooks::EndOfScope; diff --git a/lib/Devel/Declare/Keyword/Parse/Ident.pm b/lib/Devel/Declare/Keyword/Parse/Ident.pm index b863788..ce4f75f 100644 --- a/lib/Devel/Declare/Keyword/Parse/Ident.pm +++ b/lib/Devel/Declare/Keyword/Parse/Ident.pm @@ -1,4 +1,4 @@ -package Keyword::Parse::Ident; +package Devel::Declare::Keyword::Parse::Ident; use strict; use warnings; use Exporter 'import'; diff --git a/lib/Devel/Declare/Keyword/Parse/Proto.pm b/lib/Devel/Declare/Keyword/Parse/Proto.pm index 4a7a921..ee36b91 100644 --- a/lib/Devel/Declare/Keyword/Parse/Proto.pm +++ b/lib/Devel/Declare/Keyword/Parse/Proto.pm @@ -1,4 +1,4 @@ -package Keyword::Parse::Proto; +package Devel::Declare::Keyword::Parse::Proto; use strict; use warnings; use Exporter 'import'; diff --git a/lib/Devel/Declare/Keyword/Parser.pm b/lib/Devel/Declare/Keyword/Parser.pm index c635332..9d381b0 100644 --- a/lib/Devel/Declare/Keyword/Parser.pm +++ b/lib/Devel/Declare/Keyword/Parser.pm @@ -1,14 +1,14 @@ -package Keyword::Parser; +package Devel::Declare::Keyword::Parser; use strict; use warnings; use Carp; -use Keyword::Declare; +use Devel::Declare::Keyword::Declare; use Data::Dumper; our %BUILTIN = ( - proto => 'Keyword::Parse::Proto::parse_proto', - ident => 'Keyword::Parse::Ident::parse_ident', - block => 'Keyword::Parse::Block::new', + proto => 'Devel::Declare::Keyword::Parse::Proto::parse_proto', + ident => 'Devel::Declare::Keyword::Parse::Ident::parse_ident', + block => 'Devel::Declare::Keyword::Parse::Block::new', ); sub new { @@ -25,7 +25,7 @@ sub build { $self->_lookup_routines; return sub { - my $kd = Keyword::Declare->new(@_); + my $kd = Devel::Declare::Keyword::Declare->new(@_); $kd->skip_token($kd->declarator); $kd->skip_ws; @@ -39,10 +39,10 @@ sub build { # if it has a block execute keyword block at compile if($self->{block}) { - &{$Keyword::__keyword_block}(@arg); + &{$Devel::Declare::Keyword::__keyword_block}(@arg); } else { # no block execute at runtime, save arg - @Keyword::__keyword_block_arg = @arg; + @Devel::Declare::Keyword::__keyword_block_arg = @arg; } }; } diff --git a/t/sanity.t b/t/sanity.t index d2f1c35..af5efb3 100644 --- a/t/sanity.t +++ b/t/sanity.t @@ -1,4 +1,4 @@ use Test::More qw/no_plan/; -use_ok('Keyword'); +use_ok('Devel::Declare::Keyword'); use lib 'examples/'; use_ok('DDExample'); diff --git a/t/syntax.t b/t/syntax.t index 9c695bf..b140790 100644 --- a/t/syntax.t +++ b/t/syntax.t @@ -1,5 +1,5 @@ use Test::More qw/no_plan/; -use Keyword; +use Devel::Declare::Keyword; use Data::Dumper; ok 1;