Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Sieve.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 'sieve.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.05
9 #kate version 2.4
10 #kate author Petter E. Stokke
11 #generated: Sun Feb  3 22:02:06 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::Sieve;
14
15 our $VERSION = '0.06';
16
17 use strict;
18 use warnings;
19 use base('Syntax::Highlight::Engine::Kate::Template');
20
21 sub new {
22    my $proto = shift;
23    my $class = ref($proto) || $proto;
24    my $self = $class->SUPER::new(@_);
25    $self->attributes({
26       'Comment' => 'Comment',
27       'Decimal' => 'DecVal',
28       'Function' => 'Function',
29       'Keyword' => 'Keyword',
30       'Normal Text' => 'Normal',
31       'String' => 'String',
32       'String Char' => 'Char',
33       'Symbol' => 'Normal',
34       'Tagged Argument' => 'Others',
35    });
36    $self->listAdd('keywords',
37       'discard',
38       'else',
39       'elsif',
40       'fileinto',
41       'if',
42       'keep',
43       'redirect',
44       'reject',
45       'require',
46       'stop',
47    );
48    $self->contextdata({
49       'Comment' => {
50          callback => \&parseComment,
51          attribute => 'Comment',
52       },
53       'Member' => {
54          callback => \&parseMember,
55          attribute => 'Normal Text',
56          lineending => '#pop',
57          fallthrough => '#pop',
58       },
59       'MultilineString' => {
60          callback => \&parseMultilineString,
61          attribute => 'String',
62       },
63       'Normal' => {
64          callback => \&parseNormal,
65          attribute => 'Normal Text',
66       },
67       'String' => {
68          callback => \&parseString,
69          attribute => 'String',
70          lineending => '#pop',
71       },
72    });
73    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
74    $self->basecontext('Normal');
75    $self->keywordscase(0);
76    $self->initialize;
77    bless ($self, $class);
78    return $self;
79 }
80
81 sub language {
82    return 'Sieve';
83 }
84
85 sub parseComment {
86    my ($self, $text) = @_;
87    # attribute => 'Comment'
88    # char => '*'
89    # char1 => '/'
90    # context => '#pop'
91    # endRegion => 'Comment'
92    # type => 'Detect2Chars'
93    if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
94       return 1
95    }
96    return 0;
97 };
98
99 sub parseMember {
100    my ($self, $text) = @_;
101    # String => '\b[_a-zA-Z]\w*(?=[\s]*)'
102    # attribute => 'Function'
103    # context => '#pop'
104    # type => 'RegExpr'
105    if ($self->testRegExpr($text, '\\b[_a-zA-Z]\\w*(?=[\\s]*)', 0, 0, 0, undef, 0, '#pop', 'Function')) {
106       return 1
107    }
108    return 0;
109 };
110
111 sub parseMultilineString {
112    my ($self, $text) = @_;
113    # String => '\.$'
114    # attribute => 'String'
115    # column => '0'
116    # context => '#pop'
117    # type => 'RegExpr'
118    if ($self->testRegExpr($text, '\\.$', 0, 0, 0, 0, 0, '#pop', 'String')) {
119       return 1
120    }
121    # attribute => 'String Char'
122    # context => '#stay'
123    # type => 'HlCStringChar'
124    if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
125       return 1
126    }
127    return 0;
128 };
129
130 sub parseNormal {
131    my ($self, $text) = @_;
132    # String => 'keywords'
133    # attribute => 'Keyword'
134    # context => '#stay'
135    # type => 'keyword'
136    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
137       return 1
138    }
139    # attribute => 'Symbol'
140    # beginRegion => 'Brace1'
141    # char => '{'
142    # context => '#stay'
143    # type => 'DetectChar'
144    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
145       return 1
146    }
147    # attribute => 'Symbol'
148    # char => '}'
149    # context => '#stay'
150    # endRegion => 'Brace1'
151    # type => 'DetectChar'
152    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
153       return 1
154    }
155    # String => '\d+[KMG]?'
156    # attribute => 'Decimal'
157    # context => '#stay'
158    # type => 'RegExpr'
159    if ($self->testRegExpr($text, '\\d+[KMG]?', 0, 0, 0, undef, 0, '#stay', 'Decimal')) {
160       return 1
161    }
162    # attribute => 'String'
163    # char => '"'
164    # context => 'String'
165    # type => 'DetectChar'
166    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
167       return 1
168    }
169    # String => 'text:$'
170    # attribute => 'String'
171    # beginRegion => 'String'
172    # context => 'MultilineString'
173    # type => 'RegExpr'
174    if ($self->testRegExpr($text, 'text:$', 0, 0, 0, undef, 0, 'MultilineString', 'String')) {
175       return 1
176    }
177    # attribute => 'Comment'
178    # beginRegion => 'Comment'
179    # char => '/'
180    # char1 => '*'
181    # context => 'Comment'
182    # type => 'Detect2Chars'
183    if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
184       return 1
185    }
186    # String => '#.*$'
187    # attribute => 'Comment'
188    # context => '#stay'
189    # type => 'RegExpr'
190    if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
191       return 1
192    }
193    # String => ':\w+'
194    # attribute => 'Tagged Argument'
195    # context => '#stay'
196    # type => 'RegExpr'
197    if ($self->testRegExpr($text, ':\\w+', 0, 0, 0, undef, 0, '#stay', 'Tagged Argument')) {
198       return 1
199    }
200    # String => '[.]{1,1}'
201    # attribute => 'Symbol'
202    # context => 'Member'
203    # type => 'RegExpr'
204    if ($self->testRegExpr($text, '[.]{1,1}', 0, 0, 0, undef, 0, 'Member', 'Symbol')) {
205       return 1
206    }
207    # String => ':!%&()+,-/.*<=>?[]|~^;'
208    # attribute => 'Symbol'
209    # context => '#stay'
210    # type => 'AnyChar'
211    if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) {
212       return 1
213    }
214    return 0;
215 };
216
217 sub parseString {
218    my ($self, $text) = @_;
219    # attribute => 'String'
220    # context => '#stay'
221    # type => 'LineContinue'
222    if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
223       return 1
224    }
225    # attribute => 'String Char'
226    # context => '#stay'
227    # type => 'HlCStringChar'
228    if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
229       return 1
230    }
231    # attribute => 'String'
232    # char => '"'
233    # context => '#pop'
234    # type => 'DetectChar'
235    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
236       return 1
237    }
238    return 0;
239 };
240
241
242 1;
243
244 __END__
245
246 =head1 NAME
247
248 Syntax::Highlight::Engine::Kate::Sieve - a Plugin for Sieve syntax highlighting
249
250 =head1 SYNOPSIS
251
252  require Syntax::Highlight::Engine::Kate::Sieve;
253  my $sh = new Syntax::Highlight::Engine::Kate::Sieve([
254  ]);
255
256 =head1 DESCRIPTION
257
258 Syntax::Highlight::Engine::Kate::Sieve is a  plugin module that provides syntax highlighting
259 for Sieve to the Syntax::Haghlight::Engine::Kate highlighting engine.
260
261 This code is generated from the syntax definition files used
262 by the Kate project.
263 It works quite fine, but can use refinement and optimization.
264
265 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
266
267 =cut
268
269 =head1 AUTHOR
270
271 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
272
273 =cut
274
275 =head1 BUGS
276
277 Unknown. If you find any, please contact the author
278
279 =cut
280