line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################### |
2
|
|
|
|
|
|
|
# File::Comments::Plugin::JavaScript |
3
|
|
|
|
|
|
|
# 2005, Mike Schilli |
4
|
|
|
|
|
|
|
########################################### |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
########################################### |
7
|
|
|
|
|
|
|
package File::Comments::Plugin::JavaScript; |
8
|
|
|
|
|
|
|
########################################### |
9
|
|
|
|
|
|
|
|
10
|
9
|
|
|
9
|
|
12365
|
use strict; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
1065
|
|
11
|
9
|
|
|
9
|
|
228
|
use warnings; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
598
|
|
12
|
9
|
|
|
9
|
|
46
|
use File::Comments::Plugin::C; |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
426
|
|
13
|
|
|
|
|
|
|
our @ISA = qw(File::Comments::Plugin::C); |
14
|
9
|
|
|
9
|
|
45
|
use Log::Log4perl qw(:easy); |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
64
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
########################################### |
18
|
|
|
|
|
|
|
sub init { |
19
|
|
|
|
|
|
|
########################################### |
20
|
11
|
|
|
11
|
0
|
23
|
my($self) = @_; |
21
|
|
|
|
|
|
|
|
22
|
11
|
|
|
|
|
76
|
$self->register_suffix(".js"); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
########################################### |
26
|
|
|
|
|
|
|
sub type { |
27
|
|
|
|
|
|
|
########################################### |
28
|
0
|
|
|
0
|
0
|
0
|
my($self, $target) = @_; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
return "javascript"; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
########################################### |
34
|
|
|
|
|
|
|
sub comments { |
35
|
|
|
|
|
|
|
########################################### |
36
|
1
|
|
|
1
|
0
|
2
|
my($self, $target) = @_; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
18
|
return $self->extract_c_comments($target); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
########################################### |
42
|
|
|
|
|
|
|
sub extract_double_slash_comments { |
43
|
|
|
|
|
|
|
# NOT USED ANYMORE, WE'RE USING C COMMENTS |
44
|
|
|
|
|
|
|
########################################### |
45
|
0
|
|
|
0
|
0
|
|
my($self, $target) = @_; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
my @comments = (); |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
while($target->{content} =~ |
50
|
|
|
|
|
|
|
m#^\s*//(.*) |
51
|
|
|
|
|
|
|
#mxg) { |
52
|
0
|
|
|
|
|
|
push @comments, $1; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
return \@comments; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |