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::Options; |
6
|
|
|
|
|
|
|
#################################################################################################### |
7
|
|
|
|
|
|
|
our $VERSION = '0.2.5'; |
8
|
|
|
|
|
|
|
#################################################################################################### |
9
|
|
|
|
|
|
|
|
10
|
7
|
|
|
7
|
|
50
|
use strict; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
213
|
|
11
|
7
|
|
|
7
|
|
35
|
use warnings; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
161
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#################################################################################################### |
14
|
|
|
|
|
|
|
|
15
|
7
|
|
|
7
|
|
36
|
use OCBNET::CSS3::Regex::Base; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
1967
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#################################################################################################### |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# plug into comment reading |
20
|
|
|
|
|
|
|
# parse all possible options |
21
|
|
|
|
|
|
|
sub reader |
22
|
|
|
|
|
|
|
{ |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# get input variables |
25
|
67
|
|
|
67
|
0
|
95
|
my ($self, $text) = @_; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# trim the comment (remove opener/closer) |
28
|
67
|
|
|
|
|
547
|
$text =~ s/(?:\A\s*\/+\*+|\*+\/+\s*\z)//gs; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# try to parse key/value pairs (pretty unstrict, but has loose syntax) |
31
|
67
|
|
|
|
|
995
|
while ($text =~ m/(?:\A|;+)\s*($re_identifier)\s*\:\s*([^;]*?)\s*(?=\z|;+)/g) |
32
|
|
|
|
|
|
|
{ |
33
|
69
|
50
|
33
|
|
|
247
|
if ($self->parent && $self->parent->options) |
34
|
69
|
|
|
|
|
179
|
{ $self->parent->options->set($1, $2); } |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# instance |
38
|
67
|
|
|
|
|
223
|
return $self |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
# EO sub reader |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
#################################################################################################### |
44
|
|
|
|
|
|
|
# register additional reader for comments |
45
|
|
|
|
|
|
|
#################################################################################################### |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
OCBNET::CSS3::DOM::Comment::register(\&reader); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
#################################################################################################### |
50
|
|
|
|
|
|
|
#################################################################################################### |
51
|
|
|
|
|
|
|
1; |