Kate/SML.pm

filter: Statementstmt 46.1% 24 / 52 Branchbran 0.0% 0 / 22 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 4 / 8 Podpod 0.0% 0 / 5 totaltotal 31.5% 29 / 92 SCAR 41.8
CC
13
Cov
32%
parseNormal
90.0
parseString
12.0
parseMultilineInlineComment
6.0
CRAP 65.1
« Kate/POVminusRay.pm ↑ Summary Kate/Debian_Changelog.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 'sml.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.06
9 #kate version 2.1
10 #kate author Christoph Cullmann (cullmann@kde.org)
11 #generated: Sun Feb 3 22:02:06 2008, localtime
12  
13 package Syntax::Highlight::Engine::Kate::SML;
14  
15 1 our $VERSION = '0.14';
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 sub new {
22 1 ▶ my $proto = shift;
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
23 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
24 1 my $self = $class->SUPER::new(@_);
25 1 $self->attributes({
26 'Comment' => 'Comment',
27 'Data Type' => 'DataType',
28 'Decimal' => 'DecVal',
29 'Float' => 'Float',
30 'Keyword' => 'Keyword',
31 'Normal Text' => 'Normal',
32 'Notice' => 'String',
33 'String' => 'String',
34 'String Char' => 'Char',
35 });
36 1 $self->listAdd('keywords',
37 'abstype',
38 'and',
39 'andalso',
40 'as',
41 'case',
42 'datatype',
43 'do',
44 'else',
45 'end',
46 'eqtype',
47 'exception',
48 'false',
49 'fn',
50 'fun',
51 'functor',
52 'handle',
53 'if',
54 'in',
55 'include',
56 'infix',
57 'infixr',
58 'let',
59 'local',
60 'nonfix',
61 'of',
62 'op',
63 'open',
64 'orelse',
65 'raise',
66 'rec',
67 'sharing',
68 'sig',
69 'signature',
70 'struct',
71 'structure',
72 'then',
73 'true',
74 'type',
75 'val',
76 'where',
77 'while',
78 'with',
79 'withtype',
80 );
81 1 $self->listAdd('types',
82 'array',
83 'bool',
84 'char',
85 'int',
86 'list',
87 'option',
88 'order',
89 'real',
90 'ref',
91 'string',
92 'substring',
93 'unit',
94 'vector',
95 'word',
96 );
97 1 $self->contextdata({
98 'Multiline/Inline Comment' => {
99 callback => \&parseMultilineInlineComment,
100 attribute => 'Comment',
101 },
102 'Normal' => {
103 callback => \&parseNormal,
104 attribute => 'Normal Text',
105 },
106 'String' => {
107 callback => \&parseString,
108 attribute => 'String',
109 },
110 });
111 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
112 1 $self->basecontext('Normal');
113 1 $self->keywordscase(0);
114 1 $self->initialize;
115 1 bless ($self, $class);
116 1 return $self;
117 }
118  
119 sub language {
120 0 ▶ return 'SML';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
121 }
122  
123 sub parseMultilineInlineComment {
124 0 ▶ my ($self, $text) = @_;
Subroutine parseMultilineInlineComment: not called CC=2 SCAR=17.9
Pod undocumented
125 # attribute => 'Comment'
126 # char => '*'
127 # char1 => ')'
128 # context => '#pop'
129 # type => 'Detect2Chars'
130 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
131 0 return 1
132 }
133 0 return 0;
134 };
135  
136 sub parseNormal {
137 0 ▶ my ($self, $text) = @_;
Subroutine parseNormal: not called CC=9 SCAR=45.0
Pod undocumented
138 # attribute => 'Comment'
139 # char => '('
140 # char1 => '*'
141 # context => 'Multiline/Inline Comment'
142 # type => 'Detect2Chars'
143 0 ▶ if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Multiline/Inline Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "(", "*", 0, 0, 0, undef, 0, "Multiline/Inline Comment", "Comment")) 0 0 0
144 0 return 1
145 }
146 # attribute => 'String'
147 # char => '"'
148 # context => 'String'
149 # type => 'DetectChar'
150 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
151 0 return 1
152 }
153 # String => 'keywords'
154 # attribute => 'Keyword'
155 # context => '#stay'
156 # type => 'keyword'
157 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
158 0 return 1
159 }
160 # String => 'types'
161 # attribute => 'Data Type'
162 # context => '#stay'
163 # type => 'keyword'
164 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
165 0 return 1
166 }
167 # attribute => 'Float'
168 # context => '#stay'
169 # items => 'ARRAY(0x18342d0)'
170 # type => 'Float'
171 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
172 # String => 'fF'
173 # attribute => 'Float'
174 # context => '#stay'
175 # type => 'AnyChar'
176 0 ▶ if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "fF", 0, 0, undef, 0, "#stay", "Float")) 0 0 0
177 0 return 1
178 }
179 }
180 # attribute => 'Decimal'
181 # context => '#stay'
182 # type => 'HlCHex'
183 0 ▶ if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Decimal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCHex($text, 0, undef, 0, "#stay", "Decimal")) 0 0 0
184 0 return 1
185 }
186 # attribute => 'Decimal'
187 # context => '#stay'
188 # type => 'Int'
189 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
190 0 return 1
191 }
192 0 return 0;
193 };
194  
195 sub parseString {
196 0 ▶ my ($self, $text) = @_;
Subroutine parseString: not called CC=3 SCAR=24.8
Pod undocumented
197 # attribute => 'String Char'
198 # context => '#stay'
199 # type => 'HlCStringChar'
200 0 ▶ if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCStringChar($text, 0, undef, 0, "#stay", "String Char")) 0 0 0
201 0 return 1
202 }
203 # attribute => 'String'
204 # char => '"'
205 # context => '#pop'
206 # type => 'DetectChar'
207 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
208 0 return 1
209 }
210 0 return 0;
211 };
212  
213  
214 1 1;
215  
216 __END__
« Kate/POVminusRay.pm ↑ Summary Kate/Debian_Changelog.pm »