Kate/Tcl_Tk.pm

filter: Statementstmt 88.7% 63 / 71 Branchbran 83.3% 35 / 42 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 4 totaltotal 81.4% 105 / 129 SCAR 32.1
CC
23
Cov
85%
parseBase
21.4
parseString
4.0
new
2.0
CRAP 24.7
« Kate/Xorg_Configuration.pm ↑ Summary Kate/Intel_x86_NASM.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 'tcl.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.08
9 #kate version 2.4
10 #generated: Sun Feb 3 22:02:06 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::Tcl_Tk;
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 2 ▶ my $proto = shift;
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
22 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
23 2 my $self = $class->SUPER::new(@_);
24 2 $self->attributes({
25 'Char' => 'Char',
26 'Comment' => 'Comment',
27 'Decimal' => 'DecVal',
28 'Float' => 'Float',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'Normal',
31 'Parameter' => 'Others',
32 'Region Marker' => 'RegionMarker',
33 'String' => 'String',
34 'Variable' => 'DataType',
35 });
36 2 $self->listAdd('keywords',
37 'AppleScript',
38 'OptProc',
39 'after',
40 'append',
41 'argc',
42 'argv',
43 'array',
44 'auto_execk',
45 'auto_load',
46 'auto_mkindex',
47 'auto_path',
48 'auto_reset',
49 'beep',
50 'bell',
51 'bgerror',
52 'binary',
53 'bind',
54 'bindtags',
55 'break',
56 'button',
57 'canvas',
58 'case',
59 'catch',
60 'cd',
61 'checkbutton',
62 'clipboard',
63 'clock',
64 'close',
65 'concat',
66 'console',
67 'continue',
68 'dde',
69 'destroy',
70 'else',
71 'elseif',
72 'encoding',
73 'entry',
74 'env',
75 'eof',
76 'error',
77 'errorCode',
78 'errorInfo',
79 'eval',
80 'event',
81 'exec',
82 'exit',
83 'expr',
84 'fblocked',
85 'fconfigure',
86 'fcopy',
87 'file',
88 'fileevent',
89 'flush',
90 'focus',
91 'font',
92 'for',
93 'foreach',
94 'format',
95 'frame',
96 'gets',
97 'glob',
98 'global',
99 'grab',
100 'grid',
101 'history',
102 'if',
103 'image',
104 'incr',
105 'info',
106 'interp',
107 'join',
108 'label',
109 'lappend',
110 'lindex',
111 'linsert',
112 'list',
113 'listbox',
114 'llength',
115 'load',
116 'lower',
117 'lrange',
118 'lreplace',
119 'lsearch',
120 'lsort',
121 'menu',
122 'menubutton',
123 'message',
124 'namespace',
125 'open',
126 'option',
127 'pack',
128 'package',
129 'parray',
130 'pid',
131 'pkg_mkindex',
132 'place',
133 'proc',
134 'puts',
135 'pwd',
136 'radiobutton',
137 'raise',
138 'read',
139 'regexp',
140 'registry',
141 'regsub',
142 'rename',
143 'resource',
144 'return',
145 'scale',
146 'scan',
147 'scrollbar',
148 'seek',
149 'selection',
150 'send',
151 'set',
152 'socket',
153 'source',
154 'split',
155 'string',
156 'subst',
157 'switch',
158 'tclLog',
159 'tcl_endOfWord',
160 'tcl_findLibrary',
161 'tcl_library',
162 'tcl_patchLevel',
163 'tcl_platform',
164 'tcl_precision',
165 'tcl_rcFileName',
166 'tcl_rcRsrcName',
167 'tcl_startOfNextWord',
168 'tcl_startOfPreviousWord',
169 'tcl_traceCompile',
170 'tcl_traceExec',
171 'tcl_version',
172 'tcl_wordBreakAfter',
173 'tcl_wordBreakBefore',
174 'tell',
175 'text',
176 'time',
177 'tk',
178 'tkTabToWindow',
179 'tk_chooseColor',
180 'tk_chooseDirectory',
181 'tk_focusFollowMouse',
182 'tk_focusNext',
183 'tk_focusPrev',
184 'tk_getOpenFile',
185 'tk_getSaveFile',
186 'tk_library',
187 'tk_messageBox',
188 'tk_optionMenu',
189 'tk_patchLevel',
190 'tk_popup',
191 'tk_strictMotif',
192 'tk_version',
193 'tkwait',
194 'toplevel',
195 'trace',
196 'unknown',
197 'unset',
198 'update',
199 'uplevel',
200 'upvar',
201 'variable',
202 'vwait',
203 'while',
204 'winfo',
205 'wm',
206 );
207 2 $self->listAdd('keywords-opt',
208 'activate',
209 'actual',
210 'add',
211 'addtag',
212 'append',
213 'appname',
214 'args',
215 'aspect',
216 'atime',
217 'atom',
218 'atomname',
219 'attributes',
220 'bbox',
221 'bind',
222 'body',
223 'broadcast',
224 'bytelength',
225 'cancel',
226 'canvasx',
227 'canvasy',
228 'caret',
229 'cells',
230 'cget',
231 'channels',
232 'children',
233 'class',
234 'clear',
235 'clicks',
236 'client',
237 'clone',
238 'cmdcount',
239 'colormapfull',
240 'colormapwindows',
241 'command',
242 'commands',
243 'compare',
244 'complete',
245 'configure',
246 'containing',
247 'convertfrom',
248 'convertto',
249 'coords',
250 'copy',
251 'create',
252 'current',
253 'curselection',
254 'dchars',
255 'debug',
256 'default',
257 'deiconify',
258 'delete',
259 'delta',
260 'depth',
261 'deselect',
262 'dirname',
263 'dlineinfo',
264 'dtag',
265 'dump',
266 'edit',
267 'entrycget',
268 'entryconfigure',
269 'equal',
270 'executable',
271 'exists',
272 'extension',
273 'families',
274 'find',
275 'first',
276 'flash',
277 'focus',
278 'focusmodel',
279 'forget',
280 'format',
281 'fpixels',
282 'fraction',
283 'frame',
284 'functions',
285 'generate',
286 'geometry',
287 'get',
288 'gettags',
289 'globals',
290 'grid',
291 'group',
292 'handle',
293 'height',
294 'hide',
295 'hostname',
296 'iconbitmap',
297 'iconify',
298 'iconmask',
299 'iconname',
300 'iconposition',
301 'iconwindow',
302 'icursor',
303 'id',
304 'identify',
305 'idle',
306 'ifneeded',
307 'image',
308 'index',
309 'info',
310 'insert',
311 'interps',
312 'inuse',
313 'invoke',
314 'is',
315 'isdirectory',
316 'isfile',
317 'ismapped',
318 'itemcget',
319 'itemconfigure',
320 'join',
321 'keys',
322 'last',
323 'length',
324 'level',
325 'library',
326 'link',
327 'loaded',
328 'locals',
329 'lower',
330 'lstat',
331 'manager',
332 'map',
333 'mark',
334 'match',
335 'maxsize',
336 'measure',
337 'metrics',
338 'minsize',
339 'mkdir',
340 'move',
341 'mtime',
342 'name',
343 'nameofexecutable',
344 'names',
345 'nativename',
346 'nearest',
347 'normalize',
348 'number',
349 'overrideredirect',
350 'own',
351 'owned',
352 'panecget',
353 'paneconfigure',
354 'panes',
355 'parent',
356 'patchlevel',
357 'pathname',
358 'pathtype',
359 'pixels',
360 'pointerx',
361 'pointerxy',
362 'pointery',
363 'positionfrom',
364 'post',
365 'postcascade',
366 'postscript',
367 'present',
368 'procs',
369 'protocol',
370 'provide',
371 'proxy',
372 'raise',
373 'range',
374 'readable',
375 'readlink',
376 'release',
377 'remove',
378 'rename',
379 'repeat',
380 'replace',
381 'reqheight',
382 'require',
383 'reqwidth',
384 'resizable',
385 'rgb',
386 'rootname',
387 'rootx',
388 'rooty',
389 'scale',
390 'scaling',
391 'scan',
392 'screen',
393 'screencells',
394 'screendepth',
395 'screenheight',
396 'screenmmheight',
397 'screenmmwidth',
398 'screenvisual',
399 'screenwidth',
400 'script',
401 'search',
402 'seconds',
403 'see',
404 'select',
405 'selection',
406 'separator',
407 'server',
408 'set',
409 'sharedlibextension',
410 'show',
411 'size',
412 'sizefrom',
413 'split',
414 'stackorder',
415 'stat',
416 'state',
417 'status',
418 'system',
419 'tag',
420 'tail',
421 'tclversion',
422 'title',
423 'tolower',
424 'toplevel',
425 'totitle',
426 'toupper',
427 'transient',
428 'trim',
429 'trimleft',
430 'trimright',
431 'type',
432 'types',
433 'unknown',
434 'unpost',
435 'useinputmethods',
436 'validate',
437 'values',
438 'variable',
439 'vars',
440 'vcompare',
441 'vdelete',
442 'versions',
443 'viewable',
444 'vinfo',
445 'visual',
446 'visualid',
447 'visualsavailable',
448 'volumes',
449 'vrootheight',
450 'vrootwidth',
451 'vrootx',
452 'vrooty',
453 'vsatisfies',
454 'width',
455 'window',
456 'windowingsystem',
457 'withdraw',
458 'wordend',
459 'wordstart',
460 'writable',
461 'x',
462 'xview',
463 'y',
464 );
465 2 $self->contextdata({
466 'Base' => {
467 callback => \&parseBase,
468 attribute => 'Normal Text',
469 },
470 'String' => {
471 callback => \&parseString,
472 attribute => 'String',
473 },
474 });
475 2 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
476 2 $self->basecontext('Base');
477 2 $self->keywordscase(0);
478 2 $self->initialize;
479 2 bless ($self, $class);
480 2 return $self;
481 }
482  
483 sub language {
484 0 ▶ return 'Tcl/Tk';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
485 }
486  
487 sub parseBase {
488 1114 ▶ my ($self, $text) = @_;
Subroutine parseBase: called CC=19 SCAR=30.7
Pod undocumented
489 # String => '#\s*BEGIN.*$'
490 # attribute => 'Region Marker'
491 # beginRegion => 'region'
492 # context => '#stay'
493 # firstNonSpace => 'true'
494 # type => 'RegExpr'
495 1114 ▶ if ($self->testRegExpr($text, '#\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "#\\s*BEGIN.*\$", 0, 0, 0, undef, 1, "#stay", "Region Marker")) 0 1114 1114
496 0 return 1
497 }
498 # String => '#\s*END.*$'
499 # attribute => 'Region Marker'
500 # context => '#stay'
501 # endRegion => 'region'
502 # firstNonSpace => 'true'
503 # type => 'RegExpr'
504 1114 ▶ if ($self->testRegExpr($text, '#\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "#\\s*END.*\$", 0, 0, 0, undef, 1, "#stay", "Region Marker")) 0 1114 1114
505 0 return 1
506 }
507 # String => 'keywords'
508 # attribute => 'Keyword'
509 # context => '#stay'
510 # type => 'keyword'
511 1114 ▶ if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywords", 0, undef, 0, "#stay", "Keyword")) 68 1046 1114
512 68 return 1
513 }
514 # String => 'keywords-opt'
515 # attribute => 'Parameter'
516 # context => '#stay'
517 # type => 'keyword'
518 1046 ▶ if ($self->testKeyword($text, 'keywords-opt', 0, undef, 0, '#stay', 'Parameter')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywords-opt", 0, undef, 0, "#stay", "Parameter")) 16 1030 1046
519 16 return 1
520 }
521 # attribute => 'Float'
522 # context => '#stay'
523 # type => 'Float'
524 1030 ▶ if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testFloat($text, 0, undef, 0, "#stay", "Float")) 10 1020 1030
525 10 return 1
526 }
527 # attribute => 'Decimal'
528 # context => '#stay'
529 # type => 'Int'
530 1020 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Decimal")) 0 1020 1020
531 0 return 1
532 }
533 # String => '\\.'
534 # attribute => 'Char'
535 # context => '#stay'
536 # type => 'RegExpr'
537 1020 ▶ if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\.", 0, 0, 0, undef, 0, "#stay", "Char")) 14 1006 1020
538 14 return 1
539 }
540 # String => '\W-\w+'
541 # attribute => 'Parameter'
542 # context => '#stay'
543 # type => 'RegExpr'
544 1006 ▶ if ($self->testRegExpr($text, '\\W-\\w+', 0, 0, 0, undef, 0, '#stay', 'Parameter')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\W-\\w+", 0, 0, 0, undef, 0, "#stay", "Parameter")) 0 1006 1006
545 0 return 1
546 }
547 # String => '\$\{[^\}]+\}'
548 # attribute => 'Variable'
549 # context => '#stay'
550 # type => 'RegExpr'
551 1006 ▶ if ($self->testRegExpr($text, '\\$\\{[^\\}]+\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\$\\{[^\\}]+\\}", 0, 0, 0, undef, 0, "#stay", "Variable")) 4 1002 1006
552 4 return 1
553 }
554 # String => '\$(::)?[\S\D]\w+'
555 # attribute => 'Variable'
556 # context => '#stay'
557 # type => 'RegExpr'
558 1002 ▶ if ($self->testRegExpr($text, '\\$(::)?[\\S\\D]\\w+', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\$(::)?[\\S\\D]\\w+", 0, 0, 0, undef, 0, "#stay", "Variable")) 4 998 1002
559 4 return 1
560 }
561 # String => '[^\\]""'
562 # attribute => 'String'
563 # context => '#stay'
564 # type => 'RegExpr'
565 998 ▶ if ($self->testRegExpr($text, '[^\\\\]""', 0, 0, 0, undef, 0, '#stay', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[^\\\\]\"\"", 0, 0, 0, undef, 0, "#stay", "String")) 0 998 998
566 0 return 1
567 }
568 # String => '[^\\]"'
569 # attribute => 'String'
570 # context => 'String'
571 # type => 'RegExpr'
572 998 ▶ if ($self->testRegExpr($text, '[^\\\\]"', 0, 0, 0, undef, 0, 'String', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[^\\\\]\"", 0, 0, 0, undef, 0, "String", "String")) 8 990 998
573 8 return 1
574 }
575 # String => '#.*$'
576 # attribute => 'Comment'
577 # context => '#stay'
578 # firstNonSpace => 'true'
579 # type => 'RegExpr'
580 990 ▶ if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "#.*\$", 0, 0, 0, undef, 1, "#stay", "Comment")) 0 990 990
581 0 return 1
582 }
583 # String => ';\s*#.*$'
584 # attribute => 'Comment'
585 # context => '#stay'
586 # type => 'RegExpr'
587 990 ▶ if ($self->testRegExpr($text, ';\\s*#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, ";\\s*#.*\$", 0, 0, 0, undef, 0, "#stay", "Comment")) 0 990 990
588 0 return 1
589 }
590 # attribute => 'Keyword'
591 # beginRegion => 'block'
592 # char => '{'
593 # context => '#stay'
594 # type => 'DetectChar'
595 990 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "#stay", "Keyword")) 26 964 990
596 26 return 1
597 }
598 # attribute => 'Keyword'
599 # char => '}'
600 # context => '#stay'
601 # endRegion => 'block'
602 # type => 'DetectChar'
603 964 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#stay", "Keyword")) 26 938 964
604 26 return 1
605 }
606 # attribute => 'Keyword'
607 # char => '['
608 # context => '#stay'
609 # type => 'DetectChar'
610 938 ▶ if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "[", 0, 0, 0, undef, 0, "#stay", "Keyword")) 4 934 938
611 4 return 1
612 }
613 # attribute => 'Keyword'
614 # char => ']'
615 # context => '#stay'
616 # type => 'DetectChar'
617 934 ▶ if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "]", 0, 0, 0, undef, 0, "#stay", "Keyword")) 4 930 934
618 4 return 1
619 }
620 930 return 0;
621 };
622  
623 sub parseString {
624 100 ▶ my ($self, $text) = @_;
Subroutine parseString: called CC=4 SCAR=13.9
Pod undocumented
625 # String => '\\.'
626 # attribute => 'Char'
627 # context => '#stay'
628 # type => 'RegExpr'
629 100 ▶ if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\.", 0, 0, 0, undef, 0, "#stay", "Char")) 6 94 100
630 6 return 1
631 }
632 # attribute => 'String'
633 # char => '"'
634 # context => '#pop'
635 # type => 'DetectChar'
636 94 ▶ 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")) 8 86 94
637 8 return 1
638 }
639 # attribute => 'Variable'
640 # char => '$'
641 # context => '#stay'
642 # type => 'DetectChar'
643 86 ▶ if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\$", 0, 0, 0, undef, 0, "#stay", "Variable")) 4 82 86
644 4 return 1
645 }
646 82 return 0;
647 };
648  
649  
650 1 1;
651  
652 __END__
« Kate/Xorg_Configuration.pm ↑ Summary Kate/Intel_x86_NASM.pm »