X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FDeclare.pm;h=ea3b47e4bca75c79d8f3c3c9c2e0c7b38a39c727;hb=4eeccf399bfe40aede5c2bc638eed248c96081f8;hp=aca999c55525e25440aa809ad3d195eb1c996464;hpb=3f54dfa370ebb4c67924cc21d79df7234aa1b8f4;p=p5sagit%2FDevel-Declare.git diff --git a/lib/Devel/Declare.pm b/lib/Devel/Declare.pm index aca999c..ea3b47e 100644 --- a/lib/Devel/Declare.pm +++ b/lib/Devel/Declare.pm @@ -4,7 +4,7 @@ use strict; use warnings; use 5.008001; -our $VERSION = '0.005002'; +our $VERSION = '0.006008'; use constant DECLARE_NAME => 1; use constant DECLARE_PROTO => 2; @@ -14,12 +14,14 @@ use constant DECLARE_PACKAGE => 8+1; # name implicit use vars qw(%declarators %declarator_handlers @ISA); use base qw(DynaLoader); use Scalar::Util 'set_prototype'; -use B::Hooks::OP::Check; +use B::Hooks::OP::Check 0.19; bootstrap Devel::Declare; @ISA = (); +initialize(); + sub import { my ($class, %args) = @_; my $target = caller; @@ -513,8 +515,25 @@ things like C). Also it Does The Right Thing with nested delimiters (like C). -It returns the length of the expression matched. Use C to -get the actual matched text. +It returns the effective length of the expression matched. Really, what +it returns is the difference in position between where the string started, +within the buffer, and where it finished. If the string extended across +multiple lines then the contents of the buffer may have been completely +replaced by the new lines, so this position difference is not the same +thing as the actual length of the expression matched. However, because +moving backward in the buffer causes problems, the function arranges +for the effective length to always be positive, padding the start of +the buffer if necessary. + +Use C to get the actual matched text, the content of +the string. Because of the behaviour around multiline strings, you +can't reliably get this from the buffer. In fact, after the function +returns, you can't rely on any content of the buffer preceding the end +of the string. + +If the string being scanned is not well formed (has no closing delimiter), +C returns C. In this case you cannot rely on the +contents of the buffer. =head4 C @@ -590,7 +609,7 @@ We'll add this to what gets 'injected' at the beginning of the method source. return ' BEGIN { MethodHandlers::inject_scope }; '; } -So at the beginning of every method, we assing a callback that will get invoked +So at the beginning of every method, we are passing a callback that will get invoked at the I of the method's compilation... i.e. exactly then the closing C<'}'> is compiled. @@ -649,19 +668,28 @@ L. =head1 AUTHORS -Matt S Trout - - original author +Matt S Trout - Emst@shadowcat.co.ukE - original author Company: http://www.shadowcat.co.uk/ Blog: http://chainsawblues.vox.com/ Florian Ragwitz Erafl@debian.orgE - maintainer -osfameron Eosfameron@cpan.org - first draft of documentation +osfameron Eosfameron@cpan.orgE - first draft of documentation -=head1 LICENSE +=head1 COPYRIGHT AND LICENSE This library is free software under the same terms as perl itself +Copyright (c) 2007, 2008, 2009 Matt S Trout + +Copyright (c) 2008, 2009 Florian Ragwitz + +stolen_chunk_of_toke.c based on toke.c from the perl core, which is + +Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +2000, 2001, 2002, 2003, 2004, 2005, 2006, by Larry Wall and others + =cut 1;