Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Token/End.pm |
Statements | Executed 7777 statements in 14.3ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1834 | 1 | 1 | 9.00ms | 14.1ms | __TOKENIZER__on_line_start | PPI::Token::End::
1834 | 1 | 1 | 794µs | 794µs | CORE:match (opcode) | PPI::Token::End::
1 | 1 | 1 | 16µs | 33µs | BEGIN@43 | PPI::Token::End::
1 | 1 | 1 | 11µs | 11µs | BEGIN@47 | PPI::Token::End::
1 | 1 | 1 | 8µs | 47µs | BEGIN@46 | PPI::Token::End::
1 | 1 | 1 | 4µs | 4µs | BEGIN@44 | PPI::Token::End::
0 | 0 | 0 | 0s | 0s | __TOKENIZER__on_char | PPI::Token::End::
0 | 0 | 0 | 0s | 0s | significant | PPI::Token::End::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package PPI::Token::End; | ||||
2 | |||||
3 | =pod | ||||
4 | |||||
5 | =head1 NAME | ||||
6 | |||||
7 | PPI::Token::End - Completely useless content after the __END__ tag | ||||
8 | |||||
9 | =head1 INHERITANCE | ||||
10 | |||||
11 | PPI::Token::End | ||||
12 | isa PPI::Token | ||||
13 | isa PPI::Element | ||||
14 | |||||
15 | =head1 DESCRIPTION | ||||
16 | |||||
17 | If you've read L<PPI::Token::Whitespace>, you should understand by now | ||||
18 | the concept of documents "floating in a sea of PPI::Token::Whitespace". | ||||
19 | |||||
20 | Well it doesn't after the __END__ tag. | ||||
21 | |||||
22 | Once you __END__, it's all over. Anything after that tag isn't even fit | ||||
23 | to be called whitespace. It just simply doesn't exist as far as perl | ||||
24 | (the interpreter) is concerned. | ||||
25 | |||||
26 | That's not to say there isn't useful content. Most often people use | ||||
27 | the __END__ tag to hide POD content, so that perl never has to see it, | ||||
28 | and presumably providing some small speed up. | ||||
29 | |||||
30 | That's fine. PPI likes POD. Any POD after the __END__ tag is parsed | ||||
31 | into valid L<PPI::Token::Pod> tags as normal. B<This> class, on the | ||||
32 | other hand, is for "what's after __END__ when it isn't POD". | ||||
33 | |||||
34 | Basically, the completely worthless bits of the file :) | ||||
35 | |||||
36 | =head1 METHODS | ||||
37 | |||||
38 | This class has no method beyond what is provided by its L<PPI::Token> and | ||||
39 | L<PPI::Element> parent classes. | ||||
40 | |||||
41 | =cut | ||||
42 | |||||
43 | 2 | 27µs | 2 | 50µs | # spent 33µs (16+17) within PPI::Token::End::BEGIN@43 which was called:
# once (16µs+17µs) by PPI::Token::BEGIN@73 at line 43 # spent 33µs making 1 call to PPI::Token::End::BEGIN@43
# spent 17µs making 1 call to strict::import |
44 | 2 | 26µs | 1 | 4µs | # spent 4µs within PPI::Token::End::BEGIN@44 which was called:
# once (4µs+0s) by PPI::Token::BEGIN@73 at line 44 # spent 4µs making 1 call to PPI::Token::End::BEGIN@44 |
45 | |||||
46 | 2 | 38µs | 2 | 86µs | # spent 47µs (8+39) within PPI::Token::End::BEGIN@46 which was called:
# once (8µs+39µs) by PPI::Token::BEGIN@73 at line 46 # spent 47µs making 1 call to PPI::Token::End::BEGIN@46
# spent 39µs making 1 call to vars::import |
47 | # spent 11µs within PPI::Token::End::BEGIN@47 which was called:
# once (11µs+0s) by PPI::Token::BEGIN@73 at line 50 | ||||
48 | 1 | 500ns | $VERSION = '1.215'; | ||
49 | 1 | 12µs | @ISA = 'PPI::Token'; | ||
50 | 1 | 162µs | 1 | 11µs | } # spent 11µs making 1 call to PPI::Token::End::BEGIN@47 |
51 | |||||
- - | |||||
56 | ##################################################################### | ||||
57 | # Tokenizer Methods | ||||
58 | |||||
59 | ### XS -> PPI/XS.xs:_PPI_Token_End__significant 0.900+ | ||||
60 | sub significant { '' } | ||||
61 | |||||
62 | sub __TOKENIZER__on_char { 1 } | ||||
63 | |||||
64 | # spent 14.1ms (9.00+5.05) within PPI::Token::End::__TOKENIZER__on_line_start which was called 1834 times, avg 8µs/call:
# 1834 times (9.00ms+5.05ms) by PPI::Tokenizer::_process_next_line at line 499 of PPI/Tokenizer.pm, avg 8µs/call | ||||
65 | 1834 | 318µs | my $t = $_[1]; | ||
66 | |||||
67 | # Can we classify the entire line in one go | ||||
68 | 1834 | 3.83ms | 1834 | 794µs | if ( $t->{line} =~ /^=(\w+)/ ) { # spent 794µs making 1834 calls to PPI::Token::End::CORE:match, avg 433ns/call |
69 | # A Pod tag... change to pod mode | ||||
70 | 144 | 229µs | 144 | 1.94ms | $t->_new_token( 'Pod', $t->{line} ); # spent 1.94ms making 144 calls to PPI::Tokenizer::_new_token, avg 13µs/call |
71 | 144 | 239µs | unless ( $1 eq 'cut' ) { | ||
72 | # Normal start to pod | ||||
73 | $t->{class} = 'PPI::Token::Pod'; | ||||
74 | } | ||||
75 | |||||
76 | # This is an error, but one we'll ignore | ||||
77 | # Don't go into Pod mode, since =cut normally | ||||
78 | # signals the end of Pod mode | ||||
79 | } else { | ||||
80 | 1690 | 1.76ms | if ( defined $t->{token} ) { | ||
81 | # Add to existing token | ||||
82 | $t->{token}->{content} .= $t->{line}; | ||||
83 | } else { | ||||
84 | 288 | 384µs | 288 | 2.32ms | $t->_new_token( 'End', $t->{line} ); # spent 2.32ms making 288 calls to PPI::Tokenizer::_new_token, avg 8µs/call |
85 | } | ||||
86 | } | ||||
87 | |||||
88 | 1834 | 7.29ms | 0; | ||
89 | } | ||||
90 | |||||
91 | 1 | 3µs | 1; | ||
92 | |||||
93 | =pod | ||||
94 | |||||
95 | =head1 SUPPORT | ||||
96 | |||||
97 | See the L<support section|PPI/SUPPORT> in the main module. | ||||
98 | |||||
99 | =head1 AUTHOR | ||||
100 | |||||
101 | Adam Kennedy E<lt>adamk@cpan.orgE<gt> | ||||
102 | |||||
103 | =head1 COPYRIGHT | ||||
104 | |||||
105 | Copyright 2001 - 2011 Adam Kennedy. | ||||
106 | |||||
107 | This program is free software; you can redistribute | ||||
108 | it and/or modify it under the same terms as Perl itself. | ||||
109 | |||||
110 | The full text of the license can be found in the | ||||
111 | LICENSE file included with this module. | ||||
112 | |||||
113 | =cut | ||||
# spent 794µs within PPI::Token::End::CORE:match which was called 1834 times, avg 433ns/call:
# 1834 times (794µs+0s) by PPI::Token::End::__TOKENIZER__on_line_start at line 68, avg 433ns/call |