← 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/Switch.pm
StatementsExecuted 8 statements in 193µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11117µs33µsPPIx::Regexp::Token::GroupType::Switch::::BEGIN@33PPIx::Regexp::Token::GroupType::Switch::BEGIN@33
11111µs17µsPPIx::Regexp::Token::GroupType::Switch::::BEGIN@34PPIx::Regexp::Token::GroupType::Switch::BEGIN@34
11110µs83µsPPIx::Regexp::Token::GroupType::Switch::::BEGIN@36PPIx::Regexp::Token::GroupType::Switch::BEGIN@36
0000s0sPPIx::Regexp::Token::GroupType::Switch::::__defining_stringPPIx::Regexp::Token::GroupType::Switch::__defining_string
0000s0sPPIx::Regexp::Token::GroupType::Switch::::__match_setupPPIx::Regexp::Token::GroupType::Switch::__match_setup
0000s0sPPIx::Regexp::Token::GroupType::Switch::::perl_version_introducedPPIx::Regexp::Token::GroupType::Switch::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::GroupType::Switch - Represent the introducing characters for a switch
4
5=head1 SYNOPSIS
6
7 use PPIx::Regexp::Dumper;
8 PPIx::Regexp::Dumper->new( 'qr{(?(1)foo|bar)}smx' )
9 ->print();
10
11=head1 INHERITANCE
12
13C<PPIx::Regexp::Token::GroupType::Switch> is a
14L<PPIx::Regexp::Token::GroupType|PPIx::Regexp::Token::GroupType>.
15
16C<PPIx::Regexp::Token::GroupType::Switch> has no descendants.
17
18=head1 DESCRIPTION
19
20This class represents the characters right after a left parenthesis that
21introduce a switch. Strictly speaking these characters are '?(', but
22this class only takes the '?'.
23
24=head1 METHODS
25
26This class provides no public methods beyond those provided by its
27superclass.
28
29=cut
30
31package PPIx::Regexp::Token::GroupType::Switch;
32
33234µs249µs
# spent 33µs (17+16) within PPIx::Regexp::Token::GroupType::Switch::BEGIN@33 which was called: # once (17µs+16µs) by PPIx::Regexp::Tokenizer::BEGIN@32 at line 33
use strict;
# spent 33µs making 1 call to PPIx::Regexp::Token::GroupType::Switch::BEGIN@33 # spent 16µs making 1 call to strict::import
34229µs223µs
# spent 17µs (11+6) within PPIx::Regexp::Token::GroupType::Switch::BEGIN@34 which was called: # once (11µs+6µs) by PPIx::Regexp::Tokenizer::BEGIN@32 at line 34
use warnings;
# spent 17µs making 1 call to PPIx::Regexp::Token::GroupType::Switch::BEGIN@34 # spent 6µs making 1 call to warnings::import
35
362126µs2156µs
# spent 83µs (10+73) within PPIx::Regexp::Token::GroupType::Switch::BEGIN@36 which was called: # once (10µs+73µs) by PPIx::Regexp::Tokenizer::BEGIN@32 at line 36
use base qw{ PPIx::Regexp::Token::GroupType };
# spent 83µs making 1 call to PPIx::Regexp::Token::GroupType::Switch::BEGIN@36 # spent 73µs making 1 call to base::import
37
381800nsour $VERSION = '0.036';
39
40sub perl_version_introduced {
41# my ( $self ) = @_;
42 return '5.005';
43}
44
45# Return true if the token can be quantified, and false otherwise
46# sub can_be_quantified { return };
47
48=begin comment
49
50sub __PPIX_TOKENIZER__regexp {
51 my ( $class, $tokenizer, $character ) = @_;
52
53 # The optional escape is because any non-open-bracket character may
54 # appear as the regular expression delimiter.
55 if ( my $accept = $tokenizer->find_regexp(
56 qr{ \A \\? \? \( }smx ) ) {
57
58 # Leave the left paren, since it belongs to the condition.
59 --$accept;
60
61 $tokenizer->expect( qw{
62 PPIx::Regexp::Token::Condition
63 } );
64
65 return $accept;
66
67 }
68
69 return;
70
71}
72
73=end comment
74
75=cut
76
77sub __defining_string {
78 return (
79 { suffix => '(' },
80 '?',
81 );
82}
83
84sub __match_setup {
85 my ( $class, $tokenizer ) = @_;
86 $tokenizer->expect( qw{ PPIx::Regexp::Token::Condition } );
87 return;
88}
89
90
9113µs1;
92
93__END__