]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/matlab.js
1 /*! `matlab` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Author: Denis Bardadym <bardadymchik@gmail.com>
8 Contributors: Eugene Nizhibitsky <nizhibitsky@ya.ru>, Egor Rogov <e.rogov@postgrespro.ru>
9 Website: https://www.mathworks.com/products/matlab.html
14 Formal syntax is not published, helpful link:
15 https://github.com/kornilova-l/matlab-IntelliJ-plugin/blob/master/src/main/grammar/Matlab.bnf
17 function matlab(hljs
) {
18 const TRANSPOSE_RE
= '(\'|\\.\')+';
21 contains: [ { begin: TRANSPOSE_RE
} ]
28 'arguments break case catch classdef continue else elseif end enumeration events for function '
29 + 'global if methods otherwise parfor persistent properties return spmd switch try while',
31 'sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan '
32 + 'atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot '
33 + 'cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog '
34 + 'realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal '
35 + 'cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli '
36 + 'besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma '
37 + 'gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms '
38 + 'nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones '
39 + 'eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length '
40 + 'ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril '
41 + 'triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute '
42 + 'shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i|0 inf nan '
43 + 'isnan isinf isfinite j|0 why compan gallery hadamard hankel hilb invhilb magic pascal '
44 + 'rosser toeplitz vander wilkinson max min nanmax nanmin mean nanmean type table '
45 + 'readtable writetable sortrows sort figure plot plot3 scatter scatter3 cellfun '
46 + 'legend intersect ismember procrustes hold num2cell '
48 illegal: '(//|"|#|/\\*|\\s+/\\w+)',
51 className: 'function',
52 beginKeywords: 'function',
55 hljs
.UNDERSCORE_TITLE_MODE
,
72 className: 'built_in',
78 begin: '[a-zA-Z][a-zA-Z_0-9]*' + TRANSPOSE_RE
,
83 begin: hljs
.C_NUMBER_RE
,
91 contains: [ { begin: '\'\'' } ]
102 contains: [ { begin: '""' } ],
105 hljs
.COMMENT('^\\s*%\\{\\s*$', '^\\s*%\\}\\s*$'),
106 hljs
.COMMENT('%', '$')
115 export default hljsGrammar
;