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 'velocity.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author John Christopher (John@animalsinneed.net)
11 #generated: Sun Feb 3 22:02:06 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Velocity;
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 'Keyword' => 'Keyword',
28 'Normal Text' => 'Normal',
30 'Properties' => 'Normal',
31 'Variable' => 'Keyword',
33 $self->listAdd('keywords',
47 callback => \&parseKeyword,
48 attribute => 'Normal Text',
50 'multilinecomment' => {
51 callback => \&parsemultilinecomment,
52 attribute => 'Comment',
54 'singleline comment' => {
55 callback => \&parsesinglelinecomment,
56 attribute => 'Comment',
60 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\+');
61 $self->basecontext('Keyword');
62 $self->keywordscase(0);
64 bless ($self, $class);
73 my ($self, $text) = @_;
74 # String => 'keywords'
75 # attribute => 'Keyword'
78 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
81 # String => '\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*'
82 # attribute => 'Variable'
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')) {
88 # String => '\$\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*\}'
89 # attribute => 'Variable'
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')) {
95 # String => '\$!\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*\}.'
96 # attribute => 'Variable'
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')) {
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'
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')) {
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'
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')) {
117 # attribute => 'Other'
120 if ($self->testAnyChar($text, '(),[]', 0, 0, undef, 0, '#stay', 'Other')) {
123 # attribute => 'Comment'
126 # context => 'singleline comment'
127 # type => 'Detect2Chars'
128 if ($self->testDetect2Chars($text, '#', '#', 0, 0, 0, undef, 0, 'singleline comment', 'Comment')) {
131 # attribute => 'Comment'
134 # context => 'multilinecomment'
135 # type => 'Detect2Chars'
136 if ($self->testDetect2Chars($text, '#', '*', 0, 0, 0, undef, 0, 'multilinecomment', 'Comment')) {
142 sub parsemultilinecomment {
143 my ($self, $text) = @_;
144 # attribute => 'Comment'
148 # type => 'Detect2Chars'
149 if ($self->testDetect2Chars($text, '*', '#', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
155 sub parsesinglelinecomment {
156 my ($self, $text) = @_;
167 Syntax::Highlight::Engine::Kate::Velocity - a Plugin for Velocity syntax highlighting
171 require Syntax::Highlight::Engine::Kate::Velocity;
172 my $sh = new Syntax::Highlight::Engine::Kate::Velocity([
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.
180 This code is generated from the syntax definition files used
182 It works quite fine, but can use refinement and optimization.
184 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
190 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
196 Unknown. If you find any, please contact the author