]> luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/scilab.js
Initial commit.
[flow-web.git] / static / highlight / es / languages / scilab.js
1 /*! `scilab` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar = (function () {
3 'use strict';
4
5 /*
6 Language: Scilab
7 Author: Sylvestre Ledru <sylvestre.ledru@scilab-enterprises.com>
8 Origin: matlab.js
9 Description: Scilab is a port from Matlab
10 Website: https://www.scilab.org
11 Category: scientific
12 */
13
14 function scilab(hljs) {
15 const COMMON_CONTAINS = [
16 hljs.C_NUMBER_MODE,
17 {
18 className: 'string',
19 begin: '\'|\"',
20 end: '\'|\"',
21 contains: [
22 hljs.BACKSLASH_ESCAPE,
23 { begin: '\'\'' }
24 ]
25 }
26 ];
27
28 return {
29 name: 'Scilab',
30 aliases: [ 'sci' ],
31 keywords: {
32 $pattern: /%?\w+/,
33 keyword: 'abort break case clear catch continue do elseif else endfunction end for function '
34 + 'global if pause return resume select try then while',
35 literal:
36 '%f %F %t %T %pi %eps %inf %nan %e %i %z %s',
37 built_in: // Scilab has more than 2000 functions. Just list the most commons
38 'abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error '
39 + 'exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty '
40 + 'isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log '
41 + 'max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real '
42 + 'round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan '
43 + 'type typename warning zeros matrix'
44 },
45 illegal: '("|#|/\\*|\\s+/\\w+)',
46 contains: [
47 {
48 className: 'function',
49 beginKeywords: 'function',
50 end: '$',
51 contains: [
52 hljs.UNDERSCORE_TITLE_MODE,
53 {
54 className: 'params',
55 begin: '\\(',
56 end: '\\)'
57 }
58 ]
59 },
60 // seems to be a guard against [ident]' or [ident].
61 // perhaps to prevent attributes from flagging as keywords?
62 {
63 begin: '[a-zA-Z_][a-zA-Z_0-9]*[\\.\']+',
64 relevance: 0
65 },
66 {
67 begin: '\\[',
68 end: '\\][\\.\']*',
69 relevance: 0,
70 contains: COMMON_CONTAINS
71 },
72 hljs.COMMENT('//', '$')
73 ].concat(COMMON_CONTAINS)
74 };
75 }
76
77 return scilab;
78
79 })();
80 ;
81 export default hljsGrammar;