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.
5 # This file was generated from the 'asp.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Antonio Salazar (savedfastcool@gmail.com)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
13 package Syntax::Highlight::Engine::Kate::ASP;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
26 'ASP Text' => 'Normal',
27 'Comment' => 'Comment',
28 'Control Structures' => 'Operator',
29 'Decimal' => 'DecVal',
30 'Escape Code' => 'Char',
32 'Function' => 'Function',
33 'HTML Comment' => 'Comment',
34 'HTML Tag' => 'BString',
36 'Identifier' => 'Others',
37 'Keyword' => 'Keyword',
38 'Normal Text' => 'Normal',
42 'Types' => 'DataType',
43 'Variable' => 'Variable',
45 $self->listAdd('control structures',
67 $self->listAdd('functions',
98 'GetAbsolutePathName',
107 'GetParentFolderName',
157 'ScriptEngineBuildVersion',
158 'ScriptEngineMajorVersion',
159 'ScriptEngineMinorVersion',
218 $self->listAdd('keywords',
249 'asp_onelinecomment' => {
250 callback => \&parseasp_onelinecomment,
251 attribute => 'Comment',
252 lineending => '#pop',
255 callback => \&parseaspsource,
256 attribute => 'ASP Text',
258 'doublequotestring' => {
259 callback => \&parsedoublequotestring,
260 attribute => 'String',
263 callback => \&parsehtmlcomment,
264 attribute => 'HTML Comment',
267 callback => \&parsehtmltag,
268 attribute => 'Identifier',
271 callback => \&parseidentifiers,
272 attribute => 'Identifier',
275 callback => \&parsenosource,
276 attribute => 'Normal Text',
279 callback => \&parsescripts,
280 attribute => 'Normal Text',
282 'scripts_onelinecomment' => {
283 callback => \&parsescripts_onelinecomment,
284 attribute => 'Comment',
285 lineending => '#pop',
287 'singlequotestring' => {
288 callback => \&parsesinglequotestring,
289 attribute => 'String',
291 'twolinecomment' => {
292 callback => \&parsetwolinecomment,
293 attribute => 'Comment',
296 callback => \&parsetypes1,
297 attribute => 'Types',
300 callback => \&parsetypes2,
301 attribute => 'Types',
304 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
305 $self->basecontext('nosource');
306 $self->keywordscase(0);
308 bless ($self, $class);
316 sub parseasp_onelinecomment {
317 my ($self, $text) = @_;
319 # attribute => 'Keyword'
320 # context => '#pop#pop'
321 # type => 'StringDetect'
322 if ($self->testStringDetect($text, '%>', 0, 0, 0, undef, 0, '#pop#pop', 'Keyword')) {
329 my ($self, $text) = @_;
331 # attribute => 'Keyword'
333 # type => 'StringDetect'
334 if ($self->testStringDetect($text, '%>', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
337 # attribute => 'Comment'
339 # context => 'asp_onelinecomment'
340 # type => 'DetectChar'
341 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'asp_onelinecomment', 'Comment')) {
344 # attribute => 'String'
346 # context => 'doublequotestring'
347 # type => 'DetectChar'
348 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'doublequotestring', 'String')) {
351 # attribute => 'String'
353 # context => 'singlequotestring'
354 # type => 'DetectChar'
355 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'singlequotestring', 'String')) {
358 # attribute => 'Keyword'
361 # type => 'DetectChar'
362 if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
366 # attribute => 'String'
369 if ($self->testRegExpr($text, '', 0, 0, 0, undef, 0, '', 'String')) {
372 # String => '[0123456789]*\.\.\.[0123456789]*'
373 # attribute => 'String'
376 if ($self->testRegExpr($text, '[0123456789]*\\.\\.\\.[0123456789]*', 0, 0, 0, undef, 0, '#stay', 'String')) {
379 # attribute => 'Octal'
382 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
388 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
391 # attribute => 'Float'
394 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
397 # attribute => 'Decimal'
400 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
403 # String => ';()}{:,[]'
404 # attribute => 'Other'
407 if ($self->testAnyChar($text, ';()}{:,[]', 0, 0, undef, 0, '#stay', 'Other')) {
410 # String => '\belseif\b'
411 # attribute => 'Control Structures'
412 # beginRegion => 'iffi1'
414 # endRegion => 'iffi1'
415 # insensitive => 'TRUE'
417 if ($self->testRegExpr($text, '\\belseif\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
420 # String => '\belse\b'
421 # attribute => 'Control Structures'
422 # beginRegion => 'iffi1'
424 # endRegion => 'iffi1'
425 # insensitive => 'TRUE'
427 if ($self->testRegExpr($text, '\\belse\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
431 # attribute => 'Control Structures'
432 # beginRegion => 'iffi1'
434 # insensitive => 'TRUE'
436 if ($self->testRegExpr($text, '\\bif\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
439 # String => '\bend if\b'
440 # attribute => 'Control Structures'
442 # endRegion => 'iffi1'
443 # insensitive => 'TRUE'
445 if ($self->testRegExpr($text, '\\bend if\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
448 # String => '\bexit function\b'
449 # attribute => 'Keyword'
451 # insensitive => 'TRUE'
453 if ($self->testRegExpr($text, '\\bexit function\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
456 # String => '\bfunction\b'
457 # attribute => 'Keyword'
458 # beginRegion => 'funendfun1'
460 # insensitive => 'TRUE'
462 if ($self->testRegExpr($text, '\\bfunction\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
465 # String => '\bend function\b'
466 # attribute => 'Keyword'
468 # endRegion => 'funendfun1'
469 # insensitive => 'TRUE'
471 if ($self->testRegExpr($text, '\\bend function\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
474 # String => '\bexit sub\b'
475 # attribute => 'Keyword'
477 # insensitive => 'TRUE'
479 if ($self->testRegExpr($text, '\\bexit sub\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
482 # String => '\bsub\b'
483 # attribute => 'Keyword'
484 # beginRegion => 'subendsub1'
486 # insensitive => 'TRUE'
488 if ($self->testRegExpr($text, '\\bsub\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
491 # String => '\bend sub\b'
492 # attribute => 'Keyword'
494 # endRegion => 'subendsub1'
495 # insensitive => 'TRUE'
497 if ($self->testRegExpr($text, '\\bend sub\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
500 # String => '\bclass\b'
501 # attribute => 'Keyword'
502 # beginRegion => 'classendclass1'
504 # insensitive => 'TRUE'
506 if ($self->testRegExpr($text, '\\bclass\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
509 # String => '\bend class\b'
510 # attribute => 'Keyword'
512 # endRegion => 'classendclass1'
513 # insensitive => 'TRUE'
515 if ($self->testRegExpr($text, '\\bend class\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
518 # String => '\bexit do\b'
519 # attribute => 'Control Structures'
521 # insensitive => 'TRUE'
523 if ($self->testRegExpr($text, '\\bexit do\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
527 # attribute => 'Control Structures'
528 # beginRegion => 'doloop1'
530 # insensitive => 'TRUE'
532 if ($self->testRegExpr($text, '\\bdo\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
535 # String => '\bloop\b'
536 # attribute => 'Control Structures'
538 # endRegion => 'doloop1'
539 # insensitive => 'TRUE'
541 if ($self->testRegExpr($text, '\\bloop\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
544 # String => '\bexit while\b'
545 # attribute => 'Control Structures'
547 # insensitive => 'TRUE'
549 if ($self->testRegExpr($text, '\\bexit while\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
552 # String => '\bwhile\b'
553 # attribute => 'Control Structures'
554 # beginRegion => 'whilewend1'
556 # insensitive => 'TRUE'
558 if ($self->testRegExpr($text, '\\bwhile\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
561 # String => '\bwend\b'
562 # attribute => 'Control Structures'
564 # endRegion => 'whilewend1'
565 # insensitive => 'TRUE'
567 if ($self->testRegExpr($text, '\\bwend\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
570 # String => '\bexit for\b'
571 # attribute => 'Control Structures'
573 # insensitive => 'TRUE'
575 if ($self->testRegExpr($text, '\\bexit for\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
578 # String => '\bfor\b'
579 # attribute => 'Control Structures'
580 # beginRegion => 'fornext1'
582 # insensitive => 'TRUE'
584 if ($self->testRegExpr($text, '\\bfor\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
587 # String => '\bnext\b'
588 # attribute => 'Control Structures'
590 # endRegion => 'fornext1'
591 # insensitive => 'TRUE'
593 if ($self->testRegExpr($text, '\\bnext\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
596 # String => '\bselect case\b'
597 # attribute => 'Control Structures'
598 # beginRegion => 'selcase1'
600 # insensitive => 'TRUE'
602 if ($self->testRegExpr($text, '\\bselect case\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
605 # String => '\bend select\b'
606 # attribute => 'Control Structures'
608 # endRegion => 'selcase1'
609 # insensitive => 'TRUE'
611 if ($self->testRegExpr($text, '\\bend select\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) {
614 # String => 'keywords'
615 # attribute => 'Keyword'
618 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
621 # String => 'control structures'
622 # attribute => 'Control Structures'
625 if ($self->testKeyword($text, 'control structures', 0, undef, 0, '#stay', 'Control Structures')) {
628 # String => 'functions'
629 # attribute => 'Function'
632 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
638 sub parsedoublequotestring {
639 my ($self, $text) = @_;
640 # attribute => 'Escape Code'
644 # type => 'Detect2Chars'
645 if ($self->testDetect2Chars($text, '"', '"', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) {
648 # String => '\\[0-7]{1,3}'
649 # attribute => 'Escape Code'
652 if ($self->testRegExpr($text, '\\\\[0-7]{1,3}', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) {
655 # String => '\\x[0-9A-Fa-f]{1,2}'
656 # attribute => 'Escape Code'
659 if ($self->testRegExpr($text, '\\\\x[0-9A-Fa-f]{1,2}', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) {
662 # attribute => 'String'
665 # type => 'DetectChar'
666 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
672 sub parsehtmlcomment {
673 my ($self, $text) = @_;
675 # attribute => 'Keyword'
676 # context => 'aspsource'
677 # type => 'StringDetect'
678 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
682 # attribute => 'Keyword'
683 # context => 'aspsource'
684 # type => 'StringDetect'
685 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
689 # attribute => 'HTML Comment'
691 # type => 'StringDetect'
692 if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'HTML Comment')) {
695 # String => '\s*=\s*'
696 # attribute => 'Normal Text'
697 # context => 'identifiers'
699 if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'identifiers', 'Normal Text')) {
706 my ($self, $text) = @_;
707 # attribute => 'HTML Tag'
711 # type => 'Detect2Chars'
712 if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) {
715 # attribute => 'HTML Tag'
718 # type => 'DetectChar'
719 if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) {
723 # attribute => 'Keyword'
724 # context => 'aspsource'
725 # type => 'StringDetect'
726 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
730 # attribute => 'Keyword'
731 # context => 'aspsource'
732 # type => 'StringDetect'
733 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
736 # String => '\s*=\s*'
737 # attribute => 'Identifier'
738 # context => 'identifiers'
740 if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'identifiers', 'Identifier')) {
746 sub parseidentifiers {
747 my ($self, $text) = @_;
748 # String => '\s*#?[a-zA-Z0-9]*'
749 # attribute => 'String'
752 if ($self->testRegExpr($text, '\\s*#?[a-zA-Z0-9]*', 0, 0, 0, undef, 0, '#pop', 'String')) {
755 # attribute => 'Types'
757 # context => 'types1'
758 # type => 'DetectChar'
759 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'types1', 'Types')) {
762 # attribute => 'Types'
764 # context => 'types2'
765 # type => 'DetectChar'
766 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'types2', 'Types')) {
773 my ($self, $text) = @_;
775 # attribute => 'Keyword'
776 # context => 'aspsource'
777 # type => 'StringDetect'
778 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
781 # String => '<\s*script(\s|>)'
782 # attribute => 'HTML Tag'
783 # context => 'scripts'
784 # insensitive => 'TRUE'
786 if ($self->testRegExpr($text, '<\\s*script(\\s|>)', 1, 0, 0, undef, 0, 'scripts', 'HTML Tag')) {
789 # String => '<\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*'
790 # attribute => 'HTML Tag'
791 # context => 'htmltag'
793 if ($self->testRegExpr($text, '<\\s*\\/?\\s*[a-zA-Z_:][a-zA-Z0-9._:-]*', 0, 0, 0, undef, 0, 'htmltag', 'HTML Tag')) {
797 # attribute => 'HTML Comment'
798 # context => 'htmlcomment'
799 # type => 'StringDetect'
800 if ($self->testStringDetect($text, '<!--', 0, 0, 0, undef, 0, 'htmlcomment', 'HTML Comment')) {
807 my ($self, $text) = @_;
808 # attribute => 'Comment'
811 # context => 'scripts_onelinecomment'
812 # type => 'Detect2Chars'
813 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'scripts_onelinecomment', 'Comment')) {
816 # attribute => 'Comment'
819 # context => 'twolinecomment'
820 # type => 'Detect2Chars'
821 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'twolinecomment', 'Comment')) {
824 # String => 'control structures'
825 # attribute => 'Control Structures'
828 if ($self->testKeyword($text, 'control structures', 0, undef, 0, '#stay', 'Control Structures')) {
831 # String => 'keywords'
832 # attribute => 'Keyword'
835 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
838 # String => 'functions'
839 # attribute => 'Function'
842 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
846 # attribute => 'Keyword'
847 # context => 'aspsource'
848 # type => 'StringDetect'
849 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
852 # String => '<\s*\/\s*script\s*>'
853 # attribute => 'HTML Tag'
855 # insensitive => 'TRUE'
857 if ($self->testRegExpr($text, '<\\s*\\/\\s*script\\s*>', 1, 0, 0, undef, 0, '#pop', 'HTML Tag')) {
860 # attribute => 'String'
862 # context => 'doublequotestring'
863 # type => 'DetectChar'
864 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'doublequotestring', 'String')) {
867 # attribute => 'String'
869 # context => 'singlequotestring'
870 # type => 'DetectChar'
871 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'singlequotestring', 'String')) {
874 # attribute => 'Octal'
877 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
883 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
886 # attribute => 'Float'
889 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
892 # attribute => 'Decimal'
895 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
898 # attribute => 'Normal Text'
899 # beginRegion => 'Brace1'
902 # type => 'DetectChar'
903 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
906 # attribute => 'Normal Text'
909 # endRegion => 'Brace1'
910 # type => 'DetectChar'
911 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
914 # String => ';()}{:,[]'
915 # attribute => 'Other'
918 if ($self->testAnyChar($text, ';()}{:,[]', 0, 0, undef, 0, '#stay', 'Other')) {
924 sub parsescripts_onelinecomment {
925 my ($self, $text) = @_;
926 # String => '<\s*\/\s*script\s*>'
927 # attribute => 'HTML Tag'
928 # context => '#pop#pop'
929 # insensitive => 'TRUE'
931 if ($self->testRegExpr($text, '<\\s*\\/\\s*script\\s*>', 1, 0, 0, undef, 0, '#pop#pop', 'HTML Tag')) {
937 sub parsesinglequotestring {
938 my ($self, $text) = @_;
939 # attribute => 'Escape Code'
943 # type => 'Detect2Chars'
944 if ($self->testDetect2Chars($text, '\'', '\'', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) {
947 # attribute => 'String'
950 # type => 'DetectChar'
951 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
957 sub parsetwolinecomment {
958 my ($self, $text) = @_;
959 # attribute => 'Comment'
963 # endRegion => 'Comment'
964 # type => 'Detect2Chars'
965 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
972 my ($self, $text) = @_;
974 # attribute => 'Keyword'
975 # context => 'aspsource'
976 # type => 'StringDetect'
977 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
981 # attribute => 'Keyword'
982 # context => 'aspsource'
983 # type => 'StringDetect'
984 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
987 # attribute => 'Types'
989 # context => '#pop#pop'
990 # type => 'DetectChar'
991 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) {
998 my ($self, $text) = @_;
1000 # attribute => 'Keyword'
1001 # context => 'aspsource'
1002 # type => 'StringDetect'
1003 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
1007 # attribute => 'Keyword'
1008 # context => 'aspsource'
1009 # type => 'StringDetect'
1010 if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) {
1013 # attribute => 'Types'
1015 # context => '#pop#pop'
1016 # type => 'DetectChar'
1017 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) {
1030 Syntax::Highlight::Engine::Kate::ASP - a Plugin for ASP syntax highlighting
1034 require Syntax::Highlight::Engine::Kate::ASP;
1035 my $sh = new Syntax::Highlight::Engine::Kate::ASP([
1040 Syntax::Highlight::Engine::Kate::ASP is a plugin module that provides syntax highlighting
1041 for ASP to the Syntax::Haghlight::Engine::Kate highlighting engine.
1043 This code is generated from the syntax definition files used
1044 by the Kate project.
1045 It works quite fine, but can use refinement and optimization.
1047 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
1053 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
1059 Unknown. If you find any, please contact the author