Kate/KBasic.pm

filter: Statementstmt 53.3% 24 / 45 Branchbran 0.0% 0 / 14 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 4 / 8 Podpod 0.0% 0 / 5 totaltotal 37.6% 29 / 77 SCAR 32.7
CC
9
Cov
40%
parseNormal
56.0
parseString
6.0
new
2.0
CRAP 26.2
« Kate/AVR_Assembler.pm ↑ Summary Kate/Literate_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 'kbasic.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:05 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::KBasic;
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 'Comment' => 'Comment',
26 'Identifier' => 'Others',
27 'Keyword' => 'Keyword',
28 'Normal Text' => 'Normal',
29 'String' => 'String',
30 'Types' => 'DataType',
31 });
32 1 $self->listAdd('keywords',
33 'And',
34 'As',
35 'Close',
36 'Declare',
37 'Dim',
38 'Do',
39 'Else',
40 'End',
41 'Exit',
42 'Explicit',
43 'False',
44 'For',
45 'Function',
46 'Get',
47 'Global',
48 'Goto',
49 'If',
50 'Implements',
51 'In',
52 'Input',
53 'Let',
54 'Load',
55 'Loop',
56 'Next',
57 'Not',
58 'Open',
59 'Option',
60 'Or',
61 'Output',
62 'Print',
63 'Private',
64 'Property',
65 'Public',
66 'Put',
67 'Repeat',
68 'Seek',
69 'Set',
70 'Sub',
71 'Sub',
72 'Then',
73 'To',
74 'True',
75 'Unload',
76 'Until',
77 'Wend',
78 'While',
79 'Xor',
80 );
81 1 $self->listAdd('types',
82 'Boolean',
83 'Byte',
84 'Control',
85 'Currency',
86 'Double',
87 'Integer',
88 'Long',
89 'Object',
90 'Single',
91 'String',
92 'Variant',
93 );
94 1 $self->contextdata({
95 'Comment' => {
96 callback => \&parseComment,
97 attribute => 'Comment',
98 lineending => '#pop',
99 },
100 'Normal' => {
101 callback => \&parseNormal,
102 attribute => 'Normal Text',
103 },
104 'String' => {
105 callback => \&parseString,
106 attribute => 'String',
107 lineending => '#pop',
108 },
109 });
110 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
111 1 $self->basecontext('Normal');
112 1 $self->keywordscase(0);
113 1 $self->initialize;
114 1 bless ($self, $class);
115 1 return $self;
116 }
117  
118 sub language {
119 0 ▶ return 'KBasic';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
120 }
121  
122 sub parseComment {
123 0 ▶ my ($self, $text) = @_;
Subroutine parseComment: not called CC=1 SCAR=6.9
Pod undocumented
124 0 return 0;
125 };
126  
127 sub parseNormal {
128 0 ▶ my ($self, $text) = @_;
Subroutine parseNormal: not called CC=7 SCAR=40.3
Pod undocumented
129 # String => 'keywords'
130 # attribute => 'Keyword'
131 # context => '#stay'
132 # type => 'keyword'
133 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
134 0 return 1
135 }
136 # String => 'types'
137 # attribute => 'Identifier'
138 # context => '#stay'
139 # type => 'keyword'
140 0 ▶ if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Identifier')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "types", 0, undef, 0, "#stay", "Identifier")) 0 0 0
141 0 return 1
142 }
143 # attribute => 'String'
144 # context => '#stay'
145 # type => 'Float'
146 0 ▶ if ($self->testFloat($text, 0, undef, 0, '#stay', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testFloat($text, 0, undef, 0, "#stay", "String")) 0 0 0
147 0 return 1
148 }
149 # attribute => 'Types'
150 # context => '#stay'
151 # type => 'Int'
152 0 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Types')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Types")) 0 0 0
153 0 return 1
154 }
155 # attribute => 'String'
156 # char => '"'
157 # context => 'String'
158 # type => 'DetectChar'
159 0 ▶ 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")) 0 0 0
160 0 return 1
161 }
162 # attribute => 'Comment'
163 # char => '''
164 # context => 'Comment'
165 # type => 'DetectChar'
166 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
167 0 return 1
168 }
169 0 return 0;
170 };
171  
172 sub parseString {
173 0 ▶ my ($self, $text) = @_;
Subroutine parseString: not called CC=2 SCAR=17.9
Pod undocumented
174 # attribute => 'String'
175 # char => '''
176 # context => '#pop'
177 # type => 'DetectChar'
178 0 ▶ 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")) 0 0 0
179 0 return 1
180 }
181 0 return 0;
182 };
183  
184  
185 1 1;
186  
187 __END__
« Kate/AVR_Assembler.pm ↑ Summary Kate/Literate_Haskell.pm »