Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPIx/Regexp/Token/Recursion.pm |
Statements | Executed 13 statements in 382µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 28µs | 28µs | CORE:regcomp (opcode) | PPIx::Regexp::Token::Recursion::
1 | 1 | 1 | 21µs | 53µs | __PPIX_TOKEN__recognize | PPIx::Regexp::Token::Recursion::
1 | 1 | 1 | 19µs | 39µs | BEGIN@31 | PPIx::Regexp::Token::Recursion::
1 | 1 | 1 | 12µs | 19µs | BEGIN@32 | PPIx::Regexp::Token::Recursion::
1 | 1 | 1 | 11µs | 40µs | BEGIN@37 | PPIx::Regexp::Token::Recursion::
1 | 1 | 1 | 11µs | 105µs | BEGIN@34 | PPIx::Regexp::Token::Recursion::
1 | 1 | 1 | 11µs | 48µs | BEGIN@36 | PPIx::Regexp::Token::Recursion::
3 | 1 | 1 | 4µs | 4µs | CORE:qr (opcode) | PPIx::Regexp::Token::Recursion::
0 | 0 | 0 | 0s | 0s | perl_version_introduced | PPIx::Regexp::Token::Recursion::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | =head1 NAME | ||||
2 | |||||
3 | PPIx::Regexp::Token::Recursion - Represent a recursion | ||||
4 | |||||
5 | =head1 SYNOPSIS | ||||
6 | |||||
7 | use PPIx::Regexp::Dumper; | ||||
8 | PPIx::Regexp::Dumper->new( 'qr{(foo(?1)?)}smx' ) | ||||
9 | ->print(); | ||||
10 | |||||
11 | =head1 INHERITANCE | ||||
12 | |||||
13 | C<PPIx::Regexp::Token::Recursion> is a | ||||
14 | L<PPIx::Regexp::Token::Reference|PPIx::Regexp::Token::Reference>. | ||||
15 | |||||
16 | C<PPIx::Regexp::Token::Recursion> has no descendants. | ||||
17 | |||||
18 | =head1 DESCRIPTION | ||||
19 | |||||
20 | This class represents a recursion to a named or numbered capture. | ||||
21 | |||||
22 | =head1 METHODS | ||||
23 | |||||
24 | This class provides no public methods beyond those provided by its | ||||
25 | superclass. | ||||
26 | |||||
27 | =cut | ||||
28 | |||||
29 | package PPIx::Regexp::Token::Recursion; | ||||
30 | |||||
31 | 2 | 33µs | 2 | 59µs | # spent 39µs (19+20) within PPIx::Regexp::Token::Recursion::BEGIN@31 which was called:
# once (19µs+20µs) by PPIx::Regexp::Token::Structure::BEGIN@54 at line 31 # spent 39µs making 1 call to PPIx::Regexp::Token::Recursion::BEGIN@31
# spent 20µs making 1 call to strict::import |
32 | 2 | 34µs | 2 | 27µs | # spent 19µs (12+8) within PPIx::Regexp::Token::Recursion::BEGIN@32 which was called:
# once (12µs+8µs) by PPIx::Regexp::Token::Structure::BEGIN@54 at line 32 # spent 19µs making 1 call to PPIx::Regexp::Token::Recursion::BEGIN@32
# spent 8µs making 1 call to warnings::import |
33 | |||||
34 | 2 | 42µs | 2 | 105µs | # spent 105µs (11+94) within PPIx::Regexp::Token::Recursion::BEGIN@34 which was called:
# once (11µs+94µs) by PPIx::Regexp::Token::Structure::BEGIN@54 at line 34 # spent 105µs making 1 call to PPIx::Regexp::Token::Recursion::BEGIN@34
# spent 94µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 94µs |
35 | |||||
36 | 2 | 35µs | 2 | 85µs | # spent 48µs (11+37) within PPIx::Regexp::Token::Recursion::BEGIN@36 which was called:
# once (11µs+37µs) by PPIx::Regexp::Token::Structure::BEGIN@54 at line 36 # spent 48µs making 1 call to PPIx::Regexp::Token::Recursion::BEGIN@36
# spent 37µs making 1 call to Exporter::import |
37 | 2 | 180µs | 2 | 70µs | # spent 40µs (11+29) within PPIx::Regexp::Token::Recursion::BEGIN@37 which was called:
# once (11µs+29µs) by PPIx::Regexp::Token::Structure::BEGIN@54 at line 37 # spent 40µs making 1 call to PPIx::Regexp::Token::Recursion::BEGIN@37
# spent 29µs making 1 call to Exporter::import |
38 | |||||
39 | 1 | 1µs | our $VERSION = '0.036'; | ||
40 | |||||
41 | # Return true if the token can be quantified, and false otherwise | ||||
42 | # sub can_be_quantified { return }; | ||||
43 | |||||
44 | sub perl_version_introduced { | ||||
45 | return '5.009005'; | ||||
46 | } | ||||
47 | |||||
48 | # This must be implemented by tokens which do not recognize themselves. | ||||
49 | # The return is a list of list references. Each list reference must | ||||
50 | # contain a regular expression that recognizes the token, and optionally | ||||
51 | # a reference to a hash to pass to make_token as the class-specific | ||||
52 | # arguments. The regular expression MUST be anchored to the beginning of | ||||
53 | # the string. | ||||
54 | # spent 53µs (21+32) within PPIx::Regexp::Token::Recursion::__PPIX_TOKEN__recognize which was called:
# once (21µs+32µs) by base::import at line 102 of PPIx/Regexp/Token/Structure.pm | ||||
55 | return ( | ||||
56 | [ qr{ \A \( \? (?: ( [-+]? \d+ )) \) }smx, { is_named => 0 } ], | ||||
57 | [ qr{ \A \( \? (?: R) \) }smx, | ||||
58 | { is_named => 0, capture => '0' } ], | ||||
59 | 1 | 55µs | 4 | 32µs | [ qr{ \A \( \? (?: & | P> ) ( @{[ RE_CAPTURE_NAME ]} ) \) }smxo, # spent 28µs making 1 call to PPIx::Regexp::Token::Recursion::CORE:regcomp
# spent 4µs making 3 calls to PPIx::Regexp::Token::Recursion::CORE:qr, avg 1µs/call |
60 | { is_named => 1 } ], | ||||
61 | ); | ||||
62 | } | ||||
63 | |||||
64 | 1 | 4µs | 1; | ||
65 | |||||
66 | __END__ | ||||
# spent 4µs within PPIx::Regexp::Token::Recursion::CORE:qr which was called 3 times, avg 1µs/call:
# 3 times (4µs+0s) by PPIx::Regexp::Token::Recursion::__PPIX_TOKEN__recognize at line 59, avg 1µs/call | |||||
# spent 28µs within PPIx::Regexp::Token::Recursion::CORE:regcomp which was called:
# once (28µs+0s) by PPIx::Regexp::Token::Recursion::__PPIX_TOKEN__recognize at line 59 |