Kate/Velocity.pm

filter: Statementstmt 46.0% 23 / 50 Branchbran 0.0% 0 / 20 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 4 / 8 Podpod 0.0% 0 / 5 totaltotal 31.8% 28 / 88 CC 12 SCAR 40.8
CC
12
Cov
33%
parseKeyword
110.0
parsemultilinecomment
6.0
new
2.0
CRAP 59.1
« Kate/CSS_PHP.pm ↑ Summary Kate/Xslt.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 'velocity.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.04
9 #kate version 2.1
10 #kate author John Christopher (John@animalsinneed.net)
11 #generated: Sun Feb 3 22:02:06 2008, localtime
12  
13 package Syntax::Highlight::Engine::Kate::Velocity;
14  
15 1 our $VERSION = '0.16';
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 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
22 1 my $proto = shift;
23 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
24 1 my $self = $class->SUPER::new(@_);
25 1 $self->attributes({
26 'Comment' => 'Comment',
27 'Keyword' => 'Keyword',
28 'Normal Text' => 'Normal',
29 'Other' => 'Others',
30 'Properties' => 'Normal',
31 'Variable' => 'Keyword',
32 });
33 1 $self->listAdd('keywords',
34 '#else',
35 '#elseif',
36 '#end',
37 '#foreach',
38 '#if',
39 '#include',
40 '#macro',
41 '#parse',
42 '#set',
43 '#stop',
44 );
45 1 $self->contextdata({
46 'Keyword' => {
47 callback => \&parseKeyword,
48 attribute => 'Normal Text',
49 },
50 'multilinecomment' => {
51 callback => \&parsemultilinecomment,
52 attribute => 'Comment',
53 },
54 'singleline comment' => {
55 callback => \&parsesinglelinecomment,
56 attribute => 'Comment',
57 lineending => '#pop',
58 },
59 });
60 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\+');
61 1 $self->basecontext('Keyword');
62 1 $self->keywordscase(0);
63 1 $self->initialize;
64 1 bless ($self, $class);
65 1 return $self;
66 }
67  
68 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
69 0 return 'Velocity';
70 }
71  
72 0 ▶sub parseKeyword {
Subroutine parseKeyword: not called CC=10 SCAR=47.0
Pod undocumented
73 0 my ($self, $text) = @_;
74 # String => 'keywords'
75 # attribute => 'Keyword'
76 # context => '#stay'
77 # type => 'keyword'
78 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
79 0 return 1
80 }
81 # String => '\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*'
82 # attribute => 'Variable'
83 # context => '#stay'
84 # type => 'RegExpr'
85 0 ▶ if ($self->testRegExpr($text, '\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[[a-zA-Z0-9_]*\\])*', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[[a-zA-Z0-9_]*\\])*", 0, 0, 0, undef, 0, "#stay", "Variable")) 0 0 0
86 0 return 1
87 }
88 # String => '\$\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*\}'
89 # attribute => 'Variable'
90 # context => '#stay'
91 # type => 'RegExpr'
92 0 ▶ if ($self->testRegExpr($text, '\\$\\{[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[[a-zA-Z0-9_]*\\])*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\$\\{[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[[a-zA-Z0-9_]*\\])*\\}", 0, 0, 0, undef, 0, "#stay", "Variable")) 0 0 0
93 0 return 1
94 }
95 # String => '\$!\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*\}.'
96 # attribute => 'Variable'
97 # context => '#stay'
98 # type => 'RegExpr'
99 0 ▶ if ($self->testRegExpr($text, '\\$!\\{[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[[a-zA-Z0-9_]*\\])*\\}.', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\$!\\{[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[[a-zA-Z0-9_]*\\])*\\}.", 0, 0, 0, undef, 0, "#stay", "Variable")) 0 0 0
100 0 return 1
101 }
102 # String => '\{\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[([0-9]*|"[a-zA-Z_]*")|'[a-zA-Z_]*'|\])*(->[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[[a-zA-Z0-9_]*\])*(\[([0-9]*|"[a-zA-Z_]*")|'[a-zA-Z_]*'|\])*)*\}'
103 # attribute => 'Variable'
104 # context => '#stay'
105 # type => 'RegExpr'
106 0 ▶ if ($self->testRegExpr($text, '\\{\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[([0-9]*|"[a-zA-Z_]*")|\'[a-zA-Z_]*\'|\\])*(->[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(\\[[a-zA-Z0-9_]*\\])*(\\[([0-9]*|"[a-zA-Z_]*")|\'[a-zA-Z_]*\'|\\])*)*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\{\\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[([0-9]*|\"[a-zA-Z_]*\")|'[a-zA-Z_]*'|\\])*(->[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(\\[[a-zA-Z0-9_]*\\])*(\\[([0-9]*|\"[a-zA-Z_]*\")|'[a-zA-Z_]*'|\\])*)*\\}", 0, 0, 0, undef, 0, "#stay", "Variable")) 0 0 0
107 0 return 1
108 }
109 # String => '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\-]*(\[[a-zA-Z0-9_]*\])*\.[a-zA-Z0-9_\x7f-\xff\-]*'
110 # attribute => 'Properties'
111 # context => '#stay'
112 # type => 'RegExpr'
113 0 ▶ if ($self->testRegExpr($text, '[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\-]*(\\[[a-zA-Z0-9_]*\\])*\\.[a-zA-Z0-9_\\x7f-\\xff\\-]*', 0, 0, 0, undef, 0, '#stay', 'Properties')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\-]*(\\[[a-zA-Z0-9_]*\\])*\\.[a-zA-Z0-9_\\x7f-\\xff\\-]*", 0, 0, 0, undef, 0, "#stay", "Properties")) 0 0 0
114 0 return 1
115 }
116 # String => '(),[]'
117 # attribute => 'Other'
118 # context => '#stay'
119 # type => 'AnyChar'
120 0 ▶ if ($self->testAnyChar($text, '(),[]', 0, 0, undef, 0, '#stay', 'Other')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "(),[]", 0, 0, undef, 0, "#stay", "Other")) 0 0 0
121 0 return 1
122 }
123 # attribute => 'Comment'
124 # char => '#'
125 # char1 => '#'
126 # context => 'singleline comment'
127 # type => 'Detect2Chars'
128 0 ▶ if ($self->testDetect2Chars($text, '#', '#', 0, 0, 0, undef, 0, 'singleline comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "#", "#", 0, 0, 0, undef, 0, "singleline comment", "Comment")) 0 0 0
129 0 return 1
130 }
131 # attribute => 'Comment'
132 # char => '#'
133 # char1 => '*'
134 # context => 'multilinecomment'
135 # type => 'Detect2Chars'
136 0 ▶ if ($self->testDetect2Chars($text, '#', '*', 0, 0, 0, undef, 0, 'multilinecomment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "#", "*", 0, 0, 0, undef, 0, "multilinecomment", "Comment")) 0 0 0
137 0 return 1
138 }
139 0 return 0;
140 };
141  
142 0 ▶sub parsemultilinecomment {
Subroutine parsemultilinecomment: not called CC=2 SCAR=17.9
Pod undocumented
143 0 my ($self, $text) = @_;
144 # attribute => 'Comment'
145 # char => '*'
146 # char1 => '#'
147 # context => '#pop'
148 # type => 'Detect2Chars'
149 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
150 0 return 1
151 }
152 0 return 0;
153 };
154  
155 0 ▶sub parsesinglelinecomment {
Subroutine parsesinglelinecomment: not called CC=1 SCAR=6.9
Pod undocumented
156 0 my ($self, $text) = @_;
157 0 return 0;
158 };
159  
160  
161 1 1;
162  
163 __END__
« Kate/CSS_PHP.pm ↑ Summary Kate/Xslt.pm »