-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatlab.js
75 lines (73 loc) · 2.71 KB
/
matlab.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
module.exports = function(hljs) {
var COMMON_CONTAINS = [
hljs.C_NUMBER_MODE,
{
className: 'string',
begin: '\'', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
relevance: 0
}
];
return {
keywords: {
keyword:
'break case catch classdef continue else elseif end enumerated events for function ' +
'global if methods otherwise parfor persistent properties return spmd switch try while',
built_in:
'sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan ' +
'atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot ' +
'cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog ' +
'realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal ' +
'cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli ' +
'besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma ' +
'gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms ' +
'nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones ' +
'eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ' +
'ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril ' +
'triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute ' +
'shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan ' +
'isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal ' +
'rosser toeplitz vander wilkinson'
},
illegal: '(//|"|#|/\\*|\\s+/\\w+)',
contains: [
{
className: 'function',
beginWithKeyword: true, end: '$',
keywords: 'function',
contains: [
{
className: 'title',
begin: hljs.UNDERSCORE_IDENT_RE
},
{
className: 'params',
begin: '\\(', end: '\\)'
},
{
className: 'params',
begin: '\\[', end: '\\]'
}
]
},
{
className: 'transposed_variable',
begin: '[a-zA-Z_][a-zA-Z_0-9]*(\'+[\\.\']*|[\\.\']+)', end: ''
},
{
className: 'matrix',
begin: '\\[', end: '\\]\'*[\\.\']*',
contains: COMMON_CONTAINS
},
{
className: 'cell',
begin: '\\{', end: '\\}\'*[\\.\']*',
contains: COMMON_CONTAINS
},
{
className: 'comment',
begin: '\\%', end: '$'
}
].concat(COMMON_CONTAINS)
};
};