Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Txt2tags.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 'txt2tags.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.01
9 #kate version 2.4
10 #generated: Sun Feb  3 22:02:06 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::Txt2tags;
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       'Bar' => 'IString',
26       'Bold' => 'Float',
27       'BoldItalic' => 'Operator',
28       'Comment' => 'Comment',
29       'Date' => 'BaseN',
30       'DefList' => 'Reserved',
31       'Italic' => 'DecVal',
32       'Link' => 'Variable',
33       'List' => 'Reserved',
34       'Monospaced' => 'Others',
35       'Normal' => 'Normal',
36       'NumList' => 'Reserved',
37       'Quote' => 'Function',
38       'Tabel' => 'BString',
39       'Title' => 'Keyword',
40       'Verbatim Area' => 'String',
41       'Verbatim Line' => 'String',
42    });
43    $self->contextdata({
44       'Context' => {
45          callback => \&parseContext,
46          attribute => 'Normal',
47       },
48    });
49    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
50    $self->basecontext('Context');
51    $self->keywordscase(1);
52    $self->initialize;
53    bless ($self, $class);
54    return $self;
55 }
56
57 sub language {
58    return 'txt2tags';
59 }
60
61 sub parseContext {
62    my ($self, $text) = @_;
63    # String => '%%date(\(.*\))?'
64    # attribute => 'Date'
65    # context => 'Context'
66    # type => 'RegExpr'
67    if ($self->testRegExpr($text, '%%date(\\(.*\\))?', 0, 0, 0, undef, 0, 'Context', 'Date')) {
68       return 1
69    }
70    # String => '%.*'
71    # attribute => 'Comment'
72    # context => 'Context'
73    # type => 'RegExpr'
74    if ($self->testRegExpr($text, '%.*', 0, 0, 0, undef, 0, 'Context', 'Comment')) {
75       return 1
76    }
77    # String => '\*\*.*\*\*'
78    # attribute => 'Bold'
79    # context => 'Context'
80    # type => 'RegExpr'
81    if ($self->testRegExpr($text, '\\*\\*.*\\*\\*', 0, 0, 0, undef, 0, 'Context', 'Bold')) {
82       return 1
83    }
84    # String => '//.*//'
85    # attribute => 'Italic'
86    # context => 'Context'
87    # type => 'RegExpr'
88    if ($self->testRegExpr($text, '//.*//', 0, 0, 0, undef, 0, 'Context', 'Italic')) {
89       return 1
90    }
91    # String => '\*\*//.*//\*\*'
92    # attribute => 'BoldItalic'
93    # context => 'Context'
94    # type => 'RegExpr'
95    if ($self->testRegExpr($text, '\\*\\*//.*//\\*\\*', 0, 0, 0, undef, 0, 'Context', 'BoldItalic')) {
96       return 1
97    }
98    # String => '__.*__'
99    # attribute => 'BoldItalic'
100    # context => 'Context'
101    # type => 'RegExpr'
102    if ($self->testRegExpr($text, '__.*__', 0, 0, 0, undef, 0, 'Context', 'BoldItalic')) {
103       return 1
104    }
105    # String => '``.*``'
106    # attribute => 'Monospaced'
107    # context => 'Context'
108    # type => 'RegExpr'
109    if ($self->testRegExpr($text, '``.*``', 0, 0, 0, undef, 0, 'Context', 'Monospaced')) {
110       return 1
111    }
112    # String => '``` .*'
113    # attribute => 'Verbatim Line'
114    # context => 'Context'
115    # type => 'RegExpr'
116    if ($self->testRegExpr($text, '``` .*', 0, 0, 0, undef, 0, 'Context', 'Verbatim Line')) {
117       return 1
118    }
119    # String => ' *=[^=].*[^=]=\s*$'
120    # attribute => 'Title'
121    # column => '0'
122    # context => 'Context'
123    # type => 'RegExpr'
124    if ($self->testRegExpr($text, ' *=[^=].*[^=]=\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
125       return 1
126    }
127    # String => ' *==[^=].*[^=]==\s*$'
128    # attribute => 'Title'
129    # column => '0'
130    # context => 'Context'
131    # type => 'RegExpr'
132    if ($self->testRegExpr($text, ' *==[^=].*[^=]==\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
133       return 1
134    }
135    # String => ' *===[^=].*[^=]===\s*$'
136    # attribute => 'Title'
137    # column => '0'
138    # context => 'Context'
139    # type => 'RegExpr'
140    if ($self->testRegExpr($text, ' *===[^=].*[^=]===\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
141       return 1
142    }
143    # String => ' *====[^=].*[^=]====\s*$'
144    # attribute => 'Title'
145    # column => '0'
146    # context => 'Context'
147    # type => 'RegExpr'
148    if ($self->testRegExpr($text, ' *====[^=].*[^=]====\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
149       return 1
150    }
151    # String => ' *=====[^=].*[^=]=====\s*$'
152    # attribute => 'Title'
153    # column => '0'
154    # context => 'Context'
155    # type => 'RegExpr'
156    if ($self->testRegExpr($text, ' *=====[^=].*[^=]=====\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
157       return 1
158    }
159    # String => ' *\+[^=].*[^=]\+\s*$'
160    # attribute => 'Title'
161    # column => '0'
162    # context => 'Context'
163    # type => 'RegExpr'
164    if ($self->testRegExpr($text, ' *\\+[^=].*[^=]\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
165       return 1
166    }
167    # String => ' *\+\+[^=].*[^=]\+\+\s*$'
168    # attribute => 'Title'
169    # column => '0'
170    # context => 'Context'
171    # type => 'RegExpr'
172    if ($self->testRegExpr($text, ' *\\+\\+[^=].*[^=]\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
173       return 1
174    }
175    # String => ' *\+\+\+[^=].*[^=]\+\+\+\s*$'
176    # attribute => 'Title'
177    # column => '0'
178    # context => 'Context'
179    # type => 'RegExpr'
180    if ($self->testRegExpr($text, ' *\\+\\+\\+[^=].*[^=]\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
181       return 1
182    }
183    # String => ' *\+\+\+\+[^=].*[^=]\+\+\+\+\s*$'
184    # attribute => 'Title'
185    # column => '0'
186    # context => 'Context'
187    # type => 'RegExpr'
188    if ($self->testRegExpr($text, ' *\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
189       return 1
190    }
191    # String => ' *\+\+\+\+\+[^=].*[^=]\+\+\+\+\+\s*$'
192    # attribute => 'Title'
193    # column => '0'
194    # context => 'Context'
195    # type => 'RegExpr'
196    if ($self->testRegExpr($text, ' *\\+\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) {
197       return 1
198    }
199    # attribute => 'Link'
200    # char => '['
201    # char1 => ']'
202    # type => 'RangeDetect'
203    if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'Link')) {
204       return 1
205    }
206    # String => ' *\|\| .*'
207    # attribute => 'Tabel'
208    # column => '0'
209    # context => 'Context'
210    # type => 'RegExpr'
211    if ($self->testRegExpr($text, ' *\\|\\| .*', 0, 0, 0, 0, 0, 'Context', 'Tabel')) {
212       return 1
213    }
214    # String => ' *\| .*'
215    # attribute => 'Tabel'
216    # column => '0'
217    # context => 'Context'
218    # type => 'RegExpr'
219    if ($self->testRegExpr($text, ' *\\| .*', 0, 0, 0, 0, 0, 'Context', 'Tabel')) {
220       return 1
221    }
222    # String => ' *\: .*'
223    # attribute => 'DefList'
224    # column => '0'
225    # context => 'Context'
226    # type => 'RegExpr'
227    if ($self->testRegExpr($text, ' *\\: .*', 0, 0, 0, 0, 0, 'Context', 'DefList')) {
228       return 1
229    }
230    # String => ' *\- .*'
231    # attribute => 'List'
232    # column => '0'
233    # context => 'Context'
234    # type => 'RegExpr'
235    if ($self->testRegExpr($text, ' *\\- .*', 0, 0, 0, 0, 0, 'Context', 'List')) {
236       return 1
237    }
238    # String => ' *\+ .*'
239    # attribute => 'NumList'
240    # column => '0'
241    # context => 'Context'
242    # type => 'RegExpr'
243    if ($self->testRegExpr($text, ' *\\+ .*', 0, 0, 0, 0, 0, 'Context', 'NumList')) {
244       return 1
245    }
246    # String => '\t.*'
247    # attribute => 'Quote'
248    # context => 'Context'
249    # type => 'RegExpr'
250    if ($self->testRegExpr($text, '\\t.*', 0, 0, 0, undef, 0, 'Context', 'Quote')) {
251       return 1
252    }
253    # String => '\s*([_=-]{20,})\s*$'
254    # attribute => 'Bar'
255    # context => 'Context'
256    # type => 'RegExpr'
257    if ($self->testRegExpr($text, '\\s*([_=-]{20,})\\s*$', 0, 0, 0, undef, 0, 'Context', 'Bar')) {
258       return 1
259    }
260    return 0;
261 };
262
263
264 1;
265
266 __END__
267
268 =head1 NAME
269
270 Syntax::Highlight::Engine::Kate::Txt2tags - a Plugin for txt2tags syntax highlighting
271
272 =head1 SYNOPSIS
273
274  require Syntax::Highlight::Engine::Kate::Txt2tags;
275  my $sh = new Syntax::Highlight::Engine::Kate::Txt2tags([
276  ]);
277
278 =head1 DESCRIPTION
279
280 Syntax::Highlight::Engine::Kate::Txt2tags is a  plugin module that provides syntax highlighting
281 for txt2tags to the Syntax::Haghlight::Engine::Kate highlighting engine.
282
283 This code is generated from the syntax definition files used
284 by the Kate project.
285 It works quite fine, but can use refinement and optimization.
286
287 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
288
289 =cut
290
291 =head1 AUTHOR
292
293 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
294
295 =cut
296
297 =head1 BUGS
298
299 Unknown. If you find any, please contact the author
300
301 =cut
302