| Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Token/ArrayIndex.pm |
| Statements | Executed 27 statements in 285µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 3 | 1 | 1 | 112µs | 150µs | PPI::Token::ArrayIndex::__TOKENIZER__on_char |
| 1 | 1 | 1 | 15µs | 27µs | PPI::Token::ArrayIndex::BEGIN@29 |
| 1 | 1 | 1 | 9µs | 37µs | PPI::Token::ArrayIndex::BEGIN@32 |
| 1 | 1 | 1 | 8µs | 8µs | PPI::Token::ArrayIndex::BEGIN@33 |
| 3 | 1 | 1 | 4µs | 4µs | PPI::Token::ArrayIndex::CORE:match (opcode) |
| 1 | 1 | 1 | 3µs | 3µs | PPI::Token::ArrayIndex::BEGIN@30 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package PPI::Token::ArrayIndex; | ||||
| 2 | |||||
| 3 | =pod | ||||
| 4 | |||||
| 5 | =head1 NAME | ||||
| 6 | |||||
| 7 | PPI::Token::ArrayIndex - Token getting the last index for an array | ||||
| 8 | |||||
| 9 | =head1 INHERITANCE | ||||
| 10 | |||||
| 11 | PPI::Token::ArrayIndex | ||||
| 12 | isa PPI::Token | ||||
| 13 | isa PPI::Element | ||||
| 14 | |||||
| 15 | =head1 DESCRIPTION | ||||
| 16 | |||||
| 17 | The C<PPI::Token::ArrayIndex> token represents an attempt to get the | ||||
| 18 | last index of an array, such as C<$#array>. | ||||
| 19 | |||||
| 20 | =head1 METHODS | ||||
| 21 | |||||
| 22 | There are no additional methods beyond those provided by the parent | ||||
| 23 | L<PPI::Token> and L<PPI::Element> classes. | ||||
| 24 | |||||
| 25 | Got any ideas for methods? Submit a report to rt.cpan.org! | ||||
| 26 | |||||
| 27 | =cut | ||||
| 28 | |||||
| 29 | 2 | 22µs | 2 | 39µs | # spent 27µs (15+12) within PPI::Token::ArrayIndex::BEGIN@29 which was called:
# once (15µs+12µs) by PPI::Token::BEGIN@52 at line 29 # spent 27µs making 1 call to PPI::Token::ArrayIndex::BEGIN@29
# spent 12µs making 1 call to strict::import |
| 30 | 2 | 19µs | 1 | 3µs | # spent 3µs within PPI::Token::ArrayIndex::BEGIN@30 which was called:
# once (3µs+0s) by PPI::Token::BEGIN@52 at line 30 # spent 3µs making 1 call to PPI::Token::ArrayIndex::BEGIN@30 |
| 31 | |||||
| 32 | 2 | 28µs | 2 | 65µs | # spent 37µs (9+28) within PPI::Token::ArrayIndex::BEGIN@32 which was called:
# once (9µs+28µs) by PPI::Token::BEGIN@52 at line 32 # spent 37µs making 1 call to PPI::Token::ArrayIndex::BEGIN@32
# spent 28µs making 1 call to vars::import |
| 33 | # spent 8µs within PPI::Token::ArrayIndex::BEGIN@33 which was called:
# once (8µs+0s) by PPI::Token::BEGIN@52 at line 36 | ||||
| 34 | 1 | 300ns | $VERSION = '1.215'; | ||
| 35 | 1 | 8µs | @ISA = 'PPI::Token'; | ||
| 36 | 1 | 100µs | 1 | 8µs | } # spent 8µs making 1 call to PPI::Token::ArrayIndex::BEGIN@33 |
| 37 | |||||
| - - | |||||
| 42 | ##################################################################### | ||||
| 43 | # Tokenizer Methods | ||||
| 44 | |||||
| 45 | # spent 150µs (112+37) within PPI::Token::ArrayIndex::__TOKENIZER__on_char which was called 3 times, avg 50µs/call:
# 3 times (112µs+37µs) by PPI::Token::Magic::__TOKENIZER__on_char at line 176 of PPI/Token/Magic.pm, avg 50µs/call | ||||
| 46 | 3 | 1µs | my $t = $_[1]; | ||
| 47 | |||||
| 48 | # Suck in till the end of the arrayindex | ||||
| 49 | 3 | 3µs | my $line = substr( $t->{line}, $t->{line_cursor} ); | ||
| 50 | 3 | 26µs | 3 | 4µs | if ( $line =~ /^([\w:']+)/ ) { # spent 4µs making 3 calls to PPI::Token::ArrayIndex::CORE:match, avg 1µs/call |
| 51 | 3 | 57µs | $t->{token}->{content} .= $1; | ||
| 52 | 3 | 3µs | $t->{line_cursor} += length $1; | ||
| 53 | } | ||||
| 54 | |||||
| 55 | # End of token | ||||
| 56 | 3 | 16µs | 6 | 34µs | $t->_finalize_token->__TOKENIZER__on_char( $t ); # spent 25µs making 3 calls to PPI::Token::Whitespace::__TOKENIZER__on_char, avg 8µs/call
# spent 8µs making 3 calls to PPI::Tokenizer::_finalize_token, avg 3µs/call |
| 57 | } | ||||
| 58 | |||||
| 59 | 1 | 2µs | 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 | ||||
# spent 4µs within PPI::Token::ArrayIndex::CORE:match which was called 3 times, avg 1µs/call:
# 3 times (4µs+0s) by PPI::Token::ArrayIndex::__TOKENIZER__on_char at line 50, avg 1µs/call |