Kate/LaTeX.pm

filter: Statementstmt 83.0% 152 / 183 Branchbran 76.5% 98 / 128 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 95.2% 20 / 21 Podpod 0.0% 0 / 18 totaltotal 76.3% 271 / 355 CC 66 SCAR 21.3
CC
66
Cov
80%
parseNormalText
15.2
parseMathModeEnv
14.6
parseMathMode
11.1
CRAP 8.4
« Kate/JavaScript.pm ↑ Summary Kate/CSS.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 'latex.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.14
9 #kate version 2.4
10 #kate author Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
12  
13 package Syntax::Highlight::Engine::Kate::LaTeX;
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 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
22 2 my $proto = shift;
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 'Comment' => 'Comment',
27 'Environment' => 'DataType',
28 'Keyword' => 'Keyword',
29 'Keyword Mathmode' => 'Reserved',
30 'Math' => 'Float',
31 'Normal Text' => 'Normal',
32 'Region Marker' => 'RegionMarker',
33 'Structure' => 'String',
34 'Verbatim' => 'BString',
35 });
36 2 $self->contextdata({
37 'Comment' => {
38 callback => \&parseComment,
39 attribute => 'Comment',
40 lineending => '#pop',
41 },
42 'ContrSeq' => {
43 callback => \&parseContrSeq,
44 attribute => 'Keyword',
45 lineending => '#pop',
46 },
47 'Environment' => {
48 callback => \&parseEnvironment,
49 attribute => 'Environment',
50 },
51 'FindEnvironment' => {
52 callback => \&parseFindEnvironment,
53 attribute => 'Normal Text',
54 },
55 'Label' => {
56 callback => \&parseLabel,
57 attribute => 'Normal Text',
58 lineending => '#pop#pop',
59 fallthrough => '#pop#pop',
60 },
61 'MathContrSeq' => {
62 callback => \&parseMathContrSeq,
63 attribute => 'Keyword Mathmode',
64 lineending => '#pop',
65 },
66 'MathEnv' => {
67 callback => \&parseMathEnv,
68 attribute => 'Environment',
69 },
70 'MathFindEnd' => {
71 callback => \&parseMathFindEnd,
72 attribute => 'Normal Text',
73 lineending => '#pop',
74 fallthrough => '#pop',
75 },
76 'MathMode' => {
77 callback => \&parseMathMode,
78 attribute => 'Math',
79 },
80 'MathModeEnv' => {
81 callback => \&parseMathModeEnv,
82 attribute => 'Math',
83 },
84 'Normal Text' => {
85 callback => \&parseNormalText,
86 attribute => 'Normal Text',
87 },
88 'ToEndOfLine' => {
89 callback => \&parseToEndOfLine,
90 attribute => 'Normal Text',
91 lineending => '#pop',
92 },
93 'Verb' => {
94 callback => \&parseVerb,
95 attribute => 'Verbatim',
96 lineending => '#pop',
97 fallthrough => '#pop',
98 },
99 'VerbFindEnd' => {
100 callback => \&parseVerbFindEnd,
101 attribute => 'Normal Text',
102 lineending => '#pop',
103 fallthrough => '#pop',
104 },
105 'Verbatim' => {
106 callback => \&parseVerbatim,
107 attribute => 'Verbatim',
108 },
109 'VerbatimEnv' => {
110 callback => \&parseVerbatimEnv,
111 attribute => 'Environment',
112 },
113 });
114 2 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
115 2 $self->basecontext('Normal Text');
116 2 $self->keywordscase(1);
117 2 $self->initialize;
118 2 bless ($self, $class);
119 2 return $self;
120 }
121  
122 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
123 0 return 'LaTeX';
124 }
125  
126 386 ▶sub parseComment {
Subroutine parseComment: called CC=1 SCAR=0.0
Pod undocumented
127 386 my ($self, $text) = @_;
128 386 return 0;
129 };
130  
131 12 ▶sub parseContrSeq {
Subroutine parseContrSeq: called CC=5 SCAR=16.6
Pod undocumented
132 12 my ($self, $text) = @_;
133 # String => 'verb*'
134 # attribute => 'Keyword'
135 # context => 'Verb'
136 # type => 'StringDetect'
137 12 ▶ if ($self->testStringDetect($text, 'verb*', 0, 0, 0, undef, 0, 'Verb', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "verb*", 0, 0, 0, undef, 0, "Verb", "Keyword")) 0 12 12
138 0 return 1
139 }
140 # String => 'verb'
141 # attribute => 'Keyword'
142 # context => 'Verb'
143 # type => 'StringDetect'
144 12 ▶ if ($self->testStringDetect($text, 'verb', 0, 0, 0, undef, 0, 'Verb', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "verb", 0, 0, 0, undef, 0, "Verb", "Keyword")) 2 10 12
145 2 return 1
146 }
147 # String => '[a-zA-Z]+'
148 # attribute => 'Keyword'
149 # context => '#pop'
150 # type => 'RegExpr'
151 10 ▶ if ($self->testRegExpr($text, '[a-zA-Z]+', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[a-zA-Z]+", 0, 0, 0, undef, 0, "#pop", "Keyword")) 2 8 10
152 2 return 1
153 }
154 # String => '[^a-zA-Z]'
155 # attribute => 'Keyword'
156 # context => '#pop'
157 # type => 'RegExpr'
158 8 ▶ if ($self->testRegExpr($text, '[^a-zA-Z]', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[^a-zA-Z]", 0, 0, 0, undef, 0, "#pop", "Keyword")) 8 0 8
159 8 return 1
160 }
161 0 return 0;
162 };
163  
164 130 ▶sub parseEnvironment {
Subroutine parseEnvironment: called CC=5 SCAR=16.2
Pod undocumented
165 130 my ($self, $text) = @_;
166 # attribute => 'Normal Text'
167 # char => '}'
168 # context => '#pop#pop'
169 # type => 'DetectChar'
170 130 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop#pop", "Normal Text")) 4 126 130
171 4 return 1
172 }
173 # attribute => 'Normal Text'
174 # char => ']'
175 # context => '#pop#pop'
176 # type => 'DetectChar'
177 126 ▶ if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "]", 0, 0, 0, undef, 0, "#pop#pop", "Normal Text")) 0 126 126
178 0 return 1
179 }
180 # String => '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?'
181 # attribute => 'Environment'
182 # context => 'VerbatimEnv'
183 # type => 'RegExpr'
184 126 ▶ if ($self->testRegExpr($text, '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?', 0, 0, 0, undef, 0, 'VerbatimEnv', 'Environment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?", 0, 0, 0, undef, 0, "VerbatimEnv", "Environment")) 6 120 126
185 6 return 1
186 }
187 # String => '(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?'
188 # attribute => 'Environment'
189 # context => 'MathEnv'
190 # type => 'RegExpr'
191 120 ▶ if ($self->testRegExpr($text, '(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?', 0, 0, 0, undef, 0, 'MathEnv', 'Environment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?", 0, 0, 0, undef, 0, "MathEnv", "Environment")) 4 116 120
192 4 return 1
193 }
194 116 return 0;
195 };
196  
197 14 ▶sub parseFindEnvironment {
Subroutine parseFindEnvironment: called CC=3 SCAR=16.0
Pod undocumented
198 14 my ($self, $text) = @_;
199 # attribute => 'Normal Text'
200 # char => '{'
201 # context => 'Environment'
202 # type => 'DetectChar'
203 14 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Environment', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "Environment", "Normal Text")) 14 0 14
204 14 return 1
205 }
206 # String => '\S'
207 # attribute => 'Normal Text'
208 # context => '#pop'
209 # type => 'RegExpr'
210 0 ▶ if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\S", 0, 0, 0, undef, 0, "#pop", "Normal Text")) 0 0 0
211 0 return 1
212 }
213 0 return 0;
214 };
215  
216 18 ▶sub parseLabel {
Subroutine parseLabel: called CC=4 SCAR=14.0
Pod undocumented
217 18 my ($self, $text) = @_;
218 # String => '\s*\{\s*'
219 # attribute => 'Normal Text'
220 # context => '#stay'
221 # type => 'RegExpr'
222 18 ▶ if ($self->testRegExpr($text, '\\s*\\{\\s*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\s*\\{\\s*", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 6 12 18
223 6 return 1
224 }
225 # String => '[^\}\{]+'
226 # attribute => 'Environment'
227 # context => '#stay'
228 # type => 'RegExpr'
229 12 ▶ if ($self->testRegExpr($text, '[^\\}\\{]+', 0, 0, 0, undef, 0, '#stay', 'Environment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[^\\}\\{]+", 0, 0, 0, undef, 0, "#stay", "Environment")) 6 6 12
230 6 return 1
231 }
232 # String => '\s*\}\s*'
233 # attribute => 'Normal Text'
234 # context => '#pop'
235 # type => 'RegExpr'
236 6 ▶ if ($self->testRegExpr($text, '\\s*\\}\\s*', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\s*\\}\\s*", 0, 0, 0, undef, 0, "#pop", "Normal Text")) 6 0 6
237 6 return 1
238 }
239 0 return 0;
240 };
241  
242 16 ▶sub parseMathContrSeq {
Subroutine parseMathContrSeq: called CC=3 SCAR=11.2
Pod undocumented
243 16 my ($self, $text) = @_;
244 # String => '[a-zA-Z]+'
245 # attribute => 'Keyword Mathmode'
246 # context => '#pop'
247 # type => 'RegExpr'
248 16 ▶ if ($self->testRegExpr($text, '[a-zA-Z]+', 0, 0, 0, undef, 0, '#pop', 'Keyword Mathmode')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[a-zA-Z]+", 0, 0, 0, undef, 0, "#pop", "Keyword Mathmode")) 14 2 16
249 14 return 1
250 }
251 # String => '[^a-zA-Z]'
252 # attribute => 'Keyword Mathmode'
253 # context => '#pop'
254 # type => 'RegExpr'
255 2 ▶ if ($self->testRegExpr($text, '[^a-zA-Z]', 0, 0, 0, undef, 0, '#pop', 'Keyword Mathmode')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[^a-zA-Z]", 0, 0, 0, undef, 0, "#pop", "Keyword Mathmode")) 2 0 2
256 2 return 1
257 }
258 0 return 0;
259 };
260  
261 4 ▶sub parseMathEnv {
Subroutine parseMathEnv: called CC=3 SCAR=16.0
Pod undocumented
262 4 my ($self, $text) = @_;
263 # attribute => 'Normal Text'
264 # char => '}'
265 # context => 'MathModeEnv'
266 # type => 'DetectChar'
267 4 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'MathModeEnv', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "MathModeEnv", "Normal Text")) 4 0 4
268 4 return 1
269 }
270 # String => '\S'
271 # attribute => 'Normal Text'
272 # context => '#pop'
273 # type => 'RegExpr'
274 0 ▶ if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\S", 0, 0, 0, undef, 0, "#pop", "Normal Text")) 0 0 0
275 0 return 1
276 }
277 0 return 0;
278 };
279  
280 12 ▶sub parseMathFindEnd {
Subroutine parseMathFindEnd: called CC=5 SCAR=16.6
Pod undocumented
281 12 my ($self, $text) = @_;
282 # attribute => 'Normal Text'
283 # char => '{'
284 # context => '#stay'
285 # type => 'DetectChar'
286 12 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 4 8 12
287 4 return 1
288 }
289 # String => '[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?'
290 # attribute => 'Environment'
291 # context => '#stay'
292 # type => 'RegExpr'
293 8 ▶ if ($self->testRegExpr($text, '[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?', 0, 0, 0, undef, 0, '#stay', 'Environment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?", 0, 0, 0, undef, 0, "#stay", "Environment")) 4 4 8
294 4 return 1
295 }
296 # type => 'DetectSpaces'
297 4 ▶ if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectSpaces($text, 0, undef, 0, "#stay", undef)) 0 4 4
298 0 return 1
299 }
300 # attribute => 'Normal Text'
301 # char => '}'
302 # context => '#pop#pop#pop#pop#pop'
303 # endRegion => 'block'
304 # type => 'DetectChar'
305 4 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop#pop#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop#pop#pop#pop#pop", "Normal Text")) 4 0 4
306 4 return 1
307 }
308 0 return 0;
309 };
310  
311 230 ▶sub parseMathMode {
Subroutine parseMathMode: called CC=11 SCAR=24.1
Pod undocumented
312 230 my ($self, $text) = @_;
313 # attribute => 'Math'
314 # char => '\'
315 # char1 => ']'
316 # context => '#pop'
317 # endRegion => 'mathMode'
318 # type => 'Detect2Chars'
319 230 ▶ if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#pop', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "\\", "]", 0, 0, 0, undef, 0, "#pop", "Math")) 2 228 230
320 2 return 1
321 }
322 # attribute => 'Math'
323 # char => '\'
324 # char1 => ')'
325 # context => '#pop'
326 # endRegion => 'mathMode'
327 # type => 'Detect2Chars'
328 228 ▶ if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#pop', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "\\", ")", 0, 0, 0, undef, 0, "#pop", "Math")) 2 226 228
329 2 return 1
330 }
331 # String => '\\begin(?=[^a-zA-Z])'
332 # attribute => 'Keyword Mathmode'
333 # beginRegion => 'block'
334 # context => '#stay'
335 # type => 'RegExpr'
336 226 ▶ if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\begin(?=[^a-zA-Z])", 0, 0, 0, undef, 0, "#stay", "Keyword Mathmode")) 2 224 226
337 2 return 1
338 }
339 # String => '\\end(?=[^a-zA-Z])'
340 # attribute => 'Keyword Mathmode'
341 # context => '#stay'
342 # endRegion => 'block'
343 # type => 'RegExpr'
344 224 ▶ if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\end(?=[^a-zA-Z])", 0, 0, 0, undef, 0, "#stay", "Keyword Mathmode")) 2 222 224
345 2 return 1
346 }
347 # attribute => 'Keyword Mathmode'
348 # char => '\'
349 # context => 'MathContrSeq'
350 # type => 'DetectChar'
351 222 ▶ if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'MathContrSeq', 'Keyword Mathmode')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\\", 0, 0, 0, undef, 0, "MathContrSeq", "Keyword Mathmode")) 6 216 222
352 6 return 1
353 }
354 # String => '$$'
355 # attribute => 'Math'
356 # context => '#pop'
357 # endRegion => 'mathMode'
358 # type => 'StringDetect'
359 216 ▶ if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, '#pop', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\$\$", 0, 0, 0, undef, 0, "#pop", "Math")) 2 214 216
360 2 return 1
361 }
362 # attribute => 'Math'
363 # char => '$'
364 # context => '#pop'
365 # endRegion => 'mathMode'
366 # type => 'DetectChar'
367 214 ▶ if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#pop', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\$", 0, 0, 0, undef, 0, "#pop", "Math")) 2 212 214
368 2 return 1
369 }
370 # String => '%\s*BEGIN.*$'
371 # attribute => 'Region Marker'
372 # beginRegion => 'regionMarker'
373 # context => '#stay'
374 # firstNonSpace => 'true'
375 # type => 'RegExpr'
376 212 ▶ 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 212 212
377 0 return 1
378 }
379 # String => '%\s*END.*$'
380 # attribute => 'Region Marker'
381 # context => '#stay'
382 # endRegion => 'regionMarker'
383 # firstNonSpace => 'true'
384 # type => 'RegExpr'
385 212 ▶ 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 212 212
386 0 return 1
387 }
388 # attribute => 'Comment'
389 # char => '%'
390 # context => 'Comment'
391 # type => 'DetectChar'
392 212 ▶ if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "%", 0, 0, 0, undef, 0, "Comment", "Comment")) 2 210 212
393 2 return 1
394 }
395 210 return 0;
396 };
397  
398 112 ▶sub parseMathModeEnv {
Subroutine parseMathModeEnv: called CC=12 SCAR=26.8
Pod undocumented
399 112 my ($self, $text) = @_;
400 # String => '\\end(?=\s*\{\s*[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?\s*\})'
401 # attribute => 'Structure'
402 # context => 'MathFindEnd'
403 # type => 'RegExpr'
404 112 ▶ if ($self->testRegExpr($text, '\\\\end(?=\\s*\\{\\s*[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?\\s*\\})', 0, 0, 0, undef, 0, 'MathFindEnd', 'Structure')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\end(?=\\s*\\{\\s*[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?\\s*\\})", 0, 0, 0, undef, 0, "MathFindEnd", "Structure")) 4 108 112
405 4 return 1
406 }
407 # String => '\\begin(?=[^a-zA-Z])'
408 # attribute => 'Keyword Mathmode'
409 # beginRegion => 'block'
410 # context => '#stay'
411 # type => 'RegExpr'
412 108 ▶ if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\begin(?=[^a-zA-Z])", 0, 0, 0, undef, 0, "#stay", "Keyword Mathmode")) 4 104 108
413 4 return 1
414 }
415 # String => '\\end(?=[^a-zA-Z])'
416 # attribute => 'Keyword Mathmode'
417 # context => '#stay'
418 # endRegion => 'block'
419 # type => 'RegExpr'
420 104 ▶ if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\end(?=[^a-zA-Z])", 0, 0, 0, undef, 0, "#stay", "Keyword Mathmode")) 4 100 104
421 4 return 1
422 }
423 # String => '\('
424 # attribute => 'Math'
425 # beginRegion => 'mathMode'
426 # context => 'MathMode'
427 # type => 'StringDetect'
428 100 ▶ if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\\(", 0, 0, 0, undef, 0, "MathMode", "Math")) 0 100 100
429 0 return 1
430 }
431 # String => '\['
432 # attribute => 'Math'
433 # beginRegion => 'mathMode'
434 # context => 'MathMode'
435 # type => 'StringDetect'
436 100 ▶ if ($self->testStringDetect($text, '\\[', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\\[", 0, 0, 0, undef, 0, "MathMode", "Math")) 0 100 100
437 0 return 1
438 }
439 # attribute => 'Keyword Mathmode'
440 # char => '\'
441 # context => 'MathContrSeq'
442 # type => 'DetectChar'
443 100 ▶ if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'MathContrSeq', 'Keyword Mathmode')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\\", 0, 0, 0, undef, 0, "MathContrSeq", "Keyword Mathmode")) 10 90 100
444 10 return 1
445 }
446 # String => '$$'
447 # attribute => 'Math'
448 # beginRegion => 'mathMode'
449 # context => 'MathMode'
450 # type => 'StringDetect'
451 90 ▶ if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\$\$", 0, 0, 0, undef, 0, "MathMode", "Math")) 0 90 90
452 0 return 1
453 }
454 # attribute => 'Math'
455 # beginRegion => 'mathMode'
456 # char => '$'
457 # context => 'MathMode'
458 # type => 'DetectChar'
459 90 ▶ if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\$", 0, 0, 0, undef, 0, "MathMode", "Math")) 0 90 90
460 0 return 1
461 }
462 # String => '%\s*BEGIN.*$'
463 # attribute => 'Region Marker'
464 # beginRegion => 'regionMarker'
465 # context => '#stay'
466 # firstNonSpace => 'true'
467 # type => 'RegExpr'
468 90 ▶ 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 90 90
469 0 return 1
470 }
471 # String => '%\s*END.*$'
472 # attribute => 'Region Marker'
473 # context => '#stay'
474 # endRegion => 'regionMarker'
475 # firstNonSpace => 'true'
476 # type => 'RegExpr'
477 90 ▶ 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 90 90
478 0 return 1
479 }
480 # attribute => 'Comment'
481 # char => '%'
482 # context => 'Comment'
483 # type => 'DetectChar'
484 90 ▶ if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "%", 0, 0, 0, undef, 0, "Comment", "Comment")) 2 88 90
485 2 return 1
486 }
487 88 return 0;
488 };
489  
490 282 ▶sub parseNormalText {
Subroutine parseNormalText: called CC=15 SCAR=27.2
Pod undocumented
491 282 my ($self, $text) = @_;
492 # String => '\\begin(?=[^a-zA-Z])'
493 # attribute => 'Structure'
494 # beginRegion => 'block'
495 # context => 'FindEnvironment'
496 # type => 'RegExpr'
497 282 ▶ if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'FindEnvironment', 'Structure')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\begin(?=[^a-zA-Z])", 0, 0, 0, undef, 0, "FindEnvironment", "Structure")) 12 270 282
498 12 return 1
499 }
500 # String => '\\end(?=[^a-zA-Z])'
501 # attribute => 'Structure'
502 # context => 'FindEnvironment'
503 # endRegion => 'block'
504 # type => 'RegExpr'
505 270 ▶ if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'FindEnvironment', 'Structure')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\end(?=[^a-zA-Z])", 0, 0, 0, undef, 0, "FindEnvironment", "Structure")) 2 268 270
506 2 return 1
507 }
508 # String => '\\(label|pageref|ref|cite)(?=[^a-zA-Z])'
509 # attribute => 'Structure'
510 # context => 'Label'
511 # type => 'RegExpr'
512 268 ▶ if ($self->testRegExpr($text, '\\\\(label|pageref|ref|cite)(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'Label', 'Structure')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\(label|pageref|ref|cite)(?=[^a-zA-Z])", 0, 0, 0, undef, 0, "Label", "Structure")) 6 262 268
513 6 return 1
514 }
515 # String => '\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])'
516 # attribute => 'Structure'
517 # context => '#stay'
518 # type => 'RegExpr'
519 262 ▶ if ($self->testRegExpr($text, '\\\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Structure')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])", 0, 0, 0, undef, 0, "#stay", "Structure")) 2 260 262
520 2 return 1
521 }
522 # String => '\renewcommand'
523 # attribute => 'Keyword'
524 # context => 'ToEndOfLine'
525 # type => 'StringDetect'
526 260 ▶ if ($self->testStringDetect($text, '\\renewcommand', 0, 0, 0, undef, 0, 'ToEndOfLine', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\\renewcommand", 0, 0, 0, undef, 0, "ToEndOfLine", "Keyword")) 0 260 260
527 0 return 1
528 }
529 # String => '\newcommand'
530 # attribute => 'Keyword'
531 # context => 'ToEndOfLine'
532 # type => 'StringDetect'
533 260 ▶ if ($self->testStringDetect($text, '\\newcommand', 0, 0, 0, undef, 0, 'ToEndOfLine', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\\newcommand", 0, 0, 0, undef, 0, "ToEndOfLine", "Keyword")) 2 258 260
534 2 return 1
535 }
536 # String => '\('
537 # attribute => 'Math'
538 # beginRegion => 'mathMode'
539 # context => 'MathMode'
540 # type => 'StringDetect'
541 258 ▶ if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\\(", 0, 0, 0, undef, 0, "MathMode", "Math")) 2 256 258
542 2 return 1
543 }
544 # String => '\['
545 # attribute => 'Math'
546 # beginRegion => 'mathMode'
547 # context => 'MathMode'
548 # type => 'StringDetect'
549 256 ▶ if ($self->testStringDetect($text, '\\[', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\\[", 0, 0, 0, undef, 0, "MathMode", "Math")) 2 254 256
550 2 return 1
551 }
552 # attribute => 'Keyword'
553 # char => '\'
554 # context => 'ContrSeq'
555 # type => 'DetectChar'
556 254 ▶ if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'ContrSeq', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\\", 0, 0, 0, undef, 0, "ContrSeq", "Keyword")) 10 244 254
557 10 return 1
558 }
559 # String => '$$'
560 # attribute => 'Math'
561 # beginRegion => 'mathMode'
562 # context => 'MathMode'
563 # type => 'StringDetect'
564 244 ▶ if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\$\$", 0, 0, 0, undef, 0, "MathMode", "Math")) 2 242 244
565 2 return 1
566 }
567 # attribute => 'Math'
568 # beginRegion => 'mathMode'
569 # char => '$'
570 # context => 'MathMode'
571 # type => 'DetectChar'
572 242 ▶ if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\$", 0, 0, 0, undef, 0, "MathMode", "Math")) 2 240 242
573 2 return 1
574 }
575 # String => '%\s*BEGIN.*$'
576 # attribute => 'Region Marker'
577 # beginRegion => 'regionMarker'
578 # context => '#stay'
579 # firstNonSpace => 'true'
580 # type => 'RegExpr'
581 240 ▶ 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 240 240
582 0 return 1
583 }
584 # String => '%\s*END.*$'
585 # attribute => 'Region Marker'
586 # context => '#stay'
587 # endRegion => 'regionMarker'
588 # firstNonSpace => 'true'
589 # type => 'RegExpr'
590 240 ▶ 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 240 240
591 0 return 1
592 }
593 # attribute => 'Comment'
594 # char => '%'
595 # context => 'Comment'
596 # type => 'DetectChar'
597 240 ▶ if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "%", 0, 0, 0, undef, 0, "Comment", "Comment")) 14 226 240
598 14 return 1
599 }
600 226 return 0;
601 };
602  
603 34 ▶sub parseToEndOfLine {
Subroutine parseToEndOfLine: called CC=1 SCAR=0.0
Pod undocumented
604 34 my ($self, $text) = @_;
605 34 return 0;
606 };
607  
608 2 ▶sub parseVerb {
Subroutine parseVerb: called CC=2 SCAR=7.6
Pod undocumented
609 2 my ($self, $text) = @_;
610 # String => '(.).*\1'
611 # attribute => 'Verbatim'
612 # context => '#pop#pop'
613 # minimal => 'true'
614 # type => 'RegExpr'
615 2 ▶ if ($self->testRegExpr($text, '(.).*?\\1', 0, 0, 0, undef, 0, '#pop#pop', 'Verbatim')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "(.).*?\\1", 0, 0, 0, undef, 0, "#pop#pop", "Verbatim")) 0 2 2
616 0 return 1
617 }
618 2 return 0;
619 };
620  
621 18 ▶sub parseVerbFindEnd {
Subroutine parseVerbFindEnd: called CC=4 SCAR=14.0
Pod undocumented
622 18 my ($self, $text) = @_;
623 # attribute => 'Normal Text'
624 # char => '{'
625 # context => '#stay'
626 # type => 'DetectChar'
627 18 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 6 12 18
628 6 return 1
629 }
630 # String => '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?'
631 # attribute => 'Environment'
632 # context => '#stay'
633 # type => 'RegExpr'
634 12 ▶ if ($self->testRegExpr($text, '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?', 0, 0, 0, undef, 0, '#stay', 'Environment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?", 0, 0, 0, undef, 0, "#stay", "Environment")) 6 6 12
635 6 return 1
636 }
637 # attribute => 'Normal Text'
638 # char => '}'
639 # context => '#pop#pop#pop#pop#pop'
640 # endRegion => 'block'
641 # type => 'DetectChar'
642 6 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop#pop#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop#pop#pop#pop#pop", "Normal Text")) 6 0 6
643 6 return 1
644 }
645 0 return 0;
646 };
647  
648 264 ▶sub parseVerbatim {
Subroutine parseVerbatim: called CC=2 SCAR=6.9
Pod undocumented
649 264 my ($self, $text) = @_;
650 # String => '\\end(?=\{(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?\})'
651 # attribute => 'Structure'
652 # context => 'VerbFindEnd'
653 # type => 'RegExpr'
654 264 ▶ if ($self->testRegExpr($text, '\\\\end(?=\\{(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?\\})', 0, 0, 0, undef, 0, 'VerbFindEnd', 'Structure')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\\end(?=\\{(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?\\})", 0, 0, 0, undef, 0, "VerbFindEnd", "Structure")) 6 258 264
655 6 return 1
656 }
657 258 return 0;
658 };
659  
660 6 ▶sub parseVerbatimEnv {
Subroutine parseVerbatimEnv: called CC=4 SCAR=19.4
Pod undocumented
661 6 my ($self, $text) = @_;
662 # attribute => 'Normal Text'
663 # char => '*'
664 # context => '#stay'
665 # type => 'DetectChar'
666 6 ▶ if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "*", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 0 6 6
667 0 return 1
668 }
669 # attribute => 'Normal Text'
670 # char => '}'
671 # context => 'Verbatim'
672 # type => 'DetectChar'
673 6 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'Verbatim', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "Verbatim", "Normal Text")) 6 0 6
674 6 return 1
675 }
676 # String => '\S'
677 # attribute => 'Normal Text'
678 # context => '#pop'
679 # type => 'RegExpr'
680 0 ▶ if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\S", 0, 0, 0, undef, 0, "#pop", "Normal Text")) 0 0 0
681 0 return 1
682 }
683 0 return 0;
684 };
685  
686  
687 1 1;
688  
689 __END__
« Kate/JavaScript.pm ↑ Summary Kate/CSS.pm »