File Coverage

blib/lib/PPI/Token/_QuoteEngine/Simple.pm
Criterion Covered Total %
statement 21 21 100.0
branch 6 10 60.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 31 36 86.1


line stmt bran cond sub pod time code
1             package PPI::Token::_QuoteEngine::Simple;
2              
3             # Simple quote engine
4              
5 67     67   324 use strict;
  67         105  
  67         1987  
6 67     67   24992 use PPI::Token::_QuoteEngine ();
  67         167  
  67         10671  
7              
8             our $VERSION = '1.284';
9              
10             our @ISA = 'PPI::Token::_QuoteEngine';
11              
12             sub new {
13 12940     12940 0 19944 my $class = shift;
14 12940 50       29556 my $separator = shift or return undef;
15              
16             # Create a new token containing the separator
17             ### This manual SUPER'ing ONLY works because none of
18             ### Token::Quote, Token::QuoteLike and Token::Regexp
19             ### implement a new function of their own.
20 12940 50       25891 my $self = PPI::Token::new( $class, $separator ) or return undef;
21 12940         29941 $self->{separator} = $separator;
22              
23 12940         29053 $self;
24             }
25              
26             sub _fill {
27 12939     12939   15769 my $class = shift;
28 12939         14692 my $t = shift;
29 12939 50       34924 my $self = $t->{token} or return undef;
30              
31             # Scan for the end separator
32 12939         36975 my $string = $self->_scan_for_unescaped_character( $t, $self->{separator} );
33 12939 50       24661 return undef unless defined $string;
34 12939 100       23807 if ( ref $string ) {
35             # End of file
36 1026         2280 $self->{content} .= $$string;
37 1026         1861 return 0;
38             } else {
39             # End of string
40 11913         22908 $self->{content} .= $string;
41 11913         23601 return $self;
42             }
43             }
44              
45             1;
46              
47             =pod
48              
49             =head1 SUPPORT
50              
51             See the L<support section|PPI/SUPPORT> in the main module.
52              
53             =head1 AUTHOR
54              
55             Adam Kennedy E<lt>adamk@cpan.orgE<gt>
56              
57             =head1 COPYRIGHT
58              
59             Copyright 2001 - 2011 Adam Kennedy.
60              
61             This program is free software; you can redistribute
62             it and/or modify it under the same terms as Perl itself.
63              
64             The full text of the license can be found in the
65             LICENSE file included with this module.
66              
67             =cut