Kate/Xorg_Configuration.pm

filter: Statementstmt 86.3% 63 / 73 Branchbran 77.5% 31 / 40 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 90.0% 9 / 10 Podpod 0.0% 0 / 7 totaltotal 77.0% 104 / 135 CC 22 SCAR 16.0
CC
22
Cov
82%
parseKeyword
7.6
parseSectionContent
6.0
parseSection
5.9
CRAP 4.9
« Kate/Stata.pm ↑ Summary Kate/CMake.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 'xorg.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.01
9 #kate author Jan Janssen (medhefgo@web.de)
10 #generated: Sun Feb 3 22:02:06 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::Xorg_Configuration;
13  
14 1 our $VERSION = '0.16';
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 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
21 2 my $proto = shift;
22 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
23 2 my $self = $class->SUPER::new(@_);
24 2 $self->attributes({
25 'Alert' => 'Error',
26 'Comment' => 'Comment',
27 'Float' => 'Float',
28 'Int' => 'DecVal',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'Normal',
31 'Section' => 'Function',
32 'Section Name' => 'String',
33 'Value' => 'DataType',
34 'Value2' => 'Others',
35 });
36 2 $self->contextdata({
37 'Comment' => {
38 callback => \&parseComment,
39 attribute => 'Comment',
40 lineending => '#pop',
41 },
42 'Keyword' => {
43 callback => \&parseKeyword,
44 attribute => 'Keyword',
45 lineending => '#pop',
46 },
47 'Section' => {
48 callback => \&parseSection,
49 attribute => 'Normal Text',
50 },
51 'Section Content' => {
52 callback => \&parseSectionContent,
53 attribute => 'Normal Text',
54 },
55 'xorg' => {
56 callback => \&parsexorg,
57 attribute => 'Normal Text',
58 },
59 });
60 2 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
61 2 $self->basecontext('xorg');
62 2 $self->keywordscase(1);
63 2 $self->initialize;
64 2 bless ($self, $class);
65 2 return $self;
66 }
67  
68 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
69 0 return 'x.org Configuration';
70 }
71  
72 380 ▶sub parseComment {
Subroutine parseComment: called CC=4 SCAR=14.0
Pod undocumented
73 380 my ($self, $text) = @_;
74 # type => 'DetectSpaces'
75 380 ▶ if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectSpaces($text, 0, undef, 0, "#stay", undef)) 96 284 380
76 96 return 1
77 }
78 # context => '##Alerts'
79 # type => 'IncludeRules'
80 284 ▶ if ($self->includePlugin('Alerts', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includePlugin("Alerts", $text)) 0 284 284
81 0 return 1
82 }
83 # type => 'DetectIdentifier'
84 284 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", undef)) 106 178 284
85 106 return 1
86 }
87 178 return 0;
88 };
89  
90 1972 ▶sub parseKeyword {
Subroutine parseKeyword: called CC=7 SCAR=20.3
Pod undocumented
91 1972 my ($self, $text) = @_;
92 # attribute => 'Value'
93 # char => '"'
94 # char1 => '"'
95 # type => 'RangeDetect'
96 1972 ▶ if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRangeDetect($text, "\"", "\"", 0, 0, undef, 0, "#stay", "Value")) 230 1742 1972
97 230 return 1
98 }
99 # attribute => 'Value'
100 # char => '''
101 # char1 => '''
102 # type => 'RangeDetect'
103 1742 ▶ if ($self->testRangeDetect($text, '\'', '\'', 0, 0, undef, 0, '#stay', 'Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRangeDetect($text, "'", "'", 0, 0, undef, 0, "#stay", "Value")) 0 1742 1742
104 0 return 1
105 }
106 # attribute => 'Float'
107 # type => 'Float'
108 1742 ▶ if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testFloat($text, 0, undef, 0, "#stay", "Float")) 74 1668 1742
109 74 return 1
110 }
111 # attribute => 'Int'
112 # type => 'Int'
113 1668 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Int')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Int")) 0 1668 1668
114 0 return 1
115 }
116 # String => '[\w\d]+'
117 # attribute => 'Value2'
118 # type => 'RegExpr'
119 1668 ▶ if ($self->testRegExpr($text, '[\\w\\d]+', 0, 0, 0, undef, 0, '#stay', 'Value2')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[\\w\\d]+", 0, 0, 0, undef, 0, "#stay", "Value2")) 4 1664 1668
120 4 return 1
121 }
122 # char => '#'
123 # context => 'Comment'
124 # type => 'DetectChar'
125 1664 ▶ if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "#", 0, 0, 0, undef, 0, "Comment", undef)) 0 1664 1664
126 0 return 1
127 }
128 1664 return 0;
129 };
130  
131 100 ▶sub parseSection {
Subroutine parseSection: called CC=5 SCAR=17.8
Pod undocumented
132 100 my ($self, $text) = @_;
133 # attribute => 'Section Name'
134 # char => '"'
135 # char1 => '"'
136 # context => 'Section Content'
137 # type => 'RangeDetect'
138 100 ▶ if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, 'Section Content', 'Section Name')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRangeDetect($text, "\"", "\"", 0, 0, undef, 0, "Section Content", "Section Name")) 34 66 100
139 34 return 1
140 }
141 # attribute => 'Section Name'
142 # char => '''
143 # char1 => '''
144 # context => 'Section Content'
145 # type => 'RangeDetect'
146 66 ▶ if ($self->testRangeDetect($text, '\'', '\'', 0, 0, undef, 0, 'Section Content', 'Section Name')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRangeDetect($text, "'", "'", 0, 0, undef, 0, "Section Content", "Section Name")) 0 66 66
147 0 return 1
148 }
149 # attribute => 'Alert'
150 # type => 'DetectIdentifier'
151 66 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', 'Alert')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", "Alert")) 0 66 66
152 0 return 1
153 }
154 # char => '#'
155 # context => 'Comment'
156 # type => 'DetectChar'
157 66 ▶ if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "#", 0, 0, 0, undef, 0, "Comment", undef)) 0 66 66
158 0 return 1
159 }
160 66 return 0;
161 };
162  
163 1200 ▶sub parseSectionContent {
Subroutine parseSectionContent: called CC=6 SCAR=18.0
Pod undocumented
164 1200 my ($self, $text) = @_;
165 # String => 'EndSection'
166 # attribute => 'Section'
167 # context => '#pop#pop'
168 # endRegion => 'Section'
169 # insensitive => 'true'
170 # type => 'StringDetect'
171 1200 ▶ if ($self->testStringDetect($text, 'EndSection', 1, 0, 0, undef, 0, '#pop#pop', 'Section')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "EndSection", 1, 0, 0, undef, 0, "#pop#pop", "Section")) 26 1174 1200
172 26 return 1
173 }
174 # String => 'EndSubSection'
175 # attribute => 'Section'
176 # context => '#pop#pop'
177 # endRegion => 'SubSection'
178 # insensitive => 'true'
179 # type => 'StringDetect'
180 1174 ▶ if ($self->testStringDetect($text, 'EndSubSection', 1, 0, 0, undef, 0, '#pop#pop', 'Section')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "EndSubSection", 1, 0, 0, undef, 0, "#pop#pop", "Section")) 8 1166 1174
181 8 return 1
182 }
183 # String => 'SubSection'
184 # attribute => 'Section'
185 # beginRegion => 'SubSection'
186 # context => 'Section'
187 # insensitive => 'true'
188 # type => 'StringDetect'
189 1166 ▶ if ($self->testStringDetect($text, 'SubSection', 1, 0, 0, undef, 0, 'Section', 'Section')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "SubSection", 1, 0, 0, undef, 0, "Section", "Section")) 8 1158 1166
190 8 return 1
191 }
192 # String => '\b\w+\b'
193 # context => 'Keyword'
194 # type => 'RegExpr'
195 1158 ▶ if ($self->testRegExpr($text, '\\b\\w+\\b', 0, 0, 0, undef, 0, 'Keyword', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\b\\w+\\b", 0, 0, 0, undef, 0, "Keyword", undef)) 206 952 1158
196 206 return 1
197 }
198 # char => '#'
199 # context => 'Comment'
200 # type => 'DetectChar'
201 952 ▶ if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "#", 0, 0, 0, undef, 0, "Comment", undef)) 0 952 952
202 0 return 1
203 }
204 952 return 0;
205 };
206  
207 52 ▶sub parsexorg {
Subroutine parsexorg: called CC=3 SCAR=11.2
Pod undocumented
208 52 my ($self, $text) = @_;
209 # String => 'Section'
210 # attribute => 'Section'
211 # beginRegion => 'Section'
212 # context => 'Section'
213 # insensitive => 'true'
214 # type => 'StringDetect'
215 52 ▶ if ($self->testStringDetect($text, 'Section', 1, 0, 0, undef, 0, 'Section', 'Section')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "Section", 1, 0, 0, undef, 0, "Section", "Section")) 26 26 52
216 26 return 1
217 }
218 # char => '#'
219 # context => 'Comment'
220 # type => 'DetectChar'
221 26 ▶ if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "#", 0, 0, 0, undef, 0, "Comment", undef)) 26 0 26
222 26 return 1
223 }
224 0 return 0;
225 };
226  
227  
228 1 1;
229  
230 __END__
« Kate/Stata.pm ↑ Summary Kate/CMake.pm »