line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::Struct::Output::Raw; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
84060
|
use base qw(CSS::Struct::Output); |
|
14
|
|
|
|
|
160
|
|
|
14
|
|
|
|
|
7533
|
|
4
|
14
|
|
|
14
|
|
108
|
use strict; |
|
14
|
|
|
|
|
36
|
|
|
14
|
|
|
|
|
304
|
|
5
|
14
|
|
|
14
|
|
66
|
use warnings; |
|
14
|
|
|
|
|
26
|
|
|
14
|
|
|
|
|
414
|
|
6
|
|
|
|
|
|
|
|
7
|
14
|
|
|
14
|
|
74
|
use Readonly; |
|
14
|
|
|
|
|
27
|
|
|
14
|
|
|
|
|
9794
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Constants. |
10
|
|
|
|
|
|
|
Readonly::Scalar my $EMPTY_STR => q{}; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = 0.05; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Resets internal variables. |
15
|
|
|
|
|
|
|
sub reset { |
16
|
35
|
|
|
35
|
1
|
15234
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Reset internal variables from main class. |
19
|
35
|
|
|
|
|
172
|
$self->SUPER::reset; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Comment after selector. |
22
|
35
|
|
|
|
|
95
|
$self->{'comment_after_selector'} = 0; |
23
|
|
|
|
|
|
|
|
24
|
35
|
|
|
|
|
81
|
return; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Flush $self->{'tmp_code'}. |
28
|
|
|
|
|
|
|
sub _flush_tmp { |
29
|
42
|
|
|
42
|
|
61
|
my $self = shift; |
30
|
42
|
100
|
|
|
|
57
|
if (@{$self->{'tmp_code'}}) { |
|
42
|
|
|
|
|
99
|
|
31
|
26
|
|
|
|
|
40
|
my @comment; |
32
|
26
|
100
|
|
|
|
69
|
if ($self->{'comment_after_selector'}) { |
33
|
2
|
|
|
|
|
7
|
@comment = splice @{$self->{'tmp_code'}}, |
34
|
2
|
|
|
|
|
3
|
-$self->{'comment_after_selector'}; |
35
|
|
|
|
|
|
|
} |
36
|
26
|
|
|
|
|
41
|
pop @{$self->{'tmp_code'}}; |
|
26
|
|
|
|
|
50
|
|
37
|
|
|
|
|
|
|
$self->{'flush_code'} .= |
38
|
26
|
|
|
|
|
49
|
(join $EMPTY_STR, @{$self->{'tmp_code'}}).'{'. |
|
26
|
|
|
|
|
92
|
|
39
|
|
|
|
|
|
|
(join $EMPTY_STR, @comment); |
40
|
26
|
|
|
|
|
64
|
$self->{'tmp_code'} = []; |
41
|
|
|
|
|
|
|
} |
42
|
42
|
|
|
|
|
78
|
return; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# At-rules. |
46
|
|
|
|
|
|
|
sub _put_at_rules { |
47
|
1
|
|
|
1
|
|
3
|
my ($self, $at_rule, $value) = @_; |
48
|
1
|
|
|
|
|
6
|
$self->{'flush_code'} .= $at_rule.' "'.$value.'";'; |
49
|
1
|
|
|
|
|
3
|
return; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# Comment. |
53
|
|
|
|
|
|
|
sub _put_comment { |
54
|
21
|
|
|
21
|
|
38
|
my ($self, @comments) = @_; |
55
|
21
|
100
|
|
|
|
47
|
if (! $self->{'skip_comments'}) { |
56
|
11
|
|
|
|
|
24
|
push @comments, $self->{'comment_delimeters'}->[1]; |
57
|
11
|
|
|
|
|
23
|
unshift @comments, $self->{'comment_delimeters'}->[0]; |
58
|
11
|
|
|
|
|
26
|
my $comment = join $EMPTY_STR, @comments; |
59
|
11
|
100
|
|
|
|
16
|
if (@{$self->{'tmp_code'}}) { |
|
11
|
|
|
|
|
25
|
|
60
|
4
|
|
|
|
|
7
|
push @{$self->{'tmp_code'}}, $comment; |
|
4
|
|
|
|
|
8
|
|
61
|
4
|
|
|
|
|
7
|
$self->{'comment_after_selector'}++; |
62
|
|
|
|
|
|
|
} else { |
63
|
7
|
|
|
|
|
16
|
$self->{'flush_code'} .= $comment; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
21
|
|
|
|
|
47
|
return; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Definition. |
70
|
|
|
|
|
|
|
sub _put_definition { |
71
|
16
|
|
|
16
|
|
32
|
my ($self, $key, $value) = @_; |
72
|
16
|
|
|
|
|
52
|
$self->_check_opened_selector; |
73
|
16
|
|
|
|
|
42
|
$self->_flush_tmp; |
74
|
16
|
|
|
|
|
39
|
$self->{'flush_code'} .= $key.':'.$value.';'; |
75
|
16
|
|
|
|
|
39
|
return; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# End of selector. |
79
|
|
|
|
|
|
|
sub _put_end_of_selector { |
80
|
27
|
|
|
27
|
|
44
|
my $self = shift; |
81
|
27
|
|
|
|
|
78
|
$self->_check_opened_selector; |
82
|
26
|
|
|
|
|
73
|
$self->_flush_tmp; |
83
|
26
|
|
|
|
|
40
|
$self->{'flush_code'} .= '}'; |
84
|
26
|
|
|
|
|
39
|
$self->{'open_selector'} = 0; |
85
|
26
|
|
|
|
|
64
|
return; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Instruction. |
89
|
|
|
|
|
|
|
sub _put_instruction { |
90
|
2
|
|
|
2
|
|
5
|
my ($self, $target, $code) = @_; |
91
|
2
|
|
|
|
|
8
|
$self->_put_comment($target, $code); |
92
|
2
|
|
|
|
|
7
|
return; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# Raw data. |
96
|
|
|
|
|
|
|
sub _put_raw { |
97
|
1
|
|
|
1
|
|
3
|
my ($self, @raw_data) = @_; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
# To flush code. |
100
|
1
|
|
|
|
|
5
|
$self->{'flush_code'} .= join $EMPTY_STR, @raw_data; |
101
|
|
|
|
|
|
|
|
102
|
1
|
|
|
|
|
4
|
return; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
# Selectors. |
106
|
|
|
|
|
|
|
sub _put_selector { |
107
|
31
|
|
|
31
|
|
63
|
my ($self, $selector) = @_; |
108
|
31
|
|
|
|
|
51
|
push @{$self->{'tmp_code'}}, $selector, ','; |
|
31
|
|
|
|
|
76
|
|
109
|
31
|
|
|
|
|
60
|
$self->{'comment_after_selector'} = 0; |
110
|
31
|
|
|
|
|
53
|
$self->{'open_selector'} = 1; |
111
|
31
|
|
|
|
|
79
|
return; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# Reset flush code. |
115
|
|
|
|
|
|
|
sub _reset_flush_code { |
116
|
36
|
|
|
36
|
|
65
|
my $self = shift; |
117
|
36
|
|
|
|
|
135
|
$self->{'flush_code'} = $EMPTY_STR; |
118
|
36
|
|
|
|
|
81
|
return; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
1; |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
__END__ |