Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Debian_Changelog.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 'debianchangelog.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 0.62
9 #kate version 2.4
10 #generated: Sun Feb  3 22:02:04 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::Debian_Changelog;
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       'Bug' => 'DataType',
26       'Data' => 'DataType',
27       'Email' => 'Others',
28       'Keyword' => 'Keyword',
29       'Normal Text' => 'Normal',
30       'Version' => 'DataType',
31    });
32    $self->listAdd('distributions',
33       'experimental',
34       'frozen',
35       'stable',
36       'testing',
37       'unstable',
38    );
39    $self->listAdd('keywords',
40       'urgency',
41    );
42    $self->listAdd('urgencies',
43       'bug',
44       'emergency',
45       'high',
46       'low',
47       'medium',
48    );
49    $self->contextdata({
50       'Head' => {
51          callback => \&parseHead,
52          attribute => 'Normal Text',
53          lineending => '#pop',
54       },
55       'Version' => {
56          callback => \&parseVersion,
57          attribute => 'Version',
58          lineending => '#pop',
59       },
60       'noname' => {
61          callback => \&parsenoname,
62          attribute => 'Normal Text',
63       },
64    });
65    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
66    $self->basecontext('noname');
67    $self->keywordscase(0);
68    $self->initialize;
69    bless ($self, $class);
70    return $self;
71 }
72
73 sub language {
74    return 'Debian Changelog';
75 }
76
77 sub parseHead {
78    my ($self, $text) = @_;
79    # attribute => 'Keyword'
80    # char => '('
81    # context => 'Version'
82    # type => 'DetectChar'
83    if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'Version', 'Keyword')) {
84       return 1
85    }
86    # String => '[,;=]'
87    # attribute => 'Keyword'
88    # context => '#stay'
89    # type => 'RegExpr'
90    if ($self->testRegExpr($text, '[,;=]', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
91       return 1
92    }
93    # String => 'keywords'
94    # attribute => 'Keyword'
95    # context => '#stay'
96    # type => 'keyword'
97    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
98       return 1
99    }
100    # String => 'distributions'
101    # attribute => 'Data'
102    # context => '#stay'
103    # type => 'keyword'
104    if ($self->testKeyword($text, 'distributions', 0, undef, 0, '#stay', 'Data')) {
105       return 1
106    }
107    # String => 'urgencies'
108    # attribute => 'Data'
109    # context => '#stay'
110    # type => 'keyword'
111    if ($self->testKeyword($text, 'urgencies', 0, undef, 0, '#stay', 'Data')) {
112       return 1
113    }
114    return 0;
115 };
116
117 sub parseVersion {
118    my ($self, $text) = @_;
119    # attribute => 'Keyword'
120    # char => ')'
121    # context => '#pop'
122    # type => 'DetectChar'
123    if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
124       return 1
125    }
126    return 0;
127 };
128
129 sub parsenoname {
130    my ($self, $text) = @_;
131    # String => '[^ ]*'
132    # attribute => 'Keyword'
133    # column => '0'
134    # context => 'Head'
135    # type => 'RegExpr'
136    if ($self->testRegExpr($text, '[^ ]*', 0, 0, 0, 0, 0, 'Head', 'Keyword')) {
137       return 1
138    }
139    # String => '<.*@.*>'
140    # attribute => 'Email'
141    # context => '#stay'
142    # type => 'RegExpr'
143    if ($self->testRegExpr($text, '<.*@.*>', 0, 0, 0, undef, 0, '#stay', 'Email')) {
144       return 1
145    }
146    # String => ' \-\-'
147    # attribute => 'Keyword'
148    # column => '0'
149    # context => '#stay'
150    # type => 'RegExpr'
151    if ($self->testRegExpr($text, ' \\-\\-', 0, 0, 0, 0, 0, '#stay', 'Keyword')) {
152       return 1
153    }
154    # String => '  \*'
155    # attribute => 'Keyword'
156    # column => '0'
157    # context => '#stay'
158    # type => 'RegExpr'
159    if ($self->testRegExpr($text, '  \\*', 0, 0, 0, 0, 0, '#stay', 'Keyword')) {
160       return 1
161    }
162    # String => '[Cc][Ll][Oo][Ss][Ee][Ss]:[\s]*(([Bb][Uu][Gg]\s*)?#\s*\d+)(\s*, *([Bb[Uu][Gg]\s*)?#\s*\d+)*'
163    # attribute => 'Bug'
164    # context => '#stay'
165    # type => 'RegExpr'
166    if ($self->testRegExpr($text, '[Cc][Ll][Oo][Ss][Ee][Ss]:[\\s]*(([Bb][Uu][Gg]\\s*)?#\\s*\\d+)(\\s*, *([Bb[Uu][Gg]\\s*)?#\\s*\\d+)*', 0, 0, 0, undef, 0, '#stay', 'Bug')) {
167       return 1
168    }
169    return 0;
170 };
171
172
173 1;
174
175 __END__
176
177 =head1 NAME
178
179 Syntax::Highlight::Engine::Kate::Debian_Changelog - a Plugin for Debian Changelog syntax highlighting
180
181 =head1 SYNOPSIS
182
183  require Syntax::Highlight::Engine::Kate::Debian_Changelog;
184  my $sh = new Syntax::Highlight::Engine::Kate::Debian_Changelog([
185  ]);
186
187 =head1 DESCRIPTION
188
189 Syntax::Highlight::Engine::Kate::Debian_Changelog is a  plugin module that provides syntax highlighting
190 for Debian Changelog to the Syntax::Haghlight::Engine::Kate highlighting engine.
191
192 This code is generated from the syntax definition files used
193 by the Kate project.
194 It works quite fine, but can use refinement and optimization.
195
196 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
197
198 =cut
199
200 =head1 AUTHOR
201
202 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
203
204 =cut
205
206 =head1 BUGS
207
208 Unknown. If you find any, please contact the author
209
210 =cut
211