Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPIx/Regexp/Structure/Capture.pm |
Statements | Executed 8 statements in 136µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 12µs | 23µs | BEGIN@33 | PPIx::Regexp::Structure::Capture::
1 | 1 | 1 | 7µs | 11µs | BEGIN@34 | PPIx::Regexp::Structure::Capture::
1 | 1 | 1 | 6µs | 59µs | BEGIN@36 | PPIx::Regexp::Structure::Capture::
0 | 0 | 0 | 0s | 0s | __PPIX_LEXER__record_capture_number | PPIx::Regexp::Structure::Capture::
0 | 0 | 0 | 0s | 0s | name | PPIx::Regexp::Structure::Capture::
0 | 0 | 0 | 0s | 0s | number | PPIx::Regexp::Structure::Capture::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | =head1 NAME | ||||
2 | |||||
3 | PPIx::Regexp::Structure::Capture - Represent capture parentheses. | ||||
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 | |||||
13 | C<PPIx::Regexp::Structure::Capture> is a | ||||
14 | L<PPIx::Regexp::Structure|PPIx::Regexp::Structure>. | ||||
15 | |||||
16 | C<PPIx::Regexp::Structure::Capture> is the parent of | ||||
17 | L<PPIx::Regexp::Structure::NamedCapture|PPIx::Regexp::Structure::NamedCapture>. | ||||
18 | |||||
19 | =head1 DESCRIPTION | ||||
20 | |||||
21 | This class represents capture parentheses. | ||||
22 | |||||
23 | =head1 METHODS | ||||
24 | |||||
25 | This class provides the following public methods. Methods not documented | ||||
26 | here are private, and unsupported in the sense that the author reserves | ||||
27 | the right to change or remove them without notice. | ||||
28 | |||||
29 | =cut | ||||
30 | |||||
31 | package PPIx::Regexp::Structure::Capture; | ||||
32 | |||||
33 | 2 | 19µs | 2 | 34µs | # spent 23µs (12+12) within PPIx::Regexp::Structure::Capture::BEGIN@33 which was called:
# once (12µs+12µs) by PPIx::Regexp::Lexer::BEGIN@48 at line 33 # spent 23µs making 1 call to PPIx::Regexp::Structure::Capture::BEGIN@33
# spent 12µs making 1 call to strict::import |
34 | 2 | 20µs | 2 | 16µs | # spent 11µs (7+4) within PPIx::Regexp::Structure::Capture::BEGIN@34 which was called:
# once (7µs+4µs) by PPIx::Regexp::Lexer::BEGIN@48 at line 34 # spent 11µs making 1 call to PPIx::Regexp::Structure::Capture::BEGIN@34
# spent 4µs making 1 call to warnings::import |
35 | |||||
36 | 2 | 95µs | 2 | 111µs | # spent 59µs (6+52) within PPIx::Regexp::Structure::Capture::BEGIN@36 which was called:
# once (6µs+52µs) by PPIx::Regexp::Lexer::BEGIN@48 at line 36 # spent 59µs making 1 call to PPIx::Regexp::Structure::Capture::BEGIN@36
# spent 52µs making 1 call to base::import |
37 | |||||
38 | 1 | 600ns | our $VERSION = '0.036'; | ||
39 | |||||
40 | =head2 name | ||||
41 | |||||
42 | my $name = $element->name(); | ||||
43 | |||||
44 | This method returns the name of the capture buffer. Unless the buffer is | ||||
45 | actually named, this will be C<undef>. | ||||
46 | |||||
47 | =cut | ||||
48 | |||||
49 | sub name { | ||||
50 | return; | ||||
51 | } | ||||
52 | |||||
53 | =head2 number | ||||
54 | |||||
55 | my $number = $element->number() | ||||
56 | |||||
57 | This method returns the number of the capture buffer. Note that named | ||||
58 | buffers have numbers also. | ||||
59 | |||||
60 | =cut | ||||
61 | |||||
62 | sub number { | ||||
63 | my ( $self ) = @_; | ||||
64 | return $self->{number}; | ||||
65 | } | ||||
66 | |||||
67 | # Called by the lexer to record the capture number. | ||||
68 | sub __PPIX_LEXER__record_capture_number { | ||||
69 | my ( $self, $number ) = @_; | ||||
70 | $self->{number} = $number++; | ||||
71 | return $self->SUPER::__PPIX_LEXER__record_capture_number( $number ); | ||||
72 | } | ||||
73 | |||||
74 | 1 | 2µs | 1; | ||
75 | |||||
76 | __END__ |