Kate/JavaScript.pm

filter: Statementstmt 90.2% 138 / 153 Branchbran 88.2% 90 / 102 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 87.5% 14 / 16 Podpod 0.0% 0 / 13 totaltotal 84.0% 243 / 289 SCAR 40.4
CC
53
Cov
89%
parseNormal
22.4
parseregion_marker
12.0
parseRegularExpression
9.0
CRAP 57.0
« Kate/ABC.pm ↑ Summary Kate/Velocity.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 'javascript.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.3
10 #kate author Anders Lund (anders@alweb.dk), Joseph Wenninger (jowenn@kde.org), Whitehawk Stormchaser (zerokode@gmx.net)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
12  
13 package Syntax::Highlight::Engine::Kate::JavaScript;
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 'Char' => 'Char',
27 'Comment' => 'Comment',
28 'Data Type' => 'DataType',
29 'Decimal' => 'DecVal',
30 'Events' => 'Operator',
31 'Float' => 'Float',
32 'Function' => 'Function',
33 'Keyword' => 'Keyword',
34 'Math' => 'BString',
35 'Normal Text' => 'Normal',
36 'Objects' => 'Reserved',
37 'Pattern Character Class' => 'BaseN',
38 'Pattern Internal Operator' => 'Float',
39 'Region Marker' => 'RegionMarker',
40 'Regular Expression' => 'Others',
41 'String' => 'String',
42 'String Char' => 'Char',
43 'Symbol' => 'Normal',
44 });
45 2 $self->listAdd('events',
46 'onAbort',
47 'onBlur',
48 'onChange',
49 'onClick',
50 'onError',
51 'onFocus',
52 'onLoad',
53 'onMouseOut',
54 'onMouseOver',
55 'onReset',
56 'onSelect',
57 'onSubmit',
58 'onUnload',
59 );
60 2 $self->listAdd('functions',
61 'Number',
62 'escape',
63 'isFinite',
64 'isNaN',
65 'parseFloat',
66 'parseInt',
67 'reload',
68 'taint',
69 'unescape',
70 'untaint',
71 'write',
72 );
73 2 $self->listAdd('keywords',
74 'break',
75 'case',
76 'catch',
77 'const',
78 'continue',
79 'default',
80 'delete',
81 'do',
82 'else',
83 'false',
84 'finally',
85 'for',
86 'function',
87 'if',
88 'in',
89 'new',
90 'return',
91 'switch',
92 'throw',
93 'true',
94 'try',
95 'typeof',
96 'var',
97 'void',
98 'while',
99 'with',
100 );
101 2 $self->listAdd('math',
102 'E',
103 'LN10',
104 'LN2',
105 'LOG10E',
106 'LOG2E',
107 'PI',
108 'SQRT1_2',
109 'SQRT2',
110 'abs',
111 'acos',
112 'asin',
113 'atan',
114 'atan2',
115 'ceil',
116 'cos',
117 'ctg',
118 'exp',
119 'floor',
120 'log',
121 'pow',
122 'round',
123 'sin',
124 'sqrt',
125 'tan',
126 );
127 2 $self->listAdd('methods',
128 'MAX_VALUE',
129 'MIN_VALUE',
130 'NEGATIVE_INFINITY',
131 'NaN',
132 'POSITIVE_INFINITY',
133 'URL',
134 'UTC',
135 'above',
136 'action',
137 'alert',
138 'alinkColor',
139 'anchor',
140 'anchors',
141 'appCodeName',
142 'appName',
143 'appVersion',
144 'applets',
145 'apply',
146 'argument',
147 'arguments',
148 'arity',
149 'availHeight',
150 'availWidth',
151 'back',
152 'background',
153 'below',
154 'bgColor',
155 'big',
156 'blink',
157 'blur',
158 'bold',
159 'border',
160 'border',
161 'call',
162 'caller',
163 'charAt',
164 'charCodeAt',
165 'checked',
166 'clearInterval',
167 'clearTimeout',
168 'click',
169 'clip',
170 'close',
171 'closed',
172 'colorDepth',
173 'compile',
174 'complete',
175 'confirm',
176 'constructor',
177 'cookie',
178 'current',
179 'cursor',
180 'data',
181 'defaultChecked',
182 'defaultSelected',
183 'defaultStatus',
184 'defaultValue',
185 'description',
186 'disableExternalCapture',
187 'domain',
188 'elements',
189 'embeds',
190 'enableExternalCapture',
191 'enabledPlugin',
192 'encoding',
193 'eval',
194 'exec',
195 'fgColor',
196 'filename',
197 'find',
198 'fixed',
199 'focus',
200 'fontcolor',
201 'fontsize',
202 'form',
203 'formName',
204 'forms',
205 'forward',
206 'frames',
207 'fromCharCode',
208 'getDate',
209 'getDay',
210 'getHours',
211 'getMiliseconds',
212 'getMinutes',
213 'getMonth',
214 'getSeconds',
215 'getSelection',
216 'getTime',
217 'getTimezoneOffset',
218 'getUTCDate',
219 'getUTCDay',
220 'getUTCFullYear',
221 'getUTCHours',
222 'getUTCMilliseconds',
223 'getUTCMinutes',
224 'getUTCMonth',
225 'getUTCSeconds',
226 'getYear',
227 'global',
228 'go',
229 'hash',
230 'height',
231 'history',
232 'home',
233 'host',
234 'hostname',
235 'href',
236 'hspace',
237 'ignoreCase',
238 'images',
239 'index',
240 'indexOf',
241 'innerHeight',
242 'innerWidth',
243 'input',
244 'italics',
245 'javaEnabled',
246 'join',
247 'language',
248 'lastIndex',
249 'lastIndexOf',
250 'lastModified',
251 'lastParen',
252 'layerX',
253 'layerY',
254 'layers',
255 'left',
256 'leftContext',
257 'length',
258 'link',
259 'linkColor',
260 'links',
261 'load',
262 'location',
263 'locationbar',
264 'lowsrc',
265 'match',
266 'menubar',
267 'method',
268 'mimeTypes',
269 'modifiers',
270 'moveAbove',
271 'moveBelow',
272 'moveBy',
273 'moveTo',
274 'moveToAbsolute',
275 'multiline',
276 'name',
277 'negative_infinity',
278 'next',
279 'open',
280 'opener',
281 'options',
282 'outerHeight',
283 'outerWidth',
284 'pageX',
285 'pageXoffset',
286 'pageY',
287 'pageYoffset',
288 'parent',
289 'parse',
290 'pathname',
291 'personalbar',
292 'pixelDepth',
293 'platform',
294 'plugins',
295 'pop',
296 'port',
297 'positive_infinity',
298 'preference',
299 'previous',
300 'print',
301 'prompt',
302 'protocol',
303 'prototype',
304 'push',
305 'referrer',
306 'refresh',
307 'releaseEvents',
308 'reload',
309 'replace',
310 'reset',
311 'resizeBy',
312 'resizeTo',
313 'reverse',
314 'rightContext',
315 'screenX',
316 'screenY',
317 'scroll',
318 'scrollBy',
319 'scrollTo',
320 'scrollbar',
321 'search',
322 'select',
323 'selected',
324 'selectedIndex',
325 'self',
326 'setDate',
327 'setHours',
328 'setMinutes',
329 'setMonth',
330 'setSeconds',
331 'setTime',
332 'setTimeout',
333 'setUTCDate',
334 'setUTCDay',
335 'setUTCFullYear',
336 'setUTCHours',
337 'setUTCMilliseconds',
338 'setUTCMinutes',
339 'setUTCMonth',
340 'setUTCSeconds',
341 'setYear',
342 'shift',
343 'siblingAbove',
344 'siblingBelow',
345 'small',
346 'sort',
347 'source',
348 'splice',
349 'split',
350 'src',
351 'status',
352 'statusbar',
353 'strike',
354 'sub',
355 'submit',
356 'substr',
357 'substring',
358 'suffixes',
359 'sup',
360 'taintEnabled',
361 'target',
362 'test',
363 'text',
364 'title',
365 'toGMTString',
366 'toLocaleString',
367 'toLowerCase',
368 'toSource',
369 'toString',
370 'toUTCString',
371 'toUpperCase',
372 'toolbar',
373 'top',
374 'type',
375 'unshift',
376 'unwatch',
377 'userAgent',
378 'value',
379 'valueOf',
380 'visibility',
381 'vlinkColor',
382 'vspace',
383 'watch',
384 'which',
385 'width',
386 'width',
387 'write',
388 'writeln',
389 'x',
390 'y',
391 'zIndex',
392 );
393 2 $self->listAdd('objects',
394 'Anchor',
395 'Applet',
396 'Area',
397 'Array',
398 'Boolean',
399 'Button',
400 'Checkbox',
401 'Date',
402 'FileUpload',
403 'Form',
404 'Frame',
405 'Function',
406 'Hidden',
407 'Image',
408 'Layer',
409 'Link',
410 'Math',
411 'Max',
412 'MimeType',
413 'Min',
414 'Object',
415 'Password',
416 'Plugin',
417 'Radio',
418 'RegExp',
419 'Reset',
420 'Screen',
421 'Select',
422 'String',
423 'Text',
424 'Textarea',
425 'Window',
426 'document',
427 'navigator',
428 'this',
429 'window',
430 );
431 2 $self->contextdata({
432 '(Internal regex catch)' => {
433 callback => \&parseBoInternalregexcatchBc,
434 attribute => 'Normal Text',
435 fallthrough => '#pop',
436 },
437 '(charclass caret first check)' => {
438 callback => \&parseBocharclasscaretfirstcheckBc,
439 attribute => 'Pattern Internal Operator',
440 lineending => '#pop',
441 fallthrough => 'Regular Expression Character Class',
442 },
443 '(regex caret first check)' => {
444 callback => \&parseBoregexcaretfirstcheckBc,
445 attribute => 'Pattern Internal Operator',
446 lineending => '#pop',
447 fallthrough => 'Regular Expression',
448 },
449 'Comment' => {
450 callback => \&parseComment,
451 attribute => 'Comment',
452 lineending => '#pop',
453 },
454 'Multi/inline Comment' => {
455 callback => \&parseMultiinlineComment,
456 attribute => 'Comment',
457 },
458 'Normal' => {
459 callback => \&parseNormal,
460 attribute => 'Normal Text',
461 },
462 'Regular Expression' => {
463 callback => \&parseRegularExpression,
464 attribute => 'Regular Expression',
465 },
466 'Regular Expression Character Class' => {
467 callback => \&parseRegularExpressionCharacterClass,
468 attribute => 'Pattern Character Class',
469 },
470 'String' => {
471 callback => \&parseString,
472 attribute => 'String',
473 lineending => '#pop',
474 },
475 'String 1' => {
476 callback => \&parseString1,
477 attribute => 'String Char',
478 lineending => '#pop',
479 },
480 'region_marker' => {
481 callback => \&parseregion_marker,
482 attribute => 'Region Marker',
483 lineending => '#pop',
484 },
485 });
486 2 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
487 2 $self->basecontext('Normal');
488 2 $self->keywordscase(0);
489 2 $self->initialize;
490 2 bless ($self, $class);
491 2 return $self;
492 }
493  
494 sub language {
495 0 ▶ return 'JavaScript';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
496 }
497  
498 sub parseBoInternalregexcatchBc {
499 192 ▶ my ($self, $text) = @_;
Subroutine parseBoInternalregexcatchBc: called CC=6 SCAR=18.0
Pod undocumented
500 # String => '\s*'
501 # attribute => 'Normal Text'
502 # context => '#stay'
503 # type => 'RegExpr'
504 192 ▶ if ($self->testRegExpr($text, '\\s*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\s*", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 76 116 192
505 76 return 1
506 }
507 # String => '//(?=;)'
508 # attribute => 'Regular Expression'
509 # context => '#pop'
510 # type => 'RegExpr'
511 116 ▶ if ($self->testRegExpr($text, '//(?=;)', 0, 0, 0, undef, 0, '#pop', 'Regular Expression')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "//(?=;)", 0, 0, 0, undef, 0, "#pop", "Regular Expression")) 2 114 116
512 2 return 1
513 }
514 # attribute => 'Comment'
515 # char => '/'
516 # char1 => '/'
517 # context => 'Comment'
518 # type => 'Detect2Chars'
519 114 ▶ if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", "/", 0, 0, 0, undef, 0, "Comment", "Comment")) 0 114 114
520 0 return 1
521 }
522 # attribute => 'Comment'
523 # char => '/'
524 # char1 => '*'
525 # context => 'Multi/inline Comment'
526 # type => 'Detect2Chars'
527 114 ▶ if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multi/inline Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", "*", 0, 0, 0, undef, 0, "Multi/inline Comment", "Comment")) 2 112 114
528 2 return 1
529 }
530 # attribute => 'Regular Expression'
531 # char => '/'
532 # context => '(regex caret first check)'
533 # type => 'DetectChar'
534 112 ▶ if ($self->testDetectChar($text, '/', 0, 0, 0, undef, 0, '(regex caret first check)', 'Regular Expression')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "/", 0, 0, 0, undef, 0, "(regex caret first check)", "Regular Expression")) 34 78 112
535 34 return 1
536 }
537 78 return 0;
538 };
539  
540 sub parseBocharclasscaretfirstcheckBc {
541 4 ▶ my ($self, $text) = @_;
Subroutine parseBocharclasscaretfirstcheckBc: called CC=2 SCAR=6.9
Pod undocumented
542 # attribute => 'Pattern Internal Operator'
543 # char => '^'
544 # context => 'Regular Expression Character Class'
545 # type => 'DetectChar'
546 4 ▶ if ($self->testDetectChar($text, '^', 0, 0, 0, undef, 0, 'Regular Expression Character Class', 'Pattern Internal Operator')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "^", 0, 0, 0, undef, 0, "Regular Expression Character Class", "Pattern Internal Operator")) 2 2 4
547 2 return 1
548 }
549 2 return 0;
550 };
551  
552 sub parseBoregexcaretfirstcheckBc {
553 34 ▶ my ($self, $text) = @_;
Subroutine parseBoregexcaretfirstcheckBc: called CC=2 SCAR=6.9
Pod undocumented
554 # attribute => 'Pattern Internal Operator'
555 # char => '^'
556 # context => 'Regular Expression'
557 # type => 'DetectChar'
558 34 ▶ if ($self->testDetectChar($text, '^', 0, 0, 0, undef, 0, 'Regular Expression', 'Pattern Internal Operator')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "^", 0, 0, 0, undef, 0, "Regular Expression", "Pattern Internal Operator")) 4 30 34
559 4 return 1
560 }
561 30 return 0;
562 };
563  
564 sub parseComment {
565 722 ▶ my ($self, $text) = @_;
Subroutine parseComment: called CC=4 SCAR=13.9
Pod undocumented
566 # type => 'DetectSpaces'
567 722 ▶ if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectSpaces($text, 0, undef, 0, "#stay", undef)) 14 708 722
568 14 return 1
569 }
570 # context => '##Alerts'
571 # type => 'IncludeRules'
572 708 ▶ if ($self->includePlugin('Alerts', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includePlugin("Alerts", $text)) 4 704 708
573 4 return 1
574 }
575 # type => 'DetectIdentifier'
576 704 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", undef)) 198 506 704
577 198 return 1
578 }
579 506 return 0;
580 };
581  
582 sub parseMultiinlineComment {
583 2792 ▶ my ($self, $text) = @_;
Subroutine parseMultiinlineComment: called CC=3 SCAR=11.0
Pod undocumented
584 # context => '##Alerts'
585 # type => 'IncludeRules'
586 2792 ▶ if ($self->includePlugin('Alerts', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includePlugin("Alerts", $text)) 4 2788 2792
587 4 return 1
588 }
589 # attribute => 'Comment'
590 # char => '*'
591 # char1 => '/'
592 # context => '#pop'
593 # endRegion => 'Comment'
594 # type => 'Detect2Chars'
595 2788 ▶ 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")) 18 2770 2788
596 18 return 1
597 }
598 2770 return 0;
599 };
600  
601 sub parseNormal {
602 900 ▶ my ($self, $text) = @_;
Subroutine parseNormal: called CC=22 SCAR=31.1
Pod undocumented
603 # type => 'DetectSpaces'
604 900 ▶ if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectSpaces($text, 0, undef, 0, "#stay", undef)) 10 890 900
605 10 return 1
606 }
607 # String => '//BEGIN'
608 # attribute => 'Region Marker'
609 # beginRegion => 'Region1'
610 # context => 'region_marker'
611 # type => 'StringDetect'
612 890 ▶ if ($self->testStringDetect($text, '//BEGIN', 0, 0, 0, undef, 0, 'region_marker', 'Region Marker')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "//BEGIN", 0, 0, 0, undef, 0, "region_marker", "Region Marker")) 0 890 890
613 0 return 1
614 }
615 # String => '//END'
616 # attribute => 'Region Marker'
617 # context => 'region_marker'
618 # endRegion => 'Region1'
619 # type => 'RegExpr'
620 890 ▶ if ($self->testRegExpr($text, '//END', 0, 0, 0, undef, 0, 'region_marker', 'Region Marker')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "//END", 0, 0, 0, undef, 0, "region_marker", "Region Marker")) 0 890 890
621 0 return 1
622 }
623 # String => 'keywords'
624 # attribute => 'Keyword'
625 # context => '#stay'
626 # type => 'keyword'
627 890 ▶ if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywords", 0, undef, 0, "#stay", "Keyword")) 56 834 890
628 56 return 1
629 }
630 # String => 'functions'
631 # attribute => 'Function'
632 # context => '#stay'
633 # type => 'keyword'
634 834 ▶ if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "functions", 0, undef, 0, "#stay", "Function")) 2 832 834
635 2 return 1
636 }
637 # String => 'objects'
638 # attribute => 'Objects'
639 # context => '#stay'
640 # type => 'keyword'
641 832 ▶ if ($self->testKeyword($text, 'objects', 0, undef, 0, '#stay', 'Objects')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "objects", 0, undef, 0, "#stay", "Objects")) 8 824 832
642 8 return 1
643 }
644 # String => 'math'
645 # attribute => 'Math'
646 # context => '#stay'
647 # type => 'keyword'
648 824 ▶ if ($self->testKeyword($text, 'math', 0, undef, 0, '#stay', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "math", 0, undef, 0, "#stay", "Math")) 6 818 824
649 6 return 1
650 }
651 # String => 'events'
652 # attribute => 'Events'
653 # context => '#stay'
654 # type => 'keyword'
655 818 ▶ if ($self->testKeyword($text, 'events', 0, undef, 0, '#stay', 'Events')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "events", 0, undef, 0, "#stay", "Events")) 0 818 818
656 0 return 1
657 }
658 # String => 'methods'
659 # attribute => 'Data Type'
660 # context => '#stay'
661 # type => 'keyword'
662 818 ▶ if ($self->testKeyword($text, 'methods', 0, undef, 0, '#stay', 'Data Type')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "methods", 0, undef, 0, "#stay", "Data Type")) 10 808 818
663 10 return 1
664 }
665 # type => 'DetectIdentifier'
666 808 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", undef)) 72 736 808
667 72 return 1
668 }
669 # attribute => 'Float'
670 # context => '#stay'
671 # type => 'Float'
672 736 ▶ if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testFloat($text, 0, undef, 0, "#stay", "Float")) 6 730 736
673 6 return 1
674 }
675 # attribute => 'Decimal'
676 # context => '#stay'
677 # type => 'Int'
678 730 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Decimal")) 0 730 730
679 0 return 1
680 }
681 # attribute => 'String'
682 # char => '"'
683 # context => 'String'
684 # type => 'DetectChar'
685 730 ▶ 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")) 16 714 730
686 16 return 1
687 }
688 # attribute => 'String'
689 # char => '''
690 # context => 'String 1'
691 # type => 'DetectChar'
692 714 ▶ if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String 1', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "String 1", "String")) 2 712 714
693 2 return 1
694 }
695 # attribute => 'Comment'
696 # char => '/'
697 # char1 => '/'
698 # context => 'Comment'
699 # type => 'Detect2Chars'
700 712 ▶ if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", "/", 0, 0, 0, undef, 0, "Comment", "Comment")) 34 678 712
701 34 return 1
702 }
703 # attribute => 'Comment'
704 # beginRegion => 'Comment'
705 # char => '/'
706 # char1 => '*'
707 # context => 'Multi/inline Comment'
708 # type => 'Detect2Chars'
709 678 ▶ if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multi/inline Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", "*", 0, 0, 0, undef, 0, "Multi/inline Comment", "Comment")) 16 662 678
710 16 return 1
711 }
712 # String => '[=?:]'
713 # attribute => 'Normal Text'
714 # context => '(Internal regex catch)'
715 # type => 'RegExpr'
716 662 ▶ if ($self->testRegExpr($text, '[=?:]', 0, 0, 0, undef, 0, '(Internal regex catch)', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[=?:]", 0, 0, 0, undef, 0, "(Internal regex catch)", "Normal Text")) 68 594 662
717 68 return 1
718 }
719 # String => '\('
720 # attribute => 'Normal Text'
721 # context => '(Internal regex catch)'
722 # type => 'RegExpr'
723 594 ▶ if ($self->testRegExpr($text, '\\(', 0, 0, 0, undef, 0, '(Internal regex catch)', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\(", 0, 0, 0, undef, 0, "(Internal regex catch)", "Normal Text")) 46 548 594
724 46 return 1
725 }
726 # attribute => 'Symbol'
727 # beginRegion => 'Brace1'
728 # char => '{'
729 # context => '#stay'
730 # type => 'DetectChar'
731 548 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "#stay", "Symbol")) 16 532 548
732 16 return 1
733 }
734 # attribute => 'Symbol'
735 # char => '}'
736 # context => '#stay'
737 # endRegion => 'Brace1'
738 # type => 'DetectChar'
739 532 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#stay", "Symbol")) 16 516 532
740 16 return 1
741 }
742 # String => ':!%&+,-/.*<=>?[]|~^;'
743 # attribute => 'Symbol'
744 # context => '#stay'
745 # type => 'AnyChar'
746 516 ▶ if ($self->testAnyChar($text, ':!%&+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, ":!%&+,-/.*<=>?[]|~^;", 0, 0, undef, 0, "#stay", "Symbol")) 110 406 516
747 110 return 1
748 }
749 406 return 0;
750 };
751  
752 sub parseRegularExpression {
753 264 ▶ my ($self, $text) = @_;
Subroutine parseRegularExpression: called CC=9 SCAR=22.0
Pod undocumented
754 # String => '/[ig]{0,2}'
755 # attribute => 'Regular Expression'
756 # context => '#pop#pop#pop'
757 # type => 'RegExpr'
758 264 ▶ if ($self->testRegExpr($text, '/[ig]{0,2}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Regular Expression')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "/[ig]{0,2}", 0, 0, 0, undef, 0, "#pop#pop#pop", "Regular Expression")) 34 230 264
759 34 return 1
760 }
761 # String => '\{[\d, ]+\}'
762 # attribute => 'Pattern Internal Operator'
763 # context => '#stay'
764 # type => 'RegExpr'
765 230 ▶ if ($self->testRegExpr($text, '\\{[\\d, ]+\\}', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\{[\\d, ]+\\}", 0, 0, 0, undef, 0, "#stay", "Pattern Internal Operator")) 4 226 230
766 4 return 1
767 }
768 # String => '\\[bB]'
769 # attribute => 'Pattern Internal Operator'
770 # context => '#stay'
771 # type => 'RegExpr'
772 226 ▶ if ($self->testRegExpr($text, '\\\\[bB]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\[bB]", 0, 0, 0, undef, 0, "#stay", "Pattern Internal Operator")) 4 222 226
773 4 return 1
774 }
775 # String => '\\[nrtvfDdSsWw]'
776 # attribute => 'Pattern Character Class'
777 # context => '#stay'
778 # type => 'RegExpr'
779 222 ▶ if ($self->testRegExpr($text, '\\\\[nrtvfDdSsWw]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\[nrtvfDdSsWw]", 0, 0, 0, undef, 0, "#stay", "Pattern Character Class")) 20 202 222
780 20 return 1
781 }
782 # attribute => 'Pattern Character Class'
783 # char => '['
784 # context => '(charclass caret first check)'
785 # type => 'DetectChar'
786 202 ▶ if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '(charclass caret first check)', 'Pattern Character Class')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "[", 0, 0, 0, undef, 0, "(charclass caret first check)", "Pattern Character Class")) 4 198 202
787 4 return 1
788 }
789 # String => '\\.'
790 # attribute => 'Pattern Internal Operator'
791 # context => '#stay'
792 # type => 'RegExpr'
793 198 ▶ if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\.", 0, 0, 0, undef, 0, "#stay", "Pattern Internal Operator")) 10 188 198
794 10 return 1
795 }
796 # String => '\$(?=/)'
797 # attribute => 'Pattern Internal Operator'
798 # context => '#stay'
799 # type => 'RegExpr'
800 188 ▶ if ($self->testRegExpr($text, '\\$(?=/)', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\$(?=/)", 0, 0, 0, undef, 0, "#stay", "Pattern Internal Operator")) 6 182 188
801 6 return 1
802 }
803 # String => '?+*()|'
804 # attribute => 'Pattern Internal Operator'
805 # context => '#stay'
806 # type => 'AnyChar'
807 182 ▶ if ($self->testAnyChar($text, '?+*()|', 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "?+*()|", 0, 0, undef, 0, "#stay", "Pattern Internal Operator")) 36 146 182
808 36 return 1
809 }
810 146 return 0;
811 };
812  
813 sub parseRegularExpressionCharacterClass {
814 24 ▶ my ($self, $text) = @_;
Subroutine parseRegularExpressionCharacterClass: called CC=3 SCAR=11.2
Pod undocumented
815 # String => '\\[\[\]]'
816 # attribute => 'Pattern Character Class'
817 # context => '#stay'
818 # type => 'RegExpr'
819 24 ▶ if ($self->testRegExpr($text, '\\\\[\\[\\]]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\[\\[\\]]", 0, 0, 0, undef, 0, "#stay", "Pattern Character Class")) 0 24 24
820 0 return 1
821 }
822 # attribute => 'Pattern Character Class'
823 # char => ']'
824 # context => '#pop#pop'
825 # type => 'DetectChar'
826 24 ▶ if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Pattern Character Class')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "]", 0, 0, 0, undef, 0, "#pop#pop", "Pattern Character Class")) 4 20 24
827 4 return 1
828 }
829 20 return 0;
830 };
831  
832 sub parseString {
833 76 ▶ my ($self, $text) = @_;
Subroutine parseString: called CC=4 SCAR=13.9
Pod undocumented
834 # type => 'DetectIdentifier'
835 76 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", undef)) 16 60 76
836 16 return 1
837 }
838 # attribute => 'String Char'
839 # context => '#stay'
840 # type => 'HlCStringChar'
841 60 ▶ if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCStringChar($text, 0, undef, 0, "#stay", "String Char")) 4 56 60
842 4 return 1
843 }
844 # attribute => 'String'
845 # char => '"'
846 # context => '#pop'
847 # type => 'DetectChar'
848 56 ▶ 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")) 16 40 56
849 16 return 1
850 }
851 40 return 0;
852 };
853  
854 sub parseString1 {
855 4 ▶ my ($self, $text) = @_;
Subroutine parseString1: called CC=4 SCAR=14.8
Pod undocumented
856 # type => 'DetectIdentifier'
857 4 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", undef)) 2 2 4
858 2 return 1
859 }
860 # attribute => 'String'
861 # char => '"'
862 # context => 'String'
863 # type => 'DetectChar'
864 2 ▶ 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 2 2
865 0 return 1
866 }
867 # attribute => 'String Char'
868 # char => '''
869 # context => '#pop'
870 # type => 'DetectChar'
871 2 ▶ if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "#pop", "String Char")) 2 0 2
872 2 return 1
873 }
874 0 return 0;
875 };
876  
877 sub parseregion_marker {
878 0 ▶ my ($self, $text) = @_;
Subroutine parseregion_marker: not called CC=3 SCAR=24.8
Pod undocumented
879 # type => 'DetectIdentifier'
880 0 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", undef)) 0 0 0
881 0 return 1
882 }
883 # type => 'DetectSpaces'
884 0 ▶ if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectSpaces($text, 0, undef, 0, "#stay", undef)) 0 0 0
885 0 return 1
886 }
887 0 return 0;
888 };
889  
890  
891 1 1;
892  
893 __END__
« Kate/ABC.pm ↑ Summary Kate/Velocity.pm »