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 'matlab.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::Matlab;
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(@_);
25 'Comment' => 'Comment',
26 'Delimiter' => 'Normal',
27 'Incomplete String' => 'Char',
28 'Keyword' => 'Keyword',
29 'Normal Text' => 'Normal',
31 'Operator' => 'Normal',
34 'Variable' => 'Variable',
36 $self->listAdd('KeywordsList',
57 callback => \&parse_adjoint,
58 attribute => 'Operator',
62 callback => \&parse_normal,
63 attribute => 'Normal Text',
67 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
68 $self->basecontext('_normal');
69 $self->keywordscase(0);
71 bless ($self, $class);
80 my ($self, $text) = @_;
82 # attribute => 'Operator'
85 if ($self->testRegExpr($text, '\'+', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
92 my ($self, $text) = @_;
93 # String => '[a-zA-Z]\w*(?=')'
94 # attribute => 'Variable'
95 # context => '_adjoint'
97 if ($self->testRegExpr($text, '[a-zA-Z]\\w*(?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Variable')) {
100 # String => '(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?(?=')'
101 # attribute => 'Number'
102 # context => '_adjoint'
104 if ($self->testRegExpr($text, '(\\d+(\\.\\d+)?|\\.\\d+)([eE][+-]?\\d+)?[ij]?(?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Number')) {
107 # String => '[\)\]}](?=')'
108 # attribute => 'Delimiter'
109 # context => '_adjoint'
111 if ($self->testRegExpr($text, '[\\)\\]}](?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Delimiter')) {
114 # String => '\.'(?=')'
115 # attribute => 'Operator'
116 # context => '_adjoint'
118 if ($self->testRegExpr($text, '\\.\'(?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Operator')) {
121 # String => ''[^']*(''[^']*)*'(?=[^']|$)'
122 # attribute => 'String'
125 if ($self->testRegExpr($text, '\'[^\']*(\'\'[^\']*)*\'(?=[^\']|$)', 0, 0, 0, undef, 0, '#stay', 'String')) {
128 # String => ''[^']*(''[^']*)*'
129 # attribute => 'Incomplete String'
132 if ($self->testRegExpr($text, '\'[^\']*(\'\'[^\']*)*', 0, 0, 0, undef, 0, '#stay', 'Incomplete String')) {
135 # String => 'KeywordsList'
136 # attribute => 'Keyword'
139 if ($self->testKeyword($text, 'KeywordsList', 0, undef, 0, '#stay', 'Keyword')) {
143 # attribute => 'Comment'
146 if ($self->testRegExpr($text, '%.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
150 # attribute => 'System'
153 if ($self->testRegExpr($text, '!.*$', 0, 0, 0, undef, 0, '#stay', 'System')) {
156 # String => '[a-zA-Z]\w*'
157 # attribute => 'Variable'
160 if ($self->testRegExpr($text, '[a-zA-Z]\\w*', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
163 # String => '(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?'
164 # attribute => 'Number'
167 if ($self->testRegExpr($text, '(\\d+(\\.\\d+)?|\\.\\d+)([eE][+-]?\\d+)?[ij]?', 0, 0, 0, undef, 0, '#stay', 'Number')) {
171 # attribute => 'Delimiter'
174 if ($self->testAnyChar($text, '()[]{}', 0, 0, undef, 0, '#stay', 'Delimiter')) {
178 # attribute => 'Operator'
180 # type => 'StringDetect'
181 if ($self->testStringDetect($text, '...', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
185 # attribute => 'Operator'
187 # type => 'StringDetect'
188 if ($self->testStringDetect($text, '==', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
192 # attribute => 'Operator'
194 # type => 'StringDetect'
195 if ($self->testStringDetect($text, '~=', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
199 # attribute => 'Operator'
201 # type => 'StringDetect'
202 if ($self->testStringDetect($text, '<=', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
206 # attribute => 'Operator'
208 # type => 'StringDetect'
209 if ($self->testStringDetect($text, '>=', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
213 # attribute => 'Operator'
215 # type => 'StringDetect'
216 if ($self->testStringDetect($text, '&&', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
220 # attribute => 'Operator'
222 # type => 'StringDetect'
223 if ($self->testStringDetect($text, '||', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
227 # attribute => 'Operator'
229 # type => 'StringDetect'
230 if ($self->testStringDetect($text, '.*', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
234 # attribute => 'Operator'
236 # type => 'StringDetect'
237 if ($self->testStringDetect($text, '.^', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
241 # attribute => 'Operator'
243 # type => 'StringDetect'
244 if ($self->testStringDetect($text, './', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
248 # attribute => 'Operator'
250 # type => 'StringDetect'
251 if ($self->testStringDetect($text, '.\'', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
254 # String => '*+-/\&|<>~^=,;:@'
255 # attribute => 'Operator'
258 if ($self->testAnyChar($text, '*+-/\\&|<>~^=,;:@', 0, 0, undef, 0, '#stay', 'Operator')) {
271 Syntax::Highlight::Engine::Kate::Matlab - a Plugin for Matlab syntax highlighting
275 require Syntax::Highlight::Engine::Kate::Matlab;
276 my $sh = new Syntax::Highlight::Engine::Kate::Matlab([
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.
284 This code is generated from the syntax definition files used
286 It works quite fine, but can use refinement and optimization.
288 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
294 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
300 Unknown. If you find any, please contact the author