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.
5 # This file was generated from the 'uscript.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #generated: Sun Feb 3 22:02:06 2008, localtime
12 package Syntax::Highlight::Engine::Kate::UnrealScript;
14 our $VERSION = '0.06';
18 use base('Syntax::Highlight::Engine::Kate::Template');
22 my $class = ref($proto) || $proto;
23 my $self = $class->SUPER::new(@_);
26 'Comment' => 'Comment',
27 'Data Type' => 'DataType',
28 'Decimal' => 'DecVal',
31 'Keyword' => 'Keyword',
32 'Normal Text' => 'Normal',
34 'Preprocessor' => 'Others',
35 'Region Marker' => 'RegionMarker',
37 'String Char' => 'Char',
40 $self->listAdd('keywords',
119 $self->listAdd('types',
151 callback => \&parseCommentar1,
152 attribute => 'Comment',
153 lineending => '#pop',
156 callback => \&parseCommentar2,
157 attribute => 'Comment',
160 callback => \&parseNormal,
161 attribute => 'Normal Text',
164 callback => \&parsePreprocessor,
165 attribute => 'Preprocessor',
166 lineending => '#pop',
169 callback => \&parseString,
170 attribute => 'String',
171 lineending => '#pop',
174 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
175 $self->basecontext('Normal');
176 $self->keywordscase(0);
178 bless ($self, $class);
183 return 'UnrealScript';
186 sub parseCommentar1 {
187 my ($self, $text) = @_;
191 sub parseCommentar2 {
192 my ($self, $text) = @_;
193 # attribute => 'Comment'
197 # endRegion => 'Comment'
198 # type => 'Detect2Chars'
199 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
206 my ($self, $text) = @_;
207 # String => 'keywords'
208 # attribute => 'Keyword'
211 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
215 # attribute => 'Data Type'
218 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
221 # attribute => 'Float'
223 # items => 'ARRAY(0x16a9b80)'
225 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
227 # attribute => 'Float'
230 if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) {
234 # attribute => 'Octal'
237 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
243 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
246 # attribute => 'Decimal'
248 # items => 'ARRAY(0x16fe360)'
250 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
252 # attribute => 'Decimal'
254 # insensitive => 'TRUE'
255 # type => 'StringDetect'
256 if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
260 # attribute => 'Decimal'
262 # insensitive => 'TRUE'
263 # type => 'StringDetect'
264 if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
268 # attribute => 'Decimal'
270 # insensitive => 'TRUE'
271 # type => 'StringDetect'
272 if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
276 # attribute => 'Decimal'
278 # insensitive => 'TRUE'
279 # type => 'StringDetect'
280 if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
284 # attribute => 'Decimal'
286 # insensitive => 'TRUE'
287 # type => 'StringDetect'
288 if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
292 # attribute => 'Decimal'
294 # insensitive => 'TRUE'
295 # type => 'StringDetect'
296 if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
300 # attribute => 'Decimal'
302 # insensitive => 'TRUE'
303 # type => 'StringDetect'
304 if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
308 # attribute => 'Decimal'
310 # insensitive => 'TRUE'
311 # type => 'StringDetect'
312 if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
316 # attribute => 'Char'
319 if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
322 # String => '//BEGIN.*$'
323 # attribute => 'Region Marker'
324 # beginRegion => 'Region1'
327 if ($self->testRegExpr($text, '//BEGIN.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
330 # String => '//END.*$'
331 # attribute => 'Region Marker'
333 # endRegion => 'Region1'
335 if ($self->testRegExpr($text, '//END.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
338 # attribute => 'String'
340 # context => 'String'
341 # type => 'DetectChar'
342 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
345 # attribute => 'String'
347 # context => 'String'
348 # type => 'DetectChar'
349 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) {
352 # attribute => 'Comment'
355 # context => 'Commentar 1'
356 # type => 'Detect2Chars'
357 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
360 # attribute => 'Comment'
361 # beginRegion => 'Comment'
364 # context => 'Commentar 2'
365 # type => 'Detect2Chars'
366 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
369 # attribute => 'Normal Text'
370 # beginRegion => 'Brace1'
373 # type => 'DetectChar'
374 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
377 # attribute => 'Normal Text'
380 # endRegion => 'Brace1'
381 # type => 'DetectChar'
382 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
385 # String => '!%&()+,-<=>?[]^{|}~'
386 # attribute => 'Symbol'
389 if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) {
393 # attribute => 'Preprocessor'
394 # context => 'Preprocessor'
395 # insensitive => 'TRUE'
397 if ($self->testRegExpr($text, '#exec', 1, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
403 sub parsePreprocessor {
404 my ($self, $text) = @_;
405 # attribute => 'Comment'
408 # context => 'Commentar 1'
409 # type => 'Detect2Chars'
410 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
413 # attribute => 'Comment'
416 # context => 'Commentar 2'
417 # type => 'Detect2Chars'
418 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
425 my ($self, $text) = @_;
426 # attribute => 'String'
428 # type => 'LineContinue'
429 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
432 # attribute => 'String Char'
434 # type => 'HlCStringChar'
435 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
438 # attribute => 'String'
441 # type => 'DetectChar'
442 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
445 # attribute => 'String'
448 # type => 'DetectChar'
449 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
462 Syntax::Highlight::Engine::Kate::UnrealScript - a Plugin for UnrealScript syntax highlighting
466 require Syntax::Highlight::Engine::Kate::UnrealScript;
467 my $sh = new Syntax::Highlight::Engine::Kate::UnrealScript([
472 Syntax::Highlight::Engine::Kate::UnrealScript is a plugin module that provides syntax highlighting
473 for UnrealScript to the Syntax::Haghlight::Engine::Kate highlighting engine.
475 This code is generated from the syntax definition files used
477 It works quite fine, but can use refinement and optimization.
479 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
485 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
491 Unknown. If you find any, please contact the author