line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Diff3::Range2; |
2
|
6
|
|
|
6
|
|
104
|
use 5.006; |
|
6
|
|
|
|
|
21
|
|
|
6
|
|
|
|
|
255
|
|
3
|
6
|
|
|
6
|
|
31
|
use strict; |
|
6
|
|
|
|
|
31
|
|
|
6
|
|
|
|
|
188
|
|
4
|
6
|
|
|
6
|
|
29
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
172
|
|
5
|
6
|
|
|
6
|
|
28
|
use base qw(Text::Diff3::Base); |
|
6
|
|
|
|
|
20
|
|
|
6
|
|
|
|
|
43
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
546
|
use version; our $VERSION = '0.08'; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
110
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
## no critic (NamingConventions::Capitalization) |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->mk_attr_accessor(qw(type loA hiA loB hiB)); |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
1
|
13
|
sub set_type_a { return shift->set_type('a') } |
14
|
1
|
|
|
1
|
1
|
4
|
sub set_type_c { return shift->set_type('c') } |
15
|
1
|
|
|
1
|
1
|
4
|
sub set_type_d { return shift->set_type('d') } |
16
|
0
|
|
|
0
|
1
|
0
|
sub rangeA { return ($_[0]->loA .. $_[0]->hiA) } |
17
|
0
|
|
|
0
|
1
|
0
|
sub rangeB { return ($_[0]->loB .. $_[0]->hiB) } |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub set_type { |
20
|
3
|
|
|
3
|
1
|
6
|
my($self, $x) = @_; |
21
|
3
|
|
|
|
|
6
|
$self->{type} = $x; |
22
|
3
|
|
|
|
|
4
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub as_array { |
26
|
10
|
|
|
10
|
1
|
18
|
my($self) = @_; |
27
|
10
|
|
|
|
|
13
|
return @{$self}{qw(type loA hiA loB hiB)}; |
|
10
|
|
|
|
|
63
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub as_string { |
31
|
0
|
|
|
0
|
1
|
0
|
my($self) = @_; |
32
|
0
|
|
|
|
|
0
|
return $self->_as_line_range($self->loA, $self->hiA) |
33
|
|
|
|
|
|
|
. $self->type |
34
|
|
|
|
|
|
|
. $self->_as_line_range($self->loB, $self->hiB); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub initialize { |
38
|
55
|
|
|
55
|
1
|
107
|
my($self, @arg) = @_; |
39
|
55
|
|
|
|
|
166
|
$self->SUPER::initialize(@arg); |
40
|
55
|
|
|
|
|
99
|
@{$self}{qw(type loA hiA loB hiB)} = @arg[1 .. 5]; |
|
55
|
|
|
|
|
236
|
|
41
|
55
|
|
|
|
|
129
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _as_line_range { |
45
|
0
|
|
|
0
|
|
|
my($self, $lo, $hi) = @_; |
46
|
0
|
0
|
|
|
|
|
return $lo >= $hi ? $hi : $lo . q{,} . $hi; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |