Kate/INI_Files.pm

filter: Statementstmt 42.5% 23 / 54 Branchbran 0.0% 0 / 24 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 4 / 8 Podpod 0.0% 0 / 5 totaltotal 29.1% 28 / 96 CC 14 SCAR 31.5
CC
14
Cov
30%
parseValue
42.0
parseini
30.0
parseComment
20.0
CRAP 23.4
« Kate/Fortran.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 'ini.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.0
9 #kate author Jan Janssen (medhefgo@web.de)
10 #generated: Sun Feb 3 22:02:05 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::INI_Files;
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 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
21 1 my $proto = shift;
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 'Assignment' => 'Others',
26 'Comment' => 'Comment',
27 'Float' => 'Float',
28 'Int' => 'DecVal',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'DataType',
31 'Section' => 'Keyword',
32 'Value' => 'String',
33 });
34 1 $self->listAdd('keywords',
35 'Default',
36 'Defaults',
37 'E_ALL',
38 'E_COMPILE_ERROR',
39 'E_COMPILE_WARNING',
40 'E_CORE_ERROR',
41 'E_CORE_WARNING',
42 'E_ERROR',
43 'E_NOTICE',
44 'E_PARSE',
45 'E_STRICT',
46 'E_USER_ERROR',
47 'E_USER_NOTICE',
48 'E_USER_WARNING',
49 'E_WARNING',
50 'False',
51 'Localhost',
52 'No',
53 'Normal',
54 'Null',
55 'Off',
56 'On',
57 'True',
58 'Yes',
59 );
60 1 $self->contextdata({
61 'Comment' => {
62 callback => \&parseComment,
63 attribute => 'Comment',
64 lineending => '#pop',
65 },
66 'Value' => {
67 callback => \&parseValue,
68 attribute => 'Value',
69 lineending => '#pop',
70 },
71 'ini' => {
72 callback => \&parseini,
73 attribute => 'Normal Text',
74 },
75 });
76 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
77 1 $self->basecontext('ini');
78 1 $self->keywordscase(0);
79 1 $self->initialize;
80 1 bless ($self, $class);
81 1 return $self;
82 }
83  
84 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
85 0 return 'INI Files';
86 }
87  
88 0 ▶sub parseComment {
Subroutine parseComment: not called CC=4 SCAR=30.0
Pod undocumented
89 0 my ($self, $text) = @_;
90 # type => 'DetectSpaces'
91 0 ▶ if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectSpaces($text, 0, undef, 0, "#stay", undef)) 0 0 0
92 0 return 1
93 }
94 # context => '##Alerts'
95 # type => 'IncludeRules'
96 0 ▶ if ($self->includePlugin('Alerts', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includePlugin("Alerts", $text)) 0 0 0
97 0 return 1
98 }
99 # type => 'DetectIdentifier'
100 0 ▶ if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectIdentifier($text, 0, undef, 0, "#stay", undef)) 0 0 0
101 0 return 1
102 }
103 0 return 0;
104 };
105  
106 0 ▶sub parseValue {
Subroutine parseValue: not called CC=6 SCAR=37.4
Pod undocumented
107 0 my ($self, $text) = @_;
108 # attribute => 'Float'
109 # type => 'Float'
110 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
111 0 return 1
112 }
113 # attribute => 'Int'
114 # type => 'Int'
115 0 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Int')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Int")) 0 0 0
116 0 return 1
117 }
118 # String => 'keywords'
119 # attribute => 'Keyword'
120 # type => 'keyword'
121 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
122 0 return 1
123 }
124 # String => ';.*$'
125 # attribute => 'Comment'
126 # context => '#pop'
127 # type => 'RegExpr'
128 0 ▶ if ($self->testRegExpr($text, ';.*$', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, ";.*\$", 0, 0, 0, undef, 0, "#pop", "Comment")) 0 0 0
129 0 return 1
130 }
131 # String => '#.*$'
132 # attribute => 'Comment'
133 # context => '#pop'
134 # type => 'RegExpr'
135 0 ▶ if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "#.*\$", 0, 0, 0, undef, 0, "#pop", "Comment")) 0 0 0
136 0 return 1
137 }
138 0 return 0;
139 };
140  
141 0 ▶sub parseini {
Subroutine parseini: not called CC=5 SCAR=34.0
Pod undocumented
142 0 my ($self, $text) = @_;
143 # attribute => 'Section'
144 # beginRegion => 'Section'
145 # char => '['
146 # char1 => ']'
147 # context => '#pop'
148 # endRegion => 'Section'
149 # type => 'RangeDetect'
150 0 ▶ if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#pop', 'Section')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRangeDetect($text, "[", "]", 0, 0, undef, 0, "#pop", "Section")) 0 0 0
151 0 return 1
152 }
153 # attribute => 'Assignment'
154 # char => '='
155 # context => 'Value'
156 # type => 'DetectChar'
157 0 ▶ if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Assignment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "=", 0, 0, 0, undef, 0, "Value", "Assignment")) 0 0 0
158 0 return 1
159 }
160 # attribute => 'Comment'
161 # char => ';'
162 # context => 'Comment'
163 # firstNonSpace => 'true'
164 # type => 'DetectChar'
165 0 ▶ if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 1, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ";", 0, 0, 0, undef, 1, "Comment", "Comment")) 0 0 0
166 0 return 1
167 }
168 # attribute => 'Comment'
169 # char => '#'
170 # context => 'Comment'
171 # firstNonSpace => 'true'
172 # type => 'DetectChar'
173 0 ▶ if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "#", 0, 0, 0, undef, 1, "Comment", "Comment")) 0 0 0
174 0 return 1
175 }
176 0 return 0;
177 };
178  
179  
180 1 1;
181  
182 __END__
« Kate/Fortran.pm ↑ Summary Kate/Kate_File_Template.pm »