PPI/Token/_QuoteEngine/Simple.pm

filter: Statementstmt 100% 24 / 24 Branchbran 60.0% 6 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 87.1% 34 / 39 CC 6 SCAR 11.1
CC
6
Cov
88%
_fill
4.0
new
3.1
BEGIN
1.0
CRAP 3.0
« PPI/Token/BOM.pm ↑ Summary PPI/Token/End.pm »
1 package PPI::Token::_QuoteEngine::Simple;
2  
3 # Simple quote engine
4  
5 63 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 63 ▶use PPI::Token::_QuoteEngine ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 63 our $VERSION = '1.260'; # VERSION
9  
10 63 our @ISA = 'PPI::Token::_QuoteEngine';
11  
12 sub new {
13 10939 ▶ my $class = shift;
Subroutine new: called CC=3 SCAR=11.3
Pod undocumented
14 10939 ▶ my $separator = shift or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $separator = shift() or return undef 0 10939 10939
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 10939 ▶ my $self = PPI::Token::new( $class, $separator ) or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $self = PPI::Token::new($class, $separator) or return undef 0 10939 10939
21 10939 $self->{separator} = $separator;
22  
23 10939 $self;
24 }
25  
26 sub _fill {
27 10939 ▶ my $class = shift;
Subroutine _fill: called CC=4 SCAR=13.9
28 10939 my $t = shift;
29 10939 ▶ my $self = $t->{token} or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $self = $t->{"token"} or return undef 0 10939 10939
30  
31 # Scan for the end separator
32 10939 my $string = $self->_scan_for_unescaped_character( $t, $self->{separator} );
33 10939 ▶ return undef unless defined $string;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $string 0 10939 10939
34 10939 ▶ if ( ref $string ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $string) { } 728 10211 10939
35 # End of file
36 728 $self->{content} .= $$string;
37 728 return 0;
38 } else {
39 # End of string
40 10211 $self->{content} .= $string;
41 10211 return $self;
42 }
43 }
44  
45 63 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
« PPI/Token/BOM.pm ↑ Summary PPI/Token/End.pm »