Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / CSS.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 our $VERSION = '0.06';
16
17 use strict;
18 use warnings;
19 use base('Syntax::Highlight::Engine::Kate::Template');
20
21 sub new {
22    my $proto = shift;
23    my $class = ref($proto) || $proto;
24    my $self = $class->SUPER::new(@_);
25    $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    $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    $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    $self->listAdd('paren',
102       'attr',
103       'counter',
104       'counters',
105       'format',
106       'local',
107       'rect',
108       'rgb',
109       'url',
110    );
111    $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    $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    $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    $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    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|<|=|>|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|-|\\%');
561    $self->basecontext('Base');
562    $self->keywordscase(0);
563    $self->initialize;
564    bless ($self, $class);
565    return $self;
566 }
567
568 sub language {
569    return 'CSS';
570 }
571
572 sub parseBase {
573    my ($self, $text) = @_;
574    # type => 'LineContinue'
575    if ($self->testLineContinue($text, 0, undef, 0, '#stay', undef)) {
576       return 1
577    }
578    # type => 'DetectSpaces'
579    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
580       return 1
581    }
582    # context => 'FindRuleSets'
583    # type => 'IncludeRules'
584    if ($self->includeRules('FindRuleSets', $text)) {
585       return 1
586    }
587    return 0;
588 };
589
590 sub parseComment {
591    my ($self, $text) = @_;
592    # type => 'DetectSpaces'
593    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
594       return 1
595    }
596    # attribute => 'Comment'
597    # char => '*'
598    # char1 => '/'
599    # context => '#pop'
600    # endRegion => 'comment'
601    # type => 'Detect2Chars'
602    if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
603       return 1
604    }
605    # context => '##Alerts'
606    # type => 'IncludeRules'
607    if ($self->includePlugin('Alerts', $text)) {
608       return 1
609    }
610    # type => 'DetectIdentifier'
611    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
612       return 1
613    }
614    return 0;
615 };
616
617 sub parseFindComments {
618    my ($self, $text) = @_;
619    # String => '/\*BEGIN.*\*/'
620    # attribute => 'Region Marker'
621    # beginRegion => 'UserDefined'
622    # context => '#stay'
623    # type => 'RegExpr'
624    if ($self->testRegExpr($text, '/\\*BEGIN.*\\*/', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
625       return 1
626    }
627    # String => '/\*END.*\*/'
628    # attribute => 'Region Marker'
629    # context => '#stay'
630    # endRegion => 'UserDefined'
631    # type => 'RegExpr'
632    if ($self->testRegExpr($text, '/\\*END.*\\*/', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
633       return 1
634    }
635    # attribute => 'Comment'
636    # beginRegion => 'comment'
637    # char => '/'
638    # char1 => '*'
639    # context => 'Comment'
640    # type => 'Detect2Chars'
641    if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
642       return 1
643    }
644    return 0;
645 };
646
647 sub parseFindRuleSets {
648    my ($self, $text) = @_;
649    # String => '@media\b'
650    # attribute => 'Media'
651    # context => 'Media'
652    # type => 'RegExpr'
653    if ($self->testRegExpr($text, '@media\\b', 0, 0, 0, undef, 0, 'Media', 'Media')) {
654       return 1
655    }
656    # String => '@import\b'
657    # attribute => 'At Rule'
658    # context => 'Import'
659    # type => 'RegExpr'
660    if ($self->testRegExpr($text, '@import\\b', 0, 0, 0, undef, 0, 'Import', 'At Rule')) {
661       return 1
662    }
663    # String => '@(font-face|charset)\b'
664    # attribute => 'At Rule'
665    # context => '#stay'
666    # type => 'RegExpr'
667    if ($self->testRegExpr($text, '@(font-face|charset)\\b', 0, 0, 0, undef, 0, '#stay', 'At Rule')) {
668       return 1
669    }
670    # attribute => 'Property'
671    # beginRegion => 'ruleset'
672    # char => '{'
673    # context => 'RuleSet'
674    # type => 'DetectChar'
675    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'RuleSet', 'Property')) {
676       return 1
677    }
678    # attribute => 'Selector Attr'
679    # char => '['
680    # context => 'SelAttr'
681    # type => 'DetectChar'
682    if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'SelAttr', 'Selector Attr')) {
683       return 1
684    }
685    # String => '#[A-Za-z0-9][\w\-]*'
686    # attribute => 'Selector Id'
687    # context => '#stay'
688    # type => 'RegExpr'
689    if ($self->testRegExpr($text, '#[A-Za-z0-9][\\w\\-]*', 0, 0, 0, undef, 0, '#stay', 'Selector Id')) {
690       return 1
691    }
692    # String => '\.[A-Za-z0-9][\w\-]*'
693    # attribute => 'Selector Class'
694    # context => '#stay'
695    # type => 'RegExpr'
696    if ($self->testRegExpr($text, '\\.[A-Za-z0-9][\\w\\-]*', 0, 0, 0, undef, 0, '#stay', 'Selector Class')) {
697       return 1
698    }
699    # String => ':lang\([\w_-]+\)'
700    # attribute => 'Selector Pseudo'
701    # context => '#stay'
702    # type => 'RegExpr'
703    if ($self->testRegExpr($text, ':lang\\([\\w_-]+\\)', 0, 0, 0, undef, 0, '#stay', 'Selector Pseudo')) {
704       return 1
705    }
706    # attribute => 'Selector Pseudo'
707    # char => ':'
708    # context => 'SelPseudo'
709    # type => 'DetectChar'
710    if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'SelPseudo', 'Selector Pseudo')) {
711       return 1
712    }
713    # context => 'FindStrings'
714    # type => 'IncludeRules'
715    if ($self->includeRules('FindStrings', $text)) {
716       return 1
717    }
718    # context => 'FindComments'
719    # type => 'IncludeRules'
720    if ($self->includeRules('FindComments', $text)) {
721       return 1
722    }
723    return 0;
724 };
725
726 sub parseFindStrings {
727    my ($self, $text) = @_;
728    # attribute => 'String'
729    # char => '"'
730    # context => 'StringDQ'
731    # type => 'DetectChar'
732    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'StringDQ', 'String')) {
733       return 1
734    }
735    # attribute => 'String'
736    # char => '''
737    # context => 'StringSQ'
738    # type => 'DetectChar'
739    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'StringSQ', 'String')) {
740       return 1
741    }
742    return 0;
743 };
744
745 sub parseFindValues {
746    my ($self, $text) = @_;
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    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')) {
752       return 1
753    }
754    # String => '[-+]?[0-9.]+[%]?'
755    # attribute => 'Value'
756    # context => '#stay'
757    # type => 'RegExpr'
758    if ($self->testRegExpr($text, '[-+]?[0-9.]+[%]?', 0, 0, 0, undef, 0, '#stay', 'Value')) {
759       return 1
760    }
761    # String => '[\w\-]+'
762    # attribute => 'Normal Text'
763    # context => '#stay'
764    # type => 'RegExpr'
765    if ($self->testRegExpr($text, '[\\w\\-]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
766       return 1
767    }
768    return 0;
769 };
770
771 sub parseImport {
772    my ($self, $text) = @_;
773    # attribute => 'At Rule'
774    # char => ';'
775    # context => '#pop'
776    # type => 'DetectChar'
777    if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'At Rule')) {
778       return 1
779    }
780    # String => 'mediatypes'
781    # attribute => 'Media'
782    # context => '#stay'
783    # type => 'keyword'
784    if ($self->testKeyword($text, 'mediatypes', 0, undef, 0, '#stay', 'Media')) {
785       return 1
786    }
787    # context => 'FindValues'
788    # type => 'IncludeRules'
789    if ($self->includeRules('FindValues', $text)) {
790       return 1
791    }
792    # context => 'FindStrings'
793    # type => 'IncludeRules'
794    if ($self->includeRules('FindStrings', $text)) {
795       return 1
796    }
797    # context => 'FindComments'
798    # type => 'IncludeRules'
799    if ($self->includeRules('FindComments', $text)) {
800       return 1
801    }
802    return 0;
803 };
804
805 sub parseInsideString {
806    my ($self, $text) = @_;
807    # String => '\\["']'
808    # attribute => 'String'
809    # context => '#stay'
810    # type => 'RegExpr'
811    if ($self->testRegExpr($text, '\\\\["\']', 0, 0, 0, undef, 0, '#stay', 'String')) {
812       return 1
813    }
814    # type => 'DetectIdentifier'
815    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
816       return 1
817    }
818    return 0;
819 };
820
821 sub parseMedia {
822    my ($self, $text) = @_;
823    # attribute => 'Media'
824    # beginRegion => 'media'
825    # char => '{'
826    # context => 'Media2'
827    # type => 'DetectChar'
828    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Media2', 'Media')) {
829       return 1
830    }
831    # String => 'mediatypes'
832    # attribute => 'Media'
833    # context => '#stay'
834    # type => 'keyword'
835    if ($self->testKeyword($text, 'mediatypes', 0, undef, 0, '#stay', 'Media')) {
836       return 1
837    }
838    # attribute => 'Media'
839    # char => ','
840    # context => '#stay'
841    # type => 'DetectChar'
842    if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#stay', 'Media')) {
843       return 1
844    }
845    # context => 'FindComments'
846    # type => 'IncludeRules'
847    if ($self->includeRules('FindComments', $text)) {
848       return 1
849    }
850    # String => '\S+'
851    # attribute => 'Error'
852    # context => '#stay'
853    # type => 'RegExpr'
854    if ($self->testRegExpr($text, '\\S+', 0, 0, 0, undef, 0, '#stay', 'Error')) {
855       return 1
856    }
857    return 0;
858 };
859
860 sub parseMedia2 {
861    my ($self, $text) = @_;
862    # attribute => 'Media'
863    # char => '}'
864    # context => '#pop#pop'
865    # endRegion => 'media'
866    # type => 'DetectChar'
867    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Media')) {
868       return 1
869    }
870    # context => 'FindRuleSets'
871    # type => 'IncludeRules'
872    if ($self->includeRules('FindRuleSets', $text)) {
873       return 1
874    }
875    return 0;
876 };
877
878 sub parsePropParen {
879    my ($self, $text) = @_;
880    # attribute => 'Value'
881    # char => '('
882    # context => 'PropParen2'
883    # type => 'DetectChar'
884    if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'PropParen2', 'Value')) {
885       return 1
886    }
887    # context => 'FindComments'
888    # type => 'IncludeRules'
889    if ($self->includeRules('FindComments', $text)) {
890       return 1
891    }
892    # String => '\S'
893    # attribute => 'Error'
894    # context => '#stay'
895    # type => 'RegExpr'
896    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
897       return 1
898    }
899    return 0;
900 };
901
902 sub parsePropParen2 {
903    my ($self, $text) = @_;
904    # attribute => 'Value'
905    # char => ')'
906    # context => '#pop#pop'
907    # type => 'DetectChar'
908    if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop', 'Value')) {
909       return 1
910    }
911    # context => 'FindValues'
912    # type => 'IncludeRules'
913    if ($self->includeRules('FindValues', $text)) {
914       return 1
915    }
916    # context => 'FindStrings'
917    # type => 'IncludeRules'
918    if ($self->includeRules('FindStrings', $text)) {
919       return 1
920    }
921    # context => 'FindComments'
922    # type => 'IncludeRules'
923    if ($self->includeRules('FindComments', $text)) {
924       return 1
925    }
926    return 0;
927 };
928
929 sub parseRule {
930    my ($self, $text) = @_;
931    # attribute => 'Property'
932    # char => ':'
933    # context => 'Rule2'
934    # type => 'DetectChar'
935    if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'Rule2', 'Property')) {
936       return 1
937    }
938    # String => '\S'
939    # attribute => 'Error'
940    # context => '#stay'
941    # type => 'RegExpr'
942    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
943       return 1
944    }
945    return 0;
946 };
947
948 sub parseRule2 {
949    my ($self, $text) = @_;
950    # attribute => 'Property'
951    # char => ';'
952    # context => '#pop#pop'
953    # type => 'DetectChar'
954    if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop#pop', 'Property')) {
955       return 1
956    }
957    # attribute => 'Property'
958    # char => '}'
959    # context => '#pop#pop#pop'
960    # endRegion => 'ruleset'
961    # type => 'DetectChar'
962    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Property')) {
963       return 1
964    }
965    # String => 'types'
966    # attribute => 'Value'
967    # context => '#stay'
968    # type => 'keyword'
969    if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Value')) {
970       return 1
971    }
972    # String => 'colors'
973    # attribute => 'Value'
974    # context => '#stay'
975    # type => 'keyword'
976    if ($self->testKeyword($text, 'colors', 0, undef, 0, '#stay', 'Value')) {
977       return 1
978    }
979    # String => '#([0-9A-Fa-f]{3}){1,4}\b'
980    # attribute => 'Value'
981    # context => '#stay'
982    # type => 'RegExpr'
983    if ($self->testRegExpr($text, '#([0-9A-Fa-f]{3}){1,4}\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) {
984       return 1
985    }
986    # String => 'paren'
987    # attribute => 'Value'
988    # context => 'PropParen'
989    # type => 'keyword'
990    if ($self->testKeyword($text, 'paren', 0, undef, 0, 'PropParen', 'Value')) {
991       return 1
992    }
993    # String => '!important\b'
994    # attribute => 'Important'
995    # context => '#stay'
996    # type => 'RegExpr'
997    if ($self->testRegExpr($text, '!important\\b', 0, 0, 0, undef, 0, '#stay', 'Important')) {
998       return 1
999    }
1000    # context => 'FindValues'
1001    # type => 'IncludeRules'
1002    if ($self->includeRules('FindValues', $text)) {
1003       return 1
1004    }
1005    # context => 'FindStrings'
1006    # type => 'IncludeRules'
1007    if ($self->includeRules('FindStrings', $text)) {
1008       return 1
1009    }
1010    # context => 'FindComments'
1011    # type => 'IncludeRules'
1012    if ($self->includeRules('FindComments', $text)) {
1013       return 1
1014    }
1015    return 0;
1016 };
1017
1018 sub parseRuleSet {
1019    my ($self, $text) = @_;
1020    # attribute => 'Property'
1021    # char => '}'
1022    # context => '#pop'
1023    # endRegion => 'ruleset'
1024    # type => 'DetectChar'
1025    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Property')) {
1026       return 1
1027    }
1028    # String => 'properties'
1029    # attribute => 'Property'
1030    # context => 'Rule'
1031    # type => 'keyword'
1032    if ($self->testKeyword($text, 'properties', 0, undef, 0, 'Rule', 'Property')) {
1033       return 1
1034    }
1035    # String => '-?[A-Za-z_-]+(?=\s*:)'
1036    # attribute => 'Unknown Property'
1037    # context => 'Rule'
1038    # type => 'RegExpr'
1039    if ($self->testRegExpr($text, '-?[A-Za-z_-]+(?=\\s*:)', 0, 0, 0, undef, 0, 'Rule', 'Unknown Property')) {
1040       return 1
1041    }
1042    # context => 'FindComments'
1043    # type => 'IncludeRules'
1044    if ($self->includeRules('FindComments', $text)) {
1045       return 1
1046    }
1047    # String => '\S'
1048    # attribute => 'Error'
1049    # context => '#stay'
1050    # type => 'RegExpr'
1051    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
1052       return 1
1053    }
1054    return 0;
1055 };
1056
1057 sub parseSelAttr {
1058    my ($self, $text) = @_;
1059    # attribute => 'Selector Attr'
1060    # char => ']'
1061    # context => '#pop'
1062    # type => 'DetectChar'
1063    if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Selector Attr')) {
1064       return 1
1065    }
1066    # context => 'FindStrings'
1067    # type => 'IncludeRules'
1068    if ($self->includeRules('FindStrings', $text)) {
1069       return 1
1070    }
1071    return 0;
1072 };
1073
1074 sub parseSelPseudo {
1075    my ($self, $text) = @_;
1076    # String => 'pseudoclasses'
1077    # attribute => 'Selector Pseudo'
1078    # context => '#pop'
1079    # type => 'keyword'
1080    if ($self->testKeyword($text, 'pseudoclasses', 0, undef, 0, '#pop', 'Selector Pseudo')) {
1081       return 1
1082    }
1083    return 0;
1084 };
1085
1086 sub parseStringDQ {
1087    my ($self, $text) = @_;
1088    # attribute => 'String'
1089    # char => '"'
1090    # context => '#pop'
1091    # type => 'DetectChar'
1092    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
1093       return 1
1094    }
1095    # context => 'InsideString'
1096    # type => 'IncludeRules'
1097    if ($self->includeRules('InsideString', $text)) {
1098       return 1
1099    }
1100    return 0;
1101 };
1102
1103 sub parseStringSQ {
1104    my ($self, $text) = @_;
1105    # attribute => 'String'
1106    # char => '''
1107    # context => '#pop'
1108    # type => 'DetectChar'
1109    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
1110       return 1
1111    }
1112    # context => 'InsideString'
1113    # type => 'IncludeRules'
1114    if ($self->includeRules('InsideString', $text)) {
1115       return 1
1116    }
1117    return 0;
1118 };
1119
1120
1121 1;
1122
1123 __END__
1124
1125 =head1 NAME
1126
1127 Syntax::Highlight::Engine::Kate::CSS - a Plugin for CSS syntax highlighting
1128
1129 =head1 SYNOPSIS
1130
1131  require Syntax::Highlight::Engine::Kate::CSS;
1132  my $sh = new Syntax::Highlight::Engine::Kate::CSS([
1133  ]);
1134
1135 =head1 DESCRIPTION
1136
1137 Syntax::Highlight::Engine::Kate::CSS is a  plugin module that provides syntax highlighting
1138 for CSS to the Syntax::Haghlight::Engine::Kate highlighting engine.
1139
1140 This code is generated from the syntax definition files used
1141 by the Kate project.
1142 It works quite fine, but can use refinement and optimization.
1143
1144 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
1145
1146 =cut
1147
1148 =head1 AUTHOR
1149
1150 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
1151
1152 =cut
1153
1154 =head1 BUGS
1155
1156 Unknown. If you find any, please contact the author
1157
1158 =cut
1159