← 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:13 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPIx/Regexp/Token/Comment.pm
StatementsExecuted 9 statements in 163µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11112µs23µsPPIx::Regexp::Token::Comment::::BEGIN@32PPIx::Regexp::Token::Comment::BEGIN@32
11111µs13µsPPIx::Regexp::Token::Comment::::__PPIX_TOKEN__recognizePPIx::Regexp::Token::Comment::__PPIX_TOKEN__recognize
1118µs15µsPPIx::Regexp::Token::Comment::::BEGIN@33PPIx::Regexp::Token::Comment::BEGIN@33
1117µs58µsPPIx::Regexp::Token::Comment::::BEGIN@35PPIx::Regexp::Token::Comment::BEGIN@35
1112µs2µsPPIx::Regexp::Token::Comment::::CORE:qrPPIx::Regexp::Token::Comment::CORE:qr (opcode)
0000s0sPPIx::Regexp::Token::Comment::::can_be_quantifiedPPIx::Regexp::Token::Comment::can_be_quantified
0000s0sPPIx::Regexp::Token::Comment::::commentPPIx::Regexp::Token::Comment::comment
0000s0sPPIx::Regexp::Token::Comment::::significantPPIx::Regexp::Token::Comment::significant
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1=head1 NAME
2
3PPIx::Regexp::Token::Comment - Represent a comment.
4
5=head1 SYNOPSIS
6
7 use PPIx::Regexp::Dumper;
8 PPIx::Regexp::Dumper->new( 'qr{foo(?#bar)}smx' )
9 ->print();
10
11=head1 INHERITANCE
12
13C<PPIx::Regexp::Token::Comment> is a
14L<PPIx::Regexp::Token|PPIx::Regexp::Token>.
15
16C<PPIx::Regexp::Token::Comment> has no descendants.
17
18=head1 DESCRIPTION
19
20This class represents a comment - both parenthesized comments (i.e.
21C<< (?# this is a comment ) >> and the /x mode end-of-line comments.
22
23=head1 METHODS
24
25This class provides no public methods beyond those provided by its
26superclass.
27
28=cut
29
30package PPIx::Regexp::Token::Comment;
31
32223µs235µs
# spent 23µs (12+12) within PPIx::Regexp::Token::Comment::BEGIN@32 which was called: # once (12µs+12µs) by PPIx::Regexp::Tokenizer::BEGIN@21 at line 32
use strict;
# spent 23µs making 1 call to PPIx::Regexp::Token::Comment::BEGIN@32 # spent 12µs making 1 call to strict::import
33223µs223µs
# spent 15µs (8+7) within PPIx::Regexp::Token::Comment::BEGIN@33 which was called: # once (8µs+7µs) by PPIx::Regexp::Tokenizer::BEGIN@21 at line 33
use warnings;
# spent 15µs making 1 call to PPIx::Regexp::Token::Comment::BEGIN@33 # spent 8µs making 1 call to warnings::import
34
35299µs2109µs
# spent 58µs (7+51) within PPIx::Regexp::Token::Comment::BEGIN@35 which was called: # once (7µs+51µs) by PPIx::Regexp::Tokenizer::BEGIN@21 at line 35
use base qw{ PPIx::Regexp::Token };
# spent 58µs making 1 call to PPIx::Regexp::Token::Comment::BEGIN@35 # spent 51µs making 1 call to base::import
36
371600nsour $VERSION = '0.036';
38
39# Return true if the token can be quantified, and false otherwise
40sub can_be_quantified { return };
41
42sub significant {
43 return;
44}
45
46sub comment {
47 return 1;
48}
49
50# This must be implemented by tokens which do not recognize themselves.
51# The return is a list of list references. Each list reference must
52# contain a regular expression that recognizes the token, and optionally
53# a reference to a hash to pass to make_token as the class-specific
54# arguments. The regular expression MUST be anchored to the beginning of
55# the string.
56
# spent 13µs (11+2) within PPIx::Regexp::Token::Comment::__PPIX_TOKEN__recognize which was called: # once (11µs+2µs) by base::import at line 102 of PPIx/Regexp/Token/Structure.pm
sub __PPIX_TOKEN__recognize {
57115µs12µs return ( [ qr{ \A \( \? \# [^\)]* \) }smx ] );
# spent 2µs making 1 call to PPIx::Regexp::Token::Comment::CORE:qr
58}
59
60# We anticipate that these tokens will be generated by other classes:
61# PPIx::Regexp::Token::Structure for parenthesized comments, and
62# PPIx::Regexp::Token::Literal for end-of-line /x mode comments.
63
64=begin comment
65
66sub __PPIX_TOKENIZER__regexp {
67 my ( $class, $tokenizer, $character ) = @_;
68
69 return $character eq 'x' ? 1 : 0;
70}
71
72=end comment
73
74=cut
75
7612µs1;
77
78__END__
 
# spent 2µs within PPIx::Regexp::Token::Comment::CORE:qr which was called: # once (2µs+0s) by PPIx::Regexp::Token::Comment::__PPIX_TOKEN__recognize at line 57
sub PPIx::Regexp::Token::Comment::CORE:qr; # opcode