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

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPIx/Regexp/Token/Greediness.pm
StatementsExecuted 11 statements in 289µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11117µs34µsPPIx::Regexp::Token::Greediness::::BEGIN@33PPIx::Regexp::Token::Greediness::BEGIN@33
11111µs17µsPPIx::Regexp::Token::Greediness::::BEGIN@34PPIx::Regexp::Token::Greediness::BEGIN@34
11110µs37µsPPIx::Regexp::Token::Greediness::::BEGIN@38PPIx::Regexp::Token::Greediness::BEGIN@38
1119µs77µsPPIx::Regexp::Token::Greediness::::BEGIN@36PPIx::Regexp::Token::Greediness::BEGIN@36
0000s0sPPIx::Regexp::Token::Greediness::::__PPIX_TOKENIZER__regexpPPIx::Regexp::Token::Greediness::__PPIX_TOKENIZER__regexp
0000s0sPPIx::Regexp::Token::Greediness::::can_be_quantifiedPPIx::Regexp::Token::Greediness::can_be_quantified
0000s0sPPIx::Regexp::Token::Greediness::::could_be_greedinessPPIx::Regexp::Token::Greediness::could_be_greediness
0000s0sPPIx::Regexp::Token::Greediness::::perl_version_introducedPPIx::Regexp::Token::Greediness::perl_version_introduced
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::Greediness - Represent a greediness qualifier.
4
5=head1 SYNOPSIS
6
7 use PPIx::Regexp::Dumper;
8 PPIx::Regexp::Dumper->new( 'qr{foo*+}smx' )
9 ->print();
10
11=head1 INHERITANCE
12
13C<PPIx::Regexp::Token::Greediness> is a
14L<PPIx::Regexp::Token|PPIx::Regexp::Token>.
15
16C<PPIx::Regexp::Token::Greediness> has no descendants.
17
18=head1 DESCRIPTION
19
20This class represents a greediness qualifier for the preceding
21quantifier.
22
23=head1 METHODS
24
25This class provides the following public methods. Methods not documented
26here are private, and unsupported in the sense that the author reserves
27the right to change or remove them without notice.
28
29=cut
30
31package PPIx::Regexp::Token::Greediness;
32
33229µs251µs
# spent 34µs (17+17) within PPIx::Regexp::Token::Greediness::BEGIN@33 which was called: # once (17µs+17µs) by PPIx::Regexp::Tokenizer::BEGIN@25 at line 33
use strict;
# spent 34µs making 1 call to PPIx::Regexp::Token::Greediness::BEGIN@33 # spent 17µs making 1 call to strict::import
34229µs223µs
# spent 17µs (11+6) within PPIx::Regexp::Token::Greediness::BEGIN@34 which was called: # once (11µs+6µs) by PPIx::Regexp::Tokenizer::BEGIN@25 at line 34
use warnings;
# spent 17µs making 1 call to PPIx::Regexp::Token::Greediness::BEGIN@34 # spent 6µs making 1 call to warnings::import
35
36230µs2146µs
# spent 77µs (9+68) within PPIx::Regexp::Token::Greediness::BEGIN@36 which was called: # once (9µs+68µs) by PPIx::Regexp::Tokenizer::BEGIN@25 at line 36
use base qw{ PPIx::Regexp::Token };
# spent 77µs making 1 call to PPIx::Regexp::Token::Greediness::BEGIN@36 # spent 68µs making 1 call to base::import
37
382194µs265µs
# spent 37µs (10+28) within PPIx::Regexp::Token::Greediness::BEGIN@38 which was called: # once (10µs+28µs) by PPIx::Regexp::Tokenizer::BEGIN@25 at line 38
use PPIx::Regexp::Constant qw{ MINIMUM_PERL };
# spent 37µs making 1 call to PPIx::Regexp::Token::Greediness::BEGIN@38 # spent 28µs making 1 call to Exporter::import
39
401800nsour $VERSION = '0.036';
41
42# Return true if the token can be quantified, and false otherwise
43sub can_be_quantified { return };
44
4512µsmy %greediness = (
46 '?' => MINIMUM_PERL,
47 '+' => '5.009005',
48);
49
50=head2 could_be_greediness
51
52 PPIx::Regexp::Token::Greediness->could_be_greediness( '?' );
53
54This method returns true if the given string could be a greediness
55indicator; that is, if it is '+' or '?'.
56
57=cut
58
59sub could_be_greediness {
60 my ( $class, $string ) = @_;
61 return $greediness{$string};
62}
63
64sub perl_version_introduced {
65 my ( $self ) = @_;
66 return $greediness{ $self->content() } || MINIMUM_PERL;
67}
68
69sub __PPIX_TOKENIZER__regexp {
70 my ( $class, $tokenizer, $character, $char_type ) = @_;
71
72 $tokenizer->prior( 'is_quantifier' ) or return;
73
74 $greediness{$character} or return;
75
76 return length $character;
77}
78
7914µs1;
80
81__END__