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 'haskell.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Marcel Martin (mmar@freenet.de)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Haskell;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
28 'Comment' => 'Comment',
29 'Constructor' => 'Others',
30 'Data Constructor' => 'Keyword',
31 'Decimal' => 'DecVal',
33 'Function' => 'Function',
34 'Function Definition' => 'Function',
35 'Infix Operator' => 'Others',
36 'Keyword' => 'Keyword',
37 'Normal Text' => 'Normal',
39 'Type Constructor' => 'DataType',
41 $self->listAdd('classes',
59 $self->listAdd('data constructors',
70 $self->listAdd('functions',
289 $self->listAdd('infix operators',
298 $self->listAdd('keywords',
318 $self->listAdd('type constructors',
336 'comment_multi_line' => {
337 callback => \&parsecomment_multi_line,
338 attribute => 'Comment',
340 'comment_single_line' => {
341 callback => \&parsecomment_single_line,
342 attribute => 'Comment',
343 lineending => '#pop',
345 'function_definition' => {
346 callback => \&parsefunction_definition,
347 attribute => 'Function Definition',
348 lineending => '#pop',
351 callback => \&parseinfix,
352 attribute => 'Infix Operator',
355 callback => \&parsenormal,
356 attribute => 'Normal Text',
359 callback => \&parsesingle_char,
361 lineending => '#pop',
364 callback => \&parsestring,
365 attribute => 'String',
368 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
369 $self->basecontext('normal');
370 $self->keywordscase(0);
372 bless ($self, $class);
380 sub parsecomment_multi_line {
381 my ($self, $text) = @_;
382 # attribute => 'Comment'
386 # type => 'Detect2Chars'
387 if ($self->testDetect2Chars($text, '-', '}', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
393 sub parsecomment_single_line {
394 my ($self, $text) = @_;
398 sub parsefunction_definition {
399 my ($self, $text) = @_;
400 # attribute => 'Function Definition'
403 # type => 'DetectChar'
404 if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Function Definition')) {
411 my ($self, $text) = @_;
412 # attribute => 'Infix Operator'
415 # type => 'DetectChar'
416 if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Infix Operator')) {
423 my ($self, $text) = @_;
424 # attribute => 'Comment'
427 # context => 'comment_multi_line'
428 # type => 'Detect2Chars'
429 if ($self->testDetect2Chars($text, '{', '-', 0, 0, 0, undef, 0, 'comment_multi_line', 'Comment')) {
432 # attribute => 'Comment'
435 # context => 'comment_single_line'
436 # type => 'Detect2Chars'
437 if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'comment_single_line', 'Comment')) {
440 # String => 'keywords'
441 # attribute => 'Keyword'
444 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
447 # String => 'classes'
448 # attribute => 'Class'
451 if ($self->testKeyword($text, 'classes', 0, undef, 0, '#stay', 'Class')) {
454 # String => 'type constructors'
455 # attribute => 'Type Constructor'
458 if ($self->testKeyword($text, 'type constructors', 0, undef, 0, '#stay', 'Type Constructor')) {
461 # String => 'functions'
462 # attribute => 'Function'
465 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
468 # String => 'data constructors'
469 # attribute => 'Data Constructor'
472 if ($self->testKeyword($text, 'data constructors', 0, undef, 0, '#stay', 'Data Constructor')) {
475 # attribute => 'String'
477 # context => 'string'
478 # type => 'DetectChar'
479 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) {
482 # attribute => 'Infix Operator'
485 # type => 'DetectChar'
486 if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'infix', 'Infix Operator')) {
490 # attribute => 'Normal Text'
493 if ($self->testRegExpr($text, '\\w[\']+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
496 # attribute => 'Char'
498 # context => 'single_char'
499 # type => 'DetectChar'
500 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'single_char', 'Char')) {
503 # String => '[a-z_]+\w*'*\s*::'
504 # attribute => 'Function Definition'
507 if ($self->testRegExpr($text, '[a-z_]+\\w*\'*\\s*::', 0, 0, 0, undef, 0, '#stay', 'Function Definition')) {
510 # attribute => 'Float'
513 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
516 # attribute => 'Decimal'
519 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
525 sub parsesingle_char {
526 my ($self, $text) = @_;
528 # attribute => 'Char'
531 if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) {
534 # attribute => 'Char'
537 # type => 'DetectChar'
538 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Char')) {
545 my ($self, $text) = @_;
547 # attribute => 'String'
550 if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'String')) {
553 # attribute => 'String'
556 # type => 'DetectChar'
557 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
570 Syntax::Highlight::Engine::Kate::Haskell - a Plugin for Haskell syntax highlighting
574 require Syntax::Highlight::Engine::Kate::Haskell;
575 my $sh = new Syntax::Highlight::Engine::Kate::Haskell([
580 Syntax::Highlight::Engine::Kate::Haskell is a plugin module that provides syntax highlighting
581 for Haskell to the Syntax::Haghlight::Engine::Kate highlighting engine.
583 This code is generated from the syntax definition files used
585 It works quite fine, but can use refinement and optimization.
587 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
593 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
599 Unknown. If you find any, please contact the author