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 'sieve.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Petter E. Stokke
11 #generated: Sun Feb 3 22:02:06 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Sieve;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
26 'Comment' => 'Comment',
27 'Decimal' => 'DecVal',
28 'Function' => 'Function',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'Normal',
32 'String Char' => 'Char',
34 'Tagged Argument' => 'Others',
36 $self->listAdd('keywords',
50 callback => \&parseComment,
51 attribute => 'Comment',
54 callback => \&parseMember,
55 attribute => 'Normal Text',
57 fallthrough => '#pop',
59 'MultilineString' => {
60 callback => \&parseMultilineString,
61 attribute => 'String',
64 callback => \&parseNormal,
65 attribute => 'Normal Text',
68 callback => \&parseString,
69 attribute => 'String',
73 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
74 $self->basecontext('Normal');
75 $self->keywordscase(0);
77 bless ($self, $class);
86 my ($self, $text) = @_;
87 # attribute => 'Comment'
91 # endRegion => 'Comment'
92 # type => 'Detect2Chars'
93 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
100 my ($self, $text) = @_;
101 # String => '\b[_a-zA-Z]\w*(?=[\s]*)'
102 # attribute => 'Function'
105 if ($self->testRegExpr($text, '\\b[_a-zA-Z]\\w*(?=[\\s]*)', 0, 0, 0, undef, 0, '#pop', 'Function')) {
111 sub parseMultilineString {
112 my ($self, $text) = @_;
114 # attribute => 'String'
118 if ($self->testRegExpr($text, '\\.$', 0, 0, 0, 0, 0, '#pop', 'String')) {
121 # attribute => 'String Char'
123 # type => 'HlCStringChar'
124 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
131 my ($self, $text) = @_;
132 # String => 'keywords'
133 # attribute => 'Keyword'
136 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
139 # attribute => 'Symbol'
140 # beginRegion => 'Brace1'
143 # type => 'DetectChar'
144 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
147 # attribute => 'Symbol'
150 # endRegion => 'Brace1'
151 # type => 'DetectChar'
152 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
155 # String => '\d+[KMG]?'
156 # attribute => 'Decimal'
159 if ($self->testRegExpr($text, '\\d+[KMG]?', 0, 0, 0, undef, 0, '#stay', 'Decimal')) {
162 # attribute => 'String'
164 # context => 'String'
165 # type => 'DetectChar'
166 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
170 # attribute => 'String'
171 # beginRegion => 'String'
172 # context => 'MultilineString'
174 if ($self->testRegExpr($text, 'text:$', 0, 0, 0, undef, 0, 'MultilineString', 'String')) {
177 # attribute => 'Comment'
178 # beginRegion => 'Comment'
181 # context => 'Comment'
182 # type => 'Detect2Chars'
183 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
187 # attribute => 'Comment'
190 if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
194 # attribute => 'Tagged Argument'
197 if ($self->testRegExpr($text, ':\\w+', 0, 0, 0, undef, 0, '#stay', 'Tagged Argument')) {
200 # String => '[.]{1,1}'
201 # attribute => 'Symbol'
202 # context => 'Member'
204 if ($self->testRegExpr($text, '[.]{1,1}', 0, 0, 0, undef, 0, 'Member', 'Symbol')) {
207 # String => ':!%&()+,-/.*<=>?[]|~^;'
208 # attribute => 'Symbol'
211 if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) {
218 my ($self, $text) = @_;
219 # attribute => 'String'
221 # type => 'LineContinue'
222 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
225 # attribute => 'String Char'
227 # type => 'HlCStringChar'
228 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
231 # attribute => 'String'
234 # type => 'DetectChar'
235 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
248 Syntax::Highlight::Engine::Kate::Sieve - a Plugin for Sieve syntax highlighting
252 require Syntax::Highlight::Engine::Kate::Sieve;
253 my $sh = new Syntax::Highlight::Engine::Kate::Sieve([
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.
261 This code is generated from the syntax definition files used
263 It works quite fine, but can use refinement and optimization.
265 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
271 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
277 Unknown. If you find any, please contact the author