← 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/Structure/BranchReset.pm
StatementsExecuted 10 statements in 202µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11115µs26µsPPIx::Regexp::Structure::BranchReset::::BEGIN@32PPIx::Regexp::Structure::BranchReset::BEGIN@32
1118µs12µsPPIx::Regexp::Structure::BranchReset::::BEGIN@33PPIx::Regexp::Structure::BranchReset::BEGIN@33
1117µs30µsPPIx::Regexp::Structure::BranchReset::::BEGIN@37PPIx::Regexp::Structure::BranchReset::BEGIN@37
1117µs57µsPPIx::Regexp::Structure::BranchReset::::BEGIN@35PPIx::Regexp::Structure::BranchReset::BEGIN@35
0000s0sPPIx::Regexp::Structure::BranchReset::::__PPIX_LEXER__record_capture_numberPPIx::Regexp::Structure::BranchReset::__PPIX_LEXER__record_capture_number
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::Structure::BranchReset - Represent a branch reset group
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::Structure::BranchReset> is a
14L<PPIx::Regexp::Structure|PPIx::Regexp::Structure>.
15
16C<PPIx::Regexp::Structure::BranchReset> has no descendants.
17
18=head1 DESCRIPTION
19
20This class represents a branch reset group. That is, the construction
21C<(?|(...)|(...)|...)>. This is new with Perl 5.010.
22
23=head1 METHODS
24
25This class provides no public methods beyond those provided by its
26superclass.
27
28=cut
29
30package PPIx::Regexp::Structure::BranchReset;
31
32220µs238µs
# spent 26µs (15+12) within PPIx::Regexp::Structure::BranchReset::BEGIN@32 which was called: # once (15µs+12µs) by PPIx::Regexp::Lexer::BEGIN@46 at line 32
use strict;
# spent 26µs making 1 call to PPIx::Regexp::Structure::BranchReset::BEGIN@32 # spent 12µs making 1 call to strict::import
33221µs217µs
# spent 12µs (8+5) within PPIx::Regexp::Structure::BranchReset::BEGIN@33 which was called: # once (8µs+5µs) by PPIx::Regexp::Lexer::BEGIN@46 at line 33
use warnings;
# spent 12µs making 1 call to PPIx::Regexp::Structure::BranchReset::BEGIN@33 # spent 5µs making 1 call to warnings::import
34
35232µs2106µs
# spent 57µs (7+50) within PPIx::Regexp::Structure::BranchReset::BEGIN@35 which was called: # once (7µs+50µs) by PPIx::Regexp::Lexer::BEGIN@46 at line 35
use base qw{ PPIx::Regexp::Structure };
# spent 57µs making 1 call to PPIx::Regexp::Structure::BranchReset::BEGIN@35 # spent 50µs making 1 call to base::import
36
372126µs253µs
# spent 30µs (7+23) within PPIx::Regexp::Structure::BranchReset::BEGIN@37 which was called: # once (7µs+23µs) by PPIx::Regexp::Lexer::BEGIN@46 at line 37
use Carp qw{ confess };
# spent 30µs making 1 call to PPIx::Regexp::Structure::BranchReset::BEGIN@37 # spent 23µs making 1 call to Exporter::import
38
391600nsour $VERSION = '0.036';
40
41# Called by the lexer to record the capture number.
42sub __PPIX_LEXER__record_capture_number {
43 my ( $self, $number ) = @_;
44 defined $number
45 or confess 'Programming error - initial $number is undef';
46 my $original = $number;
47 my $hiwater = $number;
48 foreach my $kid ( $self->children() ) {
49 if ( $kid->isa( 'PPIx::Regexp::Token::Operator' )
50 && $kid->content() eq '|' ) {
51 $number > $hiwater and $hiwater = $number;
52 $number = $original;
53 } else {
54 $number = $kid->__PPIX_LEXER__record_capture_number( $number );
55 }
56 }
57 return $number > $hiwater ? $number : $hiwater;
58}
59
6012µs1;
61
62__END__