diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-17 02:56:14 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-17 02:56:14 +0000 |
commit | 55909bcd913ef5a79a5a982c1ba7f83a08b9b651 (patch) | |
tree | 66c1cb96f3d805147801dd848114aa2009603eb2 /lib | |
parent | 3716a21da811a91a4487bb9cee36524784007826 (diff) | |
download | perl-55909bcd913ef5a79a5a982c1ba7f83a08b9b651.tar.gz |
Upgrade to Filter::Simple 0.78.
(Keep #14432, let Damian know of it.)
p4raw-id: //depot/perl@16641
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Filter/Simple.pm | 15 | ||||
-rw-r--r-- | lib/Filter/Simple/README | 16 | ||||
-rw-r--r-- | lib/Filter/Simple/t/data.t | 2 | ||||
-rw-r--r-- | lib/Filter/Simple/t/export.t | 2 | ||||
-rw-r--r-- | lib/Filter/Simple/t/filter.t | 2 | ||||
-rw-r--r-- | lib/Filter/Simple/t/filter_only.t | 2 | ||||
-rw-r--r-- | lib/Filter/Simple/t/import.t | 2 |
7 files changed, 27 insertions, 14 deletions
diff --git a/lib/Filter/Simple.pm b/lib/Filter/Simple.pm index e68fca123b..1ab5b98e3d 100644 --- a/lib/Filter/Simple.pm +++ b/lib/Filter/Simple.pm @@ -4,7 +4,7 @@ use Text::Balanced ':ALL'; use vars qw{ $VERSION @EXPORT }; -$VERSION = '0.77'; +$VERSION = '0.78'; use Filter::Util::Call; use Carp; @@ -20,7 +20,7 @@ sub import { sub FILTER (&;$) { my $caller = caller; my ($filter, $terminator) = @_; - no warnings 'redefine'; + local $SIG{__WARN__} = sub{}; *{"${caller}::import"} = gen_filter_import($caller,$filter,$terminator); *{"${caller}::unimport"} = gen_filter_unimport($caller); } @@ -98,6 +98,7 @@ my %selector_for = ( sub gen_std_filter_for { my ($type, $transform) = @_; return sub { my (@pieces, $instr); + $DB::single=1; for (extract_multiple($_,$extractor_for{$type})) { if (ref()) { push @pieces, $_; $instr=0 } elsif ($instr) { $pieces[-1] .= $_ } @@ -388,6 +389,8 @@ In other words, the previous example, would become: 1 ; +Note that the source code is passed as a single string, so any regex that +uses C<^> or C<$> to detect line boundaries will need the C</m> flag. =head2 Disabling or changing <no> behaviour @@ -453,7 +456,7 @@ or: } { terminator => "" }; -B<Note that, no matter what you set the terminator pattern too, +B<Note that, no matter what you set the terminator pattern to, the actual terminator itself I<must> be contained on a single source line.> @@ -525,7 +528,7 @@ For example: FILTER_ONLY code => sub { s/BANG\s+BANG/die 'BANG' if \$BANG/g }, - quotelike => sub { s/BANG\s+BANG/CHITTY CHITYY/g }; + quotelike => sub { s/BANG\s+BANG/CHITTY CHITTY/g }; The C<"code"> subroutine will only be used to filter parts of the source code that are not quotelikes, POD, or C<__DATA__>. The C<quotelike> @@ -573,7 +576,7 @@ found in the source code. Note that you can also apply two or more of the same type of filter in a single C<FILTER_ONLY>. For example, here's a simple macro-preprocessor that is only applied within regexes, -with a final debugging pass that printd the resulting source code: +with a final debugging pass that prints the resulting source code: use Regexp::Common; FILTER_ONLY @@ -651,7 +654,7 @@ C<import> subroutine you might have explicitly declared. However, Filter::Simple is smart enough to notice your existing C<import> and Do The Right Thing with it. -That is, if you explcitly define an C<import> subroutine in a package +That is, if you explicitly define an C<import> subroutine in a package that's using Filter::Simple, that C<import> subroutine will still be invoked immediately after any filter you install. diff --git a/lib/Filter/Simple/README b/lib/Filter/Simple/README index 832643df64..5ec13de99d 100644 --- a/lib/Filter/Simple/README +++ b/lib/Filter/Simple/README @@ -1,5 +1,5 @@ ============================================================================== - Release of version 0.77 of Filter::Simple + Release of version 0.78 of Filter::Simple ============================================================================== @@ -46,10 +46,20 @@ COPYRIGHT ============================================================================== -CHANGES IN VERSION 0.77 +CHANGES IN VERSION 0.78 - - Re-allowed user-defined terminators to be regexes + - Re-corified test modules in line with Jarkko's new scheme + + - Various POD nits unknitted (thanks Autrijus) + + - Added the missing DotsForArrows.pm demo file (thanks Autrijus) + + - Added support for Perl 5.005 + + - added prereq for Text::Balanced in Makefile.PL + + - Added note about use of /m flag when using ^ or $ in filter regexes ============================================================================== diff --git a/lib/Filter/Simple/t/data.t b/lib/Filter/Simple/t/data.t index c90702bfce..8d58046c0a 100644 --- a/lib/Filter/Simple/t/data.t +++ b/lib/Filter/Simple/t/data.t @@ -1,7 +1,7 @@ BEGIN { if ($ENV{PERL_CORE}) { chdir('t') if -d 't'; - @INC = qw(lib/Filter/Simple ../lib); + @INC = qw(lib/Filter/Simple ../lib); } } diff --git a/lib/Filter/Simple/t/export.t b/lib/Filter/Simple/t/export.t index 805a67a35a..40c62da96a 100644 --- a/lib/Filter/Simple/t/export.t +++ b/lib/Filter/Simple/t/export.t @@ -1,7 +1,7 @@ BEGIN { if ($ENV{PERL_CORE}) { chdir('t') if -d 't'; - @INC = qw(lib/Filter/Simple ../lib); + @INC = qw(lib/Filter/Simple ../lib); } } diff --git a/lib/Filter/Simple/t/filter.t b/lib/Filter/Simple/t/filter.t index d971b81522..f1d71d9279 100644 --- a/lib/Filter/Simple/t/filter.t +++ b/lib/Filter/Simple/t/filter.t @@ -1,7 +1,7 @@ BEGIN { if ($ENV{PERL_CORE}) { chdir('t') if -d 't'; - @INC = qw(lib/Filter/Simple ../lib); + @INC = qw(lib/Filter/Simple ../lib); } } diff --git a/lib/Filter/Simple/t/filter_only.t b/lib/Filter/Simple/t/filter_only.t index 9f81a3cc19..e537609f4b 100644 --- a/lib/Filter/Simple/t/filter_only.t +++ b/lib/Filter/Simple/t/filter_only.t @@ -1,7 +1,7 @@ BEGIN { if ($ENV{PERL_CORE}) { chdir('t') if -d 't'; - @INC = qw(lib/Filter/Simple ../lib); + @INC = qw(lib/Filter/Simple ../lib); } } diff --git a/lib/Filter/Simple/t/import.t b/lib/Filter/Simple/t/import.t index 99306de4f4..d087692b78 100644 --- a/lib/Filter/Simple/t/import.t +++ b/lib/Filter/Simple/t/import.t @@ -1,7 +1,7 @@ BEGIN { if ($ENV{PERL_CORE}) { chdir('t') if -d 't'; - @INC = qw(lib/Filter/Simple ../lib); + @INC = qw(lib/Filter/Simple ../lib); } } |