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 'debiancontrol.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::Debian_Control;
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 'Keyword' => 'Keyword',
27 'Normal Text' => 'Normal',
28 'Value' => 'DataType',
29 'Variable' => 'Others',
30 'Version' => 'DecVal',
34 callback => \&parseConstrain,
35 attribute => 'Version',
37 'DependencyField' => {
38 callback => \&parseDependencyField,
43 callback => \&parseField,
48 callback => \&parseVariable,
49 attribute => 'Variable',
53 callback => \&parsenoname,
54 attribute => 'Normal Text',
57 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
58 $self->basecontext('noname');
59 $self->keywordscase(0);
61 bless ($self, $class);
66 return 'Debian Control';
70 my ($self, $text) = @_;
71 # attribute => 'Keyword'
74 # context => 'Variable'
75 # type => 'Detect2Chars'
76 if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Variable', 'Keyword')) {
80 # attribute => 'Keyword'
83 if ($self->testRegExpr($text, '[!<=>]', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
86 # attribute => 'Keyword'
89 # type => 'DetectChar'
90 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
93 # attribute => 'Keyword'
96 # type => 'DetectChar'
97 if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
103 sub parseDependencyField {
104 my ($self, $text) = @_;
105 # String => '<.*@.*>'
106 # attribute => 'Email'
109 if ($self->testRegExpr($text, '<.*@.*>', 0, 0, 0, undef, 0, '#stay', 'Email')) {
112 # attribute => 'Keyword'
115 # context => 'Variable'
116 # type => 'Detect2Chars'
117 if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Variable', 'Keyword')) {
121 # attribute => 'Keyword'
124 if ($self->testRegExpr($text, '[,\\|]', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
127 # attribute => 'Keyword'
129 # context => 'Constrain'
130 # type => 'DetectChar'
131 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'Constrain', 'Keyword')) {
134 # attribute => 'Keyword'
136 # context => 'Constrain'
137 # type => 'DetectChar'
138 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Constrain', 'Keyword')) {
145 my ($self, $text) = @_;
146 # String => '<.*@.*>'
147 # attribute => 'Email'
150 if ($self->testRegExpr($text, '<.*@.*>', 0, 0, 0, undef, 0, '#stay', 'Email')) {
153 # attribute => 'Keyword'
156 # context => 'Variable'
157 # type => 'Detect2Chars'
158 if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Variable', 'Keyword')) {
165 my ($self, $text) = @_;
166 # attribute => 'Keyword'
169 # type => 'DetectChar'
170 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
177 my ($self, $text) = @_;
178 # String => 'Depends:'
179 # attribute => 'Keyword'
180 # context => 'DependencyField'
181 # type => 'StringDetect'
182 if ($self->testStringDetect($text, 'Depends:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
185 # String => 'Recommends:'
186 # attribute => 'Keyword'
187 # context => 'DependencyField'
188 # type => 'StringDetect'
189 if ($self->testStringDetect($text, 'Recommends:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
192 # String => 'Suggests:'
193 # attribute => 'Keyword'
194 # context => 'DependencyField'
195 # type => 'StringDetect'
196 if ($self->testStringDetect($text, 'Suggests:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
199 # String => 'Conflicts:'
200 # attribute => 'Keyword'
201 # context => 'DependencyField'
202 # type => 'StringDetect'
203 if ($self->testStringDetect($text, 'Conflicts:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
206 # String => 'Provides:'
207 # attribute => 'Keyword'
208 # context => 'DependencyField'
209 # type => 'StringDetect'
210 if ($self->testStringDetect($text, 'Provides:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
213 # String => 'Replaces:'
214 # attribute => 'Keyword'
215 # context => 'DependencyField'
216 # type => 'StringDetect'
217 if ($self->testStringDetect($text, 'Replaces:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
220 # String => 'Enhances:'
221 # attribute => 'Keyword'
222 # context => 'DependencyField'
223 # type => 'StringDetect'
224 if ($self->testStringDetect($text, 'Enhances:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
227 # String => 'Pre-Depends:'
228 # attribute => 'Keyword'
229 # context => 'DependencyField'
230 # type => 'StringDetect'
231 if ($self->testStringDetect($text, 'Pre-Depends:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
234 # String => 'Build-Depends:'
235 # attribute => 'Keyword'
236 # context => 'DependencyField'
237 # type => 'StringDetect'
238 if ($self->testStringDetect($text, 'Build-Depends:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
241 # String => 'Build-Depends-Indep:'
242 # attribute => 'Keyword'
243 # context => 'DependencyField'
244 # type => 'StringDetect'
245 if ($self->testStringDetect($text, 'Build-Depends-Indep:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
248 # String => 'Build-Conflicts:'
249 # attribute => 'Keyword'
250 # context => 'DependencyField'
251 # type => 'StringDetect'
252 if ($self->testStringDetect($text, 'Build-Conflicts:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
255 # String => 'Build-Conflicts-Indep:'
256 # attribute => 'Keyword'
257 # context => 'DependencyField'
258 # type => 'StringDetect'
259 if ($self->testStringDetect($text, 'Build-Conflicts-Indep:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) {
263 # attribute => 'Keyword'
268 if ($self->testRegExpr($text, '[^ ]*?:', 0, 0, 0, 0, 0, 'Field', 'Keyword')) {
271 # attribute => 'Value'
275 # type => 'DetectChar'
276 if ($self->testDetectChar($text, ' ', 0, 0, 0, 0, 0, 'Field', 'Value')) {
289 Syntax::Highlight::Engine::Kate::Debian_Control - a Plugin for Debian Control syntax highlighting
293 require Syntax::Highlight::Engine::Kate::Debian_Control;
294 my $sh = new Syntax::Highlight::Engine::Kate::Debian_Control([
299 Syntax::Highlight::Engine::Kate::Debian_Control is a plugin module that provides syntax highlighting
300 for Debian Control to the Syntax::Haghlight::Engine::Kate highlighting engine.
302 This code is generated from the syntax definition files used
304 It works quite fine, but can use refinement and optimization.
306 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
312 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
318 Unknown. If you find any, please contact the author