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 'desktop.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:04 2008, localtime
12 package Syntax::Highlight::Engine::Kate::Desktop;
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(@_);
25 'Comment' => 'Comment',
27 'Language' => 'DecVal',
28 'Normal Text' => 'Normal',
29 'Section' => 'Keyword',
33 callback => \&parseComment,
34 attribute => 'Comment',
38 callback => \&parseNormal,
42 callback => \&parseValue,
43 attribute => 'Normal Text',
47 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
48 $self->basecontext('Normal');
49 $self->keywordscase(1);
51 bless ($self, $class);
60 my ($self, $text) = @_;
65 my ($self, $text) = @_;
67 # attribute => 'Section'
68 # beginRegion => 'Section'
71 # endRegion => 'Section'
73 if ($self->testRegExpr($text, '\\[.*\\]$', 0, 0, 0, 0, 0, '#stay', 'Section')) {
77 # attribute => 'Language'
80 if ($self->testRegExpr($text, '\\[.*\\]', 0, 0, 0, undef, 0, 'Value', 'Language')) {
83 # attribute => 'Comment'
85 # context => 'Comment'
86 # firstNonSpace => 'true'
87 # type => 'DetectChar'
88 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Comment', 'Comment')) {
91 # attribute => 'Normal Text'
94 # type => 'DetectChar'
95 if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) {
102 my ($self, $text) = @_;
113 Syntax::Highlight::Engine::Kate::Desktop - a Plugin for .desktop syntax highlighting
117 require Syntax::Highlight::Engine::Kate::Desktop;
118 my $sh = new Syntax::Highlight::Engine::Kate::Desktop([
123 Syntax::Highlight::Engine::Kate::Desktop is a plugin module that provides syntax highlighting
124 for .desktop to the Syntax::Haghlight::Engine::Kate highlighting engine.
126 This code is generated from the syntax definition files used
128 It works quite fine, but can use refinement and optimization.
130 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
136 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
142 Unknown. If you find any, please contact the author