Commit | Line | Data |
3fea05b9 |
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.06'; |
15 | |
16 | use strict; |
17 | use warnings; |
18 | use base('Syntax::Highlight::Engine::Kate::Template'); |
19 | |
20 | sub new { |
21 | my $proto = shift; |
22 | my $class = ref($proto) || $proto; |
23 | my $self = $class->SUPER::new(@_); |
24 | $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 | $self->listAdd('boolops', |
40 | 'and', |
41 | 'not', |
42 | 'or', |
43 | ); |
44 | $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 | $self->listAdd('metafunctions', |
60 | 'learn', |
61 | ); |
62 | $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 | $self->contextdata({ |
113 | 'Normal' => { |
114 | callback => \&parseNormal, |
115 | attribute => 'Normal Text', |
116 | }, |
117 | 'String' => { |
118 | callback => \&parseString, |
119 | attribute => 'String', |
120 | }, |
121 | }); |
122 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
123 | $self->basecontext('Normal'); |
124 | $self->keywordscase(0); |
125 | $self->initialize; |
126 | bless ($self, $class); |
127 | return $self; |
128 | } |
129 | |
130 | sub language { |
131 | return 'en_US'; |
132 | } |
133 | |
134 | sub parseNormal { |
135 | my ($self, $text) = @_; |
136 | # String => 'metafunctions' |
137 | # attribute => 'MetaFunctions' |
138 | # context => '#stay' |
139 | # type => 'keyword' |
140 | if ($self->testKeyword($text, 'metafunctions', 0, undef, 0, '#stay', 'MetaFunctions')) { |
141 | return 1 |
142 | } |
143 | # String => 'statements' |
144 | # attribute => 'Statements' |
145 | # context => '#stay' |
146 | # type => 'keyword' |
147 | if ($self->testKeyword($text, 'statements', 0, undef, 0, '#stay', 'Statements')) { |
148 | return 1 |
149 | } |
150 | # String => 'controllers' |
151 | # attribute => 'Execution Controllers' |
152 | # context => '#stay' |
153 | # type => 'keyword' |
154 | if ($self->testKeyword($text, 'controllers', 0, undef, 0, '#stay', 'Execution Controllers')) { |
155 | return 1 |
156 | } |
157 | # String => 'boolops' |
158 | # attribute => 'Boolean Operators' |
159 | # context => '#stay' |
160 | # type => 'keyword' |
161 | if ($self->testKeyword($text, 'boolops', 0, undef, 0, '#stay', 'Boolean Operators')) { |
162 | return 1 |
163 | } |
164 | # String => '([!=><][=]|[><])' |
165 | # attribute => 'Expressers' |
166 | # context => '#stay' |
167 | # type => 'RegExpr' |
168 | if ($self->testRegExpr($text, '([!=><][=]|[><])', 0, 0, 0, undef, 0, '#stay', 'Expressers')) { |
169 | return 1 |
170 | } |
171 | # String => '[a-zA-Z_][a-zA-Z_0-9]+' |
172 | # attribute => 'Normal' |
173 | # context => '#stay' |
174 | # type => 'RegExpr' |
175 | if ($self->testRegExpr($text, '[a-zA-Z_][a-zA-Z_0-9]+', 0, 0, 0, undef, 0, '#stay', 'Normal')) { |
176 | return 1 |
177 | } |
178 | # String => '([0-9]+\.[0-9]*|\.[0-9]+)?|[0-9]*' |
179 | # attribute => 'Number' |
180 | # context => '#stay' |
181 | # type => 'RegExpr' |
182 | if ($self->testRegExpr($text, '([0-9]+\\.[0-9]*|\\.[0-9]+)?|[0-9]*', 0, 0, 0, undef, 0, '#stay', 'Number')) { |
183 | return 1 |
184 | } |
185 | # String => '#.*$' |
186 | # attribute => 'Comment' |
187 | # context => '#stay' |
188 | # type => 'RegExpr' |
189 | if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
190 | return 1 |
191 | } |
192 | # String => '[+*/\(\)-]' |
193 | # attribute => 'Operator' |
194 | # context => '#stay' |
195 | # type => 'RegExpr' |
196 | if ($self->testRegExpr($text, '[+*/\\(\\)-]', 0, 0, 0, undef, 0, '#stay', 'Operator')) { |
197 | return 1 |
198 | } |
199 | # String => '[\[\]]' |
200 | # attribute => 'Scopes' |
201 | # context => '#stay' |
202 | # type => 'RegExpr' |
203 | if ($self->testRegExpr($text, '[\\[\\]]', 0, 0, 0, undef, 0, '#stay', 'Scopes')) { |
204 | return 1 |
205 | } |
206 | # attribute => 'String' |
207 | # char => '"' |
208 | # context => 'String' |
209 | # type => 'DetectChar' |
210 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { |
211 | return 1 |
212 | } |
213 | return 0; |
214 | }; |
215 | |
216 | sub parseString { |
217 | my ($self, $text) = @_; |
218 | # attribute => 'String' |
219 | # context => '#stay' |
220 | # type => 'HlCStringChar' |
221 | if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String')) { |
222 | return 1 |
223 | } |
224 | # String => '%[a-zA-Z]' |
225 | # attribute => 'Operator' |
226 | # context => '#stay' |
227 | # type => 'RegExpr' |
228 | if ($self->testRegExpr($text, '%[a-zA-Z]', 0, 0, 0, undef, 0, '#stay', 'Operator')) { |
229 | return 1 |
230 | } |
231 | # attribute => 'String' |
232 | # char => '"' |
233 | # context => '#pop' |
234 | # type => 'DetectChar' |
235 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
236 | return 1 |
237 | } |
238 | return 0; |
239 | }; |
240 | |
241 | |
242 | 1; |
243 | |
244 | __END__ |
245 | |
246 | =head1 NAME |
247 | |
248 | Syntax::Highlight::Engine::Kate::En_US - a Plugin for en_US syntax highlighting |
249 | |
250 | =head1 SYNOPSIS |
251 | |
252 | require Syntax::Highlight::Engine::Kate::En_US; |
253 | my $sh = new Syntax::Highlight::Engine::Kate::En_US([ |
254 | ]); |
255 | |
256 | =head1 DESCRIPTION |
257 | |
258 | Syntax::Highlight::Engine::Kate::En_US is a plugin module that provides syntax highlighting |
259 | for en_US to the Syntax::Haghlight::Engine::Kate highlighting engine. |
260 | |
261 | This code is generated from the syntax definition files used |
262 | by the Kate project. |
263 | It works quite fine, but can use refinement and optimization. |
264 | |
265 | It inherits Syntax::Higlight::Engine::Kate::Template. See also there. |
266 | |
267 | =cut |
268 | |
269 | =head1 AUTHOR |
270 | |
271 | Hans Jeuken (haje <at> toneel <dot> demon <dot> nl) |
272 | |
273 | =cut |
274 | |
275 | =head1 BUGS |
276 | |
277 | Unknown. If you find any, please contact the author |
278 | |
279 | =cut |
280 | |