line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5082
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
57
|
|
3
|
|
|
|
|
|
|
package Comment::Block; |
4
|
1
|
|
|
1
|
|
1114
|
use Filter::Util::Call; |
|
1
|
|
|
|
|
1483
|
|
|
1
|
|
|
|
|
1762
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
$Comment::Block::VERSION = "0.01"; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#ABSTRACT: Comment::Block - Makes Block Comments Possible |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
1
|
|
|
1
|
|
11
|
my ($type) = @_; |
12
|
1
|
|
|
|
|
9
|
my (%context) = ( |
13
|
|
|
|
|
|
|
_inBlock => 0, |
14
|
|
|
|
|
|
|
_filename => (caller)[1], |
15
|
|
|
|
|
|
|
_line_no => 0, |
16
|
|
|
|
|
|
|
_last_begin => 0, |
17
|
|
|
|
|
|
|
); |
18
|
1
|
|
|
|
|
9
|
filter_add(bless \%context); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub error { |
22
|
0
|
|
|
0
|
0
|
0
|
my ($self) = shift; |
23
|
0
|
|
|
|
|
0
|
my ($message) = shift; |
24
|
0
|
|
0
|
|
|
0
|
my ($line_no) = shift || $self->{last_begin}; |
25
|
0
|
|
|
|
|
0
|
die "Error: $message at $self->{_filename} line $line_no.\n" |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub warning { |
29
|
0
|
|
|
0
|
0
|
0
|
my ($self) = shift; |
30
|
0
|
|
|
|
|
0
|
my ($message) = shift; |
31
|
0
|
|
0
|
|
|
0
|
my ($line_no) = shift || $self->{last_begin}; |
32
|
0
|
|
|
|
|
0
|
warn "Warning: $message at $self->{_filename} line $line_no.\n" |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub filter { |
36
|
25
|
|
|
25
|
0
|
26888
|
my ($self) = @_; |
37
|
25
|
|
|
|
|
23
|
my ($status); |
38
|
25
|
|
|
|
|
80
|
$status = filter_read(); |
39
|
25
|
|
|
|
|
45
|
++ $self->{LineNo}; |
40
|
25
|
100
|
|
|
|
54
|
if ($status <= 0) { |
41
|
1
|
50
|
|
|
|
5
|
$self->error("EOF Reached with no Comment end.") if $self->{inBlock}; |
42
|
1
|
|
|
|
|
1903
|
return $status; |
43
|
|
|
|
|
|
|
} |
44
|
24
|
100
|
|
|
|
86
|
if ($self->{inBlock}) { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
45
|
4
|
50
|
|
|
|
30
|
if (/^\s*#\/\*\s*/ ) { |
|
|
100
|
|
|
|
|
|
46
|
0
|
|
|
|
|
0
|
$self->warn("Nested COMMENT START", $self->{line_no}) |
47
|
|
|
|
|
|
|
} elsif (/^\s*#\*\/\s*/) { |
48
|
2
|
|
|
|
|
37
|
$self->{inBlock} = 0; |
49
|
|
|
|
|
|
|
} |
50
|
4
|
|
|
|
|
15
|
s/^/#/; |
51
|
|
|
|
|
|
|
} elsif ( /^\s*#\/\*\s*/ ) { |
52
|
2
|
|
|
|
|
5
|
$self->{inBlock} = 1; |
53
|
2
|
|
|
|
|
4
|
$self->{last_begin} = $self->{line_no}; |
54
|
|
|
|
|
|
|
} elsif ( /^\s*#\*\/\s*/ ) { |
55
|
0
|
|
|
|
|
0
|
$self->error("Comment Start has no Comment End", $self->{line_no}); |
56
|
|
|
|
|
|
|
} |
57
|
24
|
|
|
|
|
233
|
return $status; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |