Kate/Yacas.pm

filter: Statementstmt 38.3% 23 / 60 Branchbran 0.0% 0 / 28 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 44.4% 4 / 9 Podpod 0.0% 0 / 6 totaltotal 25.9% 28 / 108 SCAR 47.7
CC
16
Cov
26%
parsedefault
110.0
parsemultilinecomment
12.0
parsestring
12.0
CRAP 118.2
« Kate/REXX.pm ↑ Summary Kate/Kate_File_Template.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 'yacas.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.02
9 #kate version 2.3
10 #generated: Sun Feb 3 22:02:06 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::Yacas;
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 'Char' => 'Char',
26 'Comment' => 'Comment',
27 'Decimal' => 'DecVal',
28 'Float' => 'Float',
29 'Highlight' => 'Alert',
30 'Keyword' => 'Keyword',
31 'Normal Text' => 'Normal',
32 'Parens' => 'Normal',
33 'String' => 'String',
34 'Symbol' => 'Others',
35 });
36 1 $self->listAdd('keywords',
37 '=',
38 'And',
39 'ApplyPure',
40 'ArrayCreate',
41 'ArrayGet',
42 'ArraySet',
43 'ArraySize',
44 'Atom',
45 'Berlekamp',
46 'BitAnd',
47 'BitOr',
48 'BitXor',
49 'Bodied',
50 'CTokenizer',
51 'Check',
52 'Clear',
53 'CommonLispTokenizer',
54 'Concat',
55 'ConcatStrings',
56 'CurrentFile',
57 'CurrentLine',
58 'CustomEval',
59 'CustomEval\\\'Expression',
60 'CustomEval\\\'Locals',
61 'CustomEval\\\'Result',
62 'CustomEval\\\'Stop',
63 'DefLoad',
64 'DefLoadFunction',
65 'DefMacroRuleBase',
66 'DefMacroRuleBaseListed',
67 'DefaultDirectory',
68 'DefaultTokenizer',
69 'Delete',
70 'DestructiveDelete',
71 'DestructiveInsert',
72 'DestructiveReplace',
73 'DestructiveReverse',
74 'DllEnumerate',
75 'DllLoad',
76 'DllUnload',
77 'Equals',
78 'Eval',
79 'FastArcCos',
80 'FastArcSin',
81 'FastArcTan',
82 'FastAssoc',
83 'FastCos',
84 'FastExp',
85 'FastIsPrime',
86 'FastLog',
87 'FastPower',
88 'FastSin',
89 'FastTan',
90 'FindFile',
91 'FindFunction',
92 'FlatCopy',
93 'FromBase',
94 'FromFile',
95 'FromString',
96 'FullForm',
97 'GarbageCollect',
98 'GenericTypeName',
99 'GetExtraInfo',
100 'GetPrecision',
101 'GreaterThan',
102 'Head',
103 'Hold',
104 'HoldArg',
105 'If',
106 'Infix',
107 'Insert',
108 'IsAtom',
109 'IsBodied',
110 'IsBound',
111 'IsFunction',
112 'IsGeneric',
113 'IsInfix',
114 'IsInteger',
115 'IsList',
116 'IsNumber',
117 'IsPostfix',
118 'IsPrefix',
119 'IsString',
120 'LazyGlobal',
121 'LeftPrecedence',
122 'Length',
123 'LessThan',
124 'LispRead',
125 'LispReadListed',
126 'List',
127 'Listify',
128 'Load',
129 'Local',
130 'LocalSymbols',
131 'MacroClear',
132 'MacroLocal',
133 'MacroRule',
134 'MacroRuleBase',
135 'MacroRuleBaseListed',
136 'MacroRulePattern',
137 'MacroSet',
138 'MathAbs',
139 'MathAdd',
140 'MathAnd',
141 'MathArcCos',
142 'MathArcSin',
143 'MathArcTan',
144 'MathCeil',
145 'MathCos',
146 'MathDiv',
147 'MathDivide',
148 'MathExp',
149 'MathFac',
150 'MathFloor',
151 'MathGcd',
152 'MathGetExactBits',
153 'MathLibrary',
154 'MathLog',
155 'MathMod',
156 'MathMultiply',
157 'MathNot',
158 'MathNth',
159 'MathOr',
160 'MathPi',
161 'MathPower',
162 'MathSetExactBits',
163 'MathSin',
164 'MathSqrt',
165 'MathSubtract',
166 'MathTan',
167 'MaxEvalDepth',
168 'Not',
169 'OpLeftPrecedence',
170 'OpPrecedence',
171 'OpRightPrecedence',
172 'Or',
173 'PatchLoad',
174 'PatchString',
175 'PatternCreate',
176 'PatternMatches',
177 'Postfix',
178 'Precision',
179 'Prefix',
180 'PrettyPrinter',
181 'Prog',
182 'Read',
183 'ReadToken',
184 'Replace',
185 'Retract',
186 'RightAssociative',
187 'RightPrecedence',
188 'Rule',
189 'RuleBase',
190 'RuleBaseArgList',
191 'RuleBaseDefined',
192 'RuleBaseListed',
193 'RulePattern',
194 'Secure',
195 'Set',
196 'SetExtraInfo',
197 'SetStringMid',
198 'ShiftLeft',
199 'ShiftRight',
200 'String',
201 'StringMid',
202 'Subst',
203 'SystemCall',
204 'Tail',
205 'ToBase',
206 'ToFile',
207 'ToString',
208 'TraceRule',
209 'TraceStack',
210 'Type',
211 'UnFence',
212 'UnList',
213 'Use',
214 'Version',
215 'While',
216 'Write',
217 'WriteString',
218 'XmlExplodeTag',
219 'XmlTokenizer',
220 '`',
221 );
222 1 $self->contextdata({
223 'default' => {
224 callback => \&parsedefault,
225 attribute => 'Normal Text',
226 },
227 'linecomment' => {
228 callback => \&parselinecomment,
229 attribute => 'Comment',
230 lineending => '#pop',
231 },
232 'multilinecomment' => {
233 callback => \&parsemultilinecomment,
234 attribute => 'Comment',
235 },
236 'string' => {
237 callback => \&parsestring,
238 attribute => 'String',
239 lineending => '#pop',
240 },
241 });
242 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|=|`');
243 1 $self->basecontext('default');
244 1 $self->keywordscase(0);
245 1 $self->initialize;
246 1 bless ($self, $class);
247 1 return $self;
248 }
249  
250 sub language {
251 0 ▶ return 'yacas';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
252 }
253  
254 sub parsedefault {
255 0 ▶ my ($self, $text) = @_;
Subroutine parsedefault: not called CC=10 SCAR=47.0
Pod undocumented
256 # attribute => 'String'
257 # char => '"'
258 # context => 'string'
259 # type => 'DetectChar'
260 0 ▶ 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 0 0
261 0 return 1
262 }
263 # attribute => 'Comment'
264 # char => '/'
265 # char1 => '/'
266 # context => 'linecomment'
267 # type => 'Detect2Chars'
268 0 ▶ if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'linecomment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", "/", 0, 0, 0, undef, 0, "linecomment", "Comment")) 0 0 0
269 0 return 1
270 }
271 # attribute => 'Comment'
272 # char => '/'
273 # char1 => '*'
274 # context => 'multilinecomment'
275 # type => 'Detect2Chars'
276 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
277 0 return 1
278 }
279 # String => 'keywords'
280 # attribute => 'Keyword'
281 # context => '#stay'
282 # type => 'keyword'
283 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
284 0 return 1
285 }
286 # String => '{[('
287 # attribute => 'Parens'
288 # beginRegion => 'brace'
289 # context => '#stay'
290 # type => 'AnyChar'
291 0 ▶ if ($self->testAnyChar($text, '{[(', 0, 0, undef, 0, '#stay', 'Parens')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "{[(", 0, 0, undef, 0, "#stay", "Parens")) 0 0 0
292 0 return 1
293 }
294 # String => '}])'
295 # attribute => 'Parens'
296 # context => '#stay'
297 # endRegion => 'brace'
298 # type => 'AnyChar'
299 0 ▶ if ($self->testAnyChar($text, '}])', 0, 0, undef, 0, '#stay', 'Parens')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "}])", 0, 0, undef, 0, "#stay", "Parens")) 0 0 0
300 0 return 1
301 }
302 # String => '+-*/=`~:!@#$^&*_|<>'
303 # attribute => 'Symbol'
304 # context => '#stay'
305 # type => 'AnyChar'
306 0 ▶ if ($self->testAnyChar($text, '+-*/=`~:!@#$^&*_|<>', 0, 0, undef, 0, '#stay', 'Symbol')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "+-*/=`~:!\@#\$^&*_|<>", 0, 0, undef, 0, "#stay", "Symbol")) 0 0 0
307 0 return 1
308 }
309 # attribute => 'Float'
310 # context => '#stay'
311 # type => 'Float'
312 0 ▶ if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testFloat($text, 0, undef, 0, "#stay", "Float")) 0 0 0
313 0 return 1
314 }
315 # attribute => 'Decimal'
316 # context => '#stay'
317 # type => 'Int'
318 0 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Decimal")) 0 0 0
319 0 return 1
320 }
321 0 return 0;
322 };
323  
324 sub parselinecomment {
325 0 ▶ my ($self, $text) = @_;
Subroutine parselinecomment: not called CC=2 SCAR=17.9
Pod undocumented
326 # String => '(FIXME|TODO)'
327 # attribute => 'Highlight'
328 # context => '#stay'
329 # type => 'RegExpr'
330 0 ▶ if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Highlight')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "(FIXME|TODO)", 0, 0, 0, undef, 0, "#stay", "Highlight")) 0 0 0
331 0 return 1
332 }
333 0 return 0;
334 };
335  
336 sub parsemultilinecomment {
337 0 ▶ my ($self, $text) = @_;
Subroutine parsemultilinecomment: not called CC=3 SCAR=24.8
Pod undocumented
338 # attribute => 'Comment'
339 # char => '*'
340 # char1 => '/'
341 # context => '#pop'
342 # type => 'Detect2Chars'
343 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
344 0 return 1
345 }
346 # String => '(FIXME|TODO)'
347 # attribute => 'Highlight'
348 # context => '#stay'
349 # type => 'RegExpr'
350 0 ▶ if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Highlight')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "(FIXME|TODO)", 0, 0, 0, undef, 0, "#stay", "Highlight")) 0 0 0
351 0 return 1
352 }
353 0 return 0;
354 };
355  
356 sub parsestring {
357 0 ▶ my ($self, $text) = @_;
Subroutine parsestring: not called CC=3 SCAR=24.8
Pod undocumented
358 # attribute => 'String'
359 # context => '#stay'
360 # type => 'LineContinue'
361 0 ▶ if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testLineContinue($text, 0, undef, 0, "#stay", "String")) 0 0 0
362 0 return 1
363 }
364 # attribute => 'String'
365 # char => '"'
366 # context => '#pop'
367 # type => 'DetectChar'
368 0 ▶ 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")) 0 0 0
369 0 return 1
370 }
371 0 return 0;
372 };
373  
374  
375 1 1;
376  
377 __END__
« Kate/REXX.pm ↑ Summary Kate/Kate_File_Template.pm »