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