Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Makefile.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 'makefile.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.06
9 #kate version 2.4
10 #kate author Per Wigren (wigren@home.se)
11 #generated: Sun Feb  3 22:02:05 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::Makefile;
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       'Commands' => 'BaseN',
27       'Comment' => 'Comment',
28       'Keyword' => 'Keyword',
29       'Normal Text' => 'Normal',
30       'Operator' => 'Char',
31       'Section' => 'Others',
32       'Special' => 'Float',
33       'String' => 'String',
34       'Target' => 'DecVal',
35       'Variable' => 'DataType',
36    });
37    $self->listAdd('keywords',
38       'define',
39       'else',
40       'endef',
41       'endif',
42       'ifdef',
43       'ifeq',
44       'ifndef',
45       'ifneq',
46       'include',
47    );
48    $self->contextdata({
49       'Commands' => {
50          callback => \&parseCommands,
51          attribute => 'Normal Text',
52          lineending => '#pop',
53       },
54       'Normal' => {
55          callback => \&parseNormal,
56          attribute => 'Normal Text',
57       },
58       'String' => {
59          callback => \&parseString,
60          attribute => 'String',
61          lineending => '#pop',
62       },
63       'Value' => {
64          callback => \&parseValue,
65          attribute => 'String',
66       },
67       'VarFromNormal' => {
68          callback => \&parseVarFromNormal,
69          attribute => 'Variable',
70       },
71       'VarFromValue' => {
72          callback => \&parseVarFromValue,
73          attribute => 'Variable',
74       },
75    });
76    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
77    $self->basecontext('Normal');
78    $self->keywordscase(0);
79    $self->initialize;
80    bless ($self, $class);
81    return $self;
82 }
83
84 sub language {
85    return 'Makefile';
86 }
87
88 sub parseCommands {
89    my ($self, $text) = @_;
90    # String => '[$][\({]'
91    # attribute => 'Operator'
92    # context => 'VarFromNormal'
93    # type => 'RegExpr'
94    if ($self->testRegExpr($text, '[$][\\({]', 0, 0, 0, undef, 0, 'VarFromNormal', 'Operator')) {
95       return 1
96    }
97    # String => '[_\w-]*\b'
98    # attribute => 'Commands'
99    # context => '#pop'
100    # type => 'RegExpr'
101    if ($self->testRegExpr($text, '[_\\w-]*\\b', 0, 0, 0, undef, 0, '#pop', 'Commands')) {
102       return 1
103    }
104    return 0;
105 };
106
107 sub parseNormal {
108    my ($self, $text) = @_;
109    # String => 'keywords'
110    # attribute => 'Keyword'
111    # context => '#stay'
112    # type => 'keyword'
113    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
114       return 1
115    }
116    # String => '[_\w\d]*\s*(?=:=|=)'
117    # attribute => 'Variable'
118    # context => 'Value'
119    # type => 'RegExpr'
120    if ($self->testRegExpr($text, '[_\\w\\d]*\\s*(?=:=|=)', 0, 0, 0, undef, 0, 'Value', 'Variable')) {
121       return 1
122    }
123    # String => '[_\w\d-]*\s*:'
124    # attribute => 'Target'
125    # context => '#stay'
126    # firstNonSpace => 'true'
127    # type => 'RegExpr'
128    if ($self->testRegExpr($text, '[_\\w\\d-]*\\s*:', 0, 0, 0, undef, 1, '#stay', 'Target')) {
129       return 1
130    }
131    # String => '^[.].*:'
132    # attribute => 'Section'
133    # context => '#stay'
134    # type => 'RegExpr'
135    if ($self->testRegExpr($text, '^[.].*:', 0, 0, 0, undef, 0, '#stay', 'Section')) {
136       return 1
137    }
138    # attribute => 'String'
139    # char => '"'
140    # context => 'String'
141    # type => 'DetectChar'
142    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
143       return 1
144    }
145    # String => '[$][\({]'
146    # attribute => 'Operator'
147    # context => 'VarFromNormal'
148    # type => 'RegExpr'
149    if ($self->testRegExpr($text, '[$][\\({]', 0, 0, 0, undef, 0, 'VarFromNormal', 'Operator')) {
150       return 1
151    }
152    # String => '+*=%$():\\;'
153    # attribute => 'Operator'
154    # context => '#stay'
155    # type => 'AnyChar'
156    if ($self->testAnyChar($text, '+*=%$():\\\\;', 0, 0, undef, 0, '#stay', 'Operator')) {
157       return 1
158    }
159    # String => '[@-]'
160    # attribute => 'Operator'
161    # context => 'Commands'
162    # firstNonSpace => 'true'
163    # type => 'RegExpr'
164    if ($self->testRegExpr($text, '[@-]', 0, 0, 0, undef, 1, 'Commands', 'Operator')) {
165       return 1
166    }
167    # String => '(:^|[^\\])#.*$'
168    # attribute => 'Comment'
169    # context => '#stay'
170    # type => 'RegExpr'
171    if ($self->testRegExpr($text, '(:^|[^\\\\])#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
172       return 1
173    }
174    return 0;
175 };
176
177 sub parseString {
178    my ($self, $text) = @_;
179    # attribute => 'String'
180    # context => '#stay'
181    # type => 'LineContinue'
182    if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
183       return 1
184    }
185    # attribute => 'String'
186    # char => '"'
187    # context => '#pop'
188    # type => 'DetectChar'
189    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
190       return 1
191    }
192    return 0;
193 };
194
195 sub parseValue {
196    my ($self, $text) = @_;
197    # String => '\\$'
198    # attribute => 'Operator'
199    # context => '#stay'
200    # type => 'RegExpr'
201    if ($self->testRegExpr($text, '\\\\$', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
202       return 1
203    }
204    # String => '[^\\]?$'
205    # attribute => 'String'
206    # context => '#pop'
207    # type => 'RegExpr'
208    if ($self->testRegExpr($text, '[^\\\\]?$', 0, 0, 0, undef, 0, '#pop', 'String')) {
209       return 1
210    }
211    # String => '[$][\({]'
212    # attribute => 'Operator'
213    # context => 'VarFromValue'
214    # type => 'RegExpr'
215    if ($self->testRegExpr($text, '[$][\\({]', 0, 0, 0, undef, 0, 'VarFromValue', 'Operator')) {
216       return 1
217    }
218    # String => '@[-_\d\w]*@'
219    # attribute => 'Special'
220    # context => '#pop'
221    # type => 'RegExpr'
222    if ($self->testRegExpr($text, '@[-_\\d\\w]*@', 0, 0, 0, undef, 0, '#pop', 'Special')) {
223       return 1
224    }
225    # attribute => 'Operator'
226    # char => ';'
227    # context => '#pop'
228    # type => 'DetectChar'
229    if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
230       return 1
231    }
232    return 0;
233 };
234
235 sub parseVarFromNormal {
236    my ($self, $text) = @_;
237    # String => '[\)}]'
238    # attribute => 'Operator'
239    # context => '#pop'
240    # type => 'RegExpr'
241    if ($self->testRegExpr($text, '[\\)}]', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
242       return 1
243    }
244    return 0;
245 };
246
247 sub parseVarFromValue {
248    my ($self, $text) = @_;
249    # String => '[\)}](?=/)'
250    # attribute => 'Operator'
251    # context => '#pop'
252    # type => 'RegExpr'
253    if ($self->testRegExpr($text, '[\\)}](?=/)', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
254       return 1
255    }
256    # String => '[\)}][^$]'
257    # attribute => 'Operator'
258    # context => '#pop'
259    # type => 'RegExpr'
260    if ($self->testRegExpr($text, '[\\)}][^$]', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
261       return 1
262    }
263    # String => '[\)}]$'
264    # attribute => 'Operator'
265    # context => '#pop#pop'
266    # type => 'RegExpr'
267    if ($self->testRegExpr($text, '[\\)}]$', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
268       return 1
269    }
270    return 0;
271 };
272
273
274 1;
275
276 __END__
277
278 =head1 NAME
279
280 Syntax::Highlight::Engine::Kate::Makefile - a Plugin for Makefile syntax highlighting
281
282 =head1 SYNOPSIS
283
284  require Syntax::Highlight::Engine::Kate::Makefile;
285  my $sh = new Syntax::Highlight::Engine::Kate::Makefile([
286  ]);
287
288 =head1 DESCRIPTION
289
290 Syntax::Highlight::Engine::Kate::Makefile is a  plugin module that provides syntax highlighting
291 for Makefile to the Syntax::Haghlight::Engine::Kate highlighting engine.
292
293 This code is generated from the syntax definition files used
294 by the Kate project.
295 It works quite fine, but can use refinement and optimization.
296
297 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
298
299 =cut
300
301 =head1 AUTHOR
302
303 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
304
305 =cut
306
307 =head1 BUGS
308
309 Unknown. If you find any, please contact the author
310
311 =cut
312