| 1 | package CSS::Struct::Output; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 21 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 21 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 21 | ▶ | use Class::Utils qw(set_params); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 21 | ▶ | use Error::Pure qw(err); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 21 | ▶ | use List::MoreUtils qw(none); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 21 | ▶ | use Scalar::Util qw(openhandle); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 21 | our $VERSION = 0.05; | |||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | # Constructor. | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 39 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 39 | my ($class, @params) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | # Create object. | ||||||||||||||||||||||||||||||||||||||||||
| 18 | 39 | my $self = bless {}, $class; | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | # Get default parameters. | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 39 | $self->_default_parameters; | |||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | # Process params. | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 39 | set_params($self, @params); | |||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | # Check parameters to right values. | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 36 | $self->_check_params; | |||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | # Reset. | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 26 | $self->reset; | |||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | # Object. | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 26 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | # Flush CSS structure in object. | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 41 | ▶ | sub flush { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
flush: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 41 | my ($self, $reset_flag) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 39 | 41 | my $ouf = $self->{'output_handler'}; | |||||||||||||||||||||||||||||||||||||||||
| 40 | 41 | my $ret; | |||||||||||||||||||||||||||||||||||||||||
| 41 | 41 | ▶ | if (ref $self->{'flush_code'} eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 9 | $ret = join $self->{'output_sep'}, @{$self->{'flush_code'}}; | |||||||||||||||||||||||||||||||||||||||||
| 43 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 32 | $ret = $self->{'flush_code'}; | |||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | 41 | ▶ | if ($ouf) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | 21 | ▶ | no warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | 6 | ▶ | print {$ouf} $ret or err 'Cannot write to output handler.'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | 4 | undef $ret; | |||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | # Reset. | ||||||||||||||||||||||||||||||||||||||||||
| 53 | 39 | ▶ | if ($reset_flag) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | 2 | $self->reset; | |||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | # Return string. | ||||||||||||||||||||||||||||||||||||||||||
| 58 | 39 | return $ret; | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | # Put CSS structure code. | ||||||||||||||||||||||||||||||||||||||||||
| 62 | 50 | ▶ | sub put { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
put: called CC=12 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 63 | 50 | my ($self, @data) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | # For every data. | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 50 | foreach my $css_structure_ar (@data) { | |||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | # Bad data. | ||||||||||||||||||||||||||||||||||||||||||
| 69 | 135 | ▶ | if (ref $css_structure_ar ne 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 2 | err 'Bad data.'; | |||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | # Split to type and main CSS structure. | ||||||||||||||||||||||||||||||||||||||||||
| 74 | 133 | my ($type, @css_struct) = @{$css_structure_ar}; | |||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | # At-rule. | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 133 | ▶ | if ($type eq 'a') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 7 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | 2 | $self->_check_arguments(\@css_struct, 1, 2); | |||||||||||||||||||||||||||||||||||||||||
| 79 | 2 | $self->_put_at_rules(@css_struct); | |||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | # Comment. | ||||||||||||||||||||||||||||||||||||||||||
| 82 | } elsif ($type eq 'c') { | ||||||||||||||||||||||||||||||||||||||||||
| 83 | 20 | $self->_put_comment(@css_struct); | |||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||
| 85 | # Definition. | ||||||||||||||||||||||||||||||||||||||||||
| 86 | } elsif ($type eq 'd') { | ||||||||||||||||||||||||||||||||||||||||||
| 87 | 24 | $self->_check_arguments(\@css_struct, 1, 2); | |||||||||||||||||||||||||||||||||||||||||
| 88 | 24 | $self->_put_definition(@css_struct); | |||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | # End of selector. | ||||||||||||||||||||||||||||||||||||||||||
| 91 | } elsif ($type eq 'e') { | ||||||||||||||||||||||||||||||||||||||||||
| 92 | 35 | $self->_check_arguments(\@css_struct, 0, 0); | |||||||||||||||||||||||||||||||||||||||||
| 93 | 35 | $self->_put_end_of_selector; | |||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||
| 95 | # Instruction. | ||||||||||||||||||||||||||||||||||||||||||
| 96 | } elsif ($type eq 'i') { | ||||||||||||||||||||||||||||||||||||||||||
| 97 | 3 | $self->_check_arguments(\@css_struct, 1, 2); | |||||||||||||||||||||||||||||||||||||||||
| 98 | 3 | $self->_put_instruction(@css_struct); | |||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | # Raw data. | ||||||||||||||||||||||||||||||||||||||||||
| 101 | } elsif ($type eq 'r') { | ||||||||||||||||||||||||||||||||||||||||||
| 102 | 2 | $self->_put_raw(@css_struct); | |||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | # Selector. | ||||||||||||||||||||||||||||||||||||||||||
| 105 | } elsif ($type eq 's') { | ||||||||||||||||||||||||||||||||||||||||||
| 106 | 43 | $self->_check_arguments(\@css_struct, 1, 1); | |||||||||||||||||||||||||||||||||||||||||
| 107 | 39 | $self->_put_selector(@css_struct); | |||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||
| 109 | # Other. | ||||||||||||||||||||||||||||||||||||||||||
| 110 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 4 | ▶ | if (! $self->{'skip_bad_types'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | 2 | err 'Bad type of data.', 'type', $type; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||
| 117 | # Auto-flush. | ||||||||||||||||||||||||||||||||||||||||||
| 118 | 41 | ▶ | if ($self->{'auto_flush'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | 2 | $self->flush; | |||||||||||||||||||||||||||||||||||||||||
| 120 | 2 | $self->_reset_flush_code; | |||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | 41 | return; | |||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||
| 127 | # Resets internal variables. | ||||||||||||||||||||||||||||||||||||||||||
| 128 | 46 | ▶ | sub reset { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
reset: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | 46 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||
| 131 | # Tmp code. | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 46 | $self->{'tmp_code'} = []; | |||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||
| 134 | # Flush code. | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 46 | $self->_reset_flush_code; | |||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | # Open selector flag. | ||||||||||||||||||||||||||||||||||||||||||
| 138 | 46 | $self->{'open_selector'} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||
| 140 | 46 | return; | |||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | # Check arguments. | ||||||||||||||||||||||||||||||||||||||||||
| 144 | 107 | ▶ | sub _check_arguments { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_arguments: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 145 | 107 | my ($self, $css_structure_ar, $min_arg_num, $max_arg_num) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 146 | 107 | my $arg_num = scalar @{$css_structure_ar}; | |||||||||||||||||||||||||||||||||||||||||
| 147 | 107 | ▶ | if ($arg_num < $min_arg_num || $arg_num > $max_arg_num) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$arg_num < $min_arg_num or $arg_num > $max_arg_num
MC/DC100%2/2
$arg_num < $min_arg_num or $arg_num > $max_arg_num
$arg_num < $min_arg_num
$arg_num > $max_arg_num
Truth table100%3/3
A or B
A= $arg_num < $min_arg_numB= $arg_num > $max_arg_num
| |||||||||||||||||||||||||||||||||||||||||||
| 148 | err 'Bad number of arguments.', | ||||||||||||||||||||||||||||||||||||||||||
| 149 | '\'CSS::Struct\' structure', | ||||||||||||||||||||||||||||||||||||||||||
| 150 | 4 | join ', ', @{$css_structure_ar}; | |||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 103 | return; | |||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | # Check to opened selector. | ||||||||||||||||||||||||||||||||||||||||||
| 156 | 43 | ▶ | sub _check_opened_selector { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_opened_selector: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 157 | 43 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 158 | 43 | ▶ | if (! $self->{'open_selector'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | 1 | err 'No opened selector.'; | |||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||
| 161 | 42 | return; | |||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||
| 164 | # Default parameters. | ||||||||||||||||||||||||||||||||||||||||||
| 165 | 39 | ▶ | sub _default_parameters { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_default_parameters: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | 39 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||
| 168 | # Auto flush flag. | ||||||||||||||||||||||||||||||||||||||||||
| 169 | 39 | $self->{'auto_flush'} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||
| 171 | # CSS comment delimeters. | ||||||||||||||||||||||||||||||||||||||||||
| 172 | 39 | $self->{'comment_delimeters'} = [q{/*}, q{*/}]; | |||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||
| 174 | # Set output handler. | ||||||||||||||||||||||||||||||||||||||||||
| 175 | 39 | $self->{'output_handler'} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||
| 177 | # Output separator. | ||||||||||||||||||||||||||||||||||||||||||
| 178 | 39 | $self->{'output_sep'} = "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | # Skip bad 'CSS::Struct' types. | ||||||||||||||||||||||||||||||||||||||||||
| 181 | 39 | $self->{'skip_bad_types'} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | # Skip comments. | ||||||||||||||||||||||||||||||||||||||||||
| 184 | 39 | $self->{'skip_comments'} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | 39 | return; | |||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | # Check parameters to rigth values. | ||||||||||||||||||||||||||||||||||||||||||
| 190 | 36 | ▶ | sub _check_params { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_params: called CC=8 SCAR=20.8
| |||||||||||||||||||||||||||||||||||||||||||
| 191 | 36 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||
| 193 | # Check to output handler. | ||||||||||||||||||||||||||||||||||||||||||
| 194 | 36 | ▶ | if (defined $self->{'output_handler'} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->{"output_handler"} and not defined &openhandle($self->{"output_handler"})
MC/DC100%2/2
defined $self->{"output_handler"} and not defined &openhandle($self->{"output_handler"})
defined $self->{"output_handler"}
not defined &openhandle($self->{"output_handler"})
Truth table100%3/3
A and not(B)
A= defined $self->{"output_handler"}B= not defined &openhandle($self->{"output_handler"})
| |||||||||||||||||||||||||||||||||||||||||||
| 195 | && ! defined openhandle($self->{'output_handler'})) { | ||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||
| 197 | 2 | err 'Output handler is bad file handler.'; | |||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||
| 199 | # Check auto-flush only with output handler. | ||||||||||||||||||||||||||||||||||||||||||
| 200 | 34 | ▶ | if ($self->{'auto_flush'} && ! defined $self->{'output_handler'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->{"auto_flush"} and not defined $self->{"output_handler"}
MC/DC100%2/2
$self->{"auto_flush"} and not defined $self->{"output_handler"}
$self->{"auto_flush"}
not defined $self->{"output_handler"}
Truth table100%3/3
A and not(B)
A= $self->{"auto_flush"}B= not defined $self->{"output_handler"}
| |||||||||||||||||||||||||||||||||||||||||||
| 201 | 2 | err 'Auto-flush can\'t use without output handler.'; | |||||||||||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||
| 204 | # Check to comment delimeters. | ||||||||||||||||||||||||||||||||||||||||||
| 205 | 32 | ▶ | if (ref $self->{'comment_delimeters'} ne 'ARRAY' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
ref $self->{"comment_delimeters"} ne "ARRAY" or &none(sub {
$_ eq $self->{"comment_delimeters"}[0];
}
, "/*", "<!--") or &none(sub {
$_ eq $self->{"comment_delimeters"}[1];
}
, "*/", "-->")
ref $self->{"comment_delimeters"} ne "ARRAY" or &none(sub {
$_ eq $self->{"comment_delimeters"}[0];
}
, "/*", "<!--")
MC/DC100%3/3
ref $self->{"comment_delimeters"} ne "ARRAY" or &none(sub {
$_ eq $self->{"comment_delimeters"}[0];
}
, "/*", "<!--") or &none(sub {
$_ eq $self->{"comment_delimeters"}[1];
}
, "*/", "-->")
ref $self->{"comment_delimeters"} ne "ARRAY"
&none(sub {
$_ eq $self->{"comment_delimeters"}[0];
}
, "/*", "<!--")
&none(sub {
$_ eq $self->{"comment_delimeters"}[1];
}
, "*/", "-->")
Truth table100%4/4
A or B or C
A= ref $self->{"comment_delimeters"} ne "ARRAY"B= &none(sub {
$_ eq $self->{"comment_delimeters"}[0];
}
, "/*", "<!--")C= &none(sub {
$_ eq $self->{"comment_delimeters"}[1];
}
, "*/", "-->")
| |||||||||||||||||||||||||||||||||||||||||||
| 206 | 32 | ▶ | || (none { $_ eq $self->{'comment_delimeters'}->[0] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 207 | (q{/*}, '<!--')) | ||||||||||||||||||||||||||||||||||||||||||
| 208 | 30 | ▶ | || (none { $_ eq $self->{'comment_delimeters'}->[1] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 209 | (q{*/}, '-->'))) { | ||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||
| 211 | 6 | err 'Bad comment delimeters.'; | |||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||
| 214 | 26 | return; | |||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||
| 217 | # At-rules. | ||||||||||||||||||||||||||||||||||||||||||
| 218 | 1 | ▶ | sub _put_at_rules { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_put_at_rules: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 219 | 1 | my ($self, $at_rule, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 220 | 1 | push @{$self->{'flush_code'}}, 'At-rule'; | |||||||||||||||||||||||||||||||||||||||||
| 221 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||
| 224 | # Comment. | ||||||||||||||||||||||||||||||||||||||||||
| 225 | 1 | ▶ | sub _put_comment { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_put_comment: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 226 | 1 | my ($self, @comments) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 227 | 1 | push @{$self->{'flush_code'}}, 'Comment'; | |||||||||||||||||||||||||||||||||||||||||
| 228 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||
| 231 | # Definition. | ||||||||||||||||||||||||||||||||||||||||||
| 232 | 8 | ▶ | sub _put_definition { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_put_definition: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 233 | 8 | my ($self, $key, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 234 | 8 | push @{$self->{'flush_code'}}, 'Definition'; | |||||||||||||||||||||||||||||||||||||||||
| 235 | 8 | return; | |||||||||||||||||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||
| 238 | # End of selector. | ||||||||||||||||||||||||||||||||||||||||||
| 239 | 8 | ▶ | sub _put_end_of_selector { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_put_end_of_selector: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 240 | 8 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 241 | 8 | push @{$self->{'flush_code'}}, 'End of selector'; | |||||||||||||||||||||||||||||||||||||||||
| 242 | 8 | return; | |||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||
| 245 | # Instruction. | ||||||||||||||||||||||||||||||||||||||||||
| 246 | 1 | ▶ | sub _put_instruction { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_put_instruction: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 247 | 1 | my ($self, $target, $code) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 248 | 1 | push @{$self->{'flush_code'}}, 'Instruction'; | |||||||||||||||||||||||||||||||||||||||||
| 249 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||
| 252 | # Raw data. | ||||||||||||||||||||||||||||||||||||||||||
| 253 | 1 | ▶ | sub _put_raw { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_put_raw: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 254 | 1 | my ($self, @raw_data) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 255 | 1 | push @{$self->{'flush_code'}}, 'Raw data'; | |||||||||||||||||||||||||||||||||||||||||
| 256 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||
| 259 | # Selectors. | ||||||||||||||||||||||||||||||||||||||||||
| 260 | 8 | ▶ | sub _put_selector { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_put_selector: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 261 | 8 | my ($self, $selector) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 262 | 8 | push @{$self->{'flush_code'}}, 'Selector'; | |||||||||||||||||||||||||||||||||||||||||
| 263 | 8 | return; | |||||||||||||||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||
| 266 | # Reset flush code. | ||||||||||||||||||||||||||||||||||||||||||
| 267 | 12 | ▶ | sub _reset_flush_code { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_reset_flush_code: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 268 | 12 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 269 | 12 | $self->{'flush_code'} = []; | |||||||||||||||||||||||||||||||||||||||||
| 270 | 12 | return; | |||||||||||||||||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||
| 273 | 21 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||
| 275 | __END__ | ||||||||||||||||||||||||||||||||||||||||||