Kate/RPM_Spec.pm

filter: Statementstmt 42.1% 24 / 57 Branchbran 0.0% 0 / 24 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 44.4% 4 / 9 Podpod 0.0% 0 / 6 totaltotal 28.7% 29 / 101 SCAR 44.1
CC
14
Cov
30%
parseNormal
132.0
parseSomeContext
6.0
parseSomeContext2
6.0
CRAP 81.9
« Kate/PureBasic.pm ↑ Summary Kate/INI_Files.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 'rpmspec.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.1
9 #kate version 2.4
10 #generated: Sun Feb 3 22:02:06 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::RPM_Spec;
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 'Blue' => 'DecVal',
26 'Comment' => 'Comment',
27 'Data' => 'DataType',
28 'Keyword' => 'Keyword',
29 'Normal Text' => 'Normal',
30 'Red' => 'String',
31 });
32 1 $self->listAdd('keywords',
33 'BuildArch',
34 'BuildArchitectures',
35 'BuildConflicts',
36 'BuildRequires',
37 'BuildRoot',
38 'Conflicts',
39 'Copyright',
40 'Distribution',
41 'Epoch',
42 'ExcludeArch',
43 'ExcludeOs',
44 'ExclusiveArch',
45 'ExclusiveOs',
46 'Group',
47 'License',
48 'Name',
49 'Obsoletes',
50 'Packager',
51 'PreReq',
52 'Prefix',
53 'Provides',
54 'Release',
55 'Requires',
56 'Serial',
57 'Source',
58 'Summary',
59 'URL',
60 'Url',
61 'Vendor',
62 'Version',
63 );
64 1 $self->listAdd('types',
65 'Artistic',
66 'GPL',
67 'LGPL',
68 );
69 1 $self->contextdata({
70 'Comment' => {
71 callback => \&parseComment,
72 attribute => 'Comment',
73 lineending => '#pop',
74 },
75 'Normal' => {
76 callback => \&parseNormal,
77 attribute => 'Normal Text',
78 },
79 'Some Context' => {
80 callback => \&parseSomeContext,
81 attribute => 'Keyword',
82 lineending => '#pop',
83 },
84 'Some Context2' => {
85 callback => \&parseSomeContext2,
86 attribute => 'Blue',
87 lineending => '#pop',
88 },
89 });
90 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
91 1 $self->basecontext('Normal');
92 1 $self->keywordscase(0);
93 1 $self->initialize;
94 1 bless ($self, $class);
95 1 return $self;
96 }
97  
98 sub language {
99 0 ▶ return 'RPM Spec';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
100 }
101  
102 sub parseComment {
103 0 ▶ my ($self, $text) = @_;
Subroutine parseComment: not called CC=1 SCAR=6.9
Pod undocumented
104 0 return 0;
105 };
106  
107 sub parseNormal {
108 0 ▶ my ($self, $text) = @_;
Subroutine parseNormal: not called CC=11 SCAR=48.8
Pod undocumented
109 # String => 'keywords'
110 # attribute => 'Keyword'
111 # context => '#stay'
112 # type => 'keyword'
113 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
114 0 return 1
115 }
116 # String => 'types'
117 # attribute => 'Data'
118 # context => '#stay'
119 # type => 'keyword'
120 0 ▶ if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "types", 0, undef, 0, "#stay", "Data")) 0 0 0
121 0 return 1
122 }
123 # String => '%\w*'
124 # attribute => 'Red'
125 # context => '#stay'
126 # type => 'RegExpr'
127 0 ▶ if ($self->testRegExpr($text, '%\\w*', 0, 0, 0, undef, 0, '#stay', 'Red')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "%\\w*", 0, 0, 0, undef, 0, "#stay", "Red")) 0 0 0
128 0 return 1
129 }
130 # attribute => 'Comment'
131 # char => '#'
132 # context => 'Comment'
133 # type => 'DetectChar'
134 0 ▶ if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "#", 0, 0, 0, undef, 0, "Comment", "Comment")) 0 0 0
135 0 return 1
136 }
137 # String => '\{\w*'
138 # attribute => 'Keyword'
139 # context => 'Some Context'
140 # type => 'RegExpr'
141 0 ▶ if ($self->testRegExpr($text, '\\{\\w*', 0, 0, 0, undef, 0, 'Some Context', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\{\\w*", 0, 0, 0, undef, 0, "Some Context", "Keyword")) 0 0 0
142 0 return 1
143 }
144 # String => '<\s*[\w@\.]*'
145 # attribute => 'Blue'
146 # context => 'Some Context2'
147 # type => 'RegExpr'
148 0 ▶ if ($self->testRegExpr($text, '<\\s*[\\w@\\.]*', 0, 0, 0, undef, 0, 'Some Context2', 'Blue')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "<\\s*[\\w\@\\.]*", 0, 0, 0, undef, 0, "Some Context2", "Blue")) 0 0 0
149 0 return 1
150 }
151 # String => '\$\w*'
152 # attribute => 'Data'
153 # context => '#stay'
154 # type => 'RegExpr'
155 0 ▶ if ($self->testRegExpr($text, '\\$\\w*', 0, 0, 0, undef, 0, '#stay', 'Data')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\$\\w*", 0, 0, 0, undef, 0, "#stay", "Data")) 0 0 0
156 0 return 1
157 }
158 # String => '(Source|Patch)\d*'
159 # attribute => 'Keyword'
160 # context => '#stay'
161 # type => 'RegExpr'
162 0 ▶ if ($self->testRegExpr($text, '(Source|Patch)\\d*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "(Source|Patch)\\d*", 0, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
163 0 return 1
164 }
165 # String => '\*.*'
166 # attribute => 'Keyword'
167 # context => '#stay'
168 # firstNonSpace => 'true'
169 # type => 'RegExpr'
170 0 ▶ if ($self->testRegExpr($text, '\\*.*', 0, 0, 0, undef, 1, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\*.*", 0, 0, 0, undef, 1, "#stay", "Keyword")) 0 0 0
171 0 return 1
172 }
173 # attribute => 'Blue'
174 # context => '#stay'
175 # type => 'Int'
176 0 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Blue')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Blue")) 0 0 0
177 0 return 1
178 }
179 0 return 0;
180 };
181  
182 sub parseSomeContext {
183 0 ▶ my ($self, $text) = @_;
Subroutine parseSomeContext: not called CC=2 SCAR=17.9
Pod undocumented
184 # attribute => 'Keyword'
185 # char => '}'
186 # context => '#pop'
187 # type => 'DetectChar'
188 0 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop", "Keyword")) 0 0 0
189 0 return 1
190 }
191 0 return 0;
192 };
193  
194 sub parseSomeContext2 {
195 0 ▶ my ($self, $text) = @_;
Subroutine parseSomeContext2: not called CC=2 SCAR=17.9
Pod undocumented
196 # attribute => 'Blue'
197 # char => '>'
198 # context => '#pop'
199 # type => 'DetectChar'
200 0 ▶ if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Blue')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ">", 0, 0, 0, undef, 0, "#pop", "Blue")) 0 0 0
201 0 return 1
202 }
203 0 return 0;
204 };
205  
206  
207 1 1;
208  
209 __END__
« Kate/PureBasic.pm ↑ Summary Kate/INI_Files.pm »