Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Velocity.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 'velocity.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.04
9 #kate version 2.1
10 #kate author John Christopher (John@animalsinneed.net)
11 #generated: Sun Feb  3 22:02:06 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::Velocity;
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       'Keyword' => 'Keyword',
28       'Normal Text' => 'Normal',
29       'Other' => 'Others',
30       'Properties' => 'Normal',
31       'Variable' => 'Keyword',
32    });
33    $self->listAdd('keywords',
34       '#else',
35       '#elseif',
36       '#end',
37       '#foreach',
38       '#if',
39       '#include',
40       '#macro',
41       '#parse',
42       '#set',
43       '#stop',
44    );
45    $self->contextdata({
46       'Keyword' => {
47          callback => \&parseKeyword,
48          attribute => 'Normal Text',
49       },
50       'multilinecomment' => {
51          callback => \&parsemultilinecomment,
52          attribute => 'Comment',
53       },
54       'singleline comment' => {
55          callback => \&parsesinglelinecomment,
56          attribute => 'Comment',
57          lineending => '#pop',
58       },
59    });
60    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\+');
61    $self->basecontext('Keyword');
62    $self->keywordscase(0);
63    $self->initialize;
64    bless ($self, $class);
65    return $self;
66 }
67
68 sub language {
69    return 'Velocity';
70 }
71
72 sub parseKeyword {
73    my ($self, $text) = @_;
74    # String => 'keywords'
75    # attribute => 'Keyword'
76    # context => '#stay'
77    # type => 'keyword'
78    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
79       return 1
80    }
81    # String => '\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*'
82    # attribute => 'Variable'
83    # context => '#stay'
84    # type => 'RegExpr'
85    if ($self->testRegExpr($text, '\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[[a-zA-Z0-9_]*\\])*', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
86       return 1
87    }
88    # String => '\$\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*\}'
89    # attribute => 'Variable'
90    # context => '#stay'
91    # type => 'RegExpr'
92    if ($self->testRegExpr($text, '\\$\\{[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[[a-zA-Z0-9_]*\\])*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
93       return 1
94    }
95    # String => '\$!\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*\}.'
96    # attribute => 'Variable'
97    # context => '#stay'
98    # type => 'RegExpr'
99    if ($self->testRegExpr($text, '\\$!\\{[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[[a-zA-Z0-9_]*\\])*\\}.', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
100       return 1
101    }
102    # String => '\{\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[([0-9]*|"[a-zA-Z_]*")|'[a-zA-Z_]*'|\])*(->[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[[a-zA-Z0-9_]*\])*(\[([0-9]*|"[a-zA-Z_]*")|'[a-zA-Z_]*'|\])*)*\}'
103    # attribute => 'Variable'
104    # context => '#stay'
105    # type => 'RegExpr'
106    if ($self->testRegExpr($text, '\\{\\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\.\\-]*(\\[([0-9]*|"[a-zA-Z_]*")|\'[a-zA-Z_]*\'|\\])*(->[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(\\[[a-zA-Z0-9_]*\\])*(\\[([0-9]*|"[a-zA-Z_]*")|\'[a-zA-Z_]*\'|\\])*)*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
107       return 1
108    }
109    # String => '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\-]*(\[[a-zA-Z0-9_]*\])*\.[a-zA-Z0-9_\x7f-\xff\-]*'
110    # attribute => 'Properties'
111    # context => '#stay'
112    # type => 'RegExpr'
113    if ($self->testRegExpr($text, '[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\-]*(\\[[a-zA-Z0-9_]*\\])*\\.[a-zA-Z0-9_\\x7f-\\xff\\-]*', 0, 0, 0, undef, 0, '#stay', 'Properties')) {
114       return 1
115    }
116    # String => '(),[]'
117    # attribute => 'Other'
118    # context => '#stay'
119    # type => 'AnyChar'
120    if ($self->testAnyChar($text, '(),[]', 0, 0, undef, 0, '#stay', 'Other')) {
121       return 1
122    }
123    # attribute => 'Comment'
124    # char => '#'
125    # char1 => '#'
126    # context => 'singleline comment'
127    # type => 'Detect2Chars'
128    if ($self->testDetect2Chars($text, '#', '#', 0, 0, 0, undef, 0, 'singleline comment', 'Comment')) {
129       return 1
130    }
131    # attribute => 'Comment'
132    # char => '#'
133    # char1 => '*'
134    # context => 'multilinecomment'
135    # type => 'Detect2Chars'
136    if ($self->testDetect2Chars($text, '#', '*', 0, 0, 0, undef, 0, 'multilinecomment', 'Comment')) {
137       return 1
138    }
139    return 0;
140 };
141
142 sub parsemultilinecomment {
143    my ($self, $text) = @_;
144    # attribute => 'Comment'
145    # char => '*'
146    # char1 => '#'
147    # context => '#pop'
148    # type => 'Detect2Chars'
149    if ($self->testDetect2Chars($text, '*', '#', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
150       return 1
151    }
152    return 0;
153 };
154
155 sub parsesinglelinecomment {
156    my ($self, $text) = @_;
157    return 0;
158 };
159
160
161 1;
162
163 __END__
164
165 =head1 NAME
166
167 Syntax::Highlight::Engine::Kate::Velocity - a Plugin for Velocity syntax highlighting
168
169 =head1 SYNOPSIS
170
171  require Syntax::Highlight::Engine::Kate::Velocity;
172  my $sh = new Syntax::Highlight::Engine::Kate::Velocity([
173  ]);
174
175 =head1 DESCRIPTION
176
177 Syntax::Highlight::Engine::Kate::Velocity is a  plugin module that provides syntax highlighting
178 for Velocity to the Syntax::Haghlight::Engine::Kate highlighting engine.
179
180 This code is generated from the syntax definition files used
181 by the Kate project.
182 It works quite fine, but can use refinement and optimization.
183
184 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
185
186 =cut
187
188 =head1 AUTHOR
189
190 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
191
192 =cut
193
194 =head1 BUGS
195
196 Unknown. If you find any, please contact the author
197
198 =cut
199