Kate/ABC.pm

filter: Statementstmt 65.8% 56 / 85 Branchbran 56.5% 26 / 46 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 61.5% 8 / 13 Podpod 0.0% 0 / 10 totaltotal 57.2% 91 / 159 SCAR 40.9
CC
25
Cov
62%
parseNormal
30.8
parseHeader
12.0
parseBar
8.4
CRAP 59.5
« Kate/Octave.pm ↑ Summary Kate/JavaScript.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 'abc.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.10
9 #kate version 2.4
10 #kate author Andrea Primiani (primiani@dag.it)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
12  
13 package Syntax::Highlight::Engine::Kate::ABC;
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 'Bar' => 'Char',
27 'Comment' => 'Comment',
28 'Decoration' => 'Float',
29 'Header' => 'Float',
30 'Lyrics' => 'DataType',
31 'Normal Text' => 'Normal',
32 'Notes' => 'Keyword',
33 'Preprocessor' => 'String',
34 'Sharp' => 'Normal',
35 'Slur' => 'DataType',
36 'String' => 'String',
37 'Tuplet' => 'DataType',
38 });
39 2 $self->contextdata({
40 'Bar' => {
41 callback => \&parseBar,
42 attribute => 'Bar',
43 lineending => '#pop',
44 },
45 'Comment' => {
46 callback => \&parseComment,
47 attribute => 'Comment',
48 lineending => '#pop',
49 },
50 'Header' => {
51 callback => \&parseHeader,
52 attribute => 'Header',
53 },
54 'Header2' => {
55 callback => \&parseHeader2,
56 attribute => 'Header',
57 lineending => '#pop',
58 },
59 'Lyrics' => {
60 callback => \&parseLyrics,
61 attribute => 'Lyrics',
62 lineending => '#pop',
63 },
64 'Normal' => {
65 callback => \&parseNormal,
66 attribute => 'Normal Text',
67 },
68 'Part' => {
69 callback => \&parsePart,
70 attribute => 'Header',
71 lineending => '#pop',
72 },
73 'Preprocessor' => {
74 callback => \&parsePreprocessor,
75 attribute => 'Preprocessor',
76 lineending => '#pop',
77 },
78 });
79 2 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
80 2 $self->basecontext('Normal');
81 2 $self->keywordscase(0);
82 2 $self->initialize;
83 2 bless ($self, $class);
84 2 return $self;
85 }
86  
87 sub language {
88 0 ▶ return 'ABC';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
89 }
90  
91 sub parseBar {
92 46 ▶ my ($self, $text) = @_;
Subroutine parseBar: called CC=7 SCAR=21.3
Pod undocumented
93 # attribute => 'Normal Text'
94 # char => '"'
95 # context => '#pop'
96 # type => 'DetectChar'
97 46 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "#pop", "Normal Text")) 0 46 46
98 0 return 1
99 }
100 # String => '[A-Ga-gZz]'
101 # attribute => 'Normal Text'
102 # context => '#pop'
103 # type => 'RegExpr'
104 46 ▶ if ($self->testRegExpr($text, '[A-Ga-gZz]', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[A-Ga-gZz]", 0, 0, 0, undef, 0, "#pop", "Normal Text")) 40 6 46
105 40 return 1
106 }
107 # attribute => 'Normal Text'
108 # char => ' '
109 # context => '#pop'
110 # type => 'DetectChar'
111 6 ▶ if ($self->testDetectChar($text, ' ', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, " ", 0, 0, 0, undef, 0, "#pop", "Normal Text")) 0 6 6
112 0 return 1
113 }
114 # attribute => 'Decoration'
115 # char => '!'
116 # char1 => '!'
117 # context => '#stay'
118 # type => 'RangeDetect'
119 6 ▶ if ($self->testRangeDetect($text, '!', '!', 0, 0, undef, 0, '#stay', 'Decoration')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRangeDetect($text, "!", "!", 0, 0, undef, 0, "#stay", "Decoration")) 0 6 6
120 0 return 1
121 }
122 # String => '()'
123 # attribute => 'Slur'
124 # context => '#stay'
125 # type => 'AnyChar'
126 6 ▶ if ($self->testAnyChar($text, '()', 0, 0, undef, 0, '#stay', 'Slur')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "()", 0, 0, undef, 0, "#stay", "Slur")) 0 6 6
127 0 return 1
128 }
129 # String => ':*\|*[1-9]|/*\|'
130 # attribute => 'Bar'
131 # context => '#pop'
132 # type => 'RegExpr'
133 6 ▶ if ($self->testRegExpr($text, ':*\\|*[1-9]|/*\\|', 0, 0, 0, undef, 0, '#pop', 'Bar')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, ":*\\|*[1-9]|/*\\|", 0, 0, 0, undef, 0, "#pop", "Bar")) 4 2 6
134 4 return 1
135 }
136 2 return 0;
137 };
138  
139 sub parseComment {
140 114 ▶ my ($self, $text) = @_;
Subroutine parseComment: called CC=1 SCAR=0.0
Pod undocumented
141 114 return 0;
142 };
143  
144 sub parseHeader {
145 0 ▶ my ($self, $text) = @_;
Subroutine parseHeader: not called CC=3 SCAR=24.8
Pod undocumented
146 # String => 'K:.+'
147 # attribute => 'Header'
148 # column => '0'
149 # context => '#pop'
150 # endRegion => 'header'
151 # type => 'RegExpr'
152 0 ▶ if ($self->testRegExpr($text, 'K:.+', 0, 0, 0, 0, 0, '#pop', 'Header')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "K:.+", 0, 0, 0, 0, 0, "#pop", "Header")) 0 0 0
153 0 return 1
154 }
155 # attribute => 'Header'
156 # char => ']'
157 # context => '#pop'
158 # type => 'DetectChar'
159 0 ▶ if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Header')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "]", 0, 0, 0, undef, 0, "#pop", "Header")) 0 0 0
160 0 return 1
161 }
162 0 return 0;
163 };
164  
165 sub parseHeader2 {
166 98 ▶ my ($self, $text) = @_;
Subroutine parseHeader2: called CC=1 SCAR=0.0
Pod undocumented
167 98 return 0;
168 };
169  
170 sub parseLyrics {
171 0 ▶ my ($self, $text) = @_;
Subroutine parseLyrics: not called CC=1 SCAR=6.9
Pod undocumented
172 0 return 0;
173 };
174  
175 sub parseNormal {
176 352 ▶ my ($self, $text) = @_;
Subroutine parseNormal: called CC=16 SCAR=34.3
Pod undocumented
177 # String => '\([23456789]:?[23456789]?:?[23456789]?'
178 # attribute => 'Tuplet'
179 # context => '#stay'
180 # type => 'RegExpr'
181 352 ▶ if ($self->testRegExpr($text, '\\([23456789]:?[23456789]?:?[23456789]?', 0, 0, 0, undef, 0, '#stay', 'Tuplet')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\([23456789]:?[23456789]?:?[23456789]?", 0, 0, 0, undef, 0, "#stay", "Tuplet")) 0 352 352
182 0 return 1
183 }
184 # attribute => 'String'
185 # char => '"'
186 # char1 => '"'
187 # context => '#stay'
188 # type => 'RangeDetect'
189 352 ▶ if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRangeDetect($text, "\"", "\"", 0, 0, undef, 0, "#stay", "String")) 0 352 352
190 0 return 1
191 }
192 # attribute => 'Decoration'
193 # char => '!'
194 # char1 => '!'
195 # context => '#stay'
196 # type => 'RangeDetect'
197 352 ▶ if ($self->testRangeDetect($text, '!', '!', 0, 0, undef, 0, '#stay', 'Decoration')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRangeDetect($text, "!", "!", 0, 0, undef, 0, "#stay", "Decoration")) 0 352 352
198 0 return 1
199 }
200 # String => '\[[ABCGHILMNOQRSTUVZ]:'
201 # attribute => 'Header'
202 # context => 'Header'
203 # type => 'RegExpr'
204 352 ▶ if ($self->testRegExpr($text, '\\[[ABCGHILMNOQRSTUVZ]:', 0, 0, 0, undef, 0, 'Header', 'Header')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\[[ABCGHILMNOQRSTUVZ]:", 0, 0, 0, undef, 0, "Header", "Header")) 0 352 352
205 0 return 1
206 }
207 # String => '[ABCGHILMNOPQRSTUVZ]:'
208 # attribute => 'Header'
209 # context => 'Header2'
210 # type => 'RegExpr'
211 352 ▶ if ($self->testRegExpr($text, '[ABCGHILMNOPQRSTUVZ]:', 0, 0, 0, undef, 0, 'Header2', 'Header')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[ABCGHILMNOPQRSTUVZ]:", 0, 0, 0, undef, 0, "Header2", "Header")) 12 340 352
212 12 return 1
213 }
214 # attribute => 'Header'
215 # beginRegion => 'header'
216 # char => 'X'
217 # char1 => ':'
218 # column => '0'
219 # context => 'Header'
220 # type => 'Detect2Chars'
221 340 ▶ if ($self->testDetect2Chars($text, 'X', ':', 0, 0, 0, 0, 0, 'Header', 'Header')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "X", ":", 0, 0, 0, 0, 0, "Header", "Header")) 0 340 340
222 0 return 1
223 }
224 # String => '|:['
225 # attribute => 'Bar'
226 # context => 'Bar'
227 # type => 'AnyChar'
228 340 ▶ if ($self->testAnyChar($text, '|:[', 0, 0, undef, 0, 'Bar', 'Bar')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "|:[", 0, 0, undef, 0, "Bar", "Bar")) 44 296 340
229 44 return 1
230 }
231 # attribute => 'Bar'
232 # char => ']'
233 # context => '#stay'
234 # type => 'DetectChar'
235 296 ▶ if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#stay', 'Bar')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "]", 0, 0, 0, undef, 0, "#stay", "Bar")) 0 296 296
236 0 return 1
237 }
238 # String => '()'
239 # attribute => 'Slur'
240 # context => '#stay'
241 # type => 'AnyChar'
242 296 ▶ if ($self->testAnyChar($text, '()', 0, 0, undef, 0, '#stay', 'Slur')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "()", 0, 0, undef, 0, "#stay", "Slur")) 0 296 296
243 0 return 1
244 }
245 # String => '{}'
246 # attribute => 'Slur'
247 # context => '#stay'
248 # type => 'AnyChar'
249 296 ▶ if ($self->testAnyChar($text, '{}', 0, 0, undef, 0, '#stay', 'Slur')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "{}", 0, 0, undef, 0, "#stay", "Slur")) 0 296 296
250 0 return 1
251 }
252 # attribute => 'Lyrics'
253 # char => 'W'
254 # char1 => ':'
255 # context => 'Lyrics'
256 # type => 'Detect2Chars'
257 296 ▶ if ($self->testDetect2Chars($text, 'W', ':', 0, 0, 0, undef, 0, 'Lyrics', 'Lyrics')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "W", ":", 0, 0, 0, undef, 0, "Lyrics", "Lyrics")) 0 296 296
258 0 return 1
259 }
260 # attribute => 'Lyrics'
261 # char => 'w'
262 # char1 => ':'
263 # context => 'Lyrics'
264 # type => 'Detect2Chars'
265 296 ▶ if ($self->testDetect2Chars($text, 'w', ':', 0, 0, 0, undef, 0, 'Lyrics', 'Lyrics')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "w", ":", 0, 0, 0, undef, 0, "Lyrics", "Lyrics")) 0 296 296
266 0 return 1
267 }
268 # attribute => 'Preprocessor'
269 # char => '%'
270 # char1 => '%'
271 # context => 'Preprocessor'
272 # type => 'Detect2Chars'
273 296 ▶ if ($self->testDetect2Chars($text, '%', '%', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "%", "%", 0, 0, 0, undef, 0, "Preprocessor", "Preprocessor")) 0 296 296
274 0 return 1
275 }
276 # attribute => 'Comment'
277 # char => '%'
278 # context => 'Comment'
279 # type => 'DetectChar'
280 296 ▶ if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "%", 0, 0, 0, undef, 0, "Comment", "Comment")) 2 294 296
281 2 return 1
282 }
283 # String => '[_|\^]?[_|=|\^][A-Ga-g]'
284 # attribute => 'Sharp'
285 # context => '#stay'
286 # type => 'RegExpr'
287 294 ▶ if ($self->testRegExpr($text, '[_|\\^]?[_|=|\\^][A-Ga-g]', 0, 0, 0, undef, 0, '#stay', 'Sharp')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[_|\\^]?[_|=|\\^][A-Ga-g]", 0, 0, 0, undef, 0, "#stay", "Sharp")) 0 294 294
288 0 return 1
289 }
290 294 return 0;
291 };
292  
293 sub parsePart {
294 0 ▶ my ($self, $text) = @_;
Subroutine parsePart: not called CC=1 SCAR=6.9
Pod undocumented
295 0 return 0;
296 };
297  
298 sub parsePreprocessor {
299 0 ▶ my ($self, $text) = @_;
Subroutine parsePreprocessor: not called CC=1 SCAR=6.9
Pod undocumented
300 0 return 0;
301 };
302  
303  
304 1 1;
305  
306 __END__
« Kate/Octave.pm ↑ Summary Kate/JavaScript.pm »