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 'lua.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #generated: Sun Feb 3 22:02:05 2008, localtime
12 package Syntax::Highlight::Engine::Kate::Lua;
14 our $VERSION = '0.06';
18 use base('Syntax::Highlight::Engine::Kate::Template');
22 my $class = ref($proto) || $proto;
23 my $self = $class->SUPER::new(@_);
26 'BaseFunc' => 'Normal',
27 'Comment' => 'Comment',
28 'Decimal' => 'DecVal',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'Normal',
35 $self->listAdd('basefunc',
209 $self->listAdd('keywords',
232 callback => \&parseComment,
233 attribute => 'Comment',
234 lineending => '#pop',
237 callback => \&parseNormal,
238 attribute => 'Normal Text',
241 callback => \&parseString,
242 attribute => 'String',
243 lineending => '#pop',
246 $self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\.');
247 $self->basecontext('Normal');
248 $self->keywordscase(0);
250 bless ($self, $class);
259 my ($self, $text) = @_;
260 # String => '(FIXME|TODO)'
261 # attribute => 'Alert'
264 if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) {
271 my ($self, $text) = @_;
272 # String => 'keywords'
273 # attribute => 'Keyword'
276 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
279 # String => 'basefunc'
280 # attribute => 'BaseFunc'
283 if ($self->testKeyword($text, 'basefunc', 0, undef, 0, '#stay', 'BaseFunc')) {
286 # attribute => 'Char'
289 #This rule is buggy, not sending it to output
290 # attribute => 'Comment'
293 # context => 'Comment'
294 # type => 'Detect2Chars'
295 if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
298 # attribute => 'Comment'
300 # context => 'Comment'
301 # type => 'DetectChar'
302 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
305 # attribute => 'String'
307 # context => 'String'
308 # type => 'DetectChar'
309 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
312 # String => '!%&()+,-<=>?[]^{|}~'
313 # attribute => 'Symbol'
316 if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) {
319 # String => '\d*\.?\d*e?\d+'
320 # attribute => 'Number'
323 if ($self->testRegExpr($text, '\\d*\\.?\\d*e?\\d+', 0, 0, 0, undef, 0, '#stay', 'Number')) {
330 my ($self, $text) = @_;
331 # attribute => 'String'
334 # type => 'DetectChar'
335 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
348 Syntax::Highlight::Engine::Kate::Lua - a Plugin for Lua syntax highlighting
352 require Syntax::Highlight::Engine::Kate::Lua;
353 my $sh = new Syntax::Highlight::Engine::Kate::Lua([
358 Syntax::Highlight::Engine::Kate::Lua is a plugin module that provides syntax highlighting
359 for Lua to the Syntax::Haghlight::Engine::Kate highlighting engine.
361 This code is generated from the syntax definition files used
363 It works quite fine, but can use refinement and optimization.
365 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
371 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
377 Unknown. If you find any, please contact the author