File Coverage

blib/lib/Syntax/Highlight/Engine/Kate/En_US.pm
Criterion Covered Total %
statement 24 57 42.1
branch 0 28 0.0
condition 1 3 33.3
subroutine 4 7 57.1
pod 0 4 0.0
total 29 99 29.2


line stmt bran cond sub pod time code
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 'logohighlightstyle.en_US.xml' file of the syntax highlight
6             # engine of the kate text editor (http://www.kate-editor.org
7              
8             #kate xml version 0.2
9             #kate version 2.1
10             #generated: Sun Feb 3 22:02:04 2008, localtime
11              
12             package Syntax::Highlight::Engine::Kate::En_US;
13              
14             our $VERSION = '0.14';
15              
16 1     1   462 use strict;
  1         2  
  1         24  
17 1     1   4 use warnings;
  1         2  
  1         22  
18 1     1   4 use base('Syntax::Highlight::Engine::Kate::Template');
  1         2  
  1         547  
19              
20             sub new {
21 1     1 0 535 my $proto = shift;
22 1   33     6 my $class = ref($proto) || $proto;
23 1         7 my $self = $class->SUPER::new(@_);
24 1         8 $self->attributes({
25             'Boolean Operators' => 'BString',
26             'Comment' => 'Comment',
27             'Execution Controllers' => 'BaseN',
28             'Expressers' => 'Datatype',
29             'MetaFunctions' => 'Function',
30             'Normal' => 'Normal',
31             'Normal Text' => 'Normal',
32             'Number' => 'Float',
33             'Operator' => 'Operator',
34             'Raw String' => 'String',
35             'Scopes' => 'RegionMarker',
36             'Statements' => 'Keyword',
37             'String' => 'String',
38             });
39 1         4 $self->listAdd('boolops',
40             'and',
41             'not',
42             'or',
43             );
44 1         558 $self->listAdd('controllers',
45             'break',
46             'do',
47             'else',
48             'for',
49             'foreach',
50             'if',
51             'in',
52             'repeat',
53             'return',
54             'rpt',
55             'to',
56             'wait',
57             'while',
58             );
59 1         3 $self->listAdd('metafunctions',
60             'learn',
61             );
62 1         4 $self->listAdd('statements',
63             'backward',
64             'bw',
65             'canvascolor',
66             'canvassize',
67             'cc',
68             'ccl',
69             'center',
70             'change',
71             'clear',
72             'cs',
73             'dir',
74             'direction',
75             'fontsize',
76             'fonttype',
77             'forward',
78             'fw',
79             'go',
80             'gox',
81             'goy',
82             'gx',
83             'gy',
84             'hide',
85             'inputwindow',
86             'message',
87             'pc',
88             'pd',
89             'pencolor',
90             'pendown',
91             'penup',
92             'penwidth',
93             'press',
94             'print',
95             'pu',
96             'pw',
97             'random',
98             'reset',
99             'run',
100             'sc',
101             'sh',
102             'show',
103             'sp',
104             'ss',
105             'tl',
106             'tr',
107             'turnleft',
108             'turnright',
109             'wrapoff',
110             'wrapon',
111             );
112 1         9 $self->contextdata({
113             'Normal' => {
114             callback => \&parseNormal,
115             attribute => 'Normal Text',
116             },
117             'String' => {
118             callback => \&parseString,
119             attribute => 'String',
120             },
121             });
122 1         6 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
123 1         4 $self->basecontext('Normal');
124 1         3 $self->keywordscase(0);
125 1         3 $self->initialize;
126 1         2 bless ($self, $class);
127 1         2 return $self;
128             }
129              
130             sub language {
131 0     0 0   return 'en_US';
132             }
133              
134             sub parseNormal {
135 0     0 0   my ($self, $text) = @_;
136             # String => 'metafunctions'
137             # attribute => 'MetaFunctions'
138             # context => '#stay'
139             # type => 'keyword'
140 0 0         if ($self->testKeyword($text, 'metafunctions', 0, undef, 0, '#stay', 'MetaFunctions')) {
141 0           return 1
142             }
143             # String => 'statements'
144             # attribute => 'Statements'
145             # context => '#stay'
146             # type => 'keyword'
147 0 0         if ($self->testKeyword($text, 'statements', 0, undef, 0, '#stay', 'Statements')) {
148 0           return 1
149             }
150             # String => 'controllers'
151             # attribute => 'Execution Controllers'
152             # context => '#stay'
153             # type => 'keyword'
154 0 0         if ($self->testKeyword($text, 'controllers', 0, undef, 0, '#stay', 'Execution Controllers')) {
155 0           return 1
156             }
157             # String => 'boolops'
158             # attribute => 'Boolean Operators'
159             # context => '#stay'
160             # type => 'keyword'
161 0 0         if ($self->testKeyword($text, 'boolops', 0, undef, 0, '#stay', 'Boolean Operators')) {
162 0           return 1
163             }
164             # String => '([!=><][=]|[><])'
165             # attribute => 'Expressers'
166             # context => '#stay'
167             # type => 'RegExpr'
168 0 0         if ($self->testRegExpr($text, '([!=><][=]|[><])', 0, 0, 0, undef, 0, '#stay', 'Expressers')) {
169 0           return 1
170             }
171             # String => '[a-zA-Z_][a-zA-Z_0-9]+'
172             # attribute => 'Normal'
173             # context => '#stay'
174             # type => 'RegExpr'
175 0 0         if ($self->testRegExpr($text, '[a-zA-Z_][a-zA-Z_0-9]+', 0, 0, 0, undef, 0, '#stay', 'Normal')) {
176 0           return 1
177             }
178             # String => '([0-9]+\.[0-9]*|\.[0-9]+)?|[0-9]*'
179             # attribute => 'Number'
180             # context => '#stay'
181             # type => 'RegExpr'
182 0 0         if ($self->testRegExpr($text, '([0-9]+\\.[0-9]*|\\.[0-9]+)?|[0-9]*', 0, 0, 0, undef, 0, '#stay', 'Number')) {
183 0           return 1
184             }
185             # String => '#.*$'
186             # attribute => 'Comment'
187             # context => '#stay'
188             # type => 'RegExpr'
189 0 0         if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
190 0           return 1
191             }
192             # String => '[+*/\(\)-]'
193             # attribute => 'Operator'
194             # context => '#stay'
195             # type => 'RegExpr'
196 0 0         if ($self->testRegExpr($text, '[+*/\\(\\)-]', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
197 0           return 1
198             }
199             # String => '[\[\]]'
200             # attribute => 'Scopes'
201             # context => '#stay'
202             # type => 'RegExpr'
203 0 0         if ($self->testRegExpr($text, '[\\[\\]]', 0, 0, 0, undef, 0, '#stay', 'Scopes')) {
204 0           return 1
205             }
206             # attribute => 'String'
207             # char => '"'
208             # context => 'String'
209             # type => 'DetectChar'
210 0 0         if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
211 0           return 1
212             }
213 0           return 0;
214             };
215              
216             sub parseString {
217 0     0 0   my ($self, $text) = @_;
218             # attribute => 'String'
219             # context => '#stay'
220             # type => 'HlCStringChar'
221 0 0         if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String')) {
222 0           return 1
223             }
224             # String => '%[a-zA-Z]'
225             # attribute => 'Operator'
226             # context => '#stay'
227             # type => 'RegExpr'
228 0 0         if ($self->testRegExpr($text, '%[a-zA-Z]', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
229 0           return 1
230             }
231             # attribute => 'String'
232             # char => '"'
233             # context => '#pop'
234             # type => 'DetectChar'
235 0 0         if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
236 0           return 1
237             }
238 0           return 0;
239             };
240              
241              
242             1;
243              
244             __END__