File Coverage

blib/lib/PPI/Token/Quote.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package PPI::Token::Quote;
2              
3             =pod
4              
5             =head1 NAME
6              
7             PPI::Token::Quote - String quote abstract base class
8              
9             =head1 INHERITANCE
10              
11             PPI::Token::Quote
12             isa PPI::Token
13             isa PPI::Element
14              
15             =head1 DESCRIPTION
16              
17             The C class is never instantiated, and simply
18             provides a common abstract base class for the four quote classes.
19             In PPI, a "quote" is limited to only the quote-like things that
20             themselves directly represent a string. (although this includes
21             double quotes with interpolated elements inside them, note that
22             L allows to extract them).
23              
24             The subclasses of C are:
25              
26             =over 2
27              
28             =item C<''> - L
29              
30             =item C - L
31              
32             =item C<""> - L
33              
34             =item C - L
35              
36             =back
37              
38             The names are hopefully obvious enough not to have to explain what
39             each class is here. See their respective pages for more details.
40              
41             Please note that although the here-doc B represent a literal
42             string, it is such a nasty piece of work that in L it is given the
43             honor of its own token class (L).
44              
45             =head1 METHODS
46              
47             =cut
48              
49 65     65   374 use strict;
  65         125  
  65         1517  
50 65     65   288 use PPI::Token ();
  65         118  
  65         3311  
51              
52             our $VERSION = '1.276';
53              
54             our @ISA = "PPI::Token";
55              
56              
57              
58              
59              
60             #####################################################################
61             # PPI::Token::Quote Methods
62              
63             =pod
64              
65             =head2 string
66              
67             The C method is provided by all four ::Quote classes. It won't
68             get you the actual literal Perl value, but it will strip off the wrapping
69             of the quotes.
70              
71             # The following all return foo from the ->string method
72             'foo'
73             "foo"
74             q{foo}
75             qq
76              
77             =cut
78              
79             #sub string {
80             # my $class = ref $_[0] || $_[0];
81             # die "$class does not implement method ->string";
82             #}
83              
84             =pod
85              
86             =head2 literal
87              
88             The C method is provided by ::Quote::Literal and
89             ::Quote::Single. This returns the value of the string as Perl sees
90             it: without the quote marks and with C<\\> and C<\'> resolved to C<\>
91             and C<'>.
92              
93             The C method is not implemented by ::Quote::Double or
94             ::Quote::Interpolate yet.
95              
96             =cut
97              
98             1;
99              
100             =pod
101              
102             =head1 SUPPORT
103              
104             See the L in the main module.
105              
106             =head1 AUTHOR
107              
108             Adam Kennedy Eadamk@cpan.orgE
109              
110             =head1 COPYRIGHT
111              
112             Copyright 2001 - 2011 Adam Kennedy.
113              
114             This program is free software; you can redistribute
115             it and/or modify it under the same terms as Perl itself.
116              
117             The full text of the license can be found in the
118             LICENSE file included with this module.
119              
120             =cut