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