Kate/Pascal.pm

filter: Statementstmt 30.5% 26 / 85 Branchbran 0.0% 0 / 44 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 4 / 12 Podpod 0.0% 0 / 9 totaltotal 20.0% 31 / 155 CC 24 SCAR 46.7
CC
24
Cov
20%
parseNormal
240.0
parseComment1
12.0
parseComment2
12.0
CRAP 106.5
« Kate/Debian_Control.pm ↑ Summary Kate/Javadoc.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 'pascal.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.20
9 #kate version 2.3
10 #generated: Sun Feb 3 22:02:05 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::Pascal;
13  
14 1 our $VERSION = '0.16';
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 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
21 1 my $proto = shift;
22 1 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
23 1 my $self = $class->SUPER::new(@_);
24 1 $self->attributes({
25 'Alert' => 'Alert',
26 'Comment' => 'Comment',
27 'Directive' => 'Others',
28 'ISO/Delphi Extended' => 'Function',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'Normal',
31 'Number' => 'DecVal',
32 'String' => 'String',
33 'Type' => 'DataType',
34 });
35 1 $self->listAdd('ISO/Delphi Extended',
36 'as',
37 'bindable',
38 'constructor',
39 'destructor',
40 'except',
41 'export',
42 'finally',
43 'implementation',
44 'import',
45 'inherited',
46 'inline',
47 'interface',
48 'is',
49 'module',
50 'on',
51 'only',
52 'otherwise',
53 'private',
54 'property',
55 'protected',
56 'public',
57 'qualified',
58 'raise',
59 'restricted',
60 'shl',
61 'shr',
62 'threadvar',
63 'try',
64 );
65 1 $self->listAdd('attention',
66 '###',
67 'FIXME',
68 'TODO',
69 );
70 1 $self->listAdd('keywords',
71 'and',
72 'array',
73 'asm',
74 'at',
75 'automated',
76 'break',
77 'case',
78 'const',
79 'continue',
80 'dispinterface',
81 'dispose',
82 'div',
83 'do',
84 'downto',
85 'else',
86 'exit',
87 'false',
88 'file',
89 'finalization',
90 'for',
91 'function',
92 'goto',
93 'if',
94 'in',
95 'initialization',
96 'label',
97 'library',
98 'mod',
99 'new',
100 'nil',
101 'not',
102 'of',
103 'operator',
104 'or',
105 'packed',
106 'procedure',
107 'program',
108 'published',
109 'record',
110 'repeat',
111 'resourcestring',
112 'self',
113 'set',
114 'then',
115 'to',
116 'true',
117 'type',
118 'unit',
119 'until',
120 'uses',
121 'var',
122 'while',
123 'with',
124 'xor',
125 );
126 1 $self->listAdd('types',
127 'AnsiChar',
128 'AnsiString',
129 'Boolean',
130 'Byte',
131 'ByteBool',
132 'Cardinal',
133 'Char',
134 'Comp',
135 'Currency',
136 'Double',
137 'Extended',
138 'File',
139 'Int64',
140 'Integer',
141 'LongBool',
142 'LongInt',
143 'LongWord',
144 'Pointer',
145 'Real',
146 'Real48',
147 'ShortInt',
148 'ShortString',
149 'Single',
150 'SmallInt',
151 'String',
152 'Text',
153 'Variant',
154 'WideChar',
155 'WideString',
156 'Word',
157 'WordBool',
158 );
159 1 $self->contextdata({
160 'Comment1' => {
161 callback => \&parseComment1,
162 attribute => 'Comment',
163 },
164 'Comment2' => {
165 callback => \&parseComment2,
166 attribute => 'Comment',
167 },
168 'Comment3' => {
169 callback => \&parseComment3,
170 attribute => 'Comment',
171 lineending => '#pop',
172 },
173 'Normal' => {
174 callback => \&parseNormal,
175 attribute => 'Normal Text',
176 },
177 'Prep1' => {
178 callback => \&parsePrep1,
179 attribute => 'Directive',
180 lineending => '#pop',
181 },
182 'Prep2' => {
183 callback => \&parsePrep2,
184 attribute => 'Directive',
185 lineending => '#pop',
186 },
187 'String' => {
188 callback => \&parseString,
189 attribute => 'String',
190 lineending => '#pop',
191 },
192 });
193 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
194 1 $self->basecontext('Normal');
195 1 $self->keywordscase(0);
196 1 $self->initialize;
197 1 bless ($self, $class);
198 1 return $self;
199 }
200  
201 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
202 0 return 'Pascal';
203 }
204  
205 0 ▶sub parseComment1 {
Subroutine parseComment1: not called CC=3 SCAR=24.8
Pod undocumented
206 0 my ($self, $text) = @_;
207 # String => 'attention'
208 # attribute => 'Alert'
209 # context => '#stay'
210 # type => 'keyword'
211 0 ▶ if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "attention", 0, undef, 0, "#stay", "Alert")) 0 0 0
212 0 return 1
213 }
214 # attribute => 'Comment'
215 # char => '}'
216 # context => '#pop'
217 # endRegion => 'Region2'
218 # type => 'DetectChar'
219 0 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop", "Comment")) 0 0 0
220 0 return 1
221 }
222 0 return 0;
223 };
224  
225 0 ▶sub parseComment2 {
Subroutine parseComment2: not called CC=3 SCAR=24.8
Pod undocumented
226 0 my ($self, $text) = @_;
227 # String => 'attention'
228 # attribute => 'Alert'
229 # context => '#stay'
230 # type => 'keyword'
231 0 ▶ if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "attention", 0, undef, 0, "#stay", "Alert")) 0 0 0
232 0 return 1
233 }
234 # attribute => 'Comment'
235 # char => '*'
236 # char1 => ')'
237 # context => '#pop'
238 # endRegion => 'Region3'
239 # type => 'Detect2Chars'
240 0 ▶ 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")) 0 0 0
241 0 return 1
242 }
243 0 return 0;
244 };
245  
246 0 ▶sub parseComment3 {
Subroutine parseComment3: not called CC=2 SCAR=17.9
Pod undocumented
247 0 my ($self, $text) = @_;
248 # String => 'attention'
249 # attribute => 'Alert'
250 # context => '#stay'
251 # type => 'keyword'
252 0 ▶ if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "attention", 0, undef, 0, "#stay", "Alert")) 0 0 0
253 0 return 1
254 }
255 0 return 0;
256 };
257  
258 0 ▶sub parseNormal {
Subroutine parseNormal: not called CC=15 SCAR=54.8
Pod undocumented
259 0 my ($self, $text) = @_;
260 # String => '\b(begin|case|record)(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//))'
261 # attribute => 'Keyword'
262 # beginRegion => 'Region1'
263 # context => '#stay'
264 # insensitive => 'true'
265 # type => 'RegExpr'
266 0 ▶ if ($self->testRegExpr($text, '\\b(begin|case|record)(?=(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*([\\s]|$|//))', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\b(begin|case|record)(?=(\\{[^}]*(\\}|\$)|\\(\\*.*(\\*\\)|\$))*([\\s]|\$|//))", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
267 0 return 1
268 }
269 # String => '\b((object|class)(?=(\(.*\))?(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*;?([\s]|$|//))|try(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//)))'
270 # attribute => 'ISO/Delphi Extended'
271 # beginRegion => 'Region1'
272 # context => '#stay'
273 # insensitive => 'true'
274 # type => 'RegExpr'
275 0 ▶ if ($self->testRegExpr($text, '\\b((object|class)(?=(\\(.*\\))?(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*;?([\\s]|$|//))|try(?=(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*([\\s]|$|//)))', 1, 0, 0, undef, 0, '#stay', 'ISO/Delphi Extended')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\b((object|class)(?=(\\(.*\\))?(\\{[^}]*(\\}|\$)|\\(\\*.*(\\*\\)|\$))*;?([\\s]|\$|//))|try(?=(\\{[^}]*(\\}|\$)|\\(\\*.*(\\*\\)|\$))*([\\s]|\$|//)))", 1, 0, 0, undef, 0, "#stay", "ISO/Delphi Extended")) 0 0 0
276 0 return 1
277 }
278 # String => '\bend(?=((\{[^}]*(\}|$)|\(\*.*(\*\)|$))*)([.;\s]|$)|//|$)'
279 # attribute => 'Keyword'
280 # context => '#stay'
281 # endRegion => 'Region1'
282 # insensitive => 'true'
283 # type => 'RegExpr'
284 0 ▶ if ($self->testRegExpr($text, '\\bend(?=((\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*)([.;\\s]|$)|//|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bend(?=((\\{[^}]*(\\}|\$)|\\(\\*.*(\\*\\)|\$))*)([.;\\s]|\$)|//|\$)", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
285 0 return 1
286 }
287 # String => 'keywords'
288 # attribute => 'Keyword'
289 # context => '#stay'
290 # type => 'keyword'
291 0 ▶ if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywords", 0, undef, 0, "#stay", "Keyword")) 0 0 0
292 0 return 1
293 }
294 # String => 'ISO/Delphi Extended'
295 # attribute => 'ISO/Delphi Extended'
296 # context => '#stay'
297 # type => 'keyword'
298 0 ▶ if ($self->testKeyword($text, 'ISO/Delphi Extended', 0, undef, 0, '#stay', 'ISO/Delphi Extended')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "ISO/Delphi Extended", 0, undef, 0, "#stay", "ISO/Delphi Extended")) 0 0 0
299 0 return 1
300 }
301 # String => 'types'
302 # attribute => 'Type'
303 # context => '#stay'
304 # type => 'keyword'
305 0 ▶ if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "types", 0, undef, 0, "#stay", "Type")) 0 0 0
306 0 return 1
307 }
308 # attribute => 'Number'
309 # context => '#stay'
310 # type => 'Float'
311 0 ▶ if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testFloat($text, 0, undef, 0, "#stay", "Number")) 0 0 0
312 0 return 1
313 }
314 # attribute => 'Number'
315 # context => '#stay'
316 # type => 'Int'
317 0 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Number")) 0 0 0
318 0 return 1
319 }
320 # attribute => 'String'
321 # char => '''
322 # context => 'String'
323 # type => 'DetectChar'
324 0 ▶ if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "String", "String")) 0 0 0
325 0 return 1
326 }
327 # String => '(*$'
328 # attribute => 'Directive'
329 # context => 'Prep1'
330 # type => 'StringDetect'
331 0 ▶ if ($self->testStringDetect($text, '(*$', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "(*\$", 0, 0, 0, undef, 0, "Prep1", "Directive")) 0 0 0
332 0 return 1
333 }
334 # attribute => 'Directive'
335 # char => '{'
336 # char1 => '$'
337 # context => 'Prep2'
338 # type => 'Detect2Chars'
339 0 ▶ if ($self->testDetect2Chars($text, '{', '$', 0, 0, 0, undef, 0, 'Prep2', 'Directive')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "{", "\$", 0, 0, 0, undef, 0, "Prep2", "Directive")) 0 0 0
340 0 return 1
341 }
342 # attribute => 'Comment'
343 # beginRegion => 'Region2'
344 # char => '{'
345 # context => 'Comment1'
346 # type => 'DetectChar'
347 0 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Comment1', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "Comment1", "Comment")) 0 0 0
348 0 return 1
349 }
350 # attribute => 'Comment'
351 # beginRegion => 'Region3'
352 # char => '('
353 # char1 => '*'
354 # context => 'Comment2'
355 # type => 'Detect2Chars'
356 0 ▶ if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "(", "*", 0, 0, 0, undef, 0, "Comment2", "Comment")) 0 0 0
357 0 return 1
358 }
359 # attribute => 'Comment'
360 # char => '/'
361 # char1 => '/'
362 # context => 'Comment3'
363 # type => 'Detect2Chars'
364 0 ▶ if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment3', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", "/", 0, 0, 0, undef, 0, "Comment3", "Comment")) 0 0 0
365 0 return 1
366 }
367 0 return 0;
368 };
369  
370 0 ▶sub parsePrep1 {
Subroutine parsePrep1: not called CC=2 SCAR=17.9
Pod undocumented
371 0 my ($self, $text) = @_;
372 # attribute => 'Directive'
373 # char => '*'
374 # char1 => ')'
375 # context => '#pop'
376 # type => 'Detect2Chars'
377 0 ▶ if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Directive')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "*", ")", 0, 0, 0, undef, 0, "#pop", "Directive")) 0 0 0
378 0 return 1
379 }
380 0 return 0;
381 };
382  
383 0 ▶sub parsePrep2 {
Subroutine parsePrep2: not called CC=2 SCAR=17.9
Pod undocumented
384 0 my ($self, $text) = @_;
385 # attribute => 'Directive'
386 # char => '}'
387 # context => '#pop'
388 # type => 'DetectChar'
389 0 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Directive')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop", "Directive")) 0 0 0
390 0 return 1
391 }
392 0 return 0;
393 };
394  
395 0 ▶sub parseString {
Subroutine parseString: not called CC=2 SCAR=17.9
Pod undocumented
396 0 my ($self, $text) = @_;
397 # attribute => 'String'
398 # char => '''
399 # context => '#pop'
400 # type => 'DetectChar'
401 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
402 0 return 1
403 }
404 0 return 0;
405 };
406  
407  
408 1 1;
409  
410 __END__
« Kate/Debian_Control.pm ↑ Summary Kate/Javadoc.pm »