Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / GNU_Gettext.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 'gettext.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.03
9 #kate version 2.4
10 #kate author Dominik Haumann (dhdev@gmx.de)
11 #generated: Sun Feb  3 22:02:05 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::GNU_Gettext;
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       'Automatic Comment' => 'Comment',
27       'Char' => 'Char',
28       'Flag' => 'Comment',
29       'Index' => 'DecVal',
30       'Keyword' => 'Keyword',
31       'Normal Text' => 'Normal',
32       'Reference' => 'Comment',
33       'String' => 'String',
34       'Translator Comment' => 'Comment',
35    });
36    $self->contextdata({
37       'Normal' => {
38          callback => \&parseNormal,
39          attribute => 'Normal Text',
40       },
41       'String' => {
42          callback => \&parseString,
43          attribute => 'String',
44       },
45    });
46    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
47    $self->basecontext('Normal');
48    $self->keywordscase(0);
49    $self->initialize;
50    bless ($self, $class);
51    return $self;
52 }
53
54 sub language {
55    return 'GNU Gettext';
56 }
57
58 sub parseNormal {
59    my ($self, $text) = @_;
60    # String => '^(msgid_plural|msgid|msgstr|msgctxt)'
61    # attribute => 'Keyword'
62    # context => '#stay'
63    # type => 'RegExpr'
64    if ($self->testRegExpr($text, '^(msgid_plural|msgid|msgstr|msgctxt)', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
65       return 1
66    }
67    # String => '#\..*$'
68    # attribute => 'Automatic Comment'
69    # context => '#stay'
70    # firstNonSpace => 'true'
71    # type => 'RegExpr'
72    if ($self->testRegExpr($text, '#\\..*$', 0, 0, 0, undef, 1, '#stay', 'Automatic Comment')) {
73       return 1
74    }
75    # String => '#:.*$'
76    # attribute => 'Reference'
77    # context => '#stay'
78    # firstNonSpace => 'true'
79    # type => 'RegExpr'
80    if ($self->testRegExpr($text, '#:.*$', 0, 0, 0, undef, 1, '#stay', 'Reference')) {
81       return 1
82    }
83    # String => '#,.*$'
84    # attribute => 'Flag'
85    # context => '#stay'
86    # firstNonSpace => 'true'
87    # type => 'RegExpr'
88    if ($self->testRegExpr($text, '#,.*$', 0, 0, 0, undef, 1, '#stay', 'Flag')) {
89       return 1
90    }
91    # String => '#.*$'
92    # attribute => 'Translator Comment'
93    # context => '#stay'
94    # firstNonSpace => 'true'
95    # type => 'RegExpr'
96    if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Translator Comment')) {
97       return 1
98    }
99    # String => '\\.'
100    # attribute => 'Char'
101    # context => '#stay'
102    # type => 'RegExpr'
103    if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) {
104       return 1
105    }
106    # attribute => 'String'
107    # char => '"'
108    # context => 'String'
109    # type => 'DetectChar'
110    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
111       return 1
112    }
113    # String => '\[\d+\]'
114    # attribute => 'Index'
115    # context => '#stay'
116    # type => 'RegExpr'
117    if ($self->testRegExpr($text, '\\[\\d+\\]', 0, 0, 0, undef, 0, '#stay', 'Index')) {
118       return 1
119    }
120    return 0;
121 };
122
123 sub parseString {
124    my ($self, $text) = @_;
125    # String => '\\.'
126    # attribute => 'Char'
127    # context => '#stay'
128    # type => 'RegExpr'
129    if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) {
130       return 1
131    }
132    # attribute => 'String'
133    # char => '"'
134    # context => '#pop'
135    # type => 'DetectChar'
136    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
137       return 1
138    }
139    return 0;
140 };
141
142
143 1;
144
145 __END__
146
147 =head1 NAME
148
149 Syntax::Highlight::Engine::Kate::GNU_Gettext - a Plugin for GNU Gettext syntax highlighting
150
151 =head1 SYNOPSIS
152
153  require Syntax::Highlight::Engine::Kate::GNU_Gettext;
154  my $sh = new Syntax::Highlight::Engine::Kate::GNU_Gettext([
155  ]);
156
157 =head1 DESCRIPTION
158
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.
161
162 This code is generated from the syntax definition files used
163 by the Kate project.
164 It works quite fine, but can use refinement and optimization.
165
166 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
167
168 =cut
169
170 =head1 AUTHOR
171
172 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
173
174 =cut
175
176 =head1 BUGS
177
178 Unknown. If you find any, please contact the author
179
180 =cut
181