]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/gams.js
1 /*! `gams` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Author: Stefan Bechert <stefan.bechert@gmx.net>
9 Contributors: Oleg Efimov <efimovov@gmail.com>, Mikko Kouhia <mikko.kouhia@iki.fi>
10 Description: The General Algebraic Modeling System language
11 Website: https://www.gams.com
15 /** @type LanguageFn */
17 const regex
= hljs
.regex
;
20 'abort acronym acronyms alias all and assign binary card diag display '
21 + 'else eq file files for free ge gt if integer le loop lt maximizing '
22 + 'minimizing model models ne negative no not option options or ord '
23 + 'positive prod put putpage puttl repeat sameas semicont semiint smax '
24 + 'smin solve sos1 sos2 sum system table then until using while xor yes',
28 'abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy '
29 + 'cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact '
30 + 'floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max '
31 + 'min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power '
32 + 'randBinomial randLinear randTriangle round rPower sigmoid sign '
33 + 'signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt '
34 + 'tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp '
35 + 'bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt '
36 + 'rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear '
37 + 'jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion '
38 + 'handleCollect handleDelete handleStatus handleSubmit heapFree '
39 + 'heapLimit heapSize jobHandle jobKill jobStatus jobTerminate '
40 + 'licenseLevel licenseStatus maxExecError sleep timeClose timeComp '
41 + 'timeElapsed timeExec timeStart'
53 { begin: /=[lgenxc]=/ },
57 const QSTR
= { // One-line quoted comment string
70 contains: [ hljs
.BACKSLASH_ESCAPE
]
78 hljs
.C_LINE_COMMENT_MODE
,
79 hljs
.C_BLOCK_COMMENT_MODE
,
80 hljs
.QUOTE_STRING_MODE
,
81 hljs
.APOS_STRING_MODE
,
85 const COMMENT_WORD
= /[a-z0-9&#*=?@\\><:,()$[\]_.{}!+%^-]+/;
86 const DESCTEXT
= { // Parameter/set/variable description text
87 begin: /[a
-z
][a
-z0
-9_
]*(\([a
-z0
-9_
, ]*\))?[ \t]+/,
96 // one comment word, then possibly more
99 // [ ] because \s would be too broad (matching newlines)
100 regex
.anyNumberOfTimes(regex
.concat(/[ ]+/, COMMENT_WORD
))
110 case_insensitive: true,
113 hljs
.COMMENT(/^\$ontext/, /^\$offtext/),
116 begin: '^\\$[a-z0-9]+',
121 className: 'keyword',
122 begin: '^\\$[a-z0-9]+'
126 hljs
.COMMENT('^\\*', '$'),
127 hljs
.C_LINE_COMMENT_MODE
,
128 hljs
.C_BLOCK_COMMENT_MODE
,
129 hljs
.QUOTE_STRING_MODE
,
130 hljs
.APOS_STRING_MODE
,
134 'set sets parameter parameters variable variables '
135 + 'scalar scalars equation equations',
138 hljs
.COMMENT('^\\*', '$'),
139 hljs
.C_LINE_COMMENT_MODE
,
140 hljs
.C_BLOCK_COMMENT_MODE
,
141 hljs
.QUOTE_STRING_MODE
,
142 hljs
.APOS_STRING_MODE
,
147 { // table environment
148 beginKeywords: 'table',
152 { // table header row
153 beginKeywords: 'table',
155 contains: [ DESCTEXT
]
157 hljs
.COMMENT('^\\*', '$'),
158 hljs
.C_LINE_COMMENT_MODE
,
159 hljs
.C_BLOCK_COMMENT_MODE
,
160 hljs
.QUOTE_STRING_MODE
,
161 hljs
.APOS_STRING_MODE
,
163 // Table does not contain DESCTEXT or ASSIGNMENT
166 // Function definitions
168 className: 'function',
169 begin: /^[a
-z
][a
-z0
-9_
,\-+' ()$]+\.{2}/,
190 hljs.registerLanguage('gams
', hljsGrammar);