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 'tcl.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::Tcl_Tk;
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 'Decimal' => 'DecVal',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'Normal',
31 'Parameter' => 'Others',
32 'Region Marker' => 'RegionMarker',
34 'Variable' => 'DataType',
36 $self->listAdd('keywords',
167 'tcl_startOfNextWord',
168 'tcl_startOfPreviousWord',
172 'tcl_wordBreakAfter',
173 'tcl_wordBreakBefore',
180 'tk_chooseDirectory',
181 'tk_focusFollowMouse',
207 $self->listAdd('keywords-opt',
409 'sharedlibextension',
467 callback => \&parseBase,
468 attribute => 'Normal Text',
471 callback => \&parseString,
472 attribute => 'String',
475 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
476 $self->basecontext('Base');
477 $self->keywordscase(0);
479 bless ($self, $class);
488 my ($self, $text) = @_;
489 # String => '#\s*BEGIN.*$'
490 # attribute => 'Region Marker'
491 # beginRegion => 'region'
493 # firstNonSpace => 'true'
495 if ($self->testRegExpr($text, '#\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
498 # String => '#\s*END.*$'
499 # attribute => 'Region Marker'
501 # endRegion => 'region'
502 # firstNonSpace => 'true'
504 if ($self->testRegExpr($text, '#\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
507 # String => 'keywords'
508 # attribute => 'Keyword'
511 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
514 # String => 'keywords-opt'
515 # attribute => 'Parameter'
518 if ($self->testKeyword($text, 'keywords-opt', 0, undef, 0, '#stay', 'Parameter')) {
521 # attribute => 'Float'
524 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
527 # attribute => 'Decimal'
530 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
534 # attribute => 'Char'
537 if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) {
541 # attribute => 'Parameter'
544 if ($self->testRegExpr($text, '\\W-\\w+', 0, 0, 0, undef, 0, '#stay', 'Parameter')) {
547 # String => '\$\{[^\}]+\}'
548 # attribute => 'Variable'
551 if ($self->testRegExpr($text, '\\$\\{[^\\}]+\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
554 # String => '\$(::)?[\S\D]\w+'
555 # attribute => 'Variable'
558 if ($self->testRegExpr($text, '\\$(::)?[\\S\\D]\\w+', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
561 # String => '[^\\]""'
562 # attribute => 'String'
565 if ($self->testRegExpr($text, '[^\\\\]""', 0, 0, 0, undef, 0, '#stay', 'String')) {
569 # attribute => 'String'
570 # context => 'String'
572 if ($self->testRegExpr($text, '[^\\\\]"', 0, 0, 0, undef, 0, 'String', 'String')) {
576 # attribute => 'Comment'
578 # firstNonSpace => 'true'
580 if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) {
583 # String => ';\s*#.*$'
584 # attribute => 'Comment'
587 if ($self->testRegExpr($text, ';\\s*#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
590 # attribute => 'Keyword'
591 # beginRegion => 'block'
594 # type => 'DetectChar'
595 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
598 # attribute => 'Keyword'
601 # endRegion => 'block'
602 # type => 'DetectChar'
603 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
606 # attribute => 'Keyword'
609 # type => 'DetectChar'
610 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
613 # attribute => 'Keyword'
616 # type => 'DetectChar'
617 if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
624 my ($self, $text) = @_;
626 # attribute => 'Char'
629 if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) {
632 # attribute => 'String'
635 # type => 'DetectChar'
636 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
639 # attribute => 'Variable'
642 # type => 'DetectChar'
643 if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
656 Syntax::Highlight::Engine::Kate::Tcl_Tk - a Plugin for Tcl/Tk syntax highlighting
660 require Syntax::Highlight::Engine::Kate::Tcl_Tk;
661 my $sh = new Syntax::Highlight::Engine::Kate::Tcl_Tk([
666 Syntax::Highlight::Engine::Kate::Tcl_Tk is a plugin module that provides syntax highlighting
667 for Tcl/Tk to the Syntax::Haghlight::Engine::Kate highlighting engine.
669 This code is generated from the syntax definition files used
671 It works quite fine, but can use refinement and optimization.
673 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
679 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
685 Unknown. If you find any, please contact the author