Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPIx/Regexp/Structure/NamedCapture.pm |
Statements | Executed 10 statements in 131µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 12µs | 24µs | BEGIN@37 | PPIx::Regexp::Structure::NamedCapture::
1 | 1 | 1 | 8µs | 38µs | BEGIN@40 | PPIx::Regexp::Structure::NamedCapture::
1 | 1 | 1 | 7µs | 11µs | BEGIN@38 | PPIx::Regexp::Structure::NamedCapture::
1 | 1 | 1 | 7µs | 59µs | BEGIN@42 | PPIx::Regexp::Structure::NamedCapture::
0 | 0 | 0 | 0s | 0s | name | PPIx::Regexp::Structure::NamedCapture::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | =head1 NAME | ||||
2 | |||||
3 | PPIx::Regexp::Structure::NamedCapture - Represent a named capture | ||||
4 | |||||
5 | =head1 SYNOPSIS | ||||
6 | |||||
7 | use PPIx::Regexp::Dumper; | ||||
8 | PPIx::Regexp::Dumper->new( 'qr{(?<foo>foo)}smx' ) | ||||
9 | ->print(); | ||||
10 | |||||
11 | =head1 INHERITANCE | ||||
12 | |||||
13 | C<PPIx::Regexp::Structure::NamedCapture> is a | ||||
14 | L<PPIx::Regexp::Structure::Capture|PPIx::Regexp::Structure::Capture>. | ||||
15 | |||||
16 | C<PPIx::Regexp::Structure::NamedCapture> has no descendants. | ||||
17 | |||||
18 | =head1 DESCRIPTION | ||||
19 | |||||
20 | This class represents a named capture. Its content will be something | ||||
21 | like one of the following: | ||||
22 | |||||
23 | (?<NAME> ... ) | ||||
24 | (?'NAME' ... ) | ||||
25 | (?P<NAME> ... ) | ||||
26 | |||||
27 | =head1 METHODS | ||||
28 | |||||
29 | This class provides the following public methods. Methods not documented | ||||
30 | here are private, and unsupported in the sense that the author reserves | ||||
31 | the right to change or remove them without notice. | ||||
32 | |||||
33 | =cut | ||||
34 | |||||
35 | package PPIx::Regexp::Structure::NamedCapture; | ||||
36 | |||||
37 | 2 | 19µs | 2 | 35µs | # spent 24µs (12+11) within PPIx::Regexp::Structure::NamedCapture::BEGIN@37 which was called:
# once (12µs+11µs) by PPIx::Regexp::Lexer::BEGIN@53 at line 37 # spent 24µs making 1 call to PPIx::Regexp::Structure::NamedCapture::BEGIN@37
# spent 11µs making 1 call to strict::import |
38 | 2 | 18µs | 2 | 16µs | # spent 11µs (7+4) within PPIx::Regexp::Structure::NamedCapture::BEGIN@38 which was called:
# once (7µs+4µs) by PPIx::Regexp::Lexer::BEGIN@53 at line 38 # spent 11µs making 1 call to PPIx::Regexp::Structure::NamedCapture::BEGIN@38
# spent 4µs making 1 call to warnings::import |
39 | |||||
40 | 2 | 25µs | 2 | 69µs | # spent 38µs (8+31) within PPIx::Regexp::Structure::NamedCapture::BEGIN@40 which was called:
# once (8µs+31µs) by PPIx::Regexp::Lexer::BEGIN@53 at line 40 # spent 38µs making 1 call to PPIx::Regexp::Structure::NamedCapture::BEGIN@40
# spent 31µs making 1 call to Exporter::import |
41 | |||||
42 | 2 | 66µs | 2 | 112µs | # spent 59µs (7+52) within PPIx::Regexp::Structure::NamedCapture::BEGIN@42 which was called:
# once (7µs+52µs) by PPIx::Regexp::Lexer::BEGIN@53 at line 42 # spent 59µs making 1 call to PPIx::Regexp::Structure::NamedCapture::BEGIN@42
# spent 52µs making 1 call to base::import |
43 | |||||
44 | 1 | 600ns | our $VERSION = '0.036'; | ||
45 | |||||
46 | =head2 name | ||||
47 | |||||
48 | my $name = $element->name(); | ||||
49 | |||||
50 | This method returns the name of the capture. | ||||
51 | |||||
52 | =cut | ||||
53 | |||||
54 | sub name { | ||||
55 | my ( $self ) = @_; | ||||
56 | my $type = $self->type() | ||||
57 | or croak 'Programming error - ', __PACKAGE__, ' without type object'; | ||||
58 | return $type->name(); | ||||
59 | } | ||||
60 | |||||
61 | 1 | 2µs | 1; | ||
62 | |||||
63 | __END__ |