Kate/Modulaminus2.pm

filter: Statementstmt 39.0% 25 / 64 Branchbran 0.0% 0 / 26 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 36.3% 4 / 11 Podpod 0.0% 0 / 8 totaltotal 26.3% 30 / 114 SCAR 46.0
CC
15
Cov
28%
parseNormal
110.0
parseComment2
6.0
parsePrep1
6.0
CRAP 99.1
« Kate/LaTeX.pm ↑ Summary Kate/VHDL.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 'modula-2.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.03
9 #kate version 2.1
10 #generated: Sun Feb 3 22:02:05 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::Modulaminus2;
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 'Comment' => 'Comment',
26 'Directive' => 'Others',
27 'Keyword' => 'Keyword',
28 'Normal Text' => 'Normal',
29 'Number' => 'DecVal',
30 'String' => 'String',
31 'Type' => 'DataType',
32 });
33 1 $self->listAdd('directives',
34 'ALLOCATE',
35 'ASSEMBLER',
36 'Accessible',
37 'Append',
38 'Assign',
39 'CAPS',
40 'Close',
41 'Concat',
42 'Copy',
43 'DEALLOCATE',
44 'Delete',
45 'Done',
46 'EOF',
47 'EmptyString',
48 'Erase',
49 'GetArgs',
50 'GetCard',
51 'GetChar',
52 'GetEnv',
53 'GetInt',
54 'GetLongReal',
55 'GetReal',
56 'GetString',
57 'Insert',
58 'Length',
59 'Open',
60 'OpenInput',
61 'OpenOutput',
62 'PutBf',
63 'PutCard',
64 'PutChar',
65 'PutInt',
66 'PutLn',
67 'PutLongReal',
68 'PutReal',
69 'PutString',
70 'Read',
71 'ReadCard',
72 'ReadInt',
73 'ReadLongReal',
74 'ReadReal',
75 'ReadString',
76 'ResetClock',
77 'SIZE',
78 'StrEq',
79 'SystemTime',
80 'UserTime',
81 'Write',
82 'WriteBf',
83 'WriteCard',
84 'WriteInt',
85 'WriteLn',
86 'WriteLongReal',
87 'WriteReal',
88 'WriteString',
89 'compare',
90 'pos',
91 );
92 1 $self->listAdd('keywords',
93 'ABS',
94 'AND',
95 'ARRAY',
96 'ASM',
97 'BEGIN',
98 'BITSET',
99 'BY',
100 'CAP',
101 'CASE',
102 'CHR',
103 'CONST',
104 'DEC',
105 'DEFINITION',
106 'DIV',
107 'DO',
108 'ELSE',
109 'ELSIF',
110 'END',
111 'EXCL',
112 'EXIT',
113 'EXPORT',
114 'FALSE',
115 'FOR',
116 'FOREIGN',
117 'FROM',
118 'HALT',
119 'HIGH',
120 'IF',
121 'IMPLEMENTATION',
122 'IMPORT',
123 'IN',
124 'INC',
125 'INCL',
126 'IOTRANSFER',
127 'LOOP',
128 'MAX',
129 'MIN',
130 'MOD',
131 'MODULE',
132 'NEWPROCESS',
133 'NIL',
134 'NOT',
135 'ODD',
136 'OF',
137 'OR',
138 'ORD',
139 'PROC',
140 'PROCEDURE',
141 'QUALIFIED',
142 'RECORD',
143 'REPEAT',
144 'RETURN',
145 'SET',
146 'THEN',
147 'TO',
148 'TRANSFER',
149 'TRUE',
150 'TRUNC',
151 'TYPE',
152 'UNTIL',
153 'VAL',
154 'VAR',
155 'WHILE',
156 'WITH',
157 );
158 1 $self->listAdd('types',
159 'ADDRESS',
160 'ADR',
161 'BOOLEAN',
162 'CARDINAL',
163 'CHAR',
164 'File',
165 'INTEGER',
166 'LONGINT',
167 'LONGREAL',
168 'POINTER',
169 'REAL',
170 'SHORTCARD',
171 'SHORTINT',
172 );
173 1 $self->contextdata({
174 'Comment2' => {
175 callback => \&parseComment2,
176 attribute => 'Comment',
177 },
178 'Comment3' => {
179 callback => \&parseComment3,
180 attribute => 'Comment',
181 lineending => '#pop',
182 },
183 'Normal' => {
184 callback => \&parseNormal,
185 attribute => 'Normal Text',
186 },
187 'Prep1' => {
188 callback => \&parsePrep1,
189 attribute => 'Directive',
190 },
191 'String1' => {
192 callback => \&parseString1,
193 attribute => 'String',
194 lineending => '#pop',
195 },
196 'String2' => {
197 callback => \&parseString2,
198 attribute => 'String',
199 lineending => '#pop',
200 },
201 });
202 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
203 1 $self->basecontext('Normal');
204 1 $self->keywordscase(0);
205 1 $self->initialize;
206 1 bless ($self, $class);
207 1 return $self;
208 }
209  
210 sub language {
211 0 ▶ return 'Modula-2';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
212 }
213  
214 sub parseComment2 {
215 0 ▶ my ($self, $text) = @_;
Subroutine parseComment2: not called CC=2 SCAR=17.9
Pod undocumented
216 # attribute => 'Comment'
217 # char => '*'
218 # char1 => ')'
219 # context => '#pop'
220 # type => 'Detect2Chars'
221 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
222 0 return 1
223 }
224 0 return 0;
225 };
226  
227 sub parseComment3 {
228 0 ▶ my ($self, $text) = @_;
Subroutine parseComment3: not called CC=1 SCAR=6.9
Pod undocumented
229 0 return 0;
230 };
231  
232 sub parseNormal {
233 0 ▶ my ($self, $text) = @_;
Subroutine parseNormal: not called CC=10 SCAR=47.0
Pod undocumented
234 # String => 'keywords'
235 # attribute => 'Keyword'
236 # context => '#stay'
237 # type => 'keyword'
238 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
239 0 return 1
240 }
241 # String => 'directives'
242 # attribute => 'Directive'
243 # context => '#stay'
244 # type => 'keyword'
245 0 ▶ if ($self->testKeyword($text, 'directives', 0, undef, 0, '#stay', 'Directive')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "directives", 0, undef, 0, "#stay", "Directive")) 0 0 0
246 0 return 1
247 }
248 # String => 'types'
249 # attribute => 'Type'
250 # context => '#stay'
251 # type => 'keyword'
252 0 ▶ if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "types", 0, undef, 0, "#stay", "Type")) 0 0 0
253 0 return 1
254 }
255 # attribute => 'Number'
256 # context => '#stay'
257 # type => 'Float'
258 0 ▶ if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testFloat($text, 0, undef, 0, "#stay", "Number")) 0 0 0
259 0 return 1
260 }
261 # attribute => 'Number'
262 # context => '#stay'
263 # type => 'Int'
264 0 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Number")) 0 0 0
265 0 return 1
266 }
267 # attribute => 'String'
268 # char => '"'
269 # context => 'String1'
270 # type => 'DetectChar'
271 0 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String1', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "String1", "String")) 0 0 0
272 0 return 1
273 }
274 # attribute => 'String'
275 # char => '''
276 # context => 'String2'
277 # type => 'DetectChar'
278 0 ▶ if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String2', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "String2", "String")) 0 0 0
279 0 return 1
280 }
281 # String => '(*$'
282 # attribute => 'Directive'
283 # context => 'Prep1'
284 # type => 'StringDetect'
285 0 ▶ if ($self->testStringDetect($text, '(*$', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "(*\$", 0, 0, 0, undef, 0, "Prep1", "Directive")) 0 0 0
286 0 return 1
287 }
288 # attribute => 'Comment'
289 # char => '('
290 # char1 => '*'
291 # context => 'Comment2'
292 # type => 'Detect2Chars'
293 0 ▶ if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "(", "*", 0, 0, 0, undef, 0, "Comment2", "Comment")) 0 0 0
294 0 return 1
295 }
296 0 return 0;
297 };
298  
299 sub parsePrep1 {
300 0 ▶ my ($self, $text) = @_;
Subroutine parsePrep1: not called CC=2 SCAR=17.9
Pod undocumented
301 # String => '$*)'
302 # attribute => 'Directive'
303 # context => 'Prep1'
304 # type => 'StringDetect'
305 0 ▶ if ($self->testStringDetect($text, '$*)', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "\$*)", 0, 0, 0, undef, 0, "Prep1", "Directive")) 0 0 0
306 0 return 1
307 }
308 0 return 0;
309 };
310  
311 sub parseString1 {
312 0 ▶ my ($self, $text) = @_;
Subroutine parseString1: not called CC=2 SCAR=17.9
Pod undocumented
313 # attribute => 'String'
314 # char => '"'
315 # context => '#pop'
316 # type => 'DetectChar'
317 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
318 0 return 1
319 }
320 0 return 0;
321 };
322  
323 sub parseString2 {
324 0 ▶ my ($self, $text) = @_;
Subroutine parseString2: not called CC=2 SCAR=17.9
Pod undocumented
325 # attribute => 'String'
326 # char => '''
327 # context => '#pop'
328 # type => 'DetectChar'
329 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
330 0 return 1
331 }
332 0 return 0;
333 };
334  
335  
336 1 1;
337  
338 __END__
« Kate/LaTeX.pm ↑ Summary Kate/VHDL.pm »