Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Desktop.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 'desktop.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.04
9 #kate version 2.4
10 #generated: Sun Feb  3 22:02:04 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::Desktop;
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       'Comment' => 'Comment',
26       'Key' => 'DataType',
27       'Language' => 'DecVal',
28       'Normal Text' => 'Normal',
29       'Section' => 'Keyword',
30    });
31    $self->contextdata({
32       'Comment' => {
33          callback => \&parseComment,
34          attribute => 'Comment',
35          lineending => '#pop',
36       },
37       'Normal' => {
38          callback => \&parseNormal,
39          attribute => 'Key',
40       },
41       'Value' => {
42          callback => \&parseValue,
43          attribute => 'Normal Text',
44          lineending => '#pop',
45       },
46    });
47    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
48    $self->basecontext('Normal');
49    $self->keywordscase(1);
50    $self->initialize;
51    bless ($self, $class);
52    return $self;
53 }
54
55 sub language {
56    return '.desktop';
57 }
58
59 sub parseComment {
60    my ($self, $text) = @_;
61    return 0;
62 };
63
64 sub parseNormal {
65    my ($self, $text) = @_;
66    # String => '\[.*\]$'
67    # attribute => 'Section'
68    # beginRegion => 'Section'
69    # column => '0'
70    # context => '#stay'
71    # endRegion => 'Section'
72    # type => 'RegExpr'
73    if ($self->testRegExpr($text, '\\[.*\\]$', 0, 0, 0, 0, 0, '#stay', 'Section')) {
74       return 1
75    }
76    # String => '\[.*\]'
77    # attribute => 'Language'
78    # context => 'Value'
79    # type => 'RegExpr'
80    if ($self->testRegExpr($text, '\\[.*\\]', 0, 0, 0, undef, 0, 'Value', 'Language')) {
81       return 1
82    }
83    # attribute => 'Comment'
84    # char => '#'
85    # context => 'Comment'
86    # firstNonSpace => 'true'
87    # type => 'DetectChar'
88    if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Comment', 'Comment')) {
89       return 1
90    }
91    # attribute => 'Normal Text'
92    # char => '='
93    # context => 'Value'
94    # type => 'DetectChar'
95    if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) {
96       return 1
97    }
98    return 0;
99 };
100
101 sub parseValue {
102    my ($self, $text) = @_;
103    return 0;
104 };
105
106
107 1;
108
109 __END__
110
111 =head1 NAME
112
113 Syntax::Highlight::Engine::Kate::Desktop - a Plugin for .desktop syntax highlighting
114
115 =head1 SYNOPSIS
116
117  require Syntax::Highlight::Engine::Kate::Desktop;
118  my $sh = new Syntax::Highlight::Engine::Kate::Desktop([
119  ]);
120
121 =head1 DESCRIPTION
122
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.
125
126 This code is generated from the syntax definition files used
127 by the Kate project.
128 It works quite fine, but can use refinement and optimization.
129
130 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
131
132 =cut
133
134 =head1 AUTHOR
135
136 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
137
138 =cut
139
140 =head1 BUGS
141
142 Unknown. If you find any, please contact the author
143
144 =cut
145