Kate/SGML.pm

filter: Statementstmt 41.5% 22 / 53 Branchbran 0.0% 0 / 20 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 40.0% 4 / 10 Podpod 0.0% 0 / 7 totaltotal 28.4% 27 / 95 CC 12 SCAR 23.9
CC
12
Cov
30%
parseAttribute
20.0
parseValue
20.0
parseNormalText
12.0
CRAP 10.9
« Kate/XML.pm ↑ Summary Kate/JavaScript.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 'sgml.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.02
9 #kate version 2.1
10 #generated: Sun Feb 3 22:02:06 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::SGML;
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 'Attribute Name' => 'Others',
26 'Attribute Value' => 'DataType',
27 'Comment' => 'Comment',
28 'Normal Text' => 'Normal',
29 'Tag' => 'Keyword',
30 });
31 1 $self->contextdata({
32 'Attribute' => {
33 callback => \&parseAttribute,
34 attribute => 'Attribute Name',
35 },
36 'Comment' => {
37 callback => \&parseComment,
38 attribute => 'Comment',
39 },
40 'Normal Text' => {
41 callback => \&parseNormalText,
42 attribute => 'Normal Text',
43 },
44 'Value' => {
45 callback => \&parseValue,
46 attribute => 'Attribute Value',
47 },
48 'Value 2' => {
49 callback => \&parseValue2,
50 attribute => 'Attribute Value',
51 },
52 });
53 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
54 1 $self->basecontext('Normal Text');
55 1 $self->keywordscase(0);
56 1 $self->initialize;
57 1 bless ($self, $class);
58 1 return $self;
59 }
60  
61 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
62 0 return 'SGML';
63 }
64  
65 0 ▶sub parseAttribute {
Subroutine parseAttribute: not called CC=4 SCAR=30.0
Pod undocumented
66 0 my ($self, $text) = @_;
67 # attribute => 'Tag'
68 # char => '/'
69 # char1 => '>'
70 # context => '#pop'
71 # type => 'Detect2Chars'
72 0 ▶ if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", ">", 0, 0, 0, undef, 0, "#pop", "Tag")) 0 0 0
73 0 return 1
74 }
75 # attribute => 'Tag'
76 # char => '>'
77 # context => '#pop'
78 # type => 'DetectChar'
79 0 ▶ if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ">", 0, 0, 0, undef, 0, "#pop", "Tag")) 0 0 0
80 0 return 1
81 }
82 # String => '\s*=\s*'
83 # attribute => 'Normal Text'
84 # context => 'Value'
85 # type => 'RegExpr'
86 0 ▶ if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\s*=\\s*", 0, 0, 0, undef, 0, "Value", "Normal Text")) 0 0 0
87 0 return 1
88 }
89 0 return 0;
90 };
91  
92 0 ▶sub parseComment {
Subroutine parseComment: not called CC=2 SCAR=17.9
Pod undocumented
93 0 my ($self, $text) = @_;
94 # String => '-->'
95 # attribute => 'Comment'
96 # context => '#pop'
97 # type => 'StringDetect'
98 0 ▶ if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "-->", 0, 0, 0, undef, 0, "#pop", "Comment")) 0 0 0
99 0 return 1
100 }
101 0 return 0;
102 };
103  
104 0 ▶sub parseNormalText {
Subroutine parseNormalText: not called CC=3 SCAR=24.8
Pod undocumented
105 0 my ($self, $text) = @_;
106 # String => '<!--'
107 # attribute => 'Comment'
108 # context => 'Comment'
109 # type => 'StringDetect'
110 0 ▶ if ($self->testStringDetect($text, '<!--', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testStringDetect($text, "<!--", 0, 0, 0, undef, 0, "Comment", "Comment")) 0 0 0
111 0 return 1
112 }
113 # String => '<\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*'
114 # attribute => 'Tag'
115 # context => 'Attribute'
116 # type => 'RegExpr'
117 0 ▶ if ($self->testRegExpr($text, '<\\s*\\/?\\s*[a-zA-Z_:][a-zA-Z0-9._:-]*', 0, 0, 0, undef, 0, 'Attribute', 'Tag')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "<\\s*\\/?\\s*[a-zA-Z_:][a-zA-Z0-9._:-]*", 0, 0, 0, undef, 0, "Attribute", "Tag")) 0 0 0
118 0 return 1
119 }
120 0 return 0;
121 };
122  
123 0 ▶sub parseValue {
Subroutine parseValue: not called CC=4 SCAR=30.0
Pod undocumented
124 0 my ($self, $text) = @_;
125 # attribute => 'Tag'
126 # char => '/'
127 # char1 => '>'
128 # context => '#pop#pop'
129 # type => 'Detect2Chars'
130 0 ▶ if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop#pop', 'Tag')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", ">", 0, 0, 0, undef, 0, "#pop#pop", "Tag")) 0 0 0
131 0 return 1
132 }
133 # attribute => 'Tag'
134 # char => '>'
135 # context => '#pop#pop'
136 # type => 'DetectChar'
137 0 ▶ if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop', 'Tag')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ">", 0, 0, 0, undef, 0, "#pop#pop", "Tag")) 0 0 0
138 0 return 1
139 }
140 # attribute => 'Attribute Value'
141 # char => '"'
142 # context => 'Value 2'
143 # type => 'DetectChar'
144 0 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Value 2', 'Attribute Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "Value 2", "Attribute Value")) 0 0 0
145 0 return 1
146 }
147 0 return 0;
148 };
149  
150 0 ▶sub parseValue2 {
Subroutine parseValue2: not called CC=2 SCAR=17.9
Pod undocumented
151 0 my ($self, $text) = @_;
152 # attribute => 'Attribute Value'
153 # char => '"'
154 # context => '#pop#pop'
155 # type => 'DetectChar'
156 0 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop#pop', 'Attribute Value')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "#pop#pop", "Attribute Value")) 0 0 0
157 0 return 1
158 }
159 0 return 0;
160 };
161  
162  
163 1 1;
164  
165 __END__
« Kate/XML.pm ↑ Summary Kate/JavaScript.pm »