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 'email.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Carl A Joslin (carl.joslin@joslin.dyndns.org)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Email;
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 'Normal Text' => 'Normal',
27 'base64' => 'RegionMarker',
28 'common' => 'Keyword',
29 'email' => 'Function',
30 'indent1' => 'DataType',
31 'indent2' => 'DecVal',
34 'indent5' => 'BString',
35 'indent6' => 'Reserved',
39 'rfc-main' => 'Alert',
45 callback => \&parseheadder,
46 attribute => 'Normal Text',
49 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
50 $self->basecontext('headder');
51 $self->keywordscase(0);
53 bless ($self, $class);
62 my ($self, $text) = @_;
63 # String => '^[Tt]o:.*$'
64 # attribute => 'rfc-main'
67 if ($self->testRegExpr($text, '^[Tt]o:.*$', 0, 0, 0, undef, 0, '#stay', 'rfc-main')) {
70 # String => '^[Ff]rom:.*$'
71 # attribute => 'rfc-main'
74 if ($self->testRegExpr($text, '^[Ff]rom:.*$', 0, 0, 0, undef, 0, '#stay', 'rfc-main')) {
77 # String => '^[Cc][Cc]:.*$'
78 # attribute => 'rfc-main'
81 if ($self->testRegExpr($text, '^[Cc][Cc]:.*$', 0, 0, 0, undef, 0, '#stay', 'rfc-main')) {
84 # String => '^[Bb][Cc][Cc]:.*$'
85 # attribute => 'rfc-main'
88 if ($self->testRegExpr($text, '^[Bb][Cc][Cc]:.*$', 0, 0, 0, undef, 0, '#stay', 'rfc-main')) {
91 # String => '^[Ss]ubject:.*$'
92 # attribute => 'rfc-main'
95 if ($self->testRegExpr($text, '^[Ss]ubject:.*$', 0, 0, 0, undef, 0, '#stay', 'rfc-main')) {
98 # String => '^[Dd]ate:.*$'
99 # attribute => 'rfc-main'
102 if ($self->testRegExpr($text, '^[Dd]ate:.*$', 0, 0, 0, undef, 0, '#stay', 'rfc-main')) {
105 # String => '^[Ss]ender:'
109 if ($self->testRegExpr($text, '^[Ss]ender:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
112 # String => '^[Rr]eply-[Tt]o:'
116 if ($self->testRegExpr($text, '^[Rr]eply-[Tt]o:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
119 # String => '^[Mm]essage-[Ii][Dd]:'
123 if ($self->testRegExpr($text, '^[Mm]essage-[Ii][Dd]:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
126 # String => '^[Ii]n-[Rr]eply-[Tt]o:'
130 if ($self->testRegExpr($text, '^[Ii]n-[Rr]eply-[Tt]o:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
133 # String => '^[Rr]eferences:'
137 if ($self->testRegExpr($text, '^[Rr]eferences:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
140 # String => '^[Cc]omments:'
144 if ($self->testRegExpr($text, '^[Cc]omments:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
147 # String => '^[Kk]eywors:'
151 if ($self->testRegExpr($text, '^[Kk]eywors:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
154 # String => '^[Rr]esent-[Dd]ate:'
158 if ($self->testRegExpr($text, '^[Rr]esent-[Dd]ate:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
161 # String => '^[Rr]esent-[Ff]rom:'
165 if ($self->testRegExpr($text, '^[Rr]esent-[Ff]rom:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
168 # String => '^[Rr]esent-[Ss]ender:'
172 if ($self->testRegExpr($text, '^[Rr]esent-[Ss]ender:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
175 # String => '^[Rr]esent-[Tt]o:'
179 if ($self->testRegExpr($text, '^[Rr]esent-[Tt]o:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
182 # String => '^[Rr]esent-[Cc][Cc]:'
186 if ($self->testRegExpr($text, '^[Rr]esent-[Cc][Cc]:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
189 # String => '^[Rr]esent-[Bb][Cc][Cc]:'
193 if ($self->testRegExpr($text, '^[Rr]esent-[Bb][Cc][Cc]:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
196 # String => '^[Rr]esent-[Mm]essage-[Ii][Dd]:'
200 if ($self->testRegExpr($text, '^[Rr]esent-[Mm]essage-[Ii][Dd]:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
203 # String => '^[Rr]esent-[Rr]eply-[Tt]o:'
207 if ($self->testRegExpr($text, '^[Rr]esent-[Rr]eply-[Tt]o:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
210 # String => '^[Rr]eturn-[Pp]ath:'
214 if ($self->testRegExpr($text, '^[Rr]eturn-[Pp]ath:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
217 # String => '^[Rr]eceived:'
221 if ($self->testRegExpr($text, '^[Rr]eceived:', 0, 0, 0, undef, 0, '#stay', 'rfc')) {
224 # String => '^[Xx]-[Mm]ozilla-[Ss]tatus:'
225 # attribute => 'common'
228 if ($self->testRegExpr($text, '^[Xx]-[Mm]ozilla-[Ss]tatus:', 0, 0, 0, undef, 0, '#stay', 'common')) {
231 # String => '^[Xx]-[Mm]ozilla-[Ss]tatus2:'
232 # attribute => 'common'
235 if ($self->testRegExpr($text, '^[Xx]-[Mm]ozilla-[Ss]tatus2:', 0, 0, 0, undef, 0, '#stay', 'common')) {
238 # String => '^[Ee]nverlope-[Tt]o:'
239 # attribute => 'common'
242 if ($self->testRegExpr($text, '^[Ee]nverlope-[Tt]o:', 0, 0, 0, undef, 0, '#stay', 'common')) {
245 # String => '^[Dd]elivery-[Dd]ate:'
246 # attribute => 'common'
249 if ($self->testRegExpr($text, '^[Dd]elivery-[Dd]ate:', 0, 0, 0, undef, 0, '#stay', 'common')) {
252 # String => '^[Xx]-[Oo]riginating-[Ii][Pp]:'
253 # attribute => 'common'
256 if ($self->testRegExpr($text, '^[Xx]-[Oo]riginating-[Ii][Pp]:', 0, 0, 0, undef, 0, '#stay', 'common')) {
259 # String => '^[Xx]-[Oo]riginating-[Ee]mail:'
260 # attribute => 'common'
263 if ($self->testRegExpr($text, '^[Xx]-[Oo]riginating-[Ee]mail:', 0, 0, 0, undef, 0, '#stay', 'common')) {
266 # String => '^[Xx]-[Ss]ender:'
267 # attribute => 'common'
270 if ($self->testRegExpr($text, '^[Xx]-[Ss]ender:', 0, 0, 0, undef, 0, '#stay', 'common')) {
273 # String => '^[Mm]ime-[Vv]ersion:'
274 # attribute => 'common'
277 if ($self->testRegExpr($text, '^[Mm]ime-[Vv]ersion:', 0, 0, 0, undef, 0, '#stay', 'common')) {
280 # String => '^[Cc]ontent-[Tt]ype:'
281 # attribute => 'common'
284 if ($self->testRegExpr($text, '^[Cc]ontent-[Tt]ype:', 0, 0, 0, undef, 0, '#stay', 'common')) {
287 # String => '^[Xx]-[Mm]ailing-[Ll]ist:'
288 # attribute => 'common'
291 if ($self->testRegExpr($text, '^[Xx]-[Mm]ailing-[Ll]ist:', 0, 0, 0, undef, 0, '#stay', 'common')) {
294 # String => '^[Xx]-[Ll]oop:'
295 # attribute => 'common'
298 if ($self->testRegExpr($text, '^[Xx]-[Ll]oop:', 0, 0, 0, undef, 0, '#stay', 'common')) {
301 # String => '^[Ll]ist-[Pp]ost:'
302 # attribute => 'common'
305 if ($self->testRegExpr($text, '^[Ll]ist-[Pp]ost:', 0, 0, 0, undef, 0, '#stay', 'common')) {
308 # String => '^[Ll]ist-[Hh]elp:'
309 # attribute => 'common'
312 if ($self->testRegExpr($text, '^[Ll]ist-[Hh]elp:', 0, 0, 0, undef, 0, '#stay', 'common')) {
315 # String => '^[Ll]ist-[Uu]nsubscribe:'
316 # attribute => 'common'
319 if ($self->testRegExpr($text, '^[Ll]ist-[Uu]nsubscribe:', 0, 0, 0, undef, 0, '#stay', 'common')) {
322 # String => '^[Pp]recedence:'
323 # attribute => 'common'
326 if ($self->testRegExpr($text, '^[Pp]recedence:', 0, 0, 0, undef, 0, '#stay', 'common')) {
329 # String => '^[Cc]ontent-[Tt]ransfer-[Ee]ncoding:'
330 # attribute => 'common'
333 if ($self->testRegExpr($text, '^[Cc]ontent-[Tt]ransfer-[Ee]ncoding:', 0, 0, 0, undef, 0, '#stay', 'common')) {
336 # String => '^[Cc]ontent-[Tt]ype:'
337 # attribute => 'common'
340 if ($self->testRegExpr($text, '^[Cc]ontent-[Tt]ype:', 0, 0, 0, undef, 0, '#stay', 'common')) {
343 # String => '^[Xx]-[Bb]ulkmail:'
344 # attribute => 'common'
347 if ($self->testRegExpr($text, '^[Xx]-[Bb]ulkmail:', 0, 0, 0, undef, 0, '#stay', 'common')) {
350 # String => '^[Pp]recedence:'
351 # attribute => 'common'
354 if ($self->testRegExpr($text, '^[Pp]recedence:', 0, 0, 0, undef, 0, '#stay', 'common')) {
357 # String => '^[Cc]ontent-[Dd]isposition:'
358 # attribute => 'common'
361 if ($self->testRegExpr($text, '^[Cc]ontent-[Dd]isposition:', 0, 0, 0, undef, 0, '#stay', 'common')) {
364 # String => '^[0-9a-zA-Z-.]+:'
365 # attribute => 'other'
368 if ($self->testRegExpr($text, '^[0-9a-zA-Z-.]+:', 0, 0, 0, undef, 0, '#stay', 'other')) {
371 # String => '[a-zA-Z0-9.\-]+\@[a-zA-Z0-9.\-]+'
372 # attribute => 'email'
375 if ($self->testRegExpr($text, '[a-zA-Z0-9.\\-]+\\@[a-zA-Z0-9.\\-]+', 0, 0, 0, undef, 0, '#stay', 'email')) {
378 # String => '[a-zA-Z0-9.\-]*\s*<[a-zA-Z0-9.\-]+\@[a-zA-Z0-9.\-]+>'
379 # attribute => 'email'
382 if ($self->testRegExpr($text, '[a-zA-Z0-9.\\-]*\\s*<[a-zA-Z0-9.\\-]+\\@[a-zA-Z0-9.\\-]+>', 0, 0, 0, undef, 0, '#stay', 'email')) {
385 # String => '"[a-zA-Z0-9. \-]+"\s*<[a-zA-Z0-9.\-]+\@[a-zA-Z0-9.\-]+>'
386 # attribute => 'email'
389 if ($self->testRegExpr($text, '"[a-zA-Z0-9. \\-]+"\\s*<[a-zA-Z0-9.\\-]+\\@[a-zA-Z0-9.\\-]+>', 0, 0, 0, undef, 0, '#stay', 'email')) {
393 # attribute => 'string'
396 if ($self->testRegExpr($text, '".*"', 0, 0, 0, undef, 0, '#stay', 'string')) {
400 # attribute => 'string'
403 if ($self->testRegExpr($text, '\'.*\'', 0, 0, 0, undef, 0, '#stay', 'string')) {
406 # String => '^[|>]\s*[|>]\s*[|>]\s*[|>]\s*[|>]\s*[|>].*'
407 # attribute => 'indent6'
410 if ($self->testRegExpr($text, '^[|>]\\s*[|>]\\s*[|>]\\s*[|>]\\s*[|>]\\s*[|>].*', 0, 0, 0, undef, 0, '#stay', 'indent6')) {
413 # String => '^[|>]\s*[|>]\s*[|>]\s*[|>]\s*[|>].*'
414 # attribute => 'indent5'
417 if ($self->testRegExpr($text, '^[|>]\\s*[|>]\\s*[|>]\\s*[|>]\\s*[|>].*', 0, 0, 0, undef, 0, '#stay', 'indent5')) {
420 # String => '^[|>]\s*[|>]\s*[|>]\s*[|>].*'
421 # attribute => 'indent4'
424 if ($self->testRegExpr($text, '^[|>]\\s*[|>]\\s*[|>]\\s*[|>].*', 0, 0, 0, undef, 0, '#stay', 'indent4')) {
427 # String => '^[|>]\s*[|>]\s*[|>].*'
428 # attribute => 'indent3'
431 if ($self->testRegExpr($text, '^[|>]\\s*[|>]\\s*[|>].*', 0, 0, 0, undef, 0, '#stay', 'indent3')) {
434 # String => '^[|>]\s*[|>].*'
435 # attribute => 'indent2'
438 if ($self->testRegExpr($text, '^[|>]\\s*[|>].*', 0, 0, 0, undef, 0, '#stay', 'indent2')) {
441 # String => '^[|>].*'
442 # attribute => 'indent1'
445 if ($self->testRegExpr($text, '^[|>].*', 0, 0, 0, undef, 0, '#stay', 'indent1')) {
448 # String => '^([A-Za-z0-9+/][A-Za-z0-9+/][A-Za-z0-9+/][A-Za-z0-9+/]){10,20}$'
449 # attribute => 'base64'
452 if ($self->testRegExpr($text, '^([A-Za-z0-9+/][A-Za-z0-9+/][A-Za-z0-9+/][A-Za-z0-9+/]){10,20}$', 0, 0, 0, undef, 0, '#stay', 'base64')) {
455 # String => '^[A-Za-z0-9+=/]+=$'
456 # attribute => 'base64'
459 if ($self->testRegExpr($text, '^[A-Za-z0-9+=/]+=$', 0, 0, 0, undef, 0, '#stay', 'base64')) {
462 # String => '^(- )?--(--.*)?'
463 # attribute => 'marker'
466 if ($self->testRegExpr($text, '^(- )?--(--.*)?', 0, 0, 0, undef, 0, '#stay', 'marker')) {
479 Syntax::Highlight::Engine::Kate::Email - a Plugin for Email syntax highlighting
483 require Syntax::Highlight::Engine::Kate::Email;
484 my $sh = new Syntax::Highlight::Engine::Kate::Email([
489 Syntax::Highlight::Engine::Kate::Email is a plugin module that provides syntax highlighting
490 for Email to the Syntax::Haghlight::Engine::Kate highlighting engine.
492 This code is generated from the syntax definition files used
494 It works quite fine, but can use refinement and optimization.
496 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
502 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
508 Unknown. If you find any, please contact the author