line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################### |
2
|
|
|
|
|
|
|
# File::Comments::Plugin::Makefile |
3
|
|
|
|
|
|
|
# 2005, Mike Schilli |
4
|
|
|
|
|
|
|
########################################### |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
########################################### |
7
|
|
|
|
|
|
|
package File::Comments::Plugin::Makefile; |
8
|
|
|
|
|
|
|
########################################### |
9
|
|
|
|
|
|
|
|
10
|
9
|
|
|
9
|
|
49
|
use strict; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
255
|
|
11
|
9
|
|
|
9
|
|
47
|
use warnings; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
203
|
|
12
|
9
|
|
|
9
|
|
46
|
use File::Comments::Plugin; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
221
|
|
13
|
9
|
|
|
9
|
|
45
|
use Log::Log4perl qw(:easy); |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
53
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
16
|
|
|
|
|
|
|
our @ISA = qw(File::Comments::Plugin); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
########################################### |
19
|
|
|
|
|
|
|
sub init { |
20
|
|
|
|
|
|
|
########################################### |
21
|
11
|
|
|
11
|
0
|
30
|
my($self) = @_; |
22
|
|
|
|
|
|
|
|
23
|
11
|
|
|
|
|
78
|
$self->register_base("Makefile"); |
24
|
11
|
|
|
|
|
44
|
$self->register_base("makefile"); |
25
|
11
|
|
|
|
|
75
|
$self->register_suffix(".make"); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
########################################### |
29
|
|
|
|
|
|
|
sub type { |
30
|
|
|
|
|
|
|
########################################### |
31
|
0
|
|
|
0
|
0
|
0
|
my($self, $target) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
0
|
return "make"; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
########################################### |
37
|
|
|
|
|
|
|
sub comments { |
38
|
|
|
|
|
|
|
########################################### |
39
|
3
|
|
|
3
|
0
|
8
|
my($self, $target) = @_; |
40
|
|
|
|
|
|
|
|
41
|
3
|
|
|
|
|
32
|
return $self->extract_hashed_comments($target); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
########################################### |
45
|
|
|
|
|
|
|
sub stripped { |
46
|
|
|
|
|
|
|
########################################### |
47
|
1
|
|
|
1
|
0
|
3
|
my($self, $target) = @_; |
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
5
|
return $self->strip_hashed_comments($target); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
########################################### |
53
|
|
|
|
|
|
|
sub extract_hashed_comments { |
54
|
|
|
|
|
|
|
########################################### |
55
|
4
|
|
|
4
|
0
|
10
|
my($self, $target) = @_; |
56
|
|
|
|
|
|
|
|
57
|
4
|
|
|
|
|
9
|
my @comments = (); |
58
|
|
|
|
|
|
|
|
59
|
4
|
|
|
|
|
36
|
while($target->{content} =~ m/^\s*#(.*)/mg) { |
60
|
10
|
|
|
|
|
60
|
push @comments, $1; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
4
|
|
|
|
|
20
|
return \@comments; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
########################################### |
67
|
|
|
|
|
|
|
sub strip_hashed_comments { |
68
|
|
|
|
|
|
|
########################################### |
69
|
1
|
|
|
1
|
0
|
3
|
my($self, $target) = @_; |
70
|
|
|
|
|
|
|
|
71
|
1
|
|
|
|
|
3
|
my $stripped = $target->{content}; |
72
|
|
|
|
|
|
|
|
73
|
1
|
|
|
|
|
12
|
$stripped =~ s/^\s*#(.*)\n//mg; |
74
|
|
|
|
|
|
|
|
75
|
1
|
|
|
|
|
6
|
return $stripped; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__END__ |