Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Pascal.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 'pascal.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.20
9 #kate version 2.3
10 #generated: Sun Feb  3 22:02:05 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::Pascal;
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       'Alert' => 'Alert',
26       'Comment' => 'Comment',
27       'Directive' => 'Others',
28       'ISO/Delphi Extended' => 'Function',
29       'Keyword' => 'Keyword',
30       'Normal Text' => 'Normal',
31       'Number' => 'DecVal',
32       'String' => 'String',
33       'Type' => 'DataType',
34    });
35    $self->listAdd('ISO/Delphi Extended',
36       'as',
37       'bindable',
38       'constructor',
39       'destructor',
40       'except',
41       'export',
42       'finally',
43       'implementation',
44       'import',
45       'inherited',
46       'inline',
47       'interface',
48       'is',
49       'module',
50       'on',
51       'only',
52       'otherwise',
53       'private',
54       'property',
55       'protected',
56       'public',
57       'qualified',
58       'raise',
59       'restricted',
60       'shl',
61       'shr',
62       'threadvar',
63       'try',
64    );
65    $self->listAdd('attention',
66       '###',
67       'FIXME',
68       'TODO',
69    );
70    $self->listAdd('keywords',
71       'and',
72       'array',
73       'asm',
74       'at',
75       'automated',
76       'break',
77       'case',
78       'const',
79       'continue',
80       'dispinterface',
81       'dispose',
82       'div',
83       'do',
84       'downto',
85       'else',
86       'exit',
87       'false',
88       'file',
89       'finalization',
90       'for',
91       'function',
92       'goto',
93       'if',
94       'in',
95       'initialization',
96       'label',
97       'library',
98       'mod',
99       'new',
100       'nil',
101       'not',
102       'of',
103       'operator',
104       'or',
105       'packed',
106       'procedure',
107       'program',
108       'published',
109       'record',
110       'repeat',
111       'resourcestring',
112       'self',
113       'set',
114       'then',
115       'to',
116       'true',
117       'type',
118       'unit',
119       'until',
120       'uses',
121       'var',
122       'while',
123       'with',
124       'xor',
125    );
126    $self->listAdd('types',
127       'AnsiChar',
128       'AnsiString',
129       'Boolean',
130       'Byte',
131       'ByteBool',
132       'Cardinal',
133       'Char',
134       'Comp',
135       'Currency',
136       'Double',
137       'Extended',
138       'File',
139       'Int64',
140       'Integer',
141       'LongBool',
142       'LongInt',
143       'LongWord',
144       'Pointer',
145       'Real',
146       'Real48',
147       'ShortInt',
148       'ShortString',
149       'Single',
150       'SmallInt',
151       'String',
152       'Text',
153       'Variant',
154       'WideChar',
155       'WideString',
156       'Word',
157       'WordBool',
158    );
159    $self->contextdata({
160       'Comment1' => {
161          callback => \&parseComment1,
162          attribute => 'Comment',
163       },
164       'Comment2' => {
165          callback => \&parseComment2,
166          attribute => 'Comment',
167       },
168       'Comment3' => {
169          callback => \&parseComment3,
170          attribute => 'Comment',
171          lineending => '#pop',
172       },
173       'Normal' => {
174          callback => \&parseNormal,
175          attribute => 'Normal Text',
176       },
177       'Prep1' => {
178          callback => \&parsePrep1,
179          attribute => 'Directive',
180          lineending => '#pop',
181       },
182       'Prep2' => {
183          callback => \&parsePrep2,
184          attribute => 'Directive',
185          lineending => '#pop',
186       },
187       'String' => {
188          callback => \&parseString,
189          attribute => 'String',
190          lineending => '#pop',
191       },
192    });
193    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
194    $self->basecontext('Normal');
195    $self->keywordscase(0);
196    $self->initialize;
197    bless ($self, $class);
198    return $self;
199 }
200
201 sub language {
202    return 'Pascal';
203 }
204
205 sub parseComment1 {
206    my ($self, $text) = @_;
207    # String => 'attention'
208    # attribute => 'Alert'
209    # context => '#stay'
210    # type => 'keyword'
211    if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
212       return 1
213    }
214    # attribute => 'Comment'
215    # char => '}'
216    # context => '#pop'
217    # endRegion => 'Region2'
218    # type => 'DetectChar'
219    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
220       return 1
221    }
222    return 0;
223 };
224
225 sub parseComment2 {
226    my ($self, $text) = @_;
227    # String => 'attention'
228    # attribute => 'Alert'
229    # context => '#stay'
230    # type => 'keyword'
231    if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
232       return 1
233    }
234    # attribute => 'Comment'
235    # char => '*'
236    # char1 => ')'
237    # context => '#pop'
238    # endRegion => 'Region3'
239    # type => 'Detect2Chars'
240    if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
241       return 1
242    }
243    return 0;
244 };
245
246 sub parseComment3 {
247    my ($self, $text) = @_;
248    # String => 'attention'
249    # attribute => 'Alert'
250    # context => '#stay'
251    # type => 'keyword'
252    if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
253       return 1
254    }
255    return 0;
256 };
257
258 sub parseNormal {
259    my ($self, $text) = @_;
260    # String => '\b(begin|case|record)(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//))'
261    # attribute => 'Keyword'
262    # beginRegion => 'Region1'
263    # context => '#stay'
264    # insensitive => 'true'
265    # type => 'RegExpr'
266    if ($self->testRegExpr($text, '\\b(begin|case|record)(?=(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*([\\s]|$|//))', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
267       return 1
268    }
269    # String => '\b((object|class)(?=(\(.*\))?(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*;?([\s]|$|//))|try(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//)))'
270    # attribute => 'ISO/Delphi Extended'
271    # beginRegion => 'Region1'
272    # context => '#stay'
273    # insensitive => 'true'
274    # type => 'RegExpr'
275    if ($self->testRegExpr($text, '\\b((object|class)(?=(\\(.*\\))?(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*;?([\\s]|$|//))|try(?=(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*([\\s]|$|//)))', 1, 0, 0, undef, 0, '#stay', 'ISO/Delphi Extended')) {
276       return 1
277    }
278    # String => '\bend(?=((\{[^}]*(\}|$)|\(\*.*(\*\)|$))*)([.;\s]|$)|//|$)'
279    # attribute => 'Keyword'
280    # context => '#stay'
281    # endRegion => 'Region1'
282    # insensitive => 'true'
283    # type => 'RegExpr'
284    if ($self->testRegExpr($text, '\\bend(?=((\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*)([.;\\s]|$)|//|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
285       return 1
286    }
287    # String => 'keywords'
288    # attribute => 'Keyword'
289    # context => '#stay'
290    # type => 'keyword'
291    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
292       return 1
293    }
294    # String => 'ISO/Delphi Extended'
295    # attribute => 'ISO/Delphi Extended'
296    # context => '#stay'
297    # type => 'keyword'
298    if ($self->testKeyword($text, 'ISO/Delphi Extended', 0, undef, 0, '#stay', 'ISO/Delphi Extended')) {
299       return 1
300    }
301    # String => 'types'
302    # attribute => 'Type'
303    # context => '#stay'
304    # type => 'keyword'
305    if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) {
306       return 1
307    }
308    # attribute => 'Number'
309    # context => '#stay'
310    # type => 'Float'
311    if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) {
312       return 1
313    }
314    # attribute => 'Number'
315    # context => '#stay'
316    # type => 'Int'
317    if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) {
318       return 1
319    }
320    # attribute => 'String'
321    # char => '''
322    # context => 'String'
323    # type => 'DetectChar'
324    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) {
325       return 1
326    }
327    # String => '(*$'
328    # attribute => 'Directive'
329    # context => 'Prep1'
330    # type => 'StringDetect'
331    if ($self->testStringDetect($text, '(*$', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) {
332       return 1
333    }
334    # attribute => 'Directive'
335    # char => '{'
336    # char1 => '$'
337    # context => 'Prep2'
338    # type => 'Detect2Chars'
339    if ($self->testDetect2Chars($text, '{', '$', 0, 0, 0, undef, 0, 'Prep2', 'Directive')) {
340       return 1
341    }
342    # attribute => 'Comment'
343    # beginRegion => 'Region2'
344    # char => '{'
345    # context => 'Comment1'
346    # type => 'DetectChar'
347    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Comment1', 'Comment')) {
348       return 1
349    }
350    # attribute => 'Comment'
351    # beginRegion => 'Region3'
352    # char => '('
353    # char1 => '*'
354    # context => 'Comment2'
355    # type => 'Detect2Chars'
356    if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'Comment')) {
357       return 1
358    }
359    # attribute => 'Comment'
360    # char => '/'
361    # char1 => '/'
362    # context => 'Comment3'
363    # type => 'Detect2Chars'
364    if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment3', 'Comment')) {
365       return 1
366    }
367    return 0;
368 };
369
370 sub parsePrep1 {
371    my ($self, $text) = @_;
372    # attribute => 'Directive'
373    # char => '*'
374    # char1 => ')'
375    # context => '#pop'
376    # type => 'Detect2Chars'
377    if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Directive')) {
378       return 1
379    }
380    return 0;
381 };
382
383 sub parsePrep2 {
384    my ($self, $text) = @_;
385    # attribute => 'Directive'
386    # char => '}'
387    # context => '#pop'
388    # type => 'DetectChar'
389    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Directive')) {
390       return 1
391    }
392    return 0;
393 };
394
395 sub parseString {
396    my ($self, $text) = @_;
397    # attribute => 'String'
398    # char => '''
399    # context => '#pop'
400    # type => 'DetectChar'
401    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
402       return 1
403    }
404    return 0;
405 };
406
407
408 1;
409
410 __END__
411
412 =head1 NAME
413
414 Syntax::Highlight::Engine::Kate::Pascal - a Plugin for Pascal syntax highlighting
415
416 =head1 SYNOPSIS
417
418  require Syntax::Highlight::Engine::Kate::Pascal;
419  my $sh = new Syntax::Highlight::Engine::Kate::Pascal([
420  ]);
421
422 =head1 DESCRIPTION
423
424 Syntax::Highlight::Engine::Kate::Pascal is a  plugin module that provides syntax highlighting
425 for Pascal to the Syntax::Haghlight::Engine::Kate highlighting engine.
426
427 This code is generated from the syntax definition files used
428 by the Kate project.
429 It works quite fine, but can use refinement and optimization.
430
431 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
432
433 =cut
434
435 =head1 AUTHOR
436
437 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
438
439 =cut
440
441 =head1 BUGS
442
443 Unknown. If you find any, please contact the author
444
445 =cut
446