File Coverage

blib/lib/PPI/Token/Quote/Literal.pm
Criterion Covered Total %
statement 13 13 100.0
branch 2 2 100.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 20 20 100.0


line stmt bran cond sub pod time code
1             package PPI::Token::Quote::Literal;
2              
3             =pod
4              
5             =head1 NAME
6              
7             PPI::Token::Quote::Literal - The literal quote-like operator
8              
9             =head1 INHERITANCE
10              
11             PPI::Token::Quote::Literal
12             isa PPI::Token::Quote
13             isa PPI::Token
14             isa PPI::Element
15              
16             =head1 DESCRIPTION
17              
18             A C<PPI::Token::Quote::Literal> object represents a single literal
19             quote-like operator, such as C<q{foo bar}>.
20              
21             =head1 METHODS
22              
23             There are no methods available for C<PPI::Token::Quote::Literal> beyond
24             those provided by the parent L<PPI::Token::Quote>, L<PPI::Token> and
25             L<PPI::Element> classes.
26              
27             =cut
28              
29 67     67   393 use strict;
  67         115  
  67         1995  
30 67     67   256 use PPI::Token::Quote ();
  67         82  
  67         985  
31 67     67   26587 use PPI::Token::_QuoteEngine::Full ();
  67         156  
  67         7690  
32              
33             our $VERSION = '1.284';
34              
35             our @ISA = qw{
36             PPI::Token::_QuoteEngine::Full
37             PPI::Token::Quote
38             };
39              
40              
41              
42              
43              
44             #####################################################################
45             # PPI::Token::Quote Methods
46              
47             sub string {
48 60     60 1 3025 my $self = shift;
49 60         289 my @sections = $self->_sections;
50             return unless #
51 60 100       225 my $str = $sections[0];
52 59         324 substr( $self->{content}, $str->{position}, $str->{size} );
53             }
54              
55              
56             # Use the same implementation as another module
57             *literal = *PPI::Token::Quote::Single::literal;
58              
59             1;
60              
61             =pod
62              
63             =head1 SUPPORT
64              
65             See the L<support section|PPI/SUPPORT> in the main module.
66              
67             =head1 AUTHOR
68              
69             Adam Kennedy E<lt>adamk@cpan.orgE<gt>
70              
71             =head1 COPYRIGHT
72              
73             Copyright 2001 - 2011 Adam Kennedy.
74              
75             This program is free software; you can redistribute
76             it and/or modify it under the same terms as Perl itself.
77              
78             The full text of the license can be found in the
79             LICENSE file included with this module.
80              
81             =cut