line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Diff3::Base; |
2
|
6
|
|
|
6
|
|
3656
|
use 5.006; |
|
6
|
|
|
|
|
20
|
|
|
6
|
|
|
|
|
221
|
|
3
|
6
|
|
|
6
|
|
30
|
use strict; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
151
|
|
4
|
6
|
|
|
6
|
|
26
|
use warnings; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
150
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
32
|
use version; our $VERSION = '0.08'; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
28
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->mk_attr_accessor('factory'); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
284
|
|
|
284
|
1
|
522
|
my($class, @arg) = @_; |
12
|
284
|
|
|
|
|
665
|
my $self = bless {}, $class; |
13
|
284
|
|
|
|
|
785
|
$self->initialize(@arg); |
14
|
284
|
|
|
|
|
918
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub initialize { |
18
|
284
|
|
|
284
|
1
|
341
|
my($self, $f) = @_; |
19
|
284
|
|
|
|
|
567
|
$self->factory($f); |
20
|
284
|
|
|
|
|
466
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub mk_attr_accessor { |
24
|
18
|
|
|
18
|
1
|
59
|
my($class, @fields) = @_; |
25
|
18
|
50
|
|
|
|
54
|
$class = ref $class ? ref $class : $class; |
26
|
18
|
|
|
|
|
38
|
for my $field (@fields) { |
27
|
78
|
|
|
|
|
192
|
my $accessor = $class->_accessor($field); |
28
|
6
|
|
|
6
|
|
1385
|
no strict 'refs'; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
1176
|
|
29
|
78
|
|
|
|
|
93
|
*{"${class}::${field}"} = $accessor; |
|
78
|
|
|
|
|
357
|
|
30
|
|
|
|
|
|
|
} |
31
|
18
|
|
|
|
|
52
|
return; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _accessor { |
35
|
78
|
|
|
78
|
|
106
|
my($class, $field) = @_; |
36
|
|
|
|
|
|
|
return sub{ |
37
|
822
|
|
|
822
|
|
1044
|
my($self, @arg) = @_; |
38
|
822
|
100
|
|
|
|
1436
|
if (@arg) { |
39
|
319
|
|
|
|
|
1155
|
$self->{$field} = $arg[0]; |
40
|
|
|
|
|
|
|
} |
41
|
822
|
|
|
|
|
1802
|
return $self->{$field}; |
42
|
78
|
|
|
|
|
279
|
}; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |