Kate/Txt2tags.pm

filter: Statementstmt 28.5% 22 / 77 Branchbran 0.0% 0 / 52 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 3 totaltotal 18.8% 27 / 143 SCAR 61.5
CC
28
Cov
17%
parseContext
756.0
new
2.0
language
2.0
CRAP 469.4
« Kate/ILERPG.pm ↑ Summary Kate/TaskJuggler.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 'txt2tags.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.01
9 #kate version 2.4
10 #generated: Sun Feb 3 22:02:06 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::Txt2tags;
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 1 ▶ my $proto = shift;
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
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 'Bar' => 'IString',
26 'Bold' => 'Float',
27 'BoldItalic' => 'Operator',
28 'Comment' => 'Comment',
29 'Date' => 'BaseN',
30 'DefList' => 'Reserved',
31 'Italic' => 'DecVal',
32 'Link' => 'Variable',
33 'List' => 'Reserved',
34 'Monospaced' => 'Others',
35 'Normal' => 'Normal',
36 'NumList' => 'Reserved',
37 'Quote' => 'Function',
38 'Tabel' => 'BString',
39 'Title' => 'Keyword',
40 'Verbatim Area' => 'String',
41 'Verbatim Line' => 'String',
42 });
43 1 $self->contextdata({
44 'Context' => {
45 callback => \&parseContext,
46 attribute => 'Normal',
47 },
48 });
49 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
50 1 $self->basecontext('Context');
51 1 $self->keywordscase(1);
52 1 $self->initialize;
53 1 bless ($self, $class);
54 1 return $self;
55 }
56  
57 sub language {
58 0 ▶ return 'txt2tags';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
59 }
60  
61 sub parseContext {
62 0 ▶ my ($self, $text) = @_;
Subroutine parseContext: not called CC=27 SCAR=66.3
Pod undocumented
63 # String => '%%date(\(.*\))?'
64 # attribute => 'Date'
65 # context => 'Context'
66 # type => 'RegExpr'
67 0 ▶ if ($self->testRegExpr($text, '%%date(\\(.*\\))?', 0, 0, 0, undef, 0, 'Context', 'Date')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "%%date(\\(.*\\))?", 0, 0, 0, undef, 0, "Context", "Date")) 0 0 0
68 0 return 1
69 }
70 # String => '%.*'
71 # attribute => 'Comment'
72 # context => 'Context'
73 # type => 'RegExpr'
74 0 ▶ if ($self->testRegExpr($text, '%.*', 0, 0, 0, undef, 0, 'Context', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "%.*", 0, 0, 0, undef, 0, "Context", "Comment")) 0 0 0
75 0 return 1
76 }
77 # String => '\*\*.*\*\*'
78 # attribute => 'Bold'
79 # context => 'Context'
80 # type => 'RegExpr'
81 0 ▶ if ($self->testRegExpr($text, '\\*\\*.*\\*\\*', 0, 0, 0, undef, 0, 'Context', 'Bold')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\*\\*.*\\*\\*", 0, 0, 0, undef, 0, "Context", "Bold")) 0 0 0
82 0 return 1
83 }
84 # String => '//.*//'
85 # attribute => 'Italic'
86 # context => 'Context'
87 # type => 'RegExpr'
88 0 ▶ if ($self->testRegExpr($text, '//.*//', 0, 0, 0, undef, 0, 'Context', 'Italic')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "//.*//", 0, 0, 0, undef, 0, "Context", "Italic")) 0 0 0
89 0 return 1
90 }
91 # String => '\*\*//.*//\*\*'
92 # attribute => 'BoldItalic'
93 # context => 'Context'
94 # type => 'RegExpr'
95 0 ▶ if ($self->testRegExpr($text, '\\*\\*//.*//\\*\\*', 0, 0, 0, undef, 0, 'Context', 'BoldItalic')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\*\\*//.*//\\*\\*", 0, 0, 0, undef, 0, "Context", "BoldItalic")) 0 0 0
96 0 return 1
97 }
98 # String => '__.*__'
99 # attribute => 'BoldItalic'
100 # context => 'Context'
101 # type => 'RegExpr'
102 0 ▶ if ($self->testRegExpr($text, '__.*__', 0, 0, 0, undef, 0, 'Context', 'BoldItalic')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "__.*__", 0, 0, 0, undef, 0, "Context", "BoldItalic")) 0 0 0
103 0 return 1
104 }
105 # String => '``.*``'
106 # attribute => 'Monospaced'
107 # context => 'Context'
108 # type => 'RegExpr'
109 0 ▶ if ($self->testRegExpr($text, '``.*``', 0, 0, 0, undef, 0, 'Context', 'Monospaced')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "``.*``", 0, 0, 0, undef, 0, "Context", "Monospaced")) 0 0 0
110 0 return 1
111 }
112 # String => '``` .*'
113 # attribute => 'Verbatim Line'
114 # context => 'Context'
115 # type => 'RegExpr'
116 0 ▶ if ($self->testRegExpr($text, '``` .*', 0, 0, 0, undef, 0, 'Context', 'Verbatim Line')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "``` .*", 0, 0, 0, undef, 0, "Context", "Verbatim Line")) 0 0 0
117 0 return 1
118 }
119 # String => ' *=[^=].*[^=]=\s*$'
120 # attribute => 'Title'
121 # column => '0'
122 # context => 'Context'
123 # type => 'RegExpr'
124 0 ▶ if ($self->testRegExpr($text, ' *=[^=].*[^=]=\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *=[^=].*[^=]=\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
125 0 return 1
126 }
127 # String => ' *==[^=].*[^=]==\s*$'
128 # attribute => 'Title'
129 # column => '0'
130 # context => 'Context'
131 # type => 'RegExpr'
132 0 ▶ if ($self->testRegExpr($text, ' *==[^=].*[^=]==\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *==[^=].*[^=]==\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
133 0 return 1
134 }
135 # String => ' *===[^=].*[^=]===\s*$'
136 # attribute => 'Title'
137 # column => '0'
138 # context => 'Context'
139 # type => 'RegExpr'
140 0 ▶ if ($self->testRegExpr($text, ' *===[^=].*[^=]===\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *===[^=].*[^=]===\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
141 0 return 1
142 }
143 # String => ' *====[^=].*[^=]====\s*$'
144 # attribute => 'Title'
145 # column => '0'
146 # context => 'Context'
147 # type => 'RegExpr'
148 0 ▶ if ($self->testRegExpr($text, ' *====[^=].*[^=]====\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *====[^=].*[^=]====\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
149 0 return 1
150 }
151 # String => ' *=====[^=].*[^=]=====\s*$'
152 # attribute => 'Title'
153 # column => '0'
154 # context => 'Context'
155 # type => 'RegExpr'
156 0 ▶ if ($self->testRegExpr($text, ' *=====[^=].*[^=]=====\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *=====[^=].*[^=]=====\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
157 0 return 1
158 }
159 # String => ' *\+[^=].*[^=]\+\s*$'
160 # attribute => 'Title'
161 # column => '0'
162 # context => 'Context'
163 # type => 'RegExpr'
164 0 ▶ if ($self->testRegExpr($text, ' *\\+[^=].*[^=]\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\+[^=].*[^=]\\+\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
165 0 return 1
166 }
167 # String => ' *\+\+[^=].*[^=]\+\+\s*$'
168 # attribute => 'Title'
169 # column => '0'
170 # context => 'Context'
171 # type => 'RegExpr'
172 0 ▶ if ($self->testRegExpr($text, ' *\\+\\+[^=].*[^=]\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\+\\+[^=].*[^=]\\+\\+\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
173 0 return 1
174 }
175 # String => ' *\+\+\+[^=].*[^=]\+\+\+\s*$'
176 # attribute => 'Title'
177 # column => '0'
178 # context => 'Context'
179 # type => 'RegExpr'
180 0 ▶ if ($self->testRegExpr($text, ' *\\+\\+\\+[^=].*[^=]\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\+\\+\\+[^=].*[^=]\\+\\+\\+\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
181 0 return 1
182 }
183 # String => ' *\+\+\+\+[^=].*[^=]\+\+\+\+\s*$'
184 # attribute => 'Title'
185 # column => '0'
186 # context => 'Context'
187 # type => 'RegExpr'
188 0 ▶ if ($self->testRegExpr($text, ' *\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
189 0 return 1
190 }
191 # String => ' *\+\+\+\+\+[^=].*[^=]\+\+\+\+\+\s*$'
192 # attribute => 'Title'
193 # column => '0'
194 # context => 'Context'
195 # type => 'RegExpr'
196 0 ▶ if ($self->testRegExpr($text, ' *\\+\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\+\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\+\\s*\$", 0, 0, 0, 0, 0, "Context", "Title")) 0 0 0
197 0 return 1
198 }
199 # attribute => 'Link'
200 # char => '['
201 # char1 => ']'
202 # type => 'RangeDetect'
203 0 ▶ if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'Link')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRangeDetect($text, "[", "]", 0, 0, undef, 0, "#stay", "Link")) 0 0 0
204 0 return 1
205 }
206 # String => ' *\|\| .*'
207 # attribute => 'Tabel'
208 # column => '0'
209 # context => 'Context'
210 # type => 'RegExpr'
211 0 ▶ if ($self->testRegExpr($text, ' *\\|\\| .*', 0, 0, 0, 0, 0, 'Context', 'Tabel')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\|\\| .*", 0, 0, 0, 0, 0, "Context", "Tabel")) 0 0 0
212 0 return 1
213 }
214 # String => ' *\| .*'
215 # attribute => 'Tabel'
216 # column => '0'
217 # context => 'Context'
218 # type => 'RegExpr'
219 0 ▶ if ($self->testRegExpr($text, ' *\\| .*', 0, 0, 0, 0, 0, 'Context', 'Tabel')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\| .*", 0, 0, 0, 0, 0, "Context", "Tabel")) 0 0 0
220 0 return 1
221 }
222 # String => ' *\: .*'
223 # attribute => 'DefList'
224 # column => '0'
225 # context => 'Context'
226 # type => 'RegExpr'
227 0 ▶ if ($self->testRegExpr($text, ' *\\: .*', 0, 0, 0, 0, 0, 'Context', 'DefList')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\: .*", 0, 0, 0, 0, 0, "Context", "DefList")) 0 0 0
228 0 return 1
229 }
230 # String => ' *\- .*'
231 # attribute => 'List'
232 # column => '0'
233 # context => 'Context'
234 # type => 'RegExpr'
235 0 ▶ if ($self->testRegExpr($text, ' *\\- .*', 0, 0, 0, 0, 0, 'Context', 'List')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\- .*", 0, 0, 0, 0, 0, "Context", "List")) 0 0 0
236 0 return 1
237 }
238 # String => ' *\+ .*'
239 # attribute => 'NumList'
240 # column => '0'
241 # context => 'Context'
242 # type => 'RegExpr'
243 0 ▶ if ($self->testRegExpr($text, ' *\\+ .*', 0, 0, 0, 0, 0, 'Context', 'NumList')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, " *\\+ .*", 0, 0, 0, 0, 0, "Context", "NumList")) 0 0 0
244 0 return 1
245 }
246 # String => '\t.*'
247 # attribute => 'Quote'
248 # context => 'Context'
249 # type => 'RegExpr'
250 0 ▶ if ($self->testRegExpr($text, '\\t.*', 0, 0, 0, undef, 0, 'Context', 'Quote')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\t.*", 0, 0, 0, undef, 0, "Context", "Quote")) 0 0 0
251 0 return 1
252 }
253 # String => '\s*([_=-]{20,})\s*$'
254 # attribute => 'Bar'
255 # context => 'Context'
256 # type => 'RegExpr'
257 0 ▶ if ($self->testRegExpr($text, '\\s*([_=-]{20,})\\s*$', 0, 0, 0, undef, 0, 'Context', 'Bar')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\s*([_=-]{20,})\\s*\$", 0, 0, 0, undef, 0, "Context", "Bar")) 0 0 0
258 0 return 1
259 }
260 0 return 0;
261 };
262  
263  
264 1 1;
265  
266 __END__
« Kate/ILERPG.pm ↑ Summary Kate/TaskJuggler.pm »