← 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/CharClass.pm
StatementsExecuted 10 statements in 197µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11112µs23µsPPIx::Regexp::Structure::CharClass::::BEGIN@32PPIx::Regexp::Structure::CharClass::BEGIN@32
11111µs15µsPPIx::Regexp::Structure::CharClass::::BEGIN@33PPIx::Regexp::Structure::CharClass::BEGIN@33
1117µs28µsPPIx::Regexp::Structure::CharClass::::BEGIN@37PPIx::Regexp::Structure::CharClass::BEGIN@37
1117µs56µsPPIx::Regexp::Structure::CharClass::::BEGIN@35PPIx::Regexp::Structure::CharClass::BEGIN@35
0000s0sPPIx::Regexp::Structure::CharClass::::__PPIX_LEXER__record_capture_numberPPIx::Regexp::Structure::CharClass::__PPIX_LEXER__record_capture_number
0000s0sPPIx::Regexp::Structure::CharClass::::_newPPIx::Regexp::Structure::CharClass::_new
0000s0sPPIx::Regexp::Structure::CharClass::::negatedPPIx::Regexp::Structure::CharClass::negated
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::CharClass - Represent a character class
4
5=head1 SYNOPSIS
6
7 use PPIx::Regexp::Dumper;
8 PPIx::Regexp::Dumper->new( 'qr{[fo]}smx' )
9 ->print();
10
11=head1 INHERITANCE
12
13C<PPIx::Regexp::Structure::CharClass> is a
14L<PPIx::Regexp::Structure|PPIx::Regexp::Structure>.
15
16C<PPIx::Regexp::Structure::CharClass> has no descendants.
17
18=head1 DESCRIPTION
19
20This class represents a square-bracketed character class.
21
22=head1 METHODS
23
24This class provides the following public methods. Methods not documented
25here are private, and unsupported in the sense that the author reserves
26the right to change or remove them without notice.
27
28=cut
29
30package PPIx::Regexp::Structure::CharClass;
31
32219µs235µs
# spent 23µs (12+12) within PPIx::Regexp::Structure::CharClass::BEGIN@32 which was called: # once (12µs+12µs) by PPIx::Regexp::Lexer::BEGIN@49 at line 32
use strict;
# spent 23µs making 1 call to PPIx::Regexp::Structure::CharClass::BEGIN@32 # spent 12µs making 1 call to strict::import
33221µs220µs
# spent 15µs (11+4) within PPIx::Regexp::Structure::CharClass::BEGIN@33 which was called: # once (11µs+4µs) by PPIx::Regexp::Lexer::BEGIN@49 at line 33
use warnings;
# spent 15µs making 1 call to PPIx::Regexp::Structure::CharClass::BEGIN@33 # spent 4µs making 1 call to warnings::import
34
35225µs2105µs
# spent 56µs (7+49) within PPIx::Regexp::Structure::CharClass::BEGIN@35 which was called: # once (7µs+49µs) by PPIx::Regexp::Lexer::BEGIN@49 at line 35
use base qw{ PPIx::Regexp::Structure };
# spent 56µs making 1 call to PPIx::Regexp::Structure::CharClass::BEGIN@35 # spent 49µs making 1 call to base::import
36
372129µs249µs
# spent 28µs (7+21) within PPIx::Regexp::Structure::CharClass::BEGIN@37 which was called: # once (7µs+21µs) by PPIx::Regexp::Lexer::BEGIN@49 at line 37
use PPIx::Regexp::Util qw{ __instance };
# spent 28µs making 1 call to PPIx::Regexp::Structure::CharClass::BEGIN@37 # spent 21µs making 1 call to Exporter::import
38
391500nsour $VERSION = '0.036';
40
41sub _new {
42 my ( $class, @args ) = @_;
43 ref $class and $class = ref $class;
44 my %brkt;
45 $brkt{finish} = pop @args;
46 $brkt{start} = shift @args;
47 __instance( $args[0], 'PPIx::Regexp::Token::Operator' )
48 and $args[0]->content() eq '^'
49 and $brkt{type} = shift @args;
50 return $class->SUPER::_new( \%brkt, @args );
51}
52
53=head2 negated
54
55 $class->negated() and print "Class is negated\n";
56
57This method returns true if the character class is negated -- that is,
58if the first token inside the left square bracket is a caret (C<^>).
59
60=cut
61
62sub negated {
63 my ( $self ) = @_;
64 return $self->type() ? 1 : 0;
65}
66
67# Called by the lexer to record the capture number.
68sub __PPIX_LEXER__record_capture_number {
69 my ( $self, $number ) = @_;
70 return $number;
71}
72
7312µs1;
74
75__END__