Kate/Sather.pm

filter: Statementstmt 50.0% 25 / 50 Branchbran 0.0% 0 / 18 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 4 / 8 Podpod 0.0% 0 / 5 totaltotal 34.8% 30 / 86 SCAR 37.3
CC
11
Cov
37%
parseNormal
90.0
parseString
6.0
new
2.0
CRAP 41.8
« Kate/Eiffel.pm ↑ Summary Kate/CUE_Sheet.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 'sather.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:06 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::Sather;
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 'Data Type' => 'DataType',
28 'Decimal' => 'DecVal',
29 'Features' => 'Others',
30 'Float' => 'Float',
31 'Keyword' => 'Keyword',
32 'Normal Text' => 'Normal',
33 'String' => 'String',
34 });
35 1 $self->listAdd('features',
36 'aget',
37 'aset',
38 'create',
39 'div',
40 'invariant',
41 'is_eq',
42 'is_geq',
43 'is_gt',
44 'is_leq',
45 'is_lt',
46 'is_neq',
47 'main',
48 'minus',
49 'mod',
50 'negate',
51 'not',
52 'plus',
53 'pow',
54 'times',
55 );
56 1 $self->listAdd('keywords',
57 'ITER',
58 'ROUT',
59 'SAME',
60 'abstract',
61 'and',
62 'any',
63 'assert',
64 'attr',
65 'bind',
66 'break!',
67 'case',
68 'class',
69 'const',
70 'else',
71 'elsif',
72 'end',
73 'exception',
74 'external',
75 'false',
76 'fork',
77 'guard',
78 'if',
79 'immutable',
80 'in',
81 'include',
82 'initial',
83 'inout',
84 'is',
85 'lock',
86 'loop',
87 'new',
88 'once',
89 'or',
90 'out',
91 'par',
92 'parloop',
93 'partial',
94 'post',
95 'pre',
96 'private',
97 'protect',
98 'quit',
99 'raise',
100 'readonly',
101 'result',
102 'return',
103 'self',
104 'shared',
105 'spread',
106 'stub',
107 'then',
108 'true',
109 'type',
110 'typecase',
111 'until!',
112 'value',
113 'void',
114 'when',
115 'while!',
116 'yield',
117 );
118 1 $self->listAdd('types',
119 '$OB',
120 '$REHASH',
121 'AREF',
122 'ARRAY',
123 'AVAL',
124 'BOOL',
125 'CHAR',
126 'EXT_OB',
127 'FLT',
128 'FLTD',
129 'FLTDX',
130 'FLTI',
131 'FLTX',
132 'INT',
133 'INTI',
134 'STR',
135 'SYS',
136 );
137 1 $self->contextdata({
138 'Comment' => {
139 callback => \&parseComment,
140 attribute => 'Comment',
141 lineending => '#pop',
142 },
143 'Normal' => {
144 callback => \&parseNormal,
145 attribute => 'Normal Text',
146 },
147 'String' => {
148 callback => \&parseString,
149 attribute => 'String',
150 },
151 });
152 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\$|\\!');
153 1 $self->basecontext('Normal');
154 1 $self->keywordscase(0);
155 1 $self->initialize;
156 1 bless ($self, $class);
157 1 return $self;
158 }
159  
160 sub language {
161 0 ▶ return 'Sather';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
162 }
163  
164 sub parseComment {
165 0 ▶ my ($self, $text) = @_;
Subroutine parseComment: not called CC=1 SCAR=6.9
Pod undocumented
166 0 return 0;
167 };
168  
169 sub parseNormal {
170 0 ▶ my ($self, $text) = @_;
Subroutine parseNormal: not called CC=9 SCAR=45.0
Pod undocumented
171 # String => 'keywords'
172 # attribute => 'Keyword'
173 # context => '#stay'
174 # type => 'keyword'
175 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
176 0 return 1
177 }
178 # String => 'types'
179 # attribute => 'Data Type'
180 # context => '#stay'
181 # type => 'keyword'
182 0 ▶ if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "types", 0, undef, 0, "#stay", "Data Type")) 0 0 0
183 0 return 1
184 }
185 # String => 'features'
186 # attribute => 'Features'
187 # context => '#stay'
188 # type => 'keyword'
189 0 ▶ if ($self->testKeyword($text, 'features', 0, undef, 0, '#stay', 'Features')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "features", 0, undef, 0, "#stay", "Features")) 0 0 0
190 0 return 1
191 }
192 # attribute => 'Float'
193 # context => '#stay'
194 # type => 'Float'
195 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
196 0 return 1
197 }
198 # attribute => 'Decimal'
199 # context => '#stay'
200 # type => 'Int'
201 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
202 0 return 1
203 }
204 # String => ''.''
205 # attribute => 'Char'
206 # context => '#stay'
207 # type => 'RegExpr'
208 0 ▶ if ($self->testRegExpr($text, '\'.\'', 0, 0, 0, undef, 0, '#stay', 'Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "'.'", 0, 0, 0, undef, 0, "#stay", "Char")) 0 0 0
209 0 return 1
210 }
211 # attribute => 'String'
212 # char => '"'
213 # context => 'String'
214 # type => 'DetectChar'
215 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
216 0 return 1
217 }
218 # attribute => 'Comment'
219 # char => '-'
220 # char1 => '-'
221 # context => 'Comment'
222 # type => 'Detect2Chars'
223 0 ▶ if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "-", "-", 0, 0, 0, undef, 0, "Comment", "Comment")) 0 0 0
224 0 return 1
225 }
226 0 return 0;
227 };
228  
229 sub parseString {
230 0 ▶ my ($self, $text) = @_;
Subroutine parseString: not called CC=2 SCAR=17.9
Pod undocumented
231 # attribute => 'String'
232 # char => '"'
233 # context => '#pop'
234 # type => 'DetectChar'
235 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
236 0 return 1
237 }
238 0 return 0;
239 };
240  
241  
242 1 1;
243  
244 __END__
« Kate/Eiffel.pm ↑ Summary Kate/CUE_Sheet.pm »