Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Token/Quote/Literal.pm |
Statements | Executed 16 statements in 254µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 1.21ms | 1.32ms | BEGIN@33 | PPI::Token::Quote::Literal::
1 | 1 | 1 | 16µs | 19µs | string | PPI::Token::Quote::Literal::
1 | 1 | 1 | 11µs | 23µs | BEGIN@31 | PPI::Token::Quote::Literal::
1 | 1 | 1 | 9µs | 9µs | BEGIN@36 | PPI::Token::Quote::Literal::
1 | 1 | 1 | 7µs | 37µs | BEGIN@35 | PPI::Token::Quote::Literal::
1 | 1 | 1 | 3µs | 3µs | BEGIN@32 | PPI::Token::Quote::Literal::
Line | State ments |
Time on line |
Calls | Time in subs |
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 | Got any ideas for methods? Submit a report to rt.cpan.org! | ||||
28 | |||||
29 | =cut | ||||
30 | |||||
31 | 2 | 22µs | 2 | 35µs | # spent 23µs (11+12) within PPI::Token::Quote::Literal::BEGIN@31 which was called:
# once (11µs+12µs) by PPI::Token::BEGIN@56 at line 31 # spent 23µs making 1 call to PPI::Token::Quote::Literal::BEGIN@31
# spent 12µs making 1 call to strict::import |
32 | 2 | 15µs | 1 | 3µs | # spent 3µs within PPI::Token::Quote::Literal::BEGIN@32 which was called:
# once (3µs+0s) by PPI::Token::BEGIN@56 at line 32 # spent 3µs making 1 call to PPI::Token::Quote::Literal::BEGIN@32 |
33 | 2 | 84µs | 1 | 1.32ms | # spent 1.32ms (1.21+113µs) within PPI::Token::Quote::Literal::BEGIN@33 which was called:
# once (1.21ms+113µs) by PPI::Token::BEGIN@56 at line 33 # spent 1.32ms making 1 call to PPI::Token::Quote::Literal::BEGIN@33 |
34 | |||||
35 | 2 | 31µs | 2 | 66µs | # spent 37µs (7+30) within PPI::Token::Quote::Literal::BEGIN@35 which was called:
# once (7µs+30µs) by PPI::Token::BEGIN@56 at line 35 # spent 37µs making 1 call to PPI::Token::Quote::Literal::BEGIN@35
# spent 30µs making 1 call to vars::import |
36 | # spent 9µs within PPI::Token::Quote::Literal::BEGIN@36 which was called:
# once (9µs+0s) by PPI::Token::BEGIN@56 at line 42 | ||||
37 | 1 | 400ns | $VERSION = '1.215'; | ||
38 | 1 | 10µs | @ISA = qw{ | ||
39 | PPI::Token::_QuoteEngine::Full | ||||
40 | PPI::Token::Quote | ||||
41 | }; | ||||
42 | 1 | 74µs | 1 | 9µs | } # spent 9µs making 1 call to PPI::Token::Quote::Literal::BEGIN@36 |
43 | |||||
- - | |||||
48 | ##################################################################### | ||||
49 | # PPI::Token::Quote Methods | ||||
50 | |||||
51 | =pod | ||||
52 | |||||
53 | =begin testing string 8 | ||||
54 | |||||
55 | my $Document = PPI::Document->new( \"print q{foo}, q!bar!, q <foo>;" ); | ||||
56 | isa_ok( $Document, 'PPI::Document' ); | ||||
57 | my $literal = $Document->find('Token::Quote::Literal'); | ||||
58 | is( scalar(@$literal), 3, '->find returns three objects' ); | ||||
59 | isa_ok( $literal->[0], 'PPI::Token::Quote::Literal' ); | ||||
60 | isa_ok( $literal->[1], 'PPI::Token::Quote::Literal' ); | ||||
61 | isa_ok( $literal->[2], 'PPI::Token::Quote::Literal' ); | ||||
62 | is( $literal->[0]->string, 'foo', '->string returns as expected' ); | ||||
63 | is( $literal->[1]->string, 'bar', '->string returns as expected' ); | ||||
64 | is( $literal->[2]->string, 'foo', '->string returns as expected' ); | ||||
65 | |||||
66 | =end testing | ||||
67 | |||||
68 | =cut | ||||
69 | |||||
70 | # spent 19µs (16+3) within PPI::Token::Quote::Literal::string which was called:
# once (16µs+3µs) by Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::_get_argument_string at line 68 of Perl/Critic/Policy/InputOutput/RequireEncodingWithUTF8Layer.pm | ||||
71 | 1 | 400ns | my $self = shift; | ||
72 | 1 | 8µs | 1 | 3µs | my @sections = $self->_sections; # spent 3µs making 1 call to PPI::Token::_QuoteEngine::Full::_sections |
73 | 1 | 400ns | my $str = $sections[0]; | ||
74 | 1 | 6µs | substr( $self->{content}, $str->{position}, $str->{size} ); | ||
75 | } | ||||
76 | |||||
77 | =pod | ||||
78 | |||||
79 | =begin testing literal 4 | ||||
80 | |||||
81 | my $Document = PPI::Document->new( \"print q{foo}, q!bar!, q <foo>;" ); | ||||
82 | isa_ok( $Document, 'PPI::Document' ); | ||||
83 | my $literal = $Document->find('Token::Quote::Literal'); | ||||
84 | is( $literal->[0]->literal, 'foo', '->literal returns as expected' ); | ||||
85 | is( $literal->[1]->literal, 'bar', '->literal returns as expected' ); | ||||
86 | is( $literal->[2]->literal, 'foo', '->literal returns as expected' ); | ||||
87 | |||||
88 | =end testing | ||||
89 | |||||
90 | =cut | ||||
91 | |||||
92 | 1 | 800ns | *literal = *PPI::Token::Quote::Single::literal; | ||
93 | |||||
94 | 1 | 2µs | 1; | ||
95 | |||||
96 | =pod | ||||
97 | |||||
98 | =head1 SUPPORT | ||||
99 | |||||
100 | See the L<support section|PPI/SUPPORT> in the main module. | ||||
101 | |||||
102 | =head1 AUTHOR | ||||
103 | |||||
104 | Adam Kennedy E<lt>adamk@cpan.orgE<gt> | ||||
105 | |||||
106 | =head1 COPYRIGHT | ||||
107 | |||||
108 | Copyright 2001 - 2011 Adam Kennedy. | ||||
109 | |||||
110 | This program is free software; you can redistribute | ||||
111 | it and/or modify it under the same terms as Perl itself. | ||||
112 | |||||
113 | The full text of the license can be found in the | ||||
114 | LICENSE file included with this module. | ||||
115 | |||||
116 | =cut |