Kate/AWK.pm

filter: Statementstmt 90.3% 56 / 62 Branchbran 83.3% 25 / 30 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 5 totaltotal 80.9% 89 / 110 CC 17 SCAR 21.0
CC
17
Cov
86%
parseBase
13.3
parseString
3.1
parseComment
2.1
CRAP 8.1
« Kate/CSS.pm ↑ Summary Kate/Haskell.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 'awk.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 0.90
9 #kate version 2.3
10 #generated: Sun Feb 3 22:02:04 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::AWK;
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 'Builtin' => 'DataType',
26 'Comment' => 'Comment',
27 'Decimal' => 'DecVal',
28 'Field' => 'Others',
29 'Float' => 'Float',
30 'Function' => 'Function',
31 'Keyword' => 'Keyword',
32 'Normal' => 'Normal',
33 'Pattern' => 'String',
34 'String' => 'String',
35 });
36 2 $self->listAdd('builtins',
37 'ARGC',
38 'ARGV',
39 'CONVFMT',
40 'ENVIRON',
41 'FILENAME',
42 'FNR',
43 'FS',
44 'NF',
45 'NR',
46 'OFMT',
47 'OFS',
48 'ORS',
49 'RLENGTH',
50 'RS',
51 'RSTART',
52 'SUBSEP',
53 );
54 2 $self->listAdd('functions',
55 'atan2',
56 'close',
57 'cos',
58 'exp',
59 'fflush',
60 'gensub',
61 'gsub',
62 'index',
63 'int',
64 'length',
65 'log',
66 'match',
67 'rand',
68 'sin',
69 'split',
70 'sprintf',
71 'sqrt',
72 'srand',
73 'sub',
74 'substr',
75 'system',
76 'tolower',
77 'toupper',
78 );
79 2 $self->listAdd('keywords',
80 'break',
81 'continue',
82 'do',
83 'else',
84 'exit',
85 'for',
86 'function',
87 'getline',
88 'if',
89 'in',
90 'next',
91 'print',
92 'printf',
93 'return',
94 'while',
95 );
96 2 $self->contextdata({
97 'Base' => {
98 callback => \&parseBase,
99 attribute => 'Normal',
100 },
101 'Comment' => {
102 callback => \&parseComment,
103 attribute => 'Comment',
104 lineending => '#pop',
105 },
106 'String' => {
107 callback => \&parseString,
108 attribute => 'String',
109 },
110 });
111 2 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
112 2 $self->basecontext('Base');
113 2 $self->keywordscase(0);
114 2 $self->initialize;
115 2 bless ($self, $class);
116 2 return $self;
117 }
118  
119 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
120 0 return 'AWK';
121 }
122  
123 136 ▶sub parseBase {
Subroutine parseBase: called CC=13 SCAR=25.9
Pod undocumented
124 136 my ($self, $text) = @_;
125 # String => '\b(BEGIN|END)\b'
126 # attribute => 'Pattern'
127 # context => '#stay'
128 # type => 'RegExpr'
129 136 ▶ if ($self->testRegExpr($text, '\\b(BEGIN|END)\\b', 0, 0, 0, undef, 0, '#stay', 'Pattern')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\b(BEGIN|END)\\b", 0, 0, 0, undef, 0, "#stay", "Pattern")) 4 132 136
130 4 return 1
131 }
132 # String => '/([^\/[]|\\.|\[\]?(\[[^]]+\]|.)+\])+/'
133 # attribute => 'Pattern'
134 # context => '#stay'
135 # type => 'RegExpr'
136 132 ▶ if ($self->testRegExpr($text, '/([^\\/[]|\\\\.|\\[\\]?(\\[[^]]+\\]|.)+\\])+/', 0, 0, 0, undef, 0, '#stay', 'Pattern')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "/([^\\/[]|\\\\.|\\[\\]?(\\[[^]]+\\]|.)+\\])+/", 0, 0, 0, undef, 0, "#stay", "Pattern")) 10 122 132
137 10 return 1
138 }
139 # attribute => 'Keyword'
140 # beginRegion => 'block'
141 # char => '{'
142 # context => '#stay'
143 # type => 'DetectChar'
144 122 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "#stay", "Keyword")) 8 114 122
145 8 return 1
146 }
147 # attribute => 'Keyword'
148 # char => '}'
149 # context => '#stay'
150 # endRegion => 'block'
151 # type => 'DetectChar'
152 114 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#stay", "Keyword")) 8 106 114
153 8 return 1
154 }
155 # attribute => 'Comment'
156 # char => '#'
157 # context => 'Comment'
158 # type => 'DetectChar'
159 106 ▶ 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")) 10 96 106
160 10 return 1
161 }
162 # attribute => 'String'
163 # char => '"'
164 # context => 'String'
165 # type => 'DetectChar'
166 96 ▶ 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")) 2 94 96
167 2 return 1
168 }
169 # String => 'keywords'
170 # attribute => 'Keyword'
171 # context => '#stay'
172 # type => 'keyword'
173 94 ▶ if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywords", 0, undef, 0, "#stay", "Keyword")) 4 90 94
174 4 return 1
175 }
176 # String => 'builtins'
177 # attribute => 'Builtin'
178 # context => '#stay'
179 # type => 'keyword'
180 90 ▶ if ($self->testKeyword($text, 'builtins', 0, undef, 0, '#stay', 'Builtin')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "builtins", 0, undef, 0, "#stay", "Builtin")) 0 90 90
181 0 return 1
182 }
183 # String => 'functions'
184 # attribute => 'Function'
185 # context => '#stay'
186 # type => 'keyword'
187 90 ▶ if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "functions", 0, undef, 0, "#stay", "Function")) 0 90 90
188 0 return 1
189 }
190 # attribute => 'Float'
191 # context => '#stay'
192 # type => 'Float'
193 90 ▶ if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testFloat($text, 0, undef, 0, "#stay", "Float")) 4 86 90
194 4 return 1
195 }
196 # attribute => 'Decimal'
197 # context => '#stay'
198 # type => 'Int'
199 86 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Decimal")) 0 86 86
200 0 return 1
201 }
202 # String => '\$[A-Za-z0-9_]+'
203 # attribute => 'Field'
204 # context => '#stay'
205 # type => 'RegExpr'
206 86 ▶ if ($self->testRegExpr($text, '\\$[A-Za-z0-9_]+', 0, 0, 0, undef, 0, '#stay', 'Field')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\\$[A-Za-z0-9_]+", 0, 0, 0, undef, 0, "#stay", "Field")) 2 84 86
207 2 return 1
208 }
209 84 return 0;
210 };
211  
212 352 ▶sub parseComment {
Subroutine parseComment: called CC=2 SCAR=7.6
Pod undocumented
213 352 my ($self, $text) = @_;
214 # context => '##Alerts'
215 # type => 'IncludeRules'
216 352 ▶ if ($self->includePlugin('Alerts', $text)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->includePlugin("Alerts", $text)) 0 352 352
217 0 return 1
218 }
219 352 return 0;
220 };
221  
222 22 ▶sub parseString {
Subroutine parseString: called CC=3 SCAR=11.2
Pod undocumented
223 22 my ($self, $text) = @_;
224 # attribute => 'String'
225 # char => '"'
226 # context => '#pop'
227 # type => 'DetectChar'
228 22 ▶ 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")) 2 20 22
229 2 return 1
230 }
231 # attribute => 'String'
232 # context => '#stay'
233 # type => 'HlCStringChar'
234 20 ▶ if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCStringChar($text, 0, undef, 0, "#stay", "String")) 0 20 20
235 0 return 1
236 }
237 20 return 0;
238 };
239  
240  
241 1 1;
242  
243 __END__
« Kate/CSS.pm ↑ Summary Kate/Haskell.pm »