1<?php
2/*************************************************************************************
3 * matlab.php
4 * -----------
5 * Author: Florian Knorn (floz@gmx.de)
6 * Copyright: (c) 2004 Florian Knorn (http://www.florian-knorn.com)
7 * Release Version: 1.0.9.1
8 * Date Started: 2005/02/09
9 *
10 * Matlab M-file language file for GeSHi.
11 *
12 * CHANGES
13 * -------
14 * 2006-03-25 (1.0.7.22)
15 *   - support for the transpose operator
16 *   - many keywords added
17 *   - links to the matlab documentation at mathworks
18 *      by: Olivier Verdier (olivier.verdier@free.fr)
19 * 2005/05/07 (1.0.0)
20 *   -  First Release
21 *
22 *
23 *************************************************************************************
24 *
25 *     This file is part of GeSHi.
26 *
27 *   GeSHi is free software; you can redistribute it and/or modify
28 *   it under the terms of the GNU General Public License as published by
29 *   the Free Software Foundation; either version 2 of the License, or
30 *   (at your option) any later version.
31 *
32 *   GeSHi is distributed in the hope that it will be useful,
33 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
34 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
35 *   GNU General Public License for more details.
36 *
37 *   You should have received a copy of the GNU General Public License
38 *   along with GeSHi; if not, write to the Free Software
39 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
40 *
41 ************************************************************************************/
42
43$language_data = array (
44    'LANG_NAME' => 'Matlab M',
45    'COMMENT_SINGLE' => array(1 => '%'),
46    'COMMENT_MULTI' => array(),
47    //Matlab Strings
48    'COMMENT_REGEXP' => array(
49        2 => "/(?<![\\w\\)\\]\\}\\.])('[^\\n']*?')/"
50        ),
51    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
52    'QUOTEMARKS' => array(),
53    'ESCAPE_CHAR' => '',
54    'KEYWORDS' => array(
55        1 => array(
56            'break', 'case', 'catch', 'classdef', 'continue', 'elseif', 'else', 'end', 'for',
57            'function', 'global', 'if', 'otherwise', 'persistent', 'return',
58            'switch', 'try', 'while'
59            ),
60        2 => array(
61            'all','any','exist','is','logical','mislocked',
62
63            'abs','acos','acosh','acot','acoth','acsc','acsch','airy','angle',
64            'ans','area','arrayfun','asec','asech','asin','asinh','atan','atan2','atanh',
65            'auread','autumn','auwrite','axes','axis','balance','bar','bar3',
66            'bar3h','barh','besselh','besseli','besselj','besselk','Bessely',
67            'beta','betainc','betaln','bicg','bicgstab','bin2dec','bitand',
68            'bitcmp','bitget','bitmax','bitor','bitset','bitshift','bitxor',
69            'blkdiag','bone','bounds','box','brighten','builtin','bwcontr','calendar',
70            'camdolly','camlight','camlookat','camorbit','campan','campos',
71            'camproj','camroll','camtarget','camup','camva','camzoom','capture',
72            'cart2pol','cart2sph','cat','caxis','cdf2rdf','ceil','cell',
73            'cell2struct','celldisp','cellfun','cellplot','cellstr','cgs',
74            'char','chol','cholinc','cholupdate','cla','clabel','class','clc',
75            'clf','clg','clock','close','colmmd','colorbar','colorcube',
76            'colordef','colormap','colperm','comet','comet3','compan','compass',
77            'complex','computer','cond','condeig','condest','coneplot','conj',
78            'contour','contourc','contourf','contourslice','contrast','conv',
79            'conv2','convhull','cool','copper','copyobj','corrcoef','cos',
80            'cosh','cot','coth','cov','cplxpair','cputime','cross','csc','csch',
81            'cumprod','cumsum','cumtrapz','cylinder','daspect','dataset','datastore','date','datenum',
82            'datestr','datetick','datetime','datevec','dbclear','dbcont','dbdown',
83            'dblquad','dbmex','dbquit','dbstack','dbstatus','dbstep','dbstop',
84            'dbtype','dbup','deblank','dec2bin','dec2hex','deconv','del2',
85            'delaunay','det','diag','dialog','diff','diffuse','discretize','dlmread',
86            'dlmwrite','dmperm','double','dragrect','drawnow','dsearch','duration','eig',
87            'eigs','ellipj','ellipke','eomday','eps','erf','erfc','erfcx',
88            'erfiny','error','errorbar','errordlg','etime','eval','evalc',
89            'evalin','exp','expint','expm','eye','ezcontour','ezcontourf',
90            'ezmesh','ezmeshc','ezplot','ezplot3','ezpolar','ezsurf','ezsurfc',
91            'factor','factorial','fclose','feather','feof','ferror','feval',
92            'fft','fft2','fftshift','fgetl','fgets','fieldnames','figure',
93            'fill','fill3','filter','filter2','find','findfigs','findobj',
94            'findstr','fix','flag','flipdim','fliplr','flipud','floor','flops',
95            'fmin','fmins','fopen','fplot','fprintf','fread','frewind','fscanf',
96            'fseek','ftell','full','funm','fwrite','fzero','gallery','gamma',
97            'gammainc','gammaln','gca','gcbo','gcd','gcf','gco','get',
98            'getfield','ginput','gmres','gradient','gray','graymon','grid',
99            'griddata','gsvd','gtext','hadamard','hankel','hdf','head','helpdlg',
100            'hess','hex2dec','hex2num','hidden','hilb','hist','hold','hot',
101            'hsv','hsv2rgb','i','ifft','ifft2','ifftn','ifftshift','imag',
102            'image','imfinfo','imread','imwrite','ind2sub','Inf','inferiorto',
103            'inline','inpolygon','input','inputdlg','inputname','int16',
104            'int2str','int32','int8','int64','interp1','interp2','interp3','interpft',
105            'interpn','intersect','inv','invhilb','ipermute','isa','iscell',
106            'iscellstr','isfile','isfolder','ishandle','isinf',
107            'ismember','isnan','isocaps','isonormals','isosurface','issorted','j','jet','keyboard',
108            'lcm','legend','legendre','light','lighting','lightingangle',
109            'lin2mu','line','lines','linspace','listdlg','loadobj','log',
110            'log10','log2','loglog','logm','logspace','lower','lscov','lu',
111            'luinc','magic','mat2str','material','max','mean','median','menu',
112            'menuedit','mesh','meshc','meshgrid','min','missing','mod','msgbox','mu2lin',
113            'NaN','nargchk','nargin','nargout','nchoosek','ndgrid','ndims',
114            'newplot','nextpow2','nnls','nnz','nonzeros','norm','normest','now',
115            'null','num2cell','num2str','nzmax','ode113,','ode15s,','ode23s,',
116            'ode23t,','ode23tb','ode45,','odefile','odeget','odeset','ones',
117            'orient','orth','pagedlg','pareto','pascal','patch','pause',
118            'pbaspect','pcg','pcolor','peaks','perms','permute','pi','pie',
119            'pie3','pinv','plot','plot3','plotmatrix','plotyy','pol2cart',
120            'polar','poly','polyarea','polyder','polyeig','polyfit','polyval',
121            'polyvalm','pow2','primes','print','printdlg','printopt','prism',
122            'prod','propedit','qmr','qr','qrdelete','qrinsert','qrupdate',
123            'quad','questdlg','quiver','quiver3','qz','rand','randn','randperm',
124            'rank','rat','rats','rbbox','rcond','readtable','real','realmax','realmin',
125            'rectangle','reducepatch','reducevolume','refresh','rem','repmat',
126            'reset','reshape','residue','rgb2hsv','rgbplot','ribbon','rmfield',
127            'roots','rose','rot90','rotate','rotate3d','round','rref',
128            'rrefmovie','rsf2csf','saveobj','scatter','scatter3','schur',
129            'script','sec','sech','selectmoveresize','semilogx','semilogy',
130            'set','setdiff','setfield','setxor','shading','shg','shiftdim',
131            'shrinkfaces','sign','sin','single','sinh','slice','smooth3','sort',
132            'sortrows','sound','soundsc','spalloc','sparse','spconvert',
133            'spdiags','specular','speye','spfun','sph2cart','sphere','spinmap',
134            'spline','spones','spparms','sprand','sprandn','sprandsym','spring',
135            'sprintf','sqrt','sqrtm','squeeze','sscanf','stairs','std','stem',
136            'stem3','str2double','str2num','strcat','strcmp','strcmpi',
137            'stream2','stream3','streamline','string','strings','strjust','strmatch',
138            'strncmp','strrep','strtok','struct','structfun','struct2cell','strvcat',
139            'sub2ind','subplot','subspace','subvolume','sum','summer',
140            'superiorto','surf','surf2patch','surface','surfc','surfl',
141            'surfnorm','svd','svds','symmmd','symrcm','symvar','tail','tall','tan','tanh',
142            'texlabel','text Create','textread','textwrap','tic','timeseries','timer','timetable','title','toc',
143            'toeplitz','trace','trapz','tril','trimesh','trisurf','triu',
144            'tsearch','uicontext Create','uicontextmenu','uicontrol',
145            'uigetfile','uimenu','uint32','uint8','uint64','uiputfile','uiresume',
146            'uisetcolor','uisetfont','uiwait Used','union','unique','unwrap',
147            'upper','var','varargin','varargout','vectorize','view','viewmtx',
148            'voronoi','waitbar','waitforbuttonpress','warndlg','warning',
149            'waterfall','wavread','wavwrite','weekday','whitebg','wilkinson',
150            'winter','wk1read','wk1write','writetable','xlabel','xlim','ylabel','ylim',
151            'zeros','zlabel','zlim','zoom',
152            //'[Keywords 6]',
153            'addpath','cd','clear','copyfile','delete','diary','dir','disp',
154            'doc','docopt','echo','edit','fileparts','format','fullfile','help',
155            'helpdesk','helpwin','home','inmem','lasterr','lastwarn','length',
156            'load','lookfor','ls','matlabrc','matlabroot','mkdir','mlock',
157            'more','munlock','numel','open','openvar','pack','partialpath','path',
158            'pathtool','profile','profreport','pwd','quit','rmpath','save',
159            'saveas','size','tempdir','tempname','type','ver','version','web',
160            'what','whatsnew','which','who','whos','workspace'
161            )
162        ),
163    'SYMBOLS' => array(
164        '...'
165        ),
166    'CASE_SENSITIVE' => array(
167        GESHI_COMMENTS => false,
168        1 => false,
169        2 => false,
170        //3 => false,
171        //4 => false,
172        ),
173    'STYLES' => array(
174        'KEYWORDS' => array(
175            1 => 'color: #0000FF;',
176            2 => 'color: #0000FF;'
177            ),
178        'COMMENTS' => array(
179            1 => 'color: #228B22;',
180            2 => 'color:#A020F0;'
181            ),
182        'ESCAPE_CHAR' => array(
183            0 => ''
184            ),
185        'BRACKETS' => array(
186            0 => 'color: #080;'
187            ),
188        'STRINGS' => array(
189            //0 => 'color: #A020F0;'
190            ),
191        'NUMBERS' => array(
192            0 => 'color: #33f;'
193            ),
194        'METHODS' => array(
195            1 => '',
196            2 => ''
197            ),
198        'SYMBOLS' => array(
199            0 => 'color: #080;'
200            ),
201        'REGEXPS' => array(
202            0 => 'color: #33f;'
203            ),
204        'SCRIPT' => array(
205            0 => ''
206            )
207        ),
208    'URLS' => array(
209        1 => '',
210        2 => 'https://www.mathworks.com/help/matlab/ref/{FNAMEL}.html'
211        ),
212    'OOLANG' => true,
213    'OBJECT_SPLITTERS' => array(
214        1 => '.',
215        2 => '::'
216        ),
217    'REGEXPS' => array(
218        //Complex numbers
219        0 => '(?<![\\w\\/])[+-]?[\\d]*([\\d]\\.|\\.[\\d])?[\\d]*[ij](?![\\w]|\<DOT>html)'
220        ),
221    'STRICT_MODE_APPLIES' => GESHI_NEVER,
222    'SCRIPT_DELIMITERS' => array(
223        ),
224    'HIGHLIGHT_STRICT_BLOCK' => array(
225        )
226);
227