← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:10 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Token.pm
StatementsExecuted 561430 statements in 1.91s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3571517119482ms482msPPI::Token::::contentPPI::Token::content
9422965231ms231msPPI::Token::::newPPI::Token::new
4507921124ms152msPPI::Token::::__LEXER__closesPPI::Token::__LEXER__closes
884521795.3ms114msPPI::Token::::set_classPPI::Token::set_class
116663269.5ms85.1msPPI::Token::::__LEXER__opensPPI::Token::__LEXER__opens
499424161.9ms61.9msPPI::Token::::CORE:matchPPI::Token::CORE:match (opcode)
1111.92ms13.7msPPI::Token::::BEGIN@25PPI::Token::BEGIN@25
1111.38ms1.85msPPI::Token::::BEGIN@24PPI::Token::BEGIN@24
1111.24ms1.42msPPI::Token::::BEGIN@39PPI::Token::BEGIN@39
1111.18ms1.28msPPI::Token::::BEGIN@49PPI::Token::BEGIN@49
111973┬Ás1.09msPPI::Token::::BEGIN@70PPI::Token::BEGIN@70
111726┬Ás2.05msPPI::Token::::BEGIN@53PPI::Token::BEGIN@53
111697┬Ás793┬ÁsPPI::Token::::BEGIN@51PPI::Token::BEGIN@51
111571┬Ás669┬ÁsPPI::Token::::BEGIN@75PPI::Token::BEGIN@75
111548┬Ás671┬ÁsPPI::Token::::BEGIN@68PPI::Token::BEGIN@68
111438┬Ás535┬ÁsPPI::Token::::BEGIN@41PPI::Token::BEGIN@41
111407┬Ás477┬ÁsPPI::Token::::BEGIN@42PPI::Token::BEGIN@42
111376┬Ás447┬ÁsPPI::Token::::BEGIN@48PPI::Token::BEGIN@48
111353┬Ás421┬ÁsPPI::Token::::BEGIN@47PPI::Token::BEGIN@47
111350┬Ás446┬ÁsPPI::Token::::BEGIN@74PPI::Token::BEGIN@74
111340┬Ás417┬ÁsPPI::Token::::BEGIN@43PPI::Token::BEGIN@43
111338┬Ás405┬ÁsPPI::Token::::BEGIN@46PPI::Token::BEGIN@46
111337┬Ás1.48msPPI::Token::::BEGIN@55PPI::Token::BEGIN@55
111335┬Ás431┬ÁsPPI::Token::::BEGIN@73PPI::Token::BEGIN@73
111331┬Ás432┬ÁsPPI::Token::::BEGIN@66PPI::Token::BEGIN@66
111321┬Ás388┬ÁsPPI::Token::::BEGIN@44PPI::Token::BEGIN@44
111318┬Ás390┬ÁsPPI::Token::::BEGIN@40PPI::Token::BEGIN@40
111318┬Ás387┬ÁsPPI::Token::::BEGIN@38PPI::Token::BEGIN@38
111302┬Ás3.61msPPI::Token::::BEGIN@72PPI::Token::BEGIN@72
111274┬Ás345┬ÁsPPI::Token::::BEGIN@50PPI::Token::BEGIN@50
111272┬Ás350┬ÁsPPI::Token::::BEGIN@26PPI::Token::BEGIN@26
111262┬Ás331┬ÁsPPI::Token::::BEGIN@45PPI::Token::BEGIN@45
111248┬Ás319┬ÁsPPI::Token::::BEGIN@60PPI::Token::BEGIN@60
111246┬Ás364┬ÁsPPI::Token::::BEGIN@71PPI::Token::BEGIN@71
14411224┬Ás224┬ÁsPPI::Token::::__TOKENIZER__on_line_endPPI::Token::__TOKENIZER__on_line_end
111222┬Ás1.62msPPI::Token::::BEGIN@56PPI::Token::BEGIN@56
111221┬Ás296┬ÁsPPI::Token::::BEGIN@52PPI::Token::BEGIN@52
111213┬Ás286┬ÁsPPI::Token::::BEGIN@61PPI::Token::BEGIN@61
111201┬Ás276┬ÁsPPI::Token::::BEGIN@57PPI::Token::BEGIN@57
111184┬Ás251┬ÁsPPI::Token::::BEGIN@67PPI::Token::BEGIN@67
111174┬Ás246┬ÁsPPI::Token::::BEGIN@62PPI::Token::BEGIN@62
111166┬Ás514┬ÁsPPI::Token::::BEGIN@63PPI::Token::BEGIN@63
111162┬Ás246┬ÁsPPI::Token::::BEGIN@59PPI::Token::BEGIN@59
111162┬Ás244┬ÁsPPI::Token::::BEGIN@64PPI::Token::BEGIN@64
111158┬Ás447┬ÁsPPI::Token::::BEGIN@58PPI::Token::BEGIN@58
111158┬Ás235┬ÁsPPI::Token::::BEGIN@65PPI::Token::BEGIN@65
111143┬Ás208┬ÁsPPI::Token::::BEGIN@69PPI::Token::BEGIN@69
11116┬Ás16┬ÁsPPI::Token::::BEGIN@29PPI::Token::BEGIN@29
11110┬Ás21┬ÁsPPI::Token::::BEGIN@23PPI::Token::BEGIN@23
1117┬Ás55┬ÁsPPI::Token::::BEGIN@28PPI::Token::BEGIN@28
1115┬Ás5┬ÁsPPI::Token::::BEGIN@76PPI::Token::BEGIN@76
1114┬Ás4┬ÁsPPI::Token::::BEGIN@54PPI::Token::BEGIN@54
0000s0sPPI::Token::::__TOKENIZER__on_charPPI::Token::__TOKENIZER__on_char
0000s0sPPI::Token::::__TOKENIZER__on_line_startPPI::Token::__TOKENIZER__on_line_start
0000s0sPPI::Token::::add_contentPPI::Token::add_content
0000s0sPPI::Token::::insert_afterPPI::Token::insert_after
0000s0sPPI::Token::::insert_beforePPI::Token::insert_before
0000s0sPPI::Token::::lengthPPI::Token::length
0000s0sPPI::Token::::set_contentPPI::Token::set_content
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package PPI::Token;
2
3=pod
4
5=head1 NAME
6
7PPI::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
16C<PPI::Token> is the abstract base class for all Tokens. In PPI terms, a "Token" is
17a L<PPI::Element> that directly represents bytes of source code.
18
19=head1 METHODS
20
21=cut
22
23223┬Ás231┬Á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
use strict;
# spent 21┬Ás making 1 call to PPI::Token::BEGIN@23 # spent 11┬Ás making 1 call to strict::import
24295┬Ás21.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
use Params::Util qw{_INSTANCE};
# spent 1.85ms making 1 call to PPI::Token::BEGIN@24 # spent 73┬Ás making 1 call to Exporter::import
25292┬Ás113.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
use PPI::Element ();
# spent 13.7ms making 1 call to PPI::Token::BEGIN@25
26279┬Ás1350┬Á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
use PPI::Exception ();
# spent 350┬Ás making 1 call to PPI::Token::BEGIN@26
27
28246┬Ás2104┬Á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
use vars qw{$VERSION @ISA};
# 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
BEGIN {
301400ns $VERSION = '1.215';
3118┬Ás @ISA = 'PPI::Element';
32116┬Ás116┬Á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
382101┬Ás1387┬Á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
use PPI::Token::BOM ();
# spent 387┬Ás making 1 call to PPI::Token::BEGIN@38
39298┬Ás11.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
use PPI::Token::Whitespace ();
# spent 1.42ms making 1 call to PPI::Token::BEGIN@39
402100┬Ás1390┬Á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
use PPI::Token::Comment ();
# spent 390┬Ás making 1 call to PPI::Token::BEGIN@40
41289┬Ás1535┬Á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
use PPI::Token::Pod ();
# spent 535┬Ás making 1 call to PPI::Token::BEGIN@41
42291┬Ás1477┬Á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
use PPI::Token::Number ();
# spent 477┬Ás making 1 call to PPI::Token::BEGIN@42
43288┬Ás1417┬Á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
use PPI::Token::Number::Binary ();
# spent 417┬Ás making 1 call to PPI::Token::BEGIN@43
44289┬Ás1388┬Á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
use PPI::Token::Number::Octal ();
# spent 388┬Ás making 1 call to PPI::Token::BEGIN@44
452126┬Ás1331┬Á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
use PPI::Token::Number::Hex ();
# spent 331┬Ás making 1 call to PPI::Token::BEGIN@45
46288┬Ás1405┬Á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
use PPI::Token::Number::Float ();
# spent 405┬Ás making 1 call to PPI::Token::BEGIN@46
47287┬Ás1421┬Á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
use PPI::Token::Number::Exp ();
# spent 421┬Ás making 1 call to PPI::Token::BEGIN@47
48292┬Ás1447┬Á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
use PPI::Token::Number::Version ();
# spent 447┬Ás making 1 call to PPI::Token::BEGIN@48
49297┬Ás11.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
use PPI::Token::Word ();
# spent 1.28ms making 1 call to PPI::Token::BEGIN@49
50294┬Ás1345┬Á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
use PPI::Token::DashedWord ();
# spent 345┬Ás making 1 call to PPI::Token::BEGIN@50
51288┬Ás1793┬Á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
use PPI::Token::Symbol ();
# spent 793┬Ás making 1 call to PPI::Token::BEGIN@51
52286┬Ás1296┬Á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
use PPI::Token::ArrayIndex ();
# spent 296┬Ás making 1 call to PPI::Token::BEGIN@52
532100┬Ás12.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
use PPI::Token::Magic ();
# spent 2.05ms making 1 call to PPI::Token::BEGIN@53
54222┬Ás14┬Á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
use PPI::Token::Quote::Single ();
# spent 4┬Ás making 1 call to PPI::Token::BEGIN@54
552102┬Ás11.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
use PPI::Token::Quote::Double ();
# spent 1.48ms making 1 call to PPI::Token::BEGIN@55
56292┬Ás11.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
use PPI::Token::Quote::Literal ();
# spent 1.62ms making 1 call to PPI::Token::BEGIN@56
57291┬Ás1276┬Á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
use PPI::Token::Quote::Interpolate ();
# spent 276┬Ás making 1 call to PPI::Token::BEGIN@57
58292┬Ás1447┬Á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
use PPI::Token::QuoteLike::Backtick ();
# spent 447┬Ás making 1 call to PPI::Token::BEGIN@58
592101┬Ás1246┬Á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
use PPI::Token::QuoteLike::Command ();
# spent 246┬Ás making 1 call to PPI::Token::BEGIN@59
60285┬Ás1319┬Á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
use PPI::Token::QuoteLike::Regexp ();
# spent 319┬Ás making 1 call to PPI::Token::BEGIN@60
61288┬Ás1286┬Á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
use PPI::Token::QuoteLike::Words ();
# spent 286┬Ás making 1 call to PPI::Token::BEGIN@61
62295┬Ás1246┬Á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
use PPI::Token::QuoteLike::Readline ();
# spent 246┬Ás making 1 call to PPI::Token::BEGIN@62
632104┬Ás1514┬Á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
use PPI::Token::Regexp::Match ();
# spent 514┬Ás making 1 call to PPI::Token::BEGIN@63
64291┬Ás1244┬Á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
use PPI::Token::Regexp::Substitute ();
# spent 244┬Ás making 1 call to PPI::Token::BEGIN@64
65299┬Ás1235┬Á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
use PPI::Token::Regexp::Transliterate ();
# spent 235┬Ás making 1 call to PPI::Token::BEGIN@65
66299┬Ás1432┬Á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
use PPI::Token::Operator ();
# spent 432┬Ás making 1 call to PPI::Token::BEGIN@66
67293┬Ás1251┬Á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
use PPI::Token::Cast ();
# spent 251┬Ás making 1 call to PPI::Token::BEGIN@67
68293┬Ás1671┬Á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
use PPI::Token::Structure ();
# spent 671┬Ás making 1 call to PPI::Token::BEGIN@68
6924.80ms1208┬Á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
use PPI::Token::Label ();
# spent 208┬Ás making 1 call to PPI::Token::BEGIN@69
702214┬Ás11.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
use PPI::Token::HereDoc ();
# spent 1.09ms making 1 call to PPI::Token::BEGIN@70
712162┬Ás1364┬Á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
use PPI::Token::Separator ();
# spent 364┬Ás making 1 call to PPI::Token::BEGIN@71
722150┬Ás13.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
use PPI::Token::Data ();
# spent 3.61ms making 1 call to PPI::Token::BEGIN@72
732138┬Ás1431┬Á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
use PPI::Token::End ();
# spent 431┬Ás making 1 call to PPI::Token::BEGIN@73
742141┬Ás1446┬Á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
use PPI::Token::Prototype ();
# spent 446┬Ás making 1 call to PPI::Token::BEGIN@74
752145┬Ás1669┬Á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
use PPI::Token::Attribute ();
# spent 669┬Ás making 1 call to PPI::Token::BEGIN@75
762838┬Ás15┬Á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
use PPI::Token::Unknown ();
# 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
sub new {
8694229412ms 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
sub set_class {
9088452.04ms my $self = shift;
91 # @_ or throw Exception("No arguments to set_class");
9288455.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
95884551.3ms884510.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
96884529.9ms88458.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
9988455.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
104884533.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
126The C<set_content> method allows to set/change the string that the
127C<PPI::Token> object represents.
128
129Returns the string you set the Token to
130
131=cut
132
133sub set_content {
134 $_[0]->{content} = $_[1];
135}
136
137=pod
138
139=head2 add_content $string
140
141The C<add_content> method allows you to add additional bytes of code
142to the end of the Token.
143
144Returns the new full string after the bytes have been added.
145
146=cut
147
148sub add_content { $_[0]->{content} .= $_[1] }
149
150=pod
151
152=head2 length
153
154The C<length> method returns the length of the string in a Token.
155
156=cut
157
158sub 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
sub content {
168357151999ms $_[0]->{content};
169}
170
171# You can insert either a statement, or a non-significant token.
172sub 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
184sub 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
202sub __TOKENIZER__on_line_start { 1 }
203144288┬Á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
sub __TOKENIZER__on_line_end { 1 }
204sub __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
sub __LEXER__opens {
21411666106ms1166615.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
sub __LEXER__closes {
22045079260ms2058627.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
22513┬Ás1;
226
227=pod
228
229=head1 SUPPORT
230
231See the L<support section|PPI/SUPPORT> in the main module.
232
233=head1 AUTHOR
234
235Adam Kennedy E<lt>adamk@cpan.orgE<gt>
236
237=head1 COPYRIGHT
238
239Copyright 2001 - 2011 Adam Kennedy.
240
241This program is free software; you can redistribute
242it and/or modify it under the same terms as Perl itself.
243
244The full text of the license can be found in the
245LICENSE 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
sub PPI::Token::CORE:match; # opcode