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