← 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/GroupType/Code.pm
StatementsExecuted 14 statements in 305µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs32µsPPIx::Regexp::Token::GroupType::Code::::BEGIN@39PPIx::Regexp::Token::GroupType::Code::BEGIN@39
11110µs37µsPPIx::Regexp::Token::GroupType::Code::::BEGIN@44PPIx::Regexp::Token::GroupType::Code::BEGIN@44
11110µs16µsPPIx::Regexp::Token::GroupType::Code::::BEGIN@40PPIx::Regexp::Token::GroupType::Code::BEGIN@40
1119µs81µsPPIx::Regexp::Token::GroupType::Code::::BEGIN@42PPIx::Regexp::Token::GroupType::Code::BEGIN@42
0000s0sPPIx::Regexp::Token::GroupType::Code::::__defining_stringPPIx::Regexp::Token::GroupType::Code::__defining_string
0000s0sPPIx::Regexp::Token::GroupType::Code::::__match_setupPPIx::Regexp::Token::GroupType::Code::__match_setup
0000s0sPPIx::Regexp::Token::GroupType::Code::::perl_version_introducedPPIx::Regexp::Token::GroupType::Code::perl_version_introduced
0000s0sPPIx::Regexp::Token::GroupType::Code::::perl_version_removedPPIx::Regexp::Token::GroupType::Code::perl_version_removed
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::GroupType::Code - Represent one of the embedded code indicators
4
5=head1 SYNOPSIS
6
7 use PPIx::Regexp::Dumper;
8 PPIx::Regexp::Dumper->new( 'qr{(?{print "hello world!\n")}smx' )
9 ->print();
10
11=head1 INHERITANCE
12
13C<PPIx::Regexp::Token::GroupType::Code> is a
14L<PPIx::Regexp::Token::GroupType|PPIx::Regexp::Token::GroupType>.
15
16C<PPIx::Regexp::Token::GroupType::Code> has no descendants.
17
18=head1 DESCRIPTION
19
20This method represents one of the embedded code indicators, either '?'
21or '??', in the zero-width assertion
22
23 (?{ print "Hello, world!\n" })
24
25or the old-style deferred expression syntax
26
27 my $foo;
28 $foo = qr{ foo (??{ $foo }) }smx;
29
30=head1 METHODS
31
32This class provides no public methods beyond those provided by its
33superclass.
34
35=cut
36
37package PPIx::Regexp::Token::GroupType::Code;
38
39227µs248µs
# spent 32µs (16+16) within PPIx::Regexp::Token::GroupType::Code::BEGIN@39 which was called: # once (16µs+16µs) by PPIx::Regexp::Tokenizer::BEGIN@28 at line 39
use strict;
# spent 32µs making 1 call to PPIx::Regexp::Token::GroupType::Code::BEGIN@39 # spent 16µs making 1 call to strict::import
40227µs222µs
# spent 16µs (10+6) within PPIx::Regexp::Token::GroupType::Code::BEGIN@40 which was called: # once (10µs+6µs) by PPIx::Regexp::Tokenizer::BEGIN@28 at line 40
use warnings;
# spent 16µs making 1 call to PPIx::Regexp::Token::GroupType::Code::BEGIN@40 # spent 6µs making 1 call to warnings::import
41
42235µs2153µs
# spent 81µs (9+72) within PPIx::Regexp::Token::GroupType::Code::BEGIN@42 which was called: # once (9µs+72µs) by PPIx::Regexp::Tokenizer::BEGIN@28 at line 42
use base qw{ PPIx::Regexp::Token::GroupType };
# spent 81µs making 1 call to PPIx::Regexp::Token::GroupType::Code::BEGIN@42 # spent 72µs making 1 call to base::import
43
442206µs265µs
# spent 37µs (10+27) within PPIx::Regexp::Token::GroupType::Code::BEGIN@44 which was called: # once (10µs+27µs) by PPIx::Regexp::Tokenizer::BEGIN@28 at line 44
use PPIx::Regexp::Constant qw{ MINIMUM_PERL };
# spent 37µs making 1 call to PPIx::Regexp::Token::GroupType::Code::BEGIN@44 # spent 27µs making 1 call to Exporter::import
45
461800nsour $VERSION = '0.036';
47
48# Return true if the token can be quantified, and false otherwise
49# sub can_be_quantified { return };
50
51{
5224µs my %perl_version_introduced = (
53 '?' => '5.005',
54 '?p' => '5.005', # Presumed. I can find no documentation.
55 '??' => '5.006',
56 );
57
58 sub perl_version_introduced {
59 my ( $self ) = @_;
60 return $perl_version_introduced{ $self->unescaped_content() } ||
61 '5.005';
62 }
63
64}
65
66{
67
6821µs my %perl_version_removed = (
69 '?p' => '5.009005',
70 );
71
72 sub perl_version_removed {
73 my ( $self ) = @_;
74 return $perl_version_removed{ $self->content() };
75 }
76}
77
78=begin comment
79
80sub __PPIX_TOKENIZER__regexp {
81 my ( $class, $tokenizer, $character ) = @_;
82
83 # Recognize '?{', '??{', or '?p{', the latter deprecated in Perl
84 # 5.6, and removed in 5.10. The extra escapes are because the
85 # non-open-bracket characters may appear as delimiters to the
86 # expression.
87 if ( my $accept = $tokenizer->find_regexp(
88 qr{ \A \\? \? \\? [?p]? \{ }smx ) ) {
89
90 --$accept; # Don't want the curly bracket.
91
92 # Code token comes after.
93 $tokenizer->expect( 'PPIx::Regexp::Token::Code' );
94
95 return $accept;
96 }
97
98 return;
99}
100
101=end comment
102
103=cut
104
105sub __defining_string {
106 return (
107 { suffix => '{' },
108 '?',
109 '??',
110 '?p',
111 );
112}
113
114sub __match_setup {
115 my ( $class, $tokenizer ) = @_;
116 $tokenizer->expect( qw{ PPIx::Regexp::Token::Code } );
117 return;
118}
119
12015µs1;
121
122__END__