| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
=head1 NAME |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
PPIx::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
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
C is a |
|
14
|
|
|
|
|
|
|
L. |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
C has no descendants. |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This class represents a branch reset group. That is, the construction |
|
21
|
|
|
|
|
|
|
C<(?|(...)|(...)|...)>. This is new with Perl 5.010. |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 METHODS |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
This class provides no public methods beyond those provided by its |
|
26
|
|
|
|
|
|
|
superclass. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
package PPIx::Regexp::Structure::BranchReset; |
|
31
|
|
|
|
|
|
|
|
|
32
|
9
|
|
|
9
|
|
112
|
use strict; |
|
|
9
|
|
|
|
|
22
|
|
|
|
9
|
|
|
|
|
328
|
|
|
33
|
9
|
|
|
9
|
|
50
|
use warnings; |
|
|
9
|
|
|
|
|
19
|
|
|
|
9
|
|
|
|
|
249
|
|
|
34
|
|
|
|
|
|
|
|
|
35
|
9
|
|
|
9
|
|
45
|
use base qw{ PPIx::Regexp::Structure }; |
|
|
9
|
|
|
|
|
37
|
|
|
|
9
|
|
|
|
|
818
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
9
|
|
|
9
|
|
58
|
use Carp qw{ confess }; |
|
|
9
|
|
|
|
|
18
|
|
|
|
9
|
|
|
|
|
489
|
|
|
38
|
9
|
|
|
9
|
|
59
|
use PPIx::Regexp::Constant qw{ @CARP_NOT }; |
|
|
9
|
|
|
|
|
80
|
|
|
|
9
|
|
|
|
|
2188
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
our $VERSION = '0.087'; |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# Called by the lexer to record the capture number. |
|
43
|
|
|
|
|
|
|
sub __PPIX_LEXER__record_capture_number { |
|
44
|
6
|
|
|
6
|
|
25
|
my ( $self, $number ) = @_; |
|
45
|
6
|
50
|
|
|
|
30
|
defined $number |
|
46
|
|
|
|
|
|
|
or confess 'Programming error - initial $number is undef'; |
|
47
|
6
|
|
|
|
|
15
|
my $original = $number; |
|
48
|
6
|
|
|
|
|
15
|
my $hiwater = $number; |
|
49
|
6
|
|
|
|
|
48
|
foreach my $kid ( $self->children() ) { |
|
50
|
16
|
100
|
66
|
|
|
121
|
if ( $kid->isa( 'PPIx::Regexp::Token::Operator' ) |
|
51
|
|
|
|
|
|
|
&& $kid->content() eq '|' ) { |
|
52
|
5
|
50
|
|
|
|
27
|
$number > $hiwater and $hiwater = $number; |
|
53
|
5
|
|
|
|
|
13
|
$number = $original; |
|
54
|
|
|
|
|
|
|
} else { |
|
55
|
11
|
|
|
|
|
61
|
$number = $kid->__PPIX_LEXER__record_capture_number( $number ); |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
} |
|
58
|
6
|
100
|
|
|
|
54
|
return $number > $hiwater ? $number : $hiwater; |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |