Kate/CSS.pm

filter: Statementstmt 77.9% 163 / 209 Branchbran 72.5% 103 / 142 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 20 / 24 Podpod 0.0% 0 / 21 totaltotal 71.5% 287 / 401 SCAR 50.2
CC
73
Cov
75%
parsePropParen2
30.0
parsePropParen
20.0
parseFindRuleSets
12.1
CRAP 152.1
« Kate/Prolog.pm ↑ Summary Kate/PHP_PHP.pm »
1 # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved.
2 # This program is free software; you can redistribute it and/or
3 # modify it under the same terms as Perl itself.
4  
5 # This file was generated from the 'css.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 2.00
9 #kate version 2.4
10 #kate author Wilbert Berendsen (wilbert@kde.nl)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
12  
13 package Syntax::Highlight::Engine::Kate::CSS;
14  
15 1 our $VERSION = '0.14';
16  
17 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use base('Syntax::Highlight::Engine::Kate::Template');
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 sub new {
22 2 ▶ my $proto = shift;
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
23 2 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
020
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
24 2 my $self = $class->SUPER::new(@_);
25 2 $self->attributes({
26 'Alert' => 'Alert',
27 'At Rule' => 'DecVal',
28 'Comment' => 'Comment',
29 'Error' => 'Error',
30 'Important' => 'Keyword',
31 'Media' => 'Others',
32 'Normal Text' => 'Normal',
33 'Property' => 'Keyword',
34 'Region Marker' => 'RegionMarker',
35 'Selector Attr' => 'Char',
36 'Selector Class' => 'Float',
37 'Selector Id' => 'BaseN',
38 'Selector Pseudo' => 'DecVal',
39 'String' => 'String',
40 'Unknown Property' => 'Error',
41 'Value' => 'DataType',
42 });
43 2 $self->listAdd('colors',
44 'ActiveBorder',
45 'ActiveCaption',
46 'AppWorkspace',
47 'Background',
48 'ButtonFace',
49 'ButtonHighlight',
50 'ButtonShadow',
51 'ButtonText',
52 'CaptionText',
53 'GrayText',
54 'Highlight',
55 'HighlightText',
56 'InactiveBorder',
57 'InactiveCaption',
58 'InactiveCaptionText',
59 'InfoBackground',
60 'InfoText',
61 'Menu',
62 'MenuText',
63 'Scrollbar',
64 'ThreeDDarkShadow',
65 'ThreeDFace',
66 'ThreeDHighlight',
67 'ThreeDLightShadow',
68 'ThreeDShadow',
69 'Window',
70 'WindowFrame',
71 'WindowText',
72 'aqua',
73 'black',
74 'blue',
75 'fuchsia',
76 'gray',
77 'green',
78 'lime',
79 'maroon',
80 'navy',
81 'olive',
82 'purple',
83 'red',
84 'silver',
85 'teal',
86 'white',
87 'yellow',
88 );
89 2 $self->listAdd('mediatypes',
90 'all',
91 'aural',
92 'braille',
93 'embossed',
94 'handheld',
95 'print',
96 'projection',
97 'screen',
98 'tty',
99 'tv',
100 );
101 2 $self->listAdd('paren',
102 'attr',
103 'counter',
104 'counters',
105 'format',
106 'local',
107 'rect',
108 'rgb',
109 'url',
110 );
111 2 $self->listAdd('properties',
112 'ascent',
113 'azimuth',
114 'background',
115 'background-attachment',
116 'background-color',
117 'background-image',
118 'background-position',
119 'background-repeat',
120 'baseline',
121 'bbox',
122 'border',
123 'border-bottom',
124 'border-bottom-color',
125 'border-bottom-style',
126 'border-bottom-width',
127 'border-collapse',
128 'border-color',
129 'border-left',
130 'border-left-color',
131 'border-left-style',
132 'border-left-width',
133 'border-right',
134 'border-right-color',
135 'border-right-style',
136 'border-right-width',
137 'border-spacing',
138 'border-style',
139 'border-top',
140 'border-top-color',
141 'border-top-style',
142 'border-top-width',
143 'border-width',
144 'bottom',
145 'box-sizing',
146 'cap-height',
147 'caption-side',
148 'centerline',
149 'clear',
150 'clip',
151 'color',
152 'content',
153 'counter-increment',
154 'counter-reset',
155 'cue',
156 'cue-after',
157 'cue-before',
158 'cursor',
159 'definition-src',
160 'descent',
161 'direction',
162 'display',
163 'elevation',
164 'empty-cells',
165 'float',
166 'font',
167 'font-family',
168 'font-family',
169 'font-size',
170 'font-size',
171 'font-size-adjust',
172 'font-stretch',
173 'font-stretch',
174 'font-style',
175 'font-style',
176 'font-variant',
177 'font-variant',
178 'font-weight',
179 'font-weight',
180 'height',
181 'konq_bgpos_x',
182 'konq_bgpos_y',
183 'left',
184 'letter-spacing',
185 'line-height',
186 'list-style',
187 'list-style-image',
188 'list-style-keyword',
189 'list-style-position',
190 'list-style-type',
191 'margin',
192 'margin-bottom',
193 'margin-left',
194 'margin-right',
195 'margin-top',
196 'marker-offset',
197 'mathline',
198 'max-height',
199 'max-width',
200 'min-height',
201 'min-width',
202 'opacity',
203 'orphans',
204 'outline',
205 'outline-color',
206 'outline-style',
207 'outline-width',
208 'overflow',
209 'padding',
210 'padding-bottom',
211 'padding-left',
212 'padding-right',
213 'padding-top',
214 'page',
215 'page-break-after',
216 'page-break-before',
217 'page-break-inside',
218 'panose-1',
219 'pause',
220 'pause-after',
221 'pause-before',
222 'pitch',
223 'pitch-range',
224 'play-during',
225 'position',
226 'quotes',
227 'richness',
228 'right',
229 'size',
230 'slope',
231 'speak',
232 'speak-header',
233 'speak-numeral',
234 'speak-punctuation',
235 'speech-rate',
236 'src',
237 'stemh',
238 'stemv',
239 'stress',
240 'table-layout',
241 'text-align',
242 'text-decoration',
243 'text-decoration-color',
244 'text-indent',
245 'text-shadow',
246 'text-shadow',
247 'text-transform',
248 'top',
249 'topline',
250 'unicode-bidi',
251 'unicode-range',
252 'units-per-em',
253 'vertical-align',
254 'visibility',
255 'voice-family',
256 'volume',
257 'white-space',
258 'widows',
259 'width',
260 'widths',
261 'word-spacing',
262 'x-height',
263 'z-index',
264 );
265 2 $self->listAdd('pseudoclasses',
266 'active',
267 'after',
268 'before',
269 'checked',
270 'disabled',
271 'empty',
272 'enabled',
273 'first-child',
274 'first-letter',
275 'first-line',
276 'first-of-type',
277 'focus',
278 'hover',
279 'indeterminate',
280 'last-child',
281 'last-of-type',
282 'link',
283 'not',
284 'nth-child',
285 'nth-last-child',
286 'nth-last-of-type',
287 'nth-of-type',
288 'only-child',
289 'only-of-type',
290 'root',
291 'selection',
292 'target',
293 'visited',
294 );
295 2 $self->listAdd('types',
296 '100',
297 '200',
298 '300',
299 '400',
300 '500',
301 '600',
302 '700',
303 '800',
304 '900',
305 'above',
306 'absolute',
307 'always',
308 'armenian',
309 'auto',
310 'avoid',
311 'baseline',
312 'below',
313 'bidi-override',
314 'blink',
315 'block',
316 'bold',
317 'bolder',
318 'border-box',
319 'both',
320 'bottom',
321 'box',
322 'break',
323 'capitalize',
324 'caption',
325 'center',
326 'circle',
327 'cjk-ideographic',
328 'close-quote',
329 'collapse',
330 'compact',
331 'condensed',
332 'content-box',
333 'crop',
334 'cross',
335 'crosshair',
336 'cursive',
337 'dashed',
338 'decimal',
339 'decimal-leading-zero',
340 'default',
341 'disc',
342 'dotted',
343 'double',
344 'e-resize',
345 'embed',
346 'expanded',
347 'extra-condensed',
348 'extra-expanded',
349 'fantasy',
350 'fixed',
351 'georgian',
352 'groove',
353 'hand',
354 'hebrew',
355 'help',
356 'hidden',
357 'hide',
358 'higher',
359 'hiragana',
360 'hiragana-iroha',
361 'icon',
362 'inherit',
363 'inline',
364 'inline-block',
365 'inline-table',
366 'inset',
367 'inside',
368 'invert',
369 'italic',
370 'justify',
371 'katakana',
372 'katakana-iroha',
373 'konq-center',
374 'landscape',
375 'large',
376 'larger',
377 'left',
378 'level',
379 'light',
380 'lighter',
381 'line-through',
382 'list-item',
383 'loud',
384 'lower',
385 'lower-alpha',
386 'lower-greek',
387 'lower-latin',
388 'lower-roman',
389 'lowercase',
390 'ltr',
391 'marker',
392 'medium',
393 'menu',
394 'message-box',
395 'middle',
396 'mix',
397 'monospace',
398 'move',
399 'n-resize',
400 'narrower',
401 'ne-resize',
402 'no-close-quote',
403 'no-open-quote',
404 'no-repeat',
405 'none',
406 'normal',
407 'nowrap',
408 'nw-resize',
409 'oblique',
410 'open-quote',
411 'outset',
412 'outside',
413 'overline',
414 'pointer',
415 'portrait',
416 'pre',
417 'pre-line',
418 'pre-wrap',
419 'relative',
420 'repeat',
421 'repeat-x',
422 'repeat-y',
423 'ridge',
424 'right',
425 'rtl',
426 'run-in',
427 's-resize',
428 'sans-serif',
429 'scroll',
430 'se-resize',
431 'semi-condensed',
432 'semi-expanded',
433 'separate',
434 'serif',
435 'show',
436 'small',
437 'small-caps',
438 'small-caption',
439 'smaller',
440 'solid',
441 'square',
442 'static',
443 'static-position',
444 'status-bar',
445 'sub',
446 'super',
447 'sw-resize',
448 'table',
449 'table-caption',
450 'table-cell',
451 'table-column',
452 'table-column-group',
453 'table-footer-group',
454 'table-header-group',
455 'table-row',
456 'table-row-group',
457 'text',
458 'text-bottom',
459 'text-top',
460 'thick',
461 'thin',
462 'top',
463 'transparent',
464 'ultra-condensed',
465 'ultra-expanded',
466 'underline',
467 'upper-alpha',
468 'upper-latin',
469 'upper-roman',
470 'uppercase',
471 'visible',
472 'w-resize',
473 'wait',
474 'wider',
475 'x-large',
476 'x-small',
477 'xx-large',
478 'xx-small',
479 );
480 2 $self->contextdata({
481 'Base' => {
482 callback => \&parseBase,
483 attribute => 'Normal Text',
484 },
485 'Comment' => {
486 callback => \&parseComment,
487 attribute => 'Comment',
488 },
489 'FindComments' => {
490 callback => \&parseFindComments,
491 attribute => 'Normal Text',
492 },
493 'FindRuleSets' => {
494 callback => \&parseFindRuleSets,
495 attribute => 'Normal Text',
496 },
497 'FindStrings' => {
498 callback => \&parseFindStrings,
499 attribute => 'Normal Text',
500 },
501 'FindValues' => {
502 callback => \&parseFindValues,
503 attribute => 'Normal Text',
504 },
505 'Import' => {
506 callback => \&parseImport,
507 attribute => 'Normal Text',
508 },
509 'InsideString' => {
510 callback => \&parseInsideString,
511 attribute => 'String',
512 },
513 'Media' => {
514 callback => \&parseMedia,
515 attribute => 'Normal Text',
516 },
517 'Media2' => {
518 callback => \&parseMedia2,
519 attribute => 'Normal Text',
520 },
521 'PropParen' => {
522 callback => \&parsePropParen,
523 attribute => 'Normal Text',
524 },
525 'PropParen2' => {
526 callback => \&parsePropParen2,
527 attribute => 'Normal Text',
528 },
529 'Rule' => {
530 callback => \&parseRule,
531 attribute => 'Normal Text',
532 },
533 'Rule2' => {
534 callback => \&parseRule2,
535 attribute => 'Normal Text',
536 },
537 'RuleSet' => {
538 callback => \&parseRuleSet,
539 attribute => 'Normal Text',
540 },
541 'SelAttr' => {
542 callback => \&parseSelAttr,
543 attribute => 'Selector Attr',
544 },
545 'SelPseudo' => {
546 callback => \&parseSelPseudo,
547 attribute => 'Selector Pseudo',
548 lineending => '#pop',
549 fallthrough => '#pop',
550 },
551 'StringDQ' => {
552 callback => \&parseStringDQ,
553 attribute => 'String',
554 },
555 'StringSQ' => {
556 callback => \&parseStringSQ,
557 attribute => 'String',
558 },
559 });
560 2 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|<|=|>|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|-|\\%');
561 2 $self->basecontext('Base');
562 2 $self->keywordscase(0);
563 2 $self->initialize;
564 2 bless ($self, $class);
565 2 return $self;
566 }
567  
568 sub language {
569 0 ▶ return 'CSS';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
570 }
571  
572 sub parseBase {
573 60 ▶ my ($self, $text) = @_;
Subroutine parseBase: called CC=4 SCAR=14.8
Pod undocumented
574 # type => 'LineContinue'
575 60 ▶ if ($self->testLineContinue($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testLineContinue($text, 0, undef, 0, "#stay", undef)) 0 60 60
576 0 return 1
577 }
578 # type => 'DetectSpaces'
579 60 ▶ if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectSpaces($text, 0, undef, 0, "#stay", undef)) 0 60 60
580 0 return 1
581 }
582 # context => 'FindRuleSets'
583 # type => 'IncludeRules'
584 60 ▶ if ($self->includeRules('FindRuleSets', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindRuleSets", $text)) 30 30 60
585 30 return 1
586 }
587 30 return 0;
588 };
589  
590 sub parseComment {
591 144 ▶ my ($self, $text) = @_;
Subroutine parseComment: called CC=5 SCAR=16.1
Pod undocumented
592 # type => 'DetectSpaces'
593 144 ▶ if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectSpaces($text, 0, undef, 0, "#stay", undef)) 6 138 144
594 6 return 1
595 }
596 # attribute => 'Comment'
597 # char => '*'
598 # char1 => '/'
599 # context => '#pop'
600 # endRegion => 'comment'
601 # type => 'Detect2Chars'
602 138 ▶ if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "*", "/", 0, 0, 0, undef, 0, "#pop", "Comment")) 8 130 138
603 8 return 1
604 }
605 # context => '##Alerts'
606 # type => 'IncludeRules'
607 130 ▶ if ($self->includePlugin('Alerts', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includePlugin("Alerts", $text)) 2 128 130
608 2 return 1
609 }
610 # type => 'DetectIdentifier'
611 128 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", undef)) 44 84 128
612 44 return 1
613 }
614 84 return 0;
615 };
616  
617 sub parseFindComments {
618 206 ▶ my ($self, $text) = @_;
Subroutine parseFindComments: called CC=4 SCAR=14.8
Pod undocumented
619 # String => '/\*BEGIN.*\*/'
620 # attribute => 'Region Marker'
621 # beginRegion => 'UserDefined'
622 # context => '#stay'
623 # type => 'RegExpr'
624 206 ▶ if ($self->testRegExpr($text, '/\\*BEGIN.*\\*/', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "/\\*BEGIN.*\\*/", 0, 0, 0, undef, 0, "#stay", "Region Marker")) 0 206 206
625 0 return 1
626 }
627 # String => '/\*END.*\*/'
628 # attribute => 'Region Marker'
629 # context => '#stay'
630 # endRegion => 'UserDefined'
631 # type => 'RegExpr'
632 206 ▶ if ($self->testRegExpr($text, '/\\*END.*\\*/', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "/\\*END.*\\*/", 0, 0, 0, undef, 0, "#stay", "Region Marker")) 0 206 206
633 0 return 1
634 }
635 # attribute => 'Comment'
636 # beginRegion => 'comment'
637 # char => '/'
638 # char1 => '*'
639 # context => 'Comment'
640 # type => 'Detect2Chars'
641 206 ▶ if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", "*", 0, 0, 0, undef, 0, "Comment", "Comment")) 8 198 206
642 8 return 1
643 }
644 198 return 0;
645 };
646  
647 sub parseFindRuleSets {
648 68 ▶ my ($self, $text) = @_;
Subroutine parseFindRuleSets: called CC=12 SCAR=24.9
Pod undocumented
649 # String => '@media\b'
650 # attribute => 'Media'
651 # context => 'Media'
652 # type => 'RegExpr'
653 68 ▶ if ($self->testRegExpr($text, '@media\\b', 0, 0, 0, undef, 0, 'Media', 'Media')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\@media\\b", 0, 0, 0, undef, 0, "Media", "Media")) 2 66 68
654 2 return 1
655 }
656 # String => '@import\b'
657 # attribute => 'At Rule'
658 # context => 'Import'
659 # type => 'RegExpr'
660 66 ▶ if ($self->testRegExpr($text, '@import\\b', 0, 0, 0, undef, 0, 'Import', 'At Rule')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\@import\\b", 0, 0, 0, undef, 0, "Import", "At Rule")) 2 64 66
661 2 return 1
662 }
663 # String => '@(font-face|charset)\b'
664 # attribute => 'At Rule'
665 # context => '#stay'
666 # type => 'RegExpr'
667 64 ▶ if ($self->testRegExpr($text, '@(font-face|charset)\\b', 0, 0, 0, undef, 0, '#stay', 'At Rule')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\@(font-face|charset)\\b", 0, 0, 0, undef, 0, "#stay", "At Rule")) 0 64 64
668 0 return 1
669 }
670 # attribute => 'Property'
671 # beginRegion => 'ruleset'
672 # char => '{'
673 # context => 'RuleSet'
674 # type => 'DetectChar'
675 64 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'RuleSet', 'Property')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "RuleSet", "Property")) 10 54 64
676 10 return 1
677 }
678 # attribute => 'Selector Attr'
679 # char => '['
680 # context => 'SelAttr'
681 # type => 'DetectChar'
682 54 ▶ if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'SelAttr', 'Selector Attr')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "[", 0, 0, 0, undef, 0, "SelAttr", "Selector Attr")) 2 52 54
683 2 return 1
684 }
685 # String => '#[A-Za-z0-9][\w\-]*'
686 # attribute => 'Selector Id'
687 # context => '#stay'
688 # type => 'RegExpr'
689 52 ▶ if ($self->testRegExpr($text, '#[A-Za-z0-9][\\w\\-]*', 0, 0, 0, undef, 0, '#stay', 'Selector Id')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "#[A-Za-z0-9][\\w\\-]*", 0, 0, 0, undef, 0, "#stay", "Selector Id")) 4 48 52
690 4 return 1
691 }
692 # String => '\.[A-Za-z0-9][\w\-]*'
693 # attribute => 'Selector Class'
694 # context => '#stay'
695 # type => 'RegExpr'
696 48 ▶ if ($self->testRegExpr($text, '\\.[A-Za-z0-9][\\w\\-]*', 0, 0, 0, undef, 0, '#stay', 'Selector Class')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\.[A-Za-z0-9][\\w\\-]*", 0, 0, 0, undef, 0, "#stay", "Selector Class")) 4 44 48
697 4 return 1
698 }
699 # String => ':lang\([\w_-]+\)'
700 # attribute => 'Selector Pseudo'
701 # context => '#stay'
702 # type => 'RegExpr'
703 44 ▶ if ($self->testRegExpr($text, ':lang\\([\\w_-]+\\)', 0, 0, 0, undef, 0, '#stay', 'Selector Pseudo')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, ":lang\\([\\w_-]+\\)", 0, 0, 0, undef, 0, "#stay", "Selector Pseudo")) 2 42 44
704 2 return 1
705 }
706 # attribute => 'Selector Pseudo'
707 # char => ':'
708 # context => 'SelPseudo'
709 # type => 'DetectChar'
710 42 ▶ if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'SelPseudo', 'Selector Pseudo')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ":", 0, 0, 0, undef, 0, "SelPseudo", "Selector Pseudo")) 4 38 42
711 4 return 1
712 }
713 # context => 'FindStrings'
714 # type => 'IncludeRules'
715 38 ▶ if ($self->includeRules('FindStrings', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindStrings", $text)) 0 38 38
716 0 return 1
717 }
718 # context => 'FindComments'
719 # type => 'IncludeRules'
720 38 ▶ if ($self->includeRules('FindComments', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindComments", $text)) 4 34 38
721 4 return 1
722 }
723 34 return 0;
724 };
725  
726 sub parseFindStrings {
727 102 ▶ my ($self, $text) = @_;
Subroutine parseFindStrings: called CC=3 SCAR=11.2
Pod undocumented
728 # attribute => 'String'
729 # char => '"'
730 # context => 'StringDQ'
731 # type => 'DetectChar'
732 102 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'StringDQ', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "StringDQ", "String")) 6 96 102
733 6 return 1
734 }
735 # attribute => 'String'
736 # char => '''
737 # context => 'StringSQ'
738 # type => 'DetectChar'
739 96 ▶ if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'StringSQ', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "StringSQ", "String")) 0 96 96
740 0 return 1
741 }
742 96 return 0;
743 };
744  
745 sub parseFindValues {
746 72 ▶ my ($self, $text) = @_;
Subroutine parseFindValues: called CC=4 SCAR=14.0
Pod undocumented
747 # String => '[-+]?[0-9.]+(em|ex|px|in|cm|mm|pt|pc|deg|rad|grad|ms|s|Hz|kHz)\b'
748 # attribute => 'Value'
749 # context => '#stay'
750 # type => 'RegExpr'
751 72 ▶ if ($self->testRegExpr($text, '[-+]?[0-9.]+(em|ex|px|in|cm|mm|pt|pc|deg|rad|grad|ms|s|Hz|kHz)\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[-+]?[0-9.]+(em|ex|px|in|cm|mm|pt|pc|deg|rad|grad|ms|s|Hz|kHz)\\b", 0, 0, 0, undef, 0, "#stay", "Value")) 16 56 72
752 16 return 1
753 }
754 # String => '[-+]?[0-9.]+[%]?'
755 # attribute => 'Value'
756 # context => '#stay'
757 # type => 'RegExpr'
758 56 ▶ if ($self->testRegExpr($text, '[-+]?[0-9.]+[%]?', 0, 0, 0, undef, 0, '#stay', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[-+]?[0-9.]+[%]?", 0, 0, 0, undef, 0, "#stay", "Value")) 0 56 56
759 0 return 1
760 }
761 # String => '[\w\-]+'
762 # attribute => 'Normal Text'
763 # context => '#stay'
764 # type => 'RegExpr'
765 56 ▶ if ($self->testRegExpr($text, '[\\w\\-]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[\\w\\-]+", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 6 50 56
766 6 return 1
767 }
768 50 return 0;
769 };
770  
771 sub parseImport {
772 22 ▶ my ($self, $text) = @_;
Subroutine parseImport: called CC=6 SCAR=18.0
Pod undocumented
773 # attribute => 'At Rule'
774 # char => ';'
775 # context => '#pop'
776 # type => 'DetectChar'
777 22 ▶ if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'At Rule')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ";", 0, 0, 0, undef, 0, "#pop", "At Rule")) 2 20 22
778 2 return 1
779 }
780 # String => 'mediatypes'
781 # attribute => 'Media'
782 # context => '#stay'
783 # type => 'keyword'
784 20 ▶ if ($self->testKeyword($text, 'mediatypes', 0, undef, 0, '#stay', 'Media')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "mediatypes", 0, undef, 0, "#stay", "Media")) 4 16 20
785 4 return 1
786 }
787 # context => 'FindValues'
788 # type => 'IncludeRules'
789 16 ▶ if ($self->includeRules('FindValues', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindValues", $text)) 2 14 16
790 2 return 1
791 }
792 # context => 'FindStrings'
793 # type => 'IncludeRules'
794 14 ▶ if ($self->includeRules('FindStrings', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindStrings", $text)) 2 12 14
795 2 return 1
796 }
797 # context => 'FindComments'
798 # type => 'IncludeRules'
799 12 ▶ if ($self->includeRules('FindComments', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindComments", $text)) 0 12 12
800 0 return 1
801 }
802 12 return 0;
803 };
804  
805 sub parseInsideString {
806 18 ▶ my ($self, $text) = @_;
Subroutine parseInsideString: called CC=3 SCAR=11.2
Pod undocumented
807 # String => '\\["']'
808 # attribute => 'String'
809 # context => '#stay'
810 # type => 'RegExpr'
811 18 ▶ if ($self->testRegExpr($text, '\\\\["\']', 0, 0, 0, undef, 0, '#stay', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\[\"']", 0, 0, 0, undef, 0, "#stay", "String")) 0 18 18
812 0 return 1
813 }
814 # type => 'DetectIdentifier'
815 18 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", undef)) 12 6 18
816 12 return 1
817 }
818 6 return 0;
819 };
820  
821 sub parseMedia {
822 8 ▶ my ($self, $text) = @_;
Subroutine parseMedia: called CC=6 SCAR=19.1
Pod undocumented
823 # attribute => 'Media'
824 # beginRegion => 'media'
825 # char => '{'
826 # context => 'Media2'
827 # type => 'DetectChar'
828 8 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Media2', 'Media')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "Media2", "Media")) 2 6 8
829 2 return 1
830 }
831 # String => 'mediatypes'
832 # attribute => 'Media'
833 # context => '#stay'
834 # type => 'keyword'
835 6 ▶ if ($self->testKeyword($text, 'mediatypes', 0, undef, 0, '#stay', 'Media')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "mediatypes", 0, undef, 0, "#stay", "Media")) 2 4 6
836 2 return 1
837 }
838 # attribute => 'Media'
839 # char => ','
840 # context => '#stay'
841 # type => 'DetectChar'
842 4 ▶ if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#stay', 'Media')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ",", 0, 0, 0, undef, 0, "#stay", "Media")) 0 4 4
843 0 return 1
844 }
845 # context => 'FindComments'
846 # type => 'IncludeRules'
847 4 ▶ if ($self->includeRules('FindComments', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindComments", $text)) 0 4 4
848 0 return 1
849 }
850 # String => '\S+'
851 # attribute => 'Error'
852 # context => '#stay'
853 # type => 'RegExpr'
854 4 ▶ if ($self->testRegExpr($text, '\\S+', 0, 0, 0, undef, 0, '#stay', 'Error')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\S+", 0, 0, 0, undef, 0, "#stay", "Error")) 0 4 4
855 0 return 1
856 }
857 4 return 0;
858 };
859  
860 sub parseMedia2 {
861 10 ▶ my ($self, $text) = @_;
Subroutine parseMedia2: called CC=3 SCAR=11.0
Pod undocumented
862 # attribute => 'Media'
863 # char => '}'
864 # context => '#pop#pop'
865 # endRegion => 'media'
866 # type => 'DetectChar'
867 10 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Media')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop#pop", "Media")) 2 8 10
868 2 return 1
869 }
870 # context => 'FindRuleSets'
871 # type => 'IncludeRules'
872 8 ▶ if ($self->includeRules('FindRuleSets', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindRuleSets", $text)) 4 4 8
873 4 return 1
874 }
875 4 return 0;
876 };
877  
878 sub parsePropParen {
879 0 ▶ my ($self, $text) = @_;
Subroutine parsePropParen: not called CC=4 SCAR=30.0
Pod undocumented
880 # attribute => 'Value'
881 # char => '('
882 # context => 'PropParen2'
883 # type => 'DetectChar'
884 0 ▶ if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'PropParen2', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "(", 0, 0, 0, undef, 0, "PropParen2", "Value")) 0 0 0
885 0 return 1
886 }
887 # context => 'FindComments'
888 # type => 'IncludeRules'
889 0 ▶ if ($self->includeRules('FindComments', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindComments", $text)) 0 0 0
890 0 return 1
891 }
892 # String => '\S'
893 # attribute => 'Error'
894 # context => '#stay'
895 # type => 'RegExpr'
896 0 ▶ if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\S", 0, 0, 0, undef, 0, "#stay", "Error")) 0 0 0
897 0 return 1
898 }
899 0 return 0;
900 };
901  
902 sub parsePropParen2 {
903 0 ▶ my ($self, $text) = @_;
Subroutine parsePropParen2: not called CC=5 SCAR=34.0
Pod undocumented
904 # attribute => 'Value'
905 # char => ')'
906 # context => '#pop#pop'
907 # type => 'DetectChar'
908 0 ▶ if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ")", 0, 0, 0, undef, 0, "#pop#pop", "Value")) 0 0 0
909 0 return 1
910 }
911 # context => 'FindValues'
912 # type => 'IncludeRules'
913 0 ▶ if ($self->includeRules('FindValues', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindValues", $text)) 0 0 0
914 0 return 1
915 }
916 # context => 'FindStrings'
917 # type => 'IncludeRules'
918 0 ▶ if ($self->includeRules('FindStrings', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindStrings", $text)) 0 0 0
919 0 return 1
920 }
921 # context => 'FindComments'
922 # type => 'IncludeRules'
923 0 ▶ if ($self->includeRules('FindComments', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindComments", $text)) 0 0 0
924 0 return 1
925 }
926 0 return 0;
927 };
928  
929 sub parseRule {
930 20 ▶ my ($self, $text) = @_;
Subroutine parseRule: called CC=3 SCAR=16.0
Pod undocumented
931 # attribute => 'Property'
932 # char => ':'
933 # context => 'Rule2'
934 # type => 'DetectChar'
935 20 ▶ if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'Rule2', 'Property')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ":", 0, 0, 0, undef, 0, "Rule2", "Property")) 20 0 20
936 20 return 1
937 }
938 # String => '\S'
939 # attribute => 'Error'
940 # context => '#stay'
941 # type => 'RegExpr'
942 0 ▶ if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\S", 0, 0, 0, undef, 0, "#stay", "Error")) 0 0 0
943 0 return 1
944 }
945 0 return 0;
946 };
947  
948 sub parseRule2 {
949 86 ▶ my ($self, $text) = @_;
Subroutine parseRule2: called CC=11 SCAR=24.7
Pod undocumented
950 # attribute => 'Property'
951 # char => ';'
952 # context => '#pop#pop'
953 # type => 'DetectChar'
954 86 ▶ if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop#pop', 'Property')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ";", 0, 0, 0, undef, 0, "#pop#pop", "Property")) 20 66 86
955 20 return 1
956 }
957 # attribute => 'Property'
958 # char => '}'
959 # context => '#pop#pop#pop'
960 # endRegion => 'ruleset'
961 # type => 'DetectChar'
962 66 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Property')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop#pop#pop", "Property")) 0 66 66
963 0 return 1
964 }
965 # String => 'types'
966 # attribute => 'Value'
967 # context => '#stay'
968 # type => 'keyword'
969 66 ▶ if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "types", 0, undef, 0, "#stay", "Value")) 6 60 66
970 6 return 1
971 }
972 # String => 'colors'
973 # attribute => 'Value'
974 # context => '#stay'
975 # type => 'keyword'
976 60 ▶ if ($self->testKeyword($text, 'colors', 0, undef, 0, '#stay', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "colors", 0, undef, 0, "#stay", "Value")) 2 58 60
977 2 return 1
978 }
979 # String => '#([0-9A-Fa-f]{3}){1,4}\b'
980 # attribute => 'Value'
981 # context => '#stay'
982 # type => 'RegExpr'
983 58 ▶ if ($self->testRegExpr($text, '#([0-9A-Fa-f]{3}){1,4}\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "#([0-9A-Fa-f]{3}){1,4}\\b", 0, 0, 0, undef, 0, "#stay", "Value")) 0 58 58
984 0 return 1
985 }
986 # String => 'paren'
987 # attribute => 'Value'
988 # context => 'PropParen'
989 # type => 'keyword'
990 58 ▶ if ($self->testKeyword($text, 'paren', 0, undef, 0, 'PropParen', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "paren", 0, undef, 0, "PropParen", "Value")) 0 58 58
991 0 return 1
992 }
993 # String => '!important\b'
994 # attribute => 'Important'
995 # context => '#stay'
996 # type => 'RegExpr'
997 58 ▶ if ($self->testRegExpr($text, '!important\\b', 0, 0, 0, undef, 0, '#stay', 'Important')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "!important\\b", 0, 0, 0, undef, 0, "#stay", "Important")) 2 56 58
998 2 return 1
999 }
1000 # context => 'FindValues'
1001 # type => 'IncludeRules'
1002 56 ▶ if ($self->includeRules('FindValues', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindValues", $text)) 20 36 56
1003 20 return 1
1004 }
1005 # context => 'FindStrings'
1006 # type => 'IncludeRules'
1007 36 ▶ if ($self->includeRules('FindStrings', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindStrings", $text)) 2 34 36
1008 2 return 1
1009 }
1010 # context => 'FindComments'
1011 # type => 'IncludeRules'
1012 34 ▶ if ($self->includeRules('FindComments', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindComments", $text)) 0 34 34
1013 0 return 1
1014 }
1015 34 return 0;
1016 };
1017  
1018 sub parseRuleSet {
1019 148 ▶ my ($self, $text) = @_;
Subroutine parseRuleSet: called CC=6 SCAR=17.9
Pod undocumented
1020 # attribute => 'Property'
1021 # char => '}'
1022 # context => '#pop'
1023 # endRegion => 'ruleset'
1024 # type => 'DetectChar'
1025 148 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Property')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop", "Property")) 10 138 148
1026 10 return 1
1027 }
1028 # String => 'properties'
1029 # attribute => 'Property'
1030 # context => 'Rule'
1031 # type => 'keyword'
1032 138 ▶ if ($self->testKeyword($text, 'properties', 0, undef, 0, 'Rule', 'Property')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "properties", 0, undef, 0, "Rule", "Property")) 18 120 138
1033 18 return 1
1034 }
1035 # String => '-?[A-Za-z_-]+(?=\s*:)'
1036 # attribute => 'Unknown Property'
1037 # context => 'Rule'
1038 # type => 'RegExpr'
1039 120 ▶ if ($self->testRegExpr($text, '-?[A-Za-z_-]+(?=\\s*:)', 0, 0, 0, undef, 0, 'Rule', 'Unknown Property')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "-?[A-Za-z_-]+(?=\\s*:)", 0, 0, 0, undef, 0, "Rule", "Unknown Property")) 2 118 120
1040 2 return 1
1041 }
1042 # context => 'FindComments'
1043 # type => 'IncludeRules'
1044 118 ▶ if ($self->includeRules('FindComments', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindComments", $text)) 4 114 118
1045 4 return 1
1046 }
1047 # String => '\S'
1048 # attribute => 'Error'
1049 # context => '#stay'
1050 # type => 'RegExpr'
1051 114 ▶ if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\S", 0, 0, 0, undef, 0, "#stay", "Error")) 66 48 114
1052 66 return 1
1053 }
1054 48 return 0;
1055 };
1056  
1057 sub parseSelAttr {
1058 16 ▶ my ($self, $text) = @_;
Subroutine parseSelAttr: called CC=3 SCAR=11.0
Pod undocumented
1059 # attribute => 'Selector Attr'
1060 # char => ']'
1061 # context => '#pop'
1062 # type => 'DetectChar'
1063 16 ▶ if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Selector Attr')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "]", 0, 0, 0, undef, 0, "#pop", "Selector Attr")) 2 14 16
1064 2 return 1
1065 }
1066 # context => 'FindStrings'
1067 # type => 'IncludeRules'
1068 14 ▶ if ($self->includeRules('FindStrings', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("FindStrings", $text)) 2 12 14
1069 2 return 1
1070 }
1071 12 return 0;
1072 };
1073  
1074 sub parseSelPseudo {
1075 4 ▶ my ($self, $text) = @_;
Subroutine parseSelPseudo: called CC=2 SCAR=7.6
Pod undocumented
1076 # String => 'pseudoclasses'
1077 # attribute => 'Selector Pseudo'
1078 # context => '#pop'
1079 # type => 'keyword'
1080 4 ▶ if ($self->testKeyword($text, 'pseudoclasses', 0, undef, 0, '#pop', 'Selector Pseudo')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "pseudoclasses", 0, undef, 0, "#pop", "Selector Pseudo")) 4 0 4
1081 4 return 1
1082 }
1083 0 return 0;
1084 };
1085  
1086 sub parseStringDQ {
1087 24 ▶ my ($self, $text) = @_;
Subroutine parseStringDQ: called CC=3 SCAR=11.0
Pod undocumented
1088 # attribute => 'String'
1089 # char => '"'
1090 # context => '#pop'
1091 # type => 'DetectChar'
1092 24 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "#pop", "String")) 6 18 24
1093 6 return 1
1094 }
1095 # context => 'InsideString'
1096 # type => 'IncludeRules'
1097 18 ▶ if ($self->includeRules('InsideString', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("InsideString", $text)) 12 6 18
1098 12 return 1
1099 }
1100 6 return 0;
1101 };
1102  
1103 sub parseStringSQ {
1104 0 ▶ my ($self, $text) = @_;
Subroutine parseStringSQ: not called CC=3 SCAR=24.8
Pod undocumented
1105 # attribute => 'String'
1106 # char => '''
1107 # context => '#pop'
1108 # type => 'DetectChar'
1109 0 ▶ if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "#pop", "String")) 0 0 0
1110 0 return 1
1111 }
1112 # context => 'InsideString'
1113 # type => 'IncludeRules'
1114 0 ▶ if ($self->includeRules('InsideString', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includeRules("InsideString", $text)) 0 0 0
1115 0 return 1
1116 }
1117 0 return 0;
1118 };
1119  
1120  
1121 1 1;
1122  
1123 __END__
« Kate/Prolog.pm ↑ Summary Kate/PHP_PHP.pm »