| Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Token.pm |
| Statements | Executed 561430 statements in 1.91s |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 357151 | 71 | 19 | 482ms | 482ms | PPI::Token::content |
| 94229 | 6 | 5 | 231ms | 231ms | PPI::Token::new |
| 45079 | 2 | 1 | 124ms | 152ms | PPI::Token::__LEXER__closes |
| 8845 | 21 | 7 | 95.3ms | 114ms | PPI::Token::set_class |
| 11666 | 3 | 2 | 69.5ms | 85.1ms | PPI::Token::__LEXER__opens |
| 49942 | 4 | 1 | 61.9ms | 61.9ms | PPI::Token::CORE:match (opcode) |
| 1 | 1 | 1 | 1.92ms | 13.7ms | PPI::Token::BEGIN@25 |
| 1 | 1 | 1 | 1.38ms | 1.85ms | PPI::Token::BEGIN@24 |
| 1 | 1 | 1 | 1.24ms | 1.42ms | PPI::Token::BEGIN@39 |
| 1 | 1 | 1 | 1.18ms | 1.28ms | PPI::Token::BEGIN@49 |
| 1 | 1 | 1 | 973µs | 1.09ms | PPI::Token::BEGIN@70 |
| 1 | 1 | 1 | 726µs | 2.05ms | PPI::Token::BEGIN@53 |
| 1 | 1 | 1 | 697µs | 793µs | PPI::Token::BEGIN@51 |
| 1 | 1 | 1 | 571µs | 669µs | PPI::Token::BEGIN@75 |
| 1 | 1 | 1 | 548µs | 671µs | PPI::Token::BEGIN@68 |
| 1 | 1 | 1 | 438µs | 535µs | PPI::Token::BEGIN@41 |
| 1 | 1 | 1 | 407µs | 477µs | PPI::Token::BEGIN@42 |
| 1 | 1 | 1 | 376µs | 447µs | PPI::Token::BEGIN@48 |
| 1 | 1 | 1 | 353µs | 421µs | PPI::Token::BEGIN@47 |
| 1 | 1 | 1 | 350µs | 446µs | PPI::Token::BEGIN@74 |
| 1 | 1 | 1 | 340µs | 417µs | PPI::Token::BEGIN@43 |
| 1 | 1 | 1 | 338µs | 405µs | PPI::Token::BEGIN@46 |
| 1 | 1 | 1 | 337µs | 1.48ms | PPI::Token::BEGIN@55 |
| 1 | 1 | 1 | 335µs | 431µs | PPI::Token::BEGIN@73 |
| 1 | 1 | 1 | 331µs | 432µs | PPI::Token::BEGIN@66 |
| 1 | 1 | 1 | 321µs | 388µs | PPI::Token::BEGIN@44 |
| 1 | 1 | 1 | 318µs | 390µs | PPI::Token::BEGIN@40 |
| 1 | 1 | 1 | 318µs | 387µs | PPI::Token::BEGIN@38 |
| 1 | 1 | 1 | 302µs | 3.61ms | PPI::Token::BEGIN@72 |
| 1 | 1 | 1 | 274µs | 345µs | PPI::Token::BEGIN@50 |
| 1 | 1 | 1 | 272µs | 350µs | PPI::Token::BEGIN@26 |
| 1 | 1 | 1 | 262µs | 331µs | PPI::Token::BEGIN@45 |
| 1 | 1 | 1 | 248µs | 319µs | PPI::Token::BEGIN@60 |
| 1 | 1 | 1 | 246µs | 364µs | PPI::Token::BEGIN@71 |
| 144 | 1 | 1 | 224µs | 224µs | PPI::Token::__TOKENIZER__on_line_end |
| 1 | 1 | 1 | 222µs | 1.62ms | PPI::Token::BEGIN@56 |
| 1 | 1 | 1 | 221µs | 296µs | PPI::Token::BEGIN@52 |
| 1 | 1 | 1 | 213µs | 286µs | PPI::Token::BEGIN@61 |
| 1 | 1 | 1 | 201µs | 276µs | PPI::Token::BEGIN@57 |
| 1 | 1 | 1 | 184µs | 251µs | PPI::Token::BEGIN@67 |
| 1 | 1 | 1 | 174µs | 246µs | PPI::Token::BEGIN@62 |
| 1 | 1 | 1 | 166µs | 514µs | PPI::Token::BEGIN@63 |
| 1 | 1 | 1 | 162µs | 246µs | PPI::Token::BEGIN@59 |
| 1 | 1 | 1 | 162µs | 244µs | PPI::Token::BEGIN@64 |
| 1 | 1 | 1 | 158µs | 447µs | PPI::Token::BEGIN@58 |
| 1 | 1 | 1 | 158µs | 235µs | PPI::Token::BEGIN@65 |
| 1 | 1 | 1 | 143µs | 208µs | PPI::Token::BEGIN@69 |
| 1 | 1 | 1 | 16µs | 16µs | PPI::Token::BEGIN@29 |
| 1 | 1 | 1 | 10µs | 21µs | PPI::Token::BEGIN@23 |
| 1 | 1 | 1 | 7µs | 55µs | PPI::Token::BEGIN@28 |
| 1 | 1 | 1 | 5µs | 5µs | PPI::Token::BEGIN@76 |
| 1 | 1 | 1 | 4µs | 4µs | PPI::Token::BEGIN@54 |
| 0 | 0 | 0 | 0s | 0s | PPI::Token::__TOKENIZER__on_char |
| 0 | 0 | 0 | 0s | 0s | PPI::Token::__TOKENIZER__on_line_start |
| 0 | 0 | 0 | 0s | 0s | PPI::Token::add_content |
| 0 | 0 | 0 | 0s | 0s | PPI::Token::insert_after |
| 0 | 0 | 0 | 0s | 0s | PPI::Token::insert_before |
| 0 | 0 | 0 | 0s | 0s | PPI::Token::length |
| 0 | 0 | 0 | 0s | 0s | PPI::Token::set_content |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package PPI::Token; | ||||
| 2 | |||||
| 3 | =pod | ||||
| 4 | |||||
| 5 | =head1 NAME | ||||
| 6 | |||||
| 7 | PPI::Token - A single token of Perl source code | ||||
| 8 | |||||
| 9 | =head1 INHERITANCE | ||||
| 10 | |||||
| 11 | PPI::Token | ||||
| 12 | isa PPI::Element | ||||
| 13 | |||||
| 14 | =head1 DESCRIPTION | ||||
| 15 | |||||
| 16 | C<PPI::Token> is the abstract base class for all Tokens. In PPI terms, a "Token" is | ||||
| 17 | a L<PPI::Element> that directly represents bytes of source code. | ||||
| 18 | |||||
| 19 | =head1 METHODS | ||||
| 20 | |||||
| 21 | =cut | ||||
| 22 | |||||
| 23 | 2 | 23µs | 2 | 31µs | # spent 21µs (10+11) within PPI::Token::BEGIN@23 which was called:
# once (10µs+11µs) by PPI::Token::Quote::BEGIN@49 at line 23 # spent 21µs making 1 call to PPI::Token::BEGIN@23
# spent 11µs making 1 call to strict::import |
| 24 | 2 | 95µs | 2 | 1.93ms | # spent 1.85ms (1.38+478µs) within PPI::Token::BEGIN@24 which was called:
# once (1.38ms+478µs) by PPI::Token::Quote::BEGIN@49 at line 24 # spent 1.85ms making 1 call to PPI::Token::BEGIN@24
# spent 73µs making 1 call to Exporter::import |
| 25 | 2 | 92µs | 1 | 13.7ms | # spent 13.7ms (1.92+11.8) within PPI::Token::BEGIN@25 which was called:
# once (1.92ms+11.8ms) by PPI::Token::Quote::BEGIN@49 at line 25 # spent 13.7ms making 1 call to PPI::Token::BEGIN@25 |
| 26 | 2 | 79µs | 1 | 350µs | # spent 350µs (272+79) within PPI::Token::BEGIN@26 which was called:
# once (272µs+79µs) by PPI::Token::Quote::BEGIN@49 at line 26 # spent 350µs making 1 call to PPI::Token::BEGIN@26 |
| 27 | |||||
| 28 | 2 | 46µs | 2 | 104µs | # spent 55µs (7+48) within PPI::Token::BEGIN@28 which was called:
# once (7µs+48µs) by PPI::Token::Quote::BEGIN@49 at line 28 # spent 55µs making 1 call to PPI::Token::BEGIN@28
# spent 48µs making 1 call to vars::import |
| 29 | # spent 16µs within PPI::Token::BEGIN@29 which was called:
# once (16µs+0s) by PPI::Token::Quote::BEGIN@49 at line 32 | ||||
| 30 | 1 | 400ns | $VERSION = '1.215'; | ||
| 31 | 1 | 8µs | @ISA = 'PPI::Element'; | ||
| 32 | 1 | 16µs | 1 | 16µs | } # spent 16µs making 1 call to PPI::Token::BEGIN@29 |
| 33 | |||||
| 34 | # We don't load the abstracts, they are loaded | ||||
| 35 | # as part of the inheritance process. | ||||
| 36 | |||||
| 37 | # Load the token classes | ||||
| 38 | 2 | 101µs | 1 | 387µs | # spent 387µs (318+69) within PPI::Token::BEGIN@38 which was called:
# once (318µs+69µs) by PPI::Token::Quote::BEGIN@49 at line 38 # spent 387µs making 1 call to PPI::Token::BEGIN@38 |
| 39 | 2 | 98µs | 1 | 1.42ms | # spent 1.42ms (1.24+187µs) within PPI::Token::BEGIN@39 which was called:
# once (1.24ms+187µs) by PPI::Token::Quote::BEGIN@49 at line 39 # spent 1.42ms making 1 call to PPI::Token::BEGIN@39 |
| 40 | 2 | 100µs | 1 | 390µs | # spent 390µs (318+72) within PPI::Token::BEGIN@40 which was called:
# once (318µs+72µs) by PPI::Token::Quote::BEGIN@49 at line 40 # spent 390µs making 1 call to PPI::Token::BEGIN@40 |
| 41 | 2 | 89µs | 1 | 535µs | # spent 535µs (438+97) within PPI::Token::BEGIN@41 which was called:
# once (438µs+97µs) by PPI::Token::Quote::BEGIN@49 at line 41 # spent 535µs making 1 call to PPI::Token::BEGIN@41 |
| 42 | 2 | 91µs | 1 | 477µs | # spent 477µs (407+70) within PPI::Token::BEGIN@42 which was called:
# once (407µs+70µs) by PPI::Token::Quote::BEGIN@49 at line 42 # spent 477µs making 1 call to PPI::Token::BEGIN@42 |
| 43 | 2 | 88µs | 1 | 417µs | # spent 417µs (340+77) within PPI::Token::BEGIN@43 which was called:
# once (340µs+77µs) by PPI::Token::Quote::BEGIN@49 at line 43 # spent 417µs making 1 call to PPI::Token::BEGIN@43 |
| 44 | 2 | 89µs | 1 | 388µs | # spent 388µs (321+68) within PPI::Token::BEGIN@44 which was called:
# once (321µs+68µs) by PPI::Token::Quote::BEGIN@49 at line 44 # spent 388µs making 1 call to PPI::Token::BEGIN@44 |
| 45 | 2 | 126µs | 1 | 331µs | # spent 331µs (262+69) within PPI::Token::BEGIN@45 which was called:
# once (262µs+69µs) by PPI::Token::Quote::BEGIN@49 at line 45 # spent 331µs making 1 call to PPI::Token::BEGIN@45 |
| 46 | 2 | 88µs | 1 | 405µs | # spent 405µs (338+66) within PPI::Token::BEGIN@46 which was called:
# once (338µs+66µs) by PPI::Token::Quote::BEGIN@49 at line 46 # spent 405µs making 1 call to PPI::Token::BEGIN@46 |
| 47 | 2 | 87µs | 1 | 421µs | # spent 421µs (353+68) within PPI::Token::BEGIN@47 which was called:
# once (353µs+68µs) by PPI::Token::Quote::BEGIN@49 at line 47 # spent 421µs making 1 call to PPI::Token::BEGIN@47 |
| 48 | 2 | 92µs | 1 | 447µs | # spent 447µs (376+71) within PPI::Token::BEGIN@48 which was called:
# once (376µs+71µs) by PPI::Token::Quote::BEGIN@49 at line 48 # spent 447µs making 1 call to PPI::Token::BEGIN@48 |
| 49 | 2 | 97µs | 1 | 1.28ms | # spent 1.28ms (1.18+91µs) within PPI::Token::BEGIN@49 which was called:
# once (1.18ms+91µs) by PPI::Token::Quote::BEGIN@49 at line 49 # spent 1.28ms making 1 call to PPI::Token::BEGIN@49 |
| 50 | 2 | 94µs | 1 | 345µs | # spent 345µs (274+71) within PPI::Token::BEGIN@50 which was called:
# once (274µs+71µs) by PPI::Token::Quote::BEGIN@49 at line 50 # spent 345µs making 1 call to PPI::Token::BEGIN@50 |
| 51 | 2 | 88µs | 1 | 793µs | # spent 793µs (697+97) within PPI::Token::BEGIN@51 which was called:
# once (697µs+97µs) by PPI::Token::Quote::BEGIN@49 at line 51 # spent 793µs making 1 call to PPI::Token::BEGIN@51 |
| 52 | 2 | 86µs | 1 | 296µs | # spent 296µs (221+75) within PPI::Token::BEGIN@52 which was called:
# once (221µs+75µs) by PPI::Token::Quote::BEGIN@49 at line 52 # spent 296µs making 1 call to PPI::Token::BEGIN@52 |
| 53 | 2 | 100µs | 1 | 2.05ms | # spent 2.05ms (726µs+1.33) within PPI::Token::BEGIN@53 which was called:
# once (726µs+1.33ms) by PPI::Token::Quote::BEGIN@49 at line 53 # spent 2.05ms making 1 call to PPI::Token::BEGIN@53 |
| 54 | 2 | 22µs | 1 | 4µs | # spent 4µs within PPI::Token::BEGIN@54 which was called:
# once (4µs+0s) by PPI::Token::Quote::BEGIN@49 at line 54 # spent 4µs making 1 call to PPI::Token::BEGIN@54 |
| 55 | 2 | 102µs | 1 | 1.48ms | # spent 1.48ms (337µs+1.14) within PPI::Token::BEGIN@55 which was called:
# once (337µs+1.14ms) by PPI::Token::Quote::BEGIN@49 at line 55 # spent 1.48ms making 1 call to PPI::Token::BEGIN@55 |
| 56 | 2 | 92µs | 1 | 1.62ms | # spent 1.62ms (222µs+1.39) within PPI::Token::BEGIN@56 which was called:
# once (222µs+1.39ms) by PPI::Token::Quote::BEGIN@49 at line 56 # spent 1.62ms making 1 call to PPI::Token::BEGIN@56 |
| 57 | 2 | 91µs | 1 | 276µs | # spent 276µs (201+75) within PPI::Token::BEGIN@57 which was called:
# once (201µs+75µs) by PPI::Token::Quote::BEGIN@49 at line 57 # spent 276µs making 1 call to PPI::Token::BEGIN@57 |
| 58 | 2 | 92µs | 1 | 447µs | # spent 447µs (158+288) within PPI::Token::BEGIN@58 which was called:
# once (158µs+288µs) by PPI::Token::Quote::BEGIN@49 at line 58 # spent 447µs making 1 call to PPI::Token::BEGIN@58 |
| 59 | 2 | 101µs | 1 | 246µs | # spent 246µs (162+84) within PPI::Token::BEGIN@59 which was called:
# once (162µs+84µs) by PPI::Token::Quote::BEGIN@49 at line 59 # spent 246µs making 1 call to PPI::Token::BEGIN@59 |
| 60 | 2 | 85µs | 1 | 319µs | # spent 319µs (248+71) within PPI::Token::BEGIN@60 which was called:
# once (248µs+71µs) by PPI::Token::Quote::BEGIN@49 at line 60 # spent 319µs making 1 call to PPI::Token::BEGIN@60 |
| 61 | 2 | 88µs | 1 | 286µs | # spent 286µs (213+73) within PPI::Token::BEGIN@61 which was called:
# once (213µs+73µs) by PPI::Token::Quote::BEGIN@49 at line 61 # spent 286µs making 1 call to PPI::Token::BEGIN@61 |
| 62 | 2 | 95µs | 1 | 246µs | # spent 246µs (174+72) within PPI::Token::BEGIN@62 which was called:
# once (174µs+72µs) by PPI::Token::Quote::BEGIN@49 at line 62 # spent 246µs making 1 call to PPI::Token::BEGIN@62 |
| 63 | 2 | 104µs | 1 | 514µs | # spent 514µs (166+348) within PPI::Token::BEGIN@63 which was called:
# once (166µs+348µs) by PPI::Token::Quote::BEGIN@49 at line 63 # spent 514µs making 1 call to PPI::Token::BEGIN@63 |
| 64 | 2 | 91µs | 1 | 244µs | # spent 244µs (162+82) within PPI::Token::BEGIN@64 which was called:
# once (162µs+82µs) by PPI::Token::Quote::BEGIN@49 at line 64 # spent 244µs making 1 call to PPI::Token::BEGIN@64 |
| 65 | 2 | 99µs | 1 | 235µs | # spent 235µs (158+77) within PPI::Token::BEGIN@65 which was called:
# once (158µs+77µs) by PPI::Token::Quote::BEGIN@49 at line 65 # spent 235µs making 1 call to PPI::Token::BEGIN@65 |
| 66 | 2 | 99µs | 1 | 432µs | # spent 432µs (331+102) within PPI::Token::BEGIN@66 which was called:
# once (331µs+102µs) by PPI::Token::Quote::BEGIN@49 at line 66 # spent 432µs making 1 call to PPI::Token::BEGIN@66 |
| 67 | 2 | 93µs | 1 | 251µs | # spent 251µs (184+67) within PPI::Token::BEGIN@67 which was called:
# once (184µs+67µs) by PPI::Token::Quote::BEGIN@49 at line 67 # spent 251µs making 1 call to PPI::Token::BEGIN@67 |
| 68 | 2 | 93µs | 1 | 671µs | # spent 671µs (548+124) within PPI::Token::BEGIN@68 which was called:
# once (548µs+124µs) by PPI::Token::Quote::BEGIN@49 at line 68 # spent 671µs making 1 call to PPI::Token::BEGIN@68 |
| 69 | 2 | 4.80ms | 1 | 208µs | # spent 208µs (143+66) within PPI::Token::BEGIN@69 which was called:
# once (143µs+66µs) by PPI::Token::Quote::BEGIN@49 at line 69 # spent 208µs making 1 call to PPI::Token::BEGIN@69 |
| 70 | 2 | 214µs | 1 | 1.09ms | # spent 1.09ms (973µs+122µs) within PPI::Token::BEGIN@70 which was called:
# once (973µs+122µs) by PPI::Token::Quote::BEGIN@49 at line 70 # spent 1.09ms making 1 call to PPI::Token::BEGIN@70 |
| 71 | 2 | 162µs | 1 | 364µs | # spent 364µs (246+118) within PPI::Token::BEGIN@71 which was called:
# once (246µs+118µs) by PPI::Token::Quote::BEGIN@49 at line 71 # spent 364µs making 1 call to PPI::Token::BEGIN@71 |
| 72 | 2 | 150µs | 1 | 3.61ms | # spent 3.61ms (302µs+3.30) within PPI::Token::BEGIN@72 which was called:
# once (302µs+3.30ms) by PPI::Token::Quote::BEGIN@49 at line 72 # spent 3.61ms making 1 call to PPI::Token::BEGIN@72 |
| 73 | 2 | 138µs | 1 | 431µs | # spent 431µs (335+95) within PPI::Token::BEGIN@73 which was called:
# once (335µs+95µs) by PPI::Token::Quote::BEGIN@49 at line 73 # spent 431µs making 1 call to PPI::Token::BEGIN@73 |
| 74 | 2 | 141µs | 1 | 446µs | # spent 446µs (350+96) within PPI::Token::BEGIN@74 which was called:
# once (350µs+96µs) by PPI::Token::Quote::BEGIN@49 at line 74 # spent 446µs making 1 call to PPI::Token::BEGIN@74 |
| 75 | 2 | 145µs | 1 | 669µs | # spent 669µs (571+98) within PPI::Token::BEGIN@75 which was called:
# once (571µs+98µs) by PPI::Token::Quote::BEGIN@49 at line 75 # spent 669µs making 1 call to PPI::Token::BEGIN@75 |
| 76 | 2 | 838µs | 1 | 5µs | # spent 5µs within PPI::Token::BEGIN@76 which was called:
# once (5µs+0s) by PPI::Token::Quote::BEGIN@49 at line 76 # spent 5µs making 1 call to PPI::Token::BEGIN@76 |
| 77 | |||||
| - - | |||||
| 82 | ##################################################################### | ||||
| 83 | # Constructor and Related | ||||
| 84 | |||||
| 85 | # spent 231ms within PPI::Token::new which was called 94229 times, avg 2µs/call:
# 53790 times (138ms+0s) by PPI::Tokenizer::_new_token at line 623 of PPI/Tokenizer.pm, avg 3µs/call
# 37692 times (85.7ms+0s) by PPI::Tokenizer::_process_next_char at line 584 of PPI/Tokenizer.pm, avg 2µs/call
# 1682 times (4.04ms+0s) by PPI::Token::_QuoteEngine::Simple::new at line 22 of PPI/Token/_QuoteEngine/Simple.pm, avg 2µs/call
# 1061 times (2.87ms+0s) by PPI::Token::_QuoteEngine::Full::new at line 149 of PPI/Token/_QuoteEngine/Full.pm, avg 3µs/call
# 3 times (9µs+0s) by PPI::Token::Magic::__TOKENIZER__on_char at line 175 of PPI/Token/Magic.pm, avg 3µs/call
# once (8µs+0s) by PPI::Token::Whitespace::null at line 79 of PPI/Token/Whitespace.pm | ||||
| 86 | 94229 | 412ms | bless { content => (defined $_[1] ? "$_[1]" : '') }, $_[0]; | ||
| 87 | } | ||||
| 88 | |||||
| 89 | # spent 114ms (95.3+18.4) within PPI::Token::set_class which was called 8845 times, avg 13µs/call:
# 6802 times (73.3ms+14.1ms) by PPI::Token::Unknown::__TOKENIZER__on_char at line 128 of PPI/Token/Unknown.pm, avg 13µs/call
# 803 times (5.47ms+1.59ms) by PPI::Token::Unknown::__TOKENIZER__on_char at line 157 of PPI/Token/Unknown.pm, avg 9µs/call
# 509 times (3.16ms+913µs) by PPI::Token::Symbol::__TOKENIZER__on_char at line 173 of PPI/Token/Symbol.pm, avg 8µs/call
# 150 times (4.98ms+522µs) by PPI::Token::Number::__TOKENIZER__on_char at line 115 of PPI/Token/Number.pm, avg 37µs/call
# 139 times (5.21ms+291µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 247 of PPI/Token/Unknown.pm, avg 40µs/call
# 119 times (896µs+252µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 199 of PPI/Token/Unknown.pm, avg 10µs/call
# 108 times (724µs+228µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 271 of PPI/Token/Unknown.pm, avg 9µs/call
# 85 times (622µs+170µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 178 of PPI/Token/Unknown.pm, avg 9µs/call
# 34 times (250µs+69µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 134 of PPI/Token/Unknown.pm, avg 9µs/call
# 28 times (208µs+55µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 236 of PPI/Token/Unknown.pm, avg 9µs/call
# 25 times (158µs+54µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 294 of PPI/Token/Unknown.pm, avg 8µs/call
# 22 times (146µs+37µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 215 of PPI/Token/Unknown.pm, avg 8µs/call
# 9 times (61µs+17µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 255 of PPI/Token/Unknown.pm, avg 9µs/call
# 2 times (16µs+5µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 60 of PPI/Token/Unknown.pm, avg 10µs/call
# 2 times (13µs+4µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 266 of PPI/Token/Unknown.pm, avg 8µs/call
# 2 times (12µs+4µs) by PPI::Token::Number::Float::__TOKENIZER__on_char at line 92 of PPI/Token/Number/Float.pm, avg 8µs/call
# 2 times (12µs+3µs) by PPI::Token::DashedWord::__TOKENIZER__on_char at line 87 of PPI/Token/DashedWord.pm, avg 8µs/call
# once (7µs+2µs) by PPI::Token::Operator::__TOKENIZER__on_char at line 101 of PPI/Token/Operator.pm
# once (7µs+2µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 221 of PPI/Token/Unknown.pm
# once (6µs+2µs) by PPI::Token::Unknown::__TOKENIZER__on_char at line 149 of PPI/Token/Unknown.pm
# once (6µs+2µs) by PPI::Token::Magic::__TOKENIZER__on_char at line 169 of PPI/Token/Magic.pm | ||||
| 90 | 8845 | 2.04ms | my $self = shift; | ||
| 91 | # @_ or throw Exception("No arguments to set_class"); | ||||
| 92 | 8845 | 5.21ms | my $class = substr( $_[0], 0, 12 ) eq 'PPI::Token::' ? shift : 'PPI::Token::' . shift; | ||
| 93 | |||||
| 94 | # Find out if the current and new classes are complex | ||||
| 95 | 8845 | 51.3ms | 8845 | 10.3ms | my $old_quote = (ref($self) =~ /\b(?:Quote|Regex)\b/o) ? 1 : 0; # spent 10.3ms making 8845 calls to PPI::Token::CORE:match, avg 1µs/call |
| 96 | 8845 | 29.9ms | 8845 | 8.01ms | my $new_quote = ($class =~ /\b(?:Quote|Regex)\b/o) ? 1 : 0; # spent 8.01ms making 8845 calls to PPI::Token::CORE:match, avg 906ns/call |
| 97 | |||||
| 98 | # No matter what happens, we will have to rebless | ||||
| 99 | 8845 | 5.10ms | bless $self, $class; | ||
| 100 | |||||
| 101 | # If we are changing to or from a Quote style token, we | ||||
| 102 | # can't just rebless and need to do some extra thing | ||||
| 103 | # Otherwise, we have done enough | ||||
| 104 | 8845 | 33.0ms | return $class if ($old_quote - $new_quote) == 0; | ||
| 105 | |||||
| 106 | # Make a new token from the old content, and overwrite the current | ||||
| 107 | # token's attributes with the new token's attributes. | ||||
| 108 | my $token = $class->new( $self->{content} ); | ||||
| 109 | %$self = %$token; | ||||
| 110 | |||||
| 111 | # Return the class as a convenience | ||||
| 112 | return $class; | ||||
| 113 | } | ||||
| 114 | |||||
| - - | |||||
| 119 | ##################################################################### | ||||
| 120 | # PPI::Token Methods | ||||
| 121 | |||||
| 122 | =pod | ||||
| 123 | |||||
| 124 | =head2 set_content $string | ||||
| 125 | |||||
| 126 | The C<set_content> method allows to set/change the string that the | ||||
| 127 | C<PPI::Token> object represents. | ||||
| 128 | |||||
| 129 | Returns the string you set the Token to | ||||
| 130 | |||||
| 131 | =cut | ||||
| 132 | |||||
| 133 | sub set_content { | ||||
| 134 | $_[0]->{content} = $_[1]; | ||||
| 135 | } | ||||
| 136 | |||||
| 137 | =pod | ||||
| 138 | |||||
| 139 | =head2 add_content $string | ||||
| 140 | |||||
| 141 | The C<add_content> method allows you to add additional bytes of code | ||||
| 142 | to the end of the Token. | ||||
| 143 | |||||
| 144 | Returns the new full string after the bytes have been added. | ||||
| 145 | |||||
| 146 | =cut | ||||
| 147 | |||||
| 148 | sub add_content { $_[0]->{content} .= $_[1] } | ||||
| 149 | |||||
| 150 | =pod | ||||
| 151 | |||||
| 152 | =head2 length | ||||
| 153 | |||||
| 154 | The C<length> method returns the length of the string in a Token. | ||||
| 155 | |||||
| 156 | =cut | ||||
| 157 | |||||
| 158 | sub length { CORE::length($_[0]->{content}) } | ||||
| 159 | |||||
| - - | |||||
| 164 | ##################################################################### | ||||
| 165 | # Overloaded PPI::Element methods | ||||
| 166 | |||||
| 167 | # spent 482ms within PPI::Token::content which was called 357151 times, avg 1µs/call:
# 105472 times (141ms+0s) by PPI::Element::__eq at line 1089 of PPI/Element.pm, avg 1µs/call
# 94224 times (133ms+0s) by PPI::Document::serialize at line 435 of PPI/Document.pm, avg 1µs/call
# 16707 times (19.6ms+0s) by Readonly::Hash::EXISTS at line 25 of Readonly/Hash.pm, avg 1µs/call
# 13481 times (16.4ms+0s) by Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::violates at line 46 of Perl/Critic/Policy/InputOutput/RequireEncodingWithUTF8Layer.pm, avg 1µs/call
# 13481 times (14.9ms+0s) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::violates at line 100 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm, avg 1µs/call
# 11219 times (14.7ms+0s) by Perl::Critic::Policy::Variables::ProhibitConditionalDeclarations::_is_conditional at line 50 of Perl/Critic/Policy/Variables/ProhibitConditionalDeclarations.pm, avg 1µs/call
# 10732 times (14.8ms+0s) by PPI::Lexer::_lex_statement at line 641 of PPI/Lexer.pm, avg 1µs/call
# 10331 times (14.6ms+0s) by PPI::Lexer::_statement at line 456 of PPI/Lexer.pm, avg 1µs/call
# 9353 times (13.9ms+0s) by Perl::Critic::Utils::McCabe::_count_logic_keywords at line 113 of Perl/Critic/Utils/McCabe.pm, avg 1µs/call
# 7954 times (10.4ms+0s) by PPI::Node::content at line 671 of PPI/Node.pm, avg 1µs/call
# 7354 times (11.0ms+0s) by Perl::Critic::Utils::McCabe::_count_logic_operators at line 130 of Perl/Critic/Utils/McCabe.pm, avg 1µs/call
# 5818 times (7.37ms+0s) by PPI::Lexer::_statement at line 497 of PPI/Lexer.pm, avg 1µs/call
# 5789 times (8.10ms+0s) by PPI::Lexer::_lex_structure at line 1356 of PPI/Lexer.pm, avg 1µs/call
# 5789 times (7.12ms+0s) by PPI::Lexer::_lex_statement at line 649 of PPI/Lexer.pm, avg 1µs/call
# 4796 times (6.04ms+0s) by PPI::Lexer::_statement at line 539 of PPI/Lexer.pm, avg 1µs/call
# 3024 times (4.79ms+0s) by PPI::Lexer::_lex_document at line 277 of PPI/Lexer.pm, avg 2µs/call
# 2953 times (4.52ms+0s) by PPI::Token::Whitespace::__TOKENIZER__on_char at line 248 of PPI/Token/Whitespace.pm, avg 2µs/call
# 2953 times (3.91ms+0s) by PPI::Lexer::_round at line 993 of PPI/Lexer.pm, avg 1µs/call
# 2598 times (3.66ms+0s) by PPI::Statement::Variable::type at line 73 of PPI/Statement/Variable.pm, avg 1µs/call
# 2334 times (3.40ms+0s) by PPI::Statement::Compound::type at line 202 of PPI/Statement/Compound.pm, avg 1µs/call
# 2244 times (2.97ms+0s) by PPI::Structure::content at line 291 of PPI/Structure.pm, avg 1µs/call
# 2244 times (2.87ms+0s) by PPI::Structure::content at line 295 of PPI/Structure.pm, avg 1µs/call
# 2219 times (3.02ms+0s) by PPI::Structure::content at line 293 of PPI/Structure.pm, avg 1µs/call
# 1910 times (3.00ms+0s) by Perl::Critic::Annotation::CORE:match at line 36 of Perl/Critic/Annotation.pm, avg 2µs/call
# 1668 times (2.55ms+0s) by PPI::Document::_logical_line_and_file at line 690 of PPI/Document.pm, avg 2µs/call
# 1644 times (2.17ms+0s) by PPI::Lexer::_curly at line 1190 of PPI/Lexer.pm, avg 1µs/call
# 1268 times (1.76ms+0s) by PPI::Statement::Include::type at line 93 of PPI/Statement/Include.pm, avg 1µs/call
# 1022 times (1.36ms+0s) by PPI::Lexer::_statement at line 508 of PPI/Lexer.pm, avg 1µs/call
# 984 times (1.36ms+0s) by PPI::Statement::Include::module at line 126 of PPI/Statement/Include.pm, avg 1µs/call
# 981 times (1.45ms+0s) by PPI::Lexer::_statement at line 551 of PPI/Lexer.pm, avg 1µs/call
# 536 times (693µs+0s) by PPI::Lexer::_continues at line 764 of PPI/Lexer.pm, avg 1µs/call
# 482 times (646µs+0s) by PPI::Statement::Compound::type at line 206 of PPI/Statement/Compound.pm, avg 1µs/call
# 426 times (709µs+0s) by PPI::Statement::Include::version at line 267 of PPI/Statement/Include.pm, avg 2µs/call
# 276 times (340µs+0s) by PPI::Lexer::_continues at line 928 of PPI/Lexer.pm, avg 1µs/call
# 240 times (332µs+0s) by PPI::Lexer::_square at line 1031 of PPI/Lexer.pm, avg 1µs/call
# 232 times (307µs+0s) by PPI::Lexer::_continues at line 859 of PPI/Lexer.pm, avg 1µs/call
# 154 times (212µs+0s) by Perl::Critic::Utils::_name_for_sub_or_stringified_element at line 356 of Perl/Critic/Utils.pm, avg 1µs/call
# 153 times (247µs+0s) by PPI::Tokenizer::_opcontext at line 747 of PPI/Tokenizer.pm, avg 2µs/call
# 151 times (209µs+0s) by PPI::Lexer::_continues at line 805 of PPI/Lexer.pm, avg 1µs/call
# 146 times (318µs+0s) by PPI::Document::_logical_line_and_file at line 705 of PPI/Document.pm, avg 2µs/call
# 144 times (228µs+0s) by PPI::Statement::Package::namespace at line 95 of PPI/Statement/Package.pm, avg 2µs/call
# 140 times (210µs+0s) by PPI::Lexer::_statement at line 437 of PPI/Lexer.pm, avg 2µs/call
# 124 times (151µs+0s) by PPI::Lexer::_continues at line 893 of PPI/Lexer.pm, avg 1µs/call
# 122 times (178µs+0s) by PPI::Lexer::_curly at line 1270 of PPI/Lexer.pm, avg 1µs/call
# 119 times (185µs+0s) by PPI::Lexer::_continues at line 885 of PPI/Lexer.pm, avg 2µs/call
# 116 times (178µs+0s) by PPI::Token::Whitespace::__TOKENIZER__on_char at line 227 of PPI/Token/Whitespace.pm, avg 2µs/call
# 111 times (152µs+0s) by PPI::Lexer::_square at line 1040 of PPI/Lexer.pm, avg 1µs/call
# 107 times (140µs+0s) by PPI::Tokenizer::_opcontext at line 753 of PPI/Tokenizer.pm, avg 1µs/call
# 96 times (130µs+0s) by PPI::Lexer::_round at line 1011 of PPI/Lexer.pm, avg 1µs/call
# 83 times (104µs+0s) by PPI::Lexer::_continues at line 923 of PPI/Lexer.pm, avg 1µs/call
# 83 times (99µs+0s) by PPI::Lexer::_continues at line 930 of PPI/Lexer.pm, avg 1µs/call
# 83 times (99µs+0s) by PPI::Lexer::_continues at line 959 of PPI/Lexer.pm, avg 1µs/call
# 83 times (96µs+0s) by PPI::Lexer::_continues at line 952 of PPI/Lexer.pm, avg 1µs/call
# 54 times (74µs+0s) by PPI::Lexer::_curly at line 1254 of PPI/Lexer.pm, avg 1µs/call
# 51 times (81µs+0s) by Perl::Critic::Annotation::CORE:match at line 73 of Perl/Critic/Annotation.pm, avg 2µs/call
# 51 times (77µs+0s) by Perl::Critic::Annotation::CORE:match at line 247 of Perl/Critic/Annotation.pm, avg 2µs/call
# 50 times (70µs+0s) by Perl::Critic::Utils::precedence_of at line 701 of Perl/Critic/Utils.pm, avg 1µs/call
# 38 times (54µs+0s) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::_is_assignment_operator at line 245 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm, avg 1µs/call
# 33 times (42µs+0s) by PPI::Lexer::_continues at line 817 of PPI/Lexer.pm, avg 1µs/call
# 23 times (35µs+0s) by Perl::Critic::Annotation::CORE:match at line 110 of Perl/Critic/Annotation.pm, avg 2µs/call
# 19 times (27µs+0s) by PPI::Token::Whitespace::__TOKENIZER__on_char at line 285 of PPI/Token/Whitespace.pm, avg 1µs/call
# 19 times (22µs+0s) by Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::_is_increment_operator at line 248 of Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm, avg 1µs/call
# 18 times (25µs+0s) by PPI::Lexer::_continues at line 751 of PPI/Lexer.pm, avg 1µs/call
# 14 times (20µs+0s) by PPI::Lexer::_continues at line 788 of PPI/Lexer.pm, avg 1µs/call
# 12 times (17µs+0s) by Perl::Critic::Utils::CORE:match at line 771 of Perl/Critic/Utils.pm, avg 1µs/call
# 6 times (7µs+0s) by PPI::Lexer::_continues at line 823 of PPI/Lexer.pm, avg 1µs/call
# 5 times (8µs+0s) by Perl::Critic::Policy::BuiltinFunctions::RequireGlobFunction::CORE:match at line 38 of Perl/Critic/Policy/BuiltinFunctions/RequireGlobFunction.pm, avg 2µs/call
# 2 times (3µs+0s) by PPI::Lexer::_continues at line 876 of PPI/Lexer.pm, avg 1µs/call
# once (2µs+0s) by PPI::Token::Whitespace::__TOKENIZER__on_char at line 322 of PPI/Token/Whitespace.pm
# once (1µs+0s) by PPI::Document::serialize at line 461 of PPI/Document.pm
# once (1µs+0s) by PPI::Lexer::_curly at line 1212 of PPI/Lexer.pm | ||||
| 168 | 357151 | 999ms | $_[0]->{content}; | ||
| 169 | } | ||||
| 170 | |||||
| 171 | # You can insert either a statement, or a non-significant token. | ||||
| 172 | sub insert_before { | ||||
| 173 | my $self = shift; | ||||
| 174 | my $Element = _INSTANCE(shift, 'PPI::Element') or return undef; | ||||
| 175 | if ( $Element->isa('PPI::Structure') ) { | ||||
| 176 | return $self->__insert_before($Element); | ||||
| 177 | } elsif ( $Element->isa('PPI::Token') ) { | ||||
| 178 | return $self->__insert_before($Element); | ||||
| 179 | } | ||||
| 180 | ''; | ||||
| 181 | } | ||||
| 182 | |||||
| 183 | # As above, you can insert a statement, or a non-significant token | ||||
| 184 | sub insert_after { | ||||
| 185 | my $self = shift; | ||||
| 186 | my $Element = _INSTANCE(shift, 'PPI::Element') or return undef; | ||||
| 187 | if ( $Element->isa('PPI::Structure') ) { | ||||
| 188 | return $self->__insert_after($Element); | ||||
| 189 | } elsif ( $Element->isa('PPI::Token') ) { | ||||
| 190 | return $self->__insert_after($Element); | ||||
| 191 | } | ||||
| 192 | ''; | ||||
| 193 | } | ||||
| 194 | |||||
| - - | |||||
| 199 | ##################################################################### | ||||
| 200 | # Tokenizer Methods | ||||
| 201 | |||||
| 202 | sub __TOKENIZER__on_line_start { 1 } | ||||
| 203 | 144 | 288µs | # spent 224µs within PPI::Token::__TOKENIZER__on_line_end which was called 144 times, avg 2µs/call:
# 144 times (224µs+0s) by PPI::Tokenizer::_process_next_line at line 518 of PPI/Tokenizer.pm, avg 2µs/call | ||
| 204 | sub __TOKENIZER__on_char { 'Unknown' } | ||||
| 205 | |||||
| - - | |||||
| 210 | ##################################################################### | ||||
| 211 | # Lexer Methods | ||||
| 212 | |||||
| 213 | # spent 85.1ms (69.5+15.7) within PPI::Token::__LEXER__opens which was called 11666 times, avg 7µs/call:
# 5871 times (23.6ms+5.72ms) by PPI::Lexer::_lex_structure at line 1344 of PPI/Lexer.pm, avg 5µs/call
# 5789 times (45.9ms+9.95ms) by PPI::Structure::new at line 123 of PPI/Structure.pm, avg 10µs/call
# 6 times (23µs+15µs) by PPI::Lexer::_lex_document at line 301 of PPI/Lexer.pm, avg 6µs/call | ||||
| 214 | 11666 | 106ms | 11666 | 15.7ms | ref($_[0]) eq 'PPI::Token::Structure' # spent 15.7ms making 11666 calls to PPI::Token::CORE:match, avg 1µs/call |
| 215 | and | ||||
| 216 | $_[0]->{content} =~ /(?:\(|\[|\{)/ | ||||
| 217 | } | ||||
| 218 | |||||
| 219 | # spent 152ms (124+27.8) within PPI::Token::__LEXER__closes which was called 45079 times, avg 3µs/call:
# 39289 times (95.0ms+20.6ms) by PPI::Lexer::_lex_statement at line 616 of PPI/Lexer.pm, avg 3µs/call
# 5790 times (28.8ms+7.22ms) by PPI::Lexer::_lex_structure at line 1354 of PPI/Lexer.pm, avg 6µs/call | ||||
| 220 | 45079 | 260ms | 20586 | 27.8ms | ref($_[0]) eq 'PPI::Token::Structure' # spent 27.8ms making 20586 calls to PPI::Token::CORE:match, avg 1µs/call |
| 221 | and | ||||
| 222 | $_[0]->{content} =~ /(?:\)|\]|\})/ | ||||
| 223 | } | ||||
| 224 | |||||
| 225 | 1 | 3µs | 1; | ||
| 226 | |||||
| 227 | =pod | ||||
| 228 | |||||
| 229 | =head1 SUPPORT | ||||
| 230 | |||||
| 231 | See the L<support section|PPI/SUPPORT> in the main module. | ||||
| 232 | |||||
| 233 | =head1 AUTHOR | ||||
| 234 | |||||
| 235 | Adam Kennedy E<lt>adamk@cpan.orgE<gt> | ||||
| 236 | |||||
| 237 | =head1 COPYRIGHT | ||||
| 238 | |||||
| 239 | Copyright 2001 - 2011 Adam Kennedy. | ||||
| 240 | |||||
| 241 | This program is free software; you can redistribute | ||||
| 242 | it and/or modify it under the same terms as Perl itself. | ||||
| 243 | |||||
| 244 | The full text of the license can be found in the | ||||
| 245 | LICENSE file included with this module. | ||||
| 246 | |||||
| 247 | =cut | ||||
# spent 61.9ms within PPI::Token::CORE:match which was called 49942 times, avg 1µs/call:
# 20586 times (27.8ms+0s) by PPI::Token::__LEXER__closes at line 220, avg 1µs/call
# 11666 times (15.7ms+0s) by PPI::Token::__LEXER__opens at line 214, avg 1µs/call
# 8845 times (10.3ms+0s) by PPI::Token::set_class at line 95, avg 1µs/call
# 8845 times (8.01ms+0s) by PPI::Token::set_class at line 96, avg 906ns/call |