| 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 'sgml.xml' file of the syntax highlight | ||||||||||||||||||||
| 6 | # engine of the kate text editor (http://www.kate-editor.org | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | #kate xml version 1.02 | ||||||||||||||||||||
| 9 | #kate version 2.1 | ||||||||||||||||||||
| 10 | #generated: Sun Feb 3 22:02:06 2008, localtime | ||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | package Syntax::Highlight::Engine::Kate::SGML; | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 1 | our $VERSION = '0.14'; | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 18 | 1 | ▶ | use base('Syntax::Highlight::Engine::Kate::Template'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | sub new { | ||||||||||||||||||||
| 21 | 1 | ▶ | my $proto = shift; | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 22 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 23 | 1 | my $self = $class->SUPER::new(@_); | |||||||||||||||||||
| 24 | 1 | $self->attributes({ | |||||||||||||||||||
| 25 | 'Attribute Name' => 'Others', | ||||||||||||||||||||
| 26 | 'Attribute Value' => 'DataType', | ||||||||||||||||||||
| 27 | 'Comment' => 'Comment', | ||||||||||||||||||||
| 28 | 'Normal Text' => 'Normal', | ||||||||||||||||||||
| 29 | 'Tag' => 'Keyword', | ||||||||||||||||||||
| 30 | }); | ||||||||||||||||||||
| 31 | 1 | $self->contextdata({ | |||||||||||||||||||
| 32 | 'Attribute' => { | ||||||||||||||||||||
| 33 | callback => \&parseAttribute, | ||||||||||||||||||||
| 34 | attribute => 'Attribute Name', | ||||||||||||||||||||
| 35 | }, | ||||||||||||||||||||
| 36 | 'Comment' => { | ||||||||||||||||||||
| 37 | callback => \&parseComment, | ||||||||||||||||||||
| 38 | attribute => 'Comment', | ||||||||||||||||||||
| 39 | }, | ||||||||||||||||||||
| 40 | 'Normal Text' => { | ||||||||||||||||||||
| 41 | callback => \&parseNormalText, | ||||||||||||||||||||
| 42 | attribute => 'Normal Text', | ||||||||||||||||||||
| 43 | }, | ||||||||||||||||||||
| 44 | 'Value' => { | ||||||||||||||||||||
| 45 | callback => \&parseValue, | ||||||||||||||||||||
| 46 | attribute => 'Attribute Value', | ||||||||||||||||||||
| 47 | }, | ||||||||||||||||||||
| 48 | 'Value 2' => { | ||||||||||||||||||||
| 49 | callback => \&parseValue2, | ||||||||||||||||||||
| 50 | attribute => 'Attribute Value', | ||||||||||||||||||||
| 51 | }, | ||||||||||||||||||||
| 52 | }); | ||||||||||||||||||||
| 53 | 1 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); | |||||||||||||||||||
| 54 | 1 | $self->basecontext('Normal Text'); | |||||||||||||||||||
| 55 | 1 | $self->keywordscase(0); | |||||||||||||||||||
| 56 | 1 | $self->initialize; | |||||||||||||||||||
| 57 | 1 | bless ($self, $class); | |||||||||||||||||||
| 58 | 1 | return $self; | |||||||||||||||||||
| 59 | } | ||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | sub language { | ||||||||||||||||||||
| 62 | 0 | ▶ | return 'SGML'; | ||||||||||||||||||
|
Subroutine
language: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 63 | } | ||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | sub parseAttribute { | ||||||||||||||||||||
| 66 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseAttribute: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||
| 67 | # attribute => 'Tag' | ||||||||||||||||||||
| 68 | # char => '/' | ||||||||||||||||||||
| 69 | # char1 => '>' | ||||||||||||||||||||
| 70 | # context => '#pop' | ||||||||||||||||||||
| 71 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 72 | 0 | ▶ | if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 73 | 0 | return 1 | |||||||||||||||||||
| 74 | } | ||||||||||||||||||||
| 75 | # attribute => 'Tag' | ||||||||||||||||||||
| 76 | # char => '>' | ||||||||||||||||||||
| 77 | # context => '#pop' | ||||||||||||||||||||
| 78 | # type => 'DetectChar' | ||||||||||||||||||||
| 79 | 0 | ▶ | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 80 | 0 | return 1 | |||||||||||||||||||
| 81 | } | ||||||||||||||||||||
| 82 | # String => '\s*=\s*' | ||||||||||||||||||||
| 83 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 84 | # context => 'Value' | ||||||||||||||||||||
| 85 | # type => 'RegExpr' | ||||||||||||||||||||
| 86 | 0 | ▶ | if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 87 | 0 | return 1 | |||||||||||||||||||
| 88 | } | ||||||||||||||||||||
| 89 | 0 | return 0; | |||||||||||||||||||
| 90 | }; | ||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | sub parseComment { | ||||||||||||||||||||
| 93 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseComment: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 94 | # String => '-->' | ||||||||||||||||||||
| 95 | # attribute => 'Comment' | ||||||||||||||||||||
| 96 | # context => '#pop' | ||||||||||||||||||||
| 97 | # type => 'StringDetect' | ||||||||||||||||||||
| 98 | 0 | ▶ | if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 99 | 0 | return 1 | |||||||||||||||||||
| 100 | } | ||||||||||||||||||||
| 101 | 0 | return 0; | |||||||||||||||||||
| 102 | }; | ||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | sub parseNormalText { | ||||||||||||||||||||
| 105 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseNormalText: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 106 | # String => '<!--' | ||||||||||||||||||||
| 107 | # attribute => 'Comment' | ||||||||||||||||||||
| 108 | # context => 'Comment' | ||||||||||||||||||||
| 109 | # type => 'StringDetect' | ||||||||||||||||||||
| 110 | 0 | ▶ | if ($self->testStringDetect($text, '<!--', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 111 | 0 | return 1 | |||||||||||||||||||
| 112 | } | ||||||||||||||||||||
| 113 | # String => '<\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*' | ||||||||||||||||||||
| 114 | # attribute => 'Tag' | ||||||||||||||||||||
| 115 | # context => 'Attribute' | ||||||||||||||||||||
| 116 | # type => 'RegExpr' | ||||||||||||||||||||
| 117 | 0 | ▶ | if ($self->testRegExpr($text, '<\\s*\\/?\\s*[a-zA-Z_:][a-zA-Z0-9._:-]*', 0, 0, 0, undef, 0, 'Attribute', 'Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 118 | 0 | return 1 | |||||||||||||||||||
| 119 | } | ||||||||||||||||||||
| 120 | 0 | return 0; | |||||||||||||||||||
| 121 | }; | ||||||||||||||||||||
| 122 | |||||||||||||||||||||
| 123 | sub parseValue { | ||||||||||||||||||||
| 124 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseValue: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||
| 125 | # attribute => 'Tag' | ||||||||||||||||||||
| 126 | # char => '/' | ||||||||||||||||||||
| 127 | # char1 => '>' | ||||||||||||||||||||
| 128 | # context => '#pop#pop' | ||||||||||||||||||||
| 129 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 130 | 0 | ▶ | if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop#pop', 'Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 131 | 0 | return 1 | |||||||||||||||||||
| 132 | } | ||||||||||||||||||||
| 133 | # attribute => 'Tag' | ||||||||||||||||||||
| 134 | # char => '>' | ||||||||||||||||||||
| 135 | # context => '#pop#pop' | ||||||||||||||||||||
| 136 | # type => 'DetectChar' | ||||||||||||||||||||
| 137 | 0 | ▶ | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop', 'Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 138 | 0 | return 1 | |||||||||||||||||||
| 139 | } | ||||||||||||||||||||
| 140 | # attribute => 'Attribute Value' | ||||||||||||||||||||
| 141 | # char => '"' | ||||||||||||||||||||
| 142 | # context => 'Value 2' | ||||||||||||||||||||
| 143 | # type => 'DetectChar' | ||||||||||||||||||||
| 144 | 0 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Value 2', 'Attribute Value')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 145 | 0 | return 1 | |||||||||||||||||||
| 146 | } | ||||||||||||||||||||
| 147 | 0 | return 0; | |||||||||||||||||||
| 148 | }; | ||||||||||||||||||||
| 149 | |||||||||||||||||||||
| 150 | sub parseValue2 { | ||||||||||||||||||||
| 151 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseValue2: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 152 | # attribute => 'Attribute Value' | ||||||||||||||||||||
| 153 | # char => '"' | ||||||||||||||||||||
| 154 | # context => '#pop#pop' | ||||||||||||||||||||
| 155 | # type => 'DetectChar' | ||||||||||||||||||||
| 156 | 0 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop#pop', 'Attribute Value')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 157 | 0 | return 1 | |||||||||||||||||||
| 158 | } | ||||||||||||||||||||
| 159 | 0 | return 0; | |||||||||||||||||||
| 160 | }; | ||||||||||||||||||||
| 161 | |||||||||||||||||||||
| 162 | |||||||||||||||||||||
| 163 | 1 | 1; | |||||||||||||||||||
| 164 | |||||||||||||||||||||
| 165 | __END__ | ||||||||||||||||||||