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 'pascal.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:05 2008, localtime
12 package Syntax::Highlight::Engine::Kate::Pascal;
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 'Directive' => 'Others',
28 'ISO/Delphi Extended' => 'Function',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'Normal',
35 $self->listAdd('ISO/Delphi Extended',
65 $self->listAdd('attention',
70 $self->listAdd('keywords',
126 $self->listAdd('types',
161 callback => \&parseComment1,
162 attribute => 'Comment',
165 callback => \&parseComment2,
166 attribute => 'Comment',
169 callback => \&parseComment3,
170 attribute => 'Comment',
171 lineending => '#pop',
174 callback => \&parseNormal,
175 attribute => 'Normal Text',
178 callback => \&parsePrep1,
179 attribute => 'Directive',
180 lineending => '#pop',
183 callback => \&parsePrep2,
184 attribute => 'Directive',
185 lineending => '#pop',
188 callback => \&parseString,
189 attribute => 'String',
190 lineending => '#pop',
193 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
194 $self->basecontext('Normal');
195 $self->keywordscase(0);
197 bless ($self, $class);
206 my ($self, $text) = @_;
207 # String => 'attention'
208 # attribute => 'Alert'
211 if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
214 # attribute => 'Comment'
217 # endRegion => 'Region2'
218 # type => 'DetectChar'
219 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
226 my ($self, $text) = @_;
227 # String => 'attention'
228 # attribute => 'Alert'
231 if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
234 # attribute => 'Comment'
238 # endRegion => 'Region3'
239 # type => 'Detect2Chars'
240 if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
247 my ($self, $text) = @_;
248 # String => 'attention'
249 # attribute => 'Alert'
252 if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
259 my ($self, $text) = @_;
260 # String => '\b(begin|case|record)(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//))'
261 # attribute => 'Keyword'
262 # beginRegion => 'Region1'
264 # insensitive => 'true'
266 if ($self->testRegExpr($text, '\\b(begin|case|record)(?=(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*([\\s]|$|//))', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
269 # String => '\b((object|class)(?=(\(.*\))?(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*;?([\s]|$|//))|try(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//)))'
270 # attribute => 'ISO/Delphi Extended'
271 # beginRegion => 'Region1'
273 # insensitive => 'true'
275 if ($self->testRegExpr($text, '\\b((object|class)(?=(\\(.*\\))?(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*;?([\\s]|$|//))|try(?=(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*([\\s]|$|//)))', 1, 0, 0, undef, 0, '#stay', 'ISO/Delphi Extended')) {
278 # String => '\bend(?=((\{[^}]*(\}|$)|\(\*.*(\*\)|$))*)([.;\s]|$)|//|$)'
279 # attribute => 'Keyword'
281 # endRegion => 'Region1'
282 # insensitive => 'true'
284 if ($self->testRegExpr($text, '\\bend(?=((\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*)([.;\\s]|$)|//|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
287 # String => 'keywords'
288 # attribute => 'Keyword'
291 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
294 # String => 'ISO/Delphi Extended'
295 # attribute => 'ISO/Delphi Extended'
298 if ($self->testKeyword($text, 'ISO/Delphi Extended', 0, undef, 0, '#stay', 'ISO/Delphi Extended')) {
302 # attribute => 'Type'
305 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) {
308 # attribute => 'Number'
311 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) {
314 # attribute => 'Number'
317 if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) {
320 # attribute => 'String'
322 # context => 'String'
323 # type => 'DetectChar'
324 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) {
328 # attribute => 'Directive'
330 # type => 'StringDetect'
331 if ($self->testStringDetect($text, '(*$', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) {
334 # attribute => 'Directive'
338 # type => 'Detect2Chars'
339 if ($self->testDetect2Chars($text, '{', '$', 0, 0, 0, undef, 0, 'Prep2', 'Directive')) {
342 # attribute => 'Comment'
343 # beginRegion => 'Region2'
345 # context => 'Comment1'
346 # type => 'DetectChar'
347 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Comment1', 'Comment')) {
350 # attribute => 'Comment'
351 # beginRegion => 'Region3'
354 # context => 'Comment2'
355 # type => 'Detect2Chars'
356 if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'Comment')) {
359 # attribute => 'Comment'
362 # context => 'Comment3'
363 # type => 'Detect2Chars'
364 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment3', 'Comment')) {
371 my ($self, $text) = @_;
372 # attribute => 'Directive'
376 # type => 'Detect2Chars'
377 if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Directive')) {
384 my ($self, $text) = @_;
385 # attribute => 'Directive'
388 # type => 'DetectChar'
389 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Directive')) {
396 my ($self, $text) = @_;
397 # attribute => 'String'
400 # type => 'DetectChar'
401 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
414 Syntax::Highlight::Engine::Kate::Pascal - a Plugin for Pascal syntax highlighting
418 require Syntax::Highlight::Engine::Kate::Pascal;
419 my $sh = new Syntax::Highlight::Engine::Kate::Pascal([
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.
427 This code is generated from the syntax definition files used
429 It works quite fine, but can use refinement and optimization.
431 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
437 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
443 Unknown. If you find any, please contact the author