| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
################################################################################################### |
|
2
|
|
|
|
|
|
|
# Copyright 2013/2014 by Marcel Greter |
|
3
|
|
|
|
|
|
|
# This file is part of OCBNET-CSS3 (GPL3) |
|
4
|
|
|
|
|
|
|
#################################################################################################### |
|
5
|
|
|
|
|
|
|
package OCBNET::CSS3::DOM::Comment; |
|
6
|
|
|
|
|
|
|
#################################################################################################### |
|
7
|
|
|
|
|
|
|
our $VERSION = '0.2.5'; |
|
8
|
|
|
|
|
|
|
#################################################################################################### |
|
9
|
|
|
|
|
|
|
|
|
10
|
11
|
|
|
11
|
|
57
|
use strict; |
|
|
11
|
|
|
|
|
18
|
|
|
|
11
|
|
|
|
|
365
|
|
|
11
|
11
|
|
|
11
|
|
53
|
use warnings; |
|
|
11
|
|
|
|
|
22
|
|
|
|
11
|
|
|
|
|
313
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#################################################################################################### |
|
14
|
11
|
|
|
11
|
|
49
|
use base 'OCBNET::CSS3'; |
|
|
11
|
|
|
|
|
17
|
|
|
|
11
|
|
|
|
|
2402
|
|
|
15
|
|
|
|
|
|
|
#################################################################################################### |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our @readers; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#################################################################################################### |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# static function only |
|
22
|
|
|
|
|
|
|
# never call as object |
|
23
|
|
|
|
|
|
|
sub register |
|
24
|
|
|
|
|
|
|
{ |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# get input arguments |
|
27
|
7
|
|
|
7
|
0
|
17
|
my ($reader) = @_; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# add additional reader |
|
30
|
7
|
|
|
|
|
29
|
push @readers, $reader; |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
# EO fn register |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#################################################################################################### |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# static getter |
|
38
|
|
|
|
|
|
|
#************************************************************************************************** |
|
39
|
5
|
|
|
5
|
0
|
20
|
sub type { return 'comment' } |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#################################################################################################### |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# set the readed comment |
|
44
|
|
|
|
|
|
|
# parse keys and values |
|
45
|
|
|
|
|
|
|
sub set |
|
46
|
|
|
|
|
|
|
{ |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# get input arguments |
|
49
|
82
|
|
|
82
|
0
|
129
|
my ($self, $text) = @_; |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# call super class method |
|
52
|
82
|
|
|
|
|
265
|
$self->SUPER::set($text); |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# call each reader for the given text |
|
55
|
82
|
|
|
|
|
284
|
$_->($self, $text) foreach @readers; |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# instance |
|
58
|
82
|
|
|
|
|
204
|
return $self; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
# EO sub set |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#################################################################################################### |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# load regex for comments |
|
66
|
|
|
|
|
|
|
#************************************************************************************************** |
|
67
|
11
|
|
|
11
|
|
5911
|
use OCBNET::CSS3::Regex::Comments; |
|
|
11
|
|
|
|
|
27
|
|
|
|
11
|
|
|
|
|
2108
|
|
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# add basic extended type with highest priority |
|
70
|
|
|
|
|
|
|
#************************************************************************************************** |
|
71
|
|
|
|
|
|
|
unshift @OCBNET::CSS3::types, [ |
|
72
|
|
|
|
|
|
|
qr//is, |
|
73
|
|
|
|
|
|
|
'OCBNET::CSS3::DOM::Comment', |
|
74
|
|
|
|
|
|
|
sub { $_[0] =~ m/\A\s*$re_comment\s*\z/is } |
|
75
|
|
|
|
|
|
|
]; |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
#################################################################################################### |
|
78
|
|
|
|
|
|
|
#################################################################################################### |
|
79
|
|
|
|
|
|
|
1; |