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 'gettext.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Dominik Haumann (dhdev@gmx.de)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::GNU_Gettext;
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 'Automatic Comment' => 'Comment',
30 'Keyword' => 'Keyword',
31 'Normal Text' => 'Normal',
32 'Reference' => 'Comment',
34 'Translator Comment' => 'Comment',
38 callback => \&parseNormal,
39 attribute => 'Normal Text',
42 callback => \&parseString,
43 attribute => 'String',
46 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
47 $self->basecontext('Normal');
48 $self->keywordscase(0);
50 bless ($self, $class);
59 my ($self, $text) = @_;
60 # String => '^(msgid_plural|msgid|msgstr|msgctxt)'
61 # attribute => 'Keyword'
64 if ($self->testRegExpr($text, '^(msgid_plural|msgid|msgstr|msgctxt)', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
68 # attribute => 'Automatic Comment'
70 # firstNonSpace => 'true'
72 if ($self->testRegExpr($text, '#\\..*$', 0, 0, 0, undef, 1, '#stay', 'Automatic Comment')) {
76 # attribute => 'Reference'
78 # firstNonSpace => 'true'
80 if ($self->testRegExpr($text, '#:.*$', 0, 0, 0, undef, 1, '#stay', 'Reference')) {
86 # firstNonSpace => 'true'
88 if ($self->testRegExpr($text, '#,.*$', 0, 0, 0, undef, 1, '#stay', 'Flag')) {
92 # attribute => 'Translator Comment'
94 # firstNonSpace => 'true'
96 if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Translator Comment')) {
100 # attribute => 'Char'
103 if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) {
106 # attribute => 'String'
108 # context => 'String'
109 # type => 'DetectChar'
110 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
113 # String => '\[\d+\]'
114 # attribute => 'Index'
117 if ($self->testRegExpr($text, '\\[\\d+\\]', 0, 0, 0, undef, 0, '#stay', 'Index')) {
124 my ($self, $text) = @_;
126 # attribute => 'Char'
129 if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) {
132 # attribute => 'String'
135 # type => 'DetectChar'
136 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
149 Syntax::Highlight::Engine::Kate::GNU_Gettext - a Plugin for GNU Gettext syntax highlighting
153 require Syntax::Highlight::Engine::Kate::GNU_Gettext;
154 my $sh = new Syntax::Highlight::Engine::Kate::GNU_Gettext([
159 Syntax::Highlight::Engine::Kate::GNU_Gettext is a plugin module that provides syntax highlighting
160 for GNU Gettext to the Syntax::Haghlight::Engine::Kate highlighting engine.
162 This code is generated from the syntax definition files used
164 It works quite fine, but can use refinement and optimization.
166 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
172 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
178 Unknown. If you find any, please contact the author