@threadlabs/looma 0.18.6 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +34 -3
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +55 -0
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +7 -2
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +29 -0
- package/dist/index.js +1 -1
- package/editor/chunks/extensions.js +24 -3
- package/editor/extensions/preset.d.ts +2 -0
- package/editor/extensions/table-commands.d.ts +1 -1
- package/editor/table-overlay.d.ts +8 -3
- package/package.json +2 -1
- package/styles/ui-editor-table-overlay.css +30 -0
- package/styles/ui-editor-table-toolbar.css +7 -2
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +9 -3
- package/vue/UiEditorTableOverlay.d.ts +8 -0
- package/vue/UiEditorTableOverlay.vue +45 -2
- package/vue/UiEditorTableToolbar.vue +7 -2
- package/vue/chunks/1c.js +106 -0
- package/vue/chunks/UiEditorTableOverlay.js +14 -4
- package/vue/chunks/UiEditorTableToolbar.js +1 -1
- package/vue/chunks/abnf.js +61 -0
- package/vue/chunks/accesslog.js +72 -0
- package/vue/chunks/actionscript.js +139 -0
- package/vue/chunks/ada.js +183 -0
- package/vue/chunks/angelscript.js +141 -0
- package/vue/chunks/apache.js +88 -0
- package/vue/chunks/applescript.js +99 -0
- package/vue/chunks/arcade.js +405 -0
- package/vue/chunks/arduino.js +871 -0
- package/vue/chunks/armasm.js +65 -0
- package/vue/chunks/asciidoc.js +181 -0
- package/vue/chunks/aspectj.js +202 -0
- package/vue/chunks/autohotkey.js +54 -0
- package/vue/chunks/autoit.js +132 -0
- package/vue/chunks/avrasm.js +46 -0
- package/vue/chunks/awk.js +58 -0
- package/vue/chunks/axapta.js +167 -0
- package/vue/chunks/bash.js +358 -0
- package/vue/chunks/basic.js +221 -0
- package/vue/chunks/bnf.js +27 -0
- package/vue/chunks/brainfuck.js +40 -0
- package/vue/chunks/c.js +265 -0
- package/vue/chunks/cal.js +136 -0
- package/vue/chunks/capnproto.js +86 -0
- package/vue/chunks/ceylon.js +125 -0
- package/vue/chunks/clean.js +54 -0
- package/vue/chunks/clojure-repl.js +17 -0
- package/vue/chunks/clojure.js +133 -0
- package/vue/chunks/cmake.js +23 -0
- package/vue/chunks/coffeescript.js +291 -0
- package/vue/chunks/coq.js +436 -0
- package/vue/chunks/cos.js +77 -0
- package/vue/chunks/cpp.js +492 -0
- package/vue/chunks/crmsh.js +80 -0
- package/vue/chunks/crystal.js +260 -0
- package/vue/chunks/csharp.js +376 -0
- package/vue/chunks/csp.js +52 -0
- package/vue/chunks/css.js +890 -0
- package/vue/chunks/d.js +184 -0
- package/vue/chunks/dart.js +226 -0
- package/vue/chunks/delphi.js +227 -0
- package/vue/chunks/diff.js +40 -0
- package/vue/chunks/django.js +43 -0
- package/vue/chunks/dns.js +66 -0
- package/vue/chunks/dockerfile.js +35 -0
- package/vue/chunks/dos.js +147 -0
- package/vue/chunks/dsconfig.js +55 -0
- package/vue/chunks/dts.js +119 -0
- package/vue/chunks/dust.js +33 -0
- package/vue/chunks/ebnf.js +40 -0
- package/vue/chunks/elixir.js +241 -0
- package/vue/chunks/elm.js +103 -0
- package/vue/chunks/erb.js +17 -0
- package/vue/chunks/erlang-repl.js +41 -0
- package/vue/chunks/erlang.js +236 -0
- package/vue/chunks/excel.js +562 -0
- package/vue/chunks/fix.js +30 -0
- package/vue/chunks/flix.js +60 -0
- package/vue/chunks/fortran.js +543 -0
- package/vue/chunks/fsharp.js +440 -0
- package/vue/chunks/gams.js +134 -0
- package/vue/chunks/gauss.js +167 -0
- package/vue/chunks/gcode.js +131 -0
- package/vue/chunks/gherkin.js +41 -0
- package/vue/chunks/glsl.js +25 -0
- package/vue/chunks/gml.js +3119 -0
- package/vue/chunks/go.js +140 -0
- package/vue/chunks/golo.js +72 -0
- package/vue/chunks/gradle.js +181 -0
- package/vue/chunks/graphql.js +68 -0
- package/vue/chunks/groovy.js +159 -0
- package/vue/chunks/haml.js +96 -0
- package/vue/chunks/handlebars.js +191 -0
- package/vue/chunks/haskell.js +149 -0
- package/vue/chunks/haxe.js +142 -0
- package/vue/chunks/hsp.js +45 -0
- package/vue/chunks/http.js +77 -0
- package/vue/chunks/hy.js +92 -0
- package/vue/chunks/inform7.js +45 -0
- package/vue/chunks/ini.js +94 -0
- package/vue/chunks/irpf90.js +52 -0
- package/vue/chunks/isbl.js +112 -0
- package/vue/chunks/java.js +237 -0
- package/vue/chunks/javascript.js +570 -0
- package/vue/chunks/jboss-cli.js +46 -0
- package/vue/chunks/json.js +45 -0
- package/vue/chunks/julia-repl.js +18 -0
- package/vue/chunks/julia.js +353 -0
- package/vue/chunks/kotlin.js +216 -0
- package/vue/chunks/lasso.js +127 -0
- package/vue/chunks/latex.js +206 -0
- package/vue/chunks/ldif.js +25 -0
- package/vue/chunks/leaf.js +72 -0
- package/vue/chunks/less.js +953 -0
- package/vue/chunks/lisp.js +119 -0
- package/vue/chunks/livecodeserver.js +86 -0
- package/vue/chunks/livescript.js +309 -0
- package/vue/chunks/llvm.js +77 -0
- package/vue/chunks/lsl.js +55 -0
- package/vue/chunks/lua.js +49 -0
- package/vue/chunks/makefile.js +62 -0
- package/vue/chunks/markdown.js +194 -0
- package/vue/chunks/mathematica.js +7317 -0
- package/vue/chunks/matlab.js +70 -0
- package/vue/chunks/maxima.js +38 -0
- package/vue/chunks/mel.js +24 -0
- package/vue/chunks/mercury.js +62 -0
- package/vue/chunks/mipsasm.js +53 -0
- package/vue/chunks/mizar.js +10 -0
- package/vue/chunks/mojolicious.js +27 -0
- package/vue/chunks/monkey.js +158 -0
- package/vue/chunks/moonscript.js +102 -0
- package/vue/chunks/n1ql.js +346 -0
- package/vue/chunks/nestedtext.js +66 -0
- package/vue/chunks/nginx.js +127 -0
- package/vue/chunks/nim.js +174 -0
- package/vue/chunks/nix.js +334 -0
- package/vue/chunks/node-repl.js +20 -0
- package/vue/chunks/nsis.js +515 -0
- package/vue/chunks/objectivec.js +235 -0
- package/vue/chunks/ocaml.js +52 -0
- package/vue/chunks/openscad.js +66 -0
- package/vue/chunks/oxygene.js +58 -0
- package/vue/chunks/parser3.js +40 -0
- package/vue/chunks/perl.js +454 -0
- package/vue/chunks/pf.js +30 -0
- package/vue/chunks/pgsql.js +196 -0
- package/vue/chunks/php-template.js +43 -0
- package/vue/chunks/php.js +527 -0
- package/vue/chunks/plaintext.js +10 -0
- package/vue/chunks/pony.js +60 -0
- package/vue/chunks/powershell.js +208 -0
- package/vue/chunks/processing.js +407 -0
- package/vue/chunks/profile.js +38 -0
- package/vue/chunks/prolog.js +62 -0
- package/vue/chunks/properties.js +45 -0
- package/vue/chunks/protobuf.js +63 -0
- package/vue/chunks/puppet.js +87 -0
- package/vue/chunks/purebasic.js +42 -0
- package/vue/chunks/python-repl.js +19 -0
- package/vue/chunks/python.js +357 -0
- package/vue/chunks/q.js +21 -0
- package/vue/chunks/qml.js +134 -0
- package/vue/chunks/r.js +145 -0
- package/vue/chunks/reasonml.js +134 -0
- package/vue/chunks/rib.js +16 -0
- package/vue/chunks/roboconf.js +54 -0
- package/vue/chunks/routeros.js +109 -0
- package/vue/chunks/rsl.js +138 -0
- package/vue/chunks/ruby.js +322 -0
- package/vue/chunks/ruleslanguage.js +26 -0
- package/vue/chunks/rust.js +296 -0
- package/vue/chunks/sas.js +533 -0
- package/vue/chunks/scala.js +173 -0
- package/vue/chunks/scheme.js +118 -0
- package/vue/chunks/scilab.js +45 -0
- package/vue/chunks/scss.js +900 -0
- package/vue/chunks/shell.js +18 -0
- package/vue/chunks/smali.js +113 -0
- package/vue/chunks/smalltalk.js +59 -0
- package/vue/chunks/sml.js +49 -0
- package/vue/chunks/sqf.js +2599 -0
- package/vue/chunks/sql.js +624 -0
- package/vue/chunks/stan.js +471 -0
- package/vue/chunks/stata.js +33 -0
- package/vue/chunks/step21.js +53 -0
- package/vue/chunks/stylus.js +925 -0
- package/vue/chunks/subunit.js +34 -0
- package/vue/chunks/swift.js +699 -0
- package/vue/chunks/taggerscript.js +37 -0
- package/vue/chunks/tap.js +30 -0
- package/vue/chunks/tcl.js +165 -0
- package/vue/chunks/thrift.js +65 -0
- package/vue/chunks/tp.js +155 -0
- package/vue/chunks/twig.js +232 -0
- package/vue/chunks/typescript.js +672 -0
- package/vue/chunks/vala.js +39 -0
- package/vue/chunks/vbnet.js +86 -0
- package/vue/chunks/vbscript-html.js +14 -0
- package/vue/chunks/vbscript.js +200 -0
- package/vue/chunks/verilog.js +534 -0
- package/vue/chunks/vhdl.js +190 -0
- package/vue/chunks/vim.js +54 -0
- package/vue/chunks/wasm.js +111 -0
- package/vue/chunks/wren.js +229 -0
- package/vue/chunks/x86asm.js +64 -0
- package/vue/chunks/xl.js +192 -0
- package/vue/chunks/xml.js +175 -0
- package/vue/chunks/xquery.js +303 -0
- package/vue/chunks/yaml.js +159 -0
- package/vue/chunks/zephir.js +74 -0
- package/vue/components.css +119 -85
- package/vue/editor/LoomaEditor.d.ts +7 -7
- package/vue/editor/code-language-catalog.d.ts +196 -0
- package/vue/editor/index.js +290 -20
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/fsharp.js
|
|
2
|
+
/**
|
|
3
|
+
* @param {string} value
|
|
4
|
+
* @returns {RegExp}
|
|
5
|
+
* */
|
|
6
|
+
function escape(value) {
|
|
7
|
+
return new RegExp(value.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), "m");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @param {RegExp | string } re
|
|
11
|
+
* @returns {string}
|
|
12
|
+
*/
|
|
13
|
+
function source(re) {
|
|
14
|
+
if (!re) return null;
|
|
15
|
+
if (typeof re === "string") return re;
|
|
16
|
+
return re.source;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @param {RegExp | string } re
|
|
20
|
+
* @returns {string}
|
|
21
|
+
*/
|
|
22
|
+
function lookahead(re) {
|
|
23
|
+
return concat("(?=", re, ")");
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @param {...(RegExp | string) } args
|
|
27
|
+
* @returns {string}
|
|
28
|
+
*/
|
|
29
|
+
function concat(...args) {
|
|
30
|
+
return args.map((x) => source(x)).join("");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @param { Array<string | RegExp | Object> } args
|
|
34
|
+
* @returns {object}
|
|
35
|
+
*/
|
|
36
|
+
function stripOptionsFromArgs(args) {
|
|
37
|
+
const opts = args[args.length - 1];
|
|
38
|
+
if (typeof opts === "object" && opts.constructor === Object) {
|
|
39
|
+
args.splice(args.length - 1, 1);
|
|
40
|
+
return opts;
|
|
41
|
+
} else return {};
|
|
42
|
+
}
|
|
43
|
+
/** @typedef { {capture?: boolean} } RegexEitherOptions */
|
|
44
|
+
/**
|
|
45
|
+
* Any of the passed expresssions may match
|
|
46
|
+
*
|
|
47
|
+
* Creates a huge this | this | that | that match
|
|
48
|
+
* @param {(RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]} args
|
|
49
|
+
* @returns {string}
|
|
50
|
+
*/
|
|
51
|
+
function either(...args) {
|
|
52
|
+
return "(" + (stripOptionsFromArgs(args).capture ? "" : "?:") + args.map((x) => source(x)).join("|") + ")";
|
|
53
|
+
}
|
|
54
|
+
/** @type LanguageFn */
|
|
55
|
+
function fsharp(hljs) {
|
|
56
|
+
const KEYWORDS = [
|
|
57
|
+
"abstract",
|
|
58
|
+
"and",
|
|
59
|
+
"as",
|
|
60
|
+
"assert",
|
|
61
|
+
"base",
|
|
62
|
+
"begin",
|
|
63
|
+
"class",
|
|
64
|
+
"default",
|
|
65
|
+
"delegate",
|
|
66
|
+
"do",
|
|
67
|
+
"done",
|
|
68
|
+
"downcast",
|
|
69
|
+
"downto",
|
|
70
|
+
"elif",
|
|
71
|
+
"else",
|
|
72
|
+
"end",
|
|
73
|
+
"exception",
|
|
74
|
+
"extern",
|
|
75
|
+
"finally",
|
|
76
|
+
"fixed",
|
|
77
|
+
"for",
|
|
78
|
+
"fun",
|
|
79
|
+
"function",
|
|
80
|
+
"global",
|
|
81
|
+
"if",
|
|
82
|
+
"in",
|
|
83
|
+
"inherit",
|
|
84
|
+
"inline",
|
|
85
|
+
"interface",
|
|
86
|
+
"internal",
|
|
87
|
+
"lazy",
|
|
88
|
+
"let",
|
|
89
|
+
"match",
|
|
90
|
+
"member",
|
|
91
|
+
"module",
|
|
92
|
+
"mutable",
|
|
93
|
+
"namespace",
|
|
94
|
+
"new",
|
|
95
|
+
"of",
|
|
96
|
+
"open",
|
|
97
|
+
"or",
|
|
98
|
+
"override",
|
|
99
|
+
"private",
|
|
100
|
+
"public",
|
|
101
|
+
"rec",
|
|
102
|
+
"return",
|
|
103
|
+
"static",
|
|
104
|
+
"struct",
|
|
105
|
+
"then",
|
|
106
|
+
"to",
|
|
107
|
+
"try",
|
|
108
|
+
"type",
|
|
109
|
+
"upcast",
|
|
110
|
+
"use",
|
|
111
|
+
"val",
|
|
112
|
+
"void",
|
|
113
|
+
"when",
|
|
114
|
+
"while",
|
|
115
|
+
"with",
|
|
116
|
+
"yield"
|
|
117
|
+
];
|
|
118
|
+
const BANG_KEYWORD_MODE = {
|
|
119
|
+
scope: "keyword",
|
|
120
|
+
match: /\b(yield|return|let|do|match|use)!/
|
|
121
|
+
};
|
|
122
|
+
const PREPROCESSOR_KEYWORDS = [
|
|
123
|
+
"if",
|
|
124
|
+
"else",
|
|
125
|
+
"endif",
|
|
126
|
+
"line",
|
|
127
|
+
"nowarn",
|
|
128
|
+
"light",
|
|
129
|
+
"r",
|
|
130
|
+
"i",
|
|
131
|
+
"I",
|
|
132
|
+
"load",
|
|
133
|
+
"time",
|
|
134
|
+
"help",
|
|
135
|
+
"quit"
|
|
136
|
+
];
|
|
137
|
+
const LITERALS = [
|
|
138
|
+
"true",
|
|
139
|
+
"false",
|
|
140
|
+
"null",
|
|
141
|
+
"Some",
|
|
142
|
+
"None",
|
|
143
|
+
"Ok",
|
|
144
|
+
"Error",
|
|
145
|
+
"infinity",
|
|
146
|
+
"infinityf",
|
|
147
|
+
"nan",
|
|
148
|
+
"nanf"
|
|
149
|
+
];
|
|
150
|
+
const SPECIAL_IDENTIFIERS = [
|
|
151
|
+
"__LINE__",
|
|
152
|
+
"__SOURCE_DIRECTORY__",
|
|
153
|
+
"__SOURCE_FILE__"
|
|
154
|
+
];
|
|
155
|
+
const KNOWN_TYPES = [
|
|
156
|
+
"bool",
|
|
157
|
+
"byte",
|
|
158
|
+
"sbyte",
|
|
159
|
+
"int8",
|
|
160
|
+
"int16",
|
|
161
|
+
"int32",
|
|
162
|
+
"uint8",
|
|
163
|
+
"uint16",
|
|
164
|
+
"uint32",
|
|
165
|
+
"int",
|
|
166
|
+
"uint",
|
|
167
|
+
"int64",
|
|
168
|
+
"uint64",
|
|
169
|
+
"nativeint",
|
|
170
|
+
"unativeint",
|
|
171
|
+
"decimal",
|
|
172
|
+
"float",
|
|
173
|
+
"double",
|
|
174
|
+
"float32",
|
|
175
|
+
"single",
|
|
176
|
+
"char",
|
|
177
|
+
"string",
|
|
178
|
+
"unit",
|
|
179
|
+
"bigint",
|
|
180
|
+
"option",
|
|
181
|
+
"voption",
|
|
182
|
+
"list",
|
|
183
|
+
"array",
|
|
184
|
+
"seq",
|
|
185
|
+
"byref",
|
|
186
|
+
"exn",
|
|
187
|
+
"inref",
|
|
188
|
+
"nativeptr",
|
|
189
|
+
"obj",
|
|
190
|
+
"outref",
|
|
191
|
+
"voidptr",
|
|
192
|
+
"Result"
|
|
193
|
+
];
|
|
194
|
+
const ALL_KEYWORDS = {
|
|
195
|
+
keyword: KEYWORDS,
|
|
196
|
+
literal: LITERALS,
|
|
197
|
+
built_in: [
|
|
198
|
+
"not",
|
|
199
|
+
"ref",
|
|
200
|
+
"raise",
|
|
201
|
+
"reraise",
|
|
202
|
+
"dict",
|
|
203
|
+
"readOnlyDict",
|
|
204
|
+
"set",
|
|
205
|
+
"get",
|
|
206
|
+
"enum",
|
|
207
|
+
"sizeof",
|
|
208
|
+
"typeof",
|
|
209
|
+
"typedefof",
|
|
210
|
+
"nameof",
|
|
211
|
+
"nullArg",
|
|
212
|
+
"invalidArg",
|
|
213
|
+
"invalidOp",
|
|
214
|
+
"id",
|
|
215
|
+
"fst",
|
|
216
|
+
"snd",
|
|
217
|
+
"ignore",
|
|
218
|
+
"lock",
|
|
219
|
+
"using",
|
|
220
|
+
"box",
|
|
221
|
+
"unbox",
|
|
222
|
+
"tryUnbox",
|
|
223
|
+
"printf",
|
|
224
|
+
"printfn",
|
|
225
|
+
"sprintf",
|
|
226
|
+
"eprintf",
|
|
227
|
+
"eprintfn",
|
|
228
|
+
"fprintf",
|
|
229
|
+
"fprintfn",
|
|
230
|
+
"failwith",
|
|
231
|
+
"failwithf"
|
|
232
|
+
],
|
|
233
|
+
"variable.constant": SPECIAL_IDENTIFIERS
|
|
234
|
+
};
|
|
235
|
+
const COMMENT = { variants: [hljs.COMMENT(/\(\*(?!\))/, /\*\)/, { contains: ["self"] }), hljs.C_LINE_COMMENT_MODE] };
|
|
236
|
+
const IDENTIFIER_RE = /[a-zA-Z_](\w|')*/;
|
|
237
|
+
const QUOTED_IDENTIFIER = {
|
|
238
|
+
scope: "variable",
|
|
239
|
+
begin: /``/,
|
|
240
|
+
end: /``/
|
|
241
|
+
};
|
|
242
|
+
const BEGIN_GENERIC_TYPE_SYMBOL_RE = /\B('|\^)/;
|
|
243
|
+
const GENERIC_TYPE_SYMBOL = {
|
|
244
|
+
scope: "symbol",
|
|
245
|
+
variants: [{ match: concat(BEGIN_GENERIC_TYPE_SYMBOL_RE, /``.*?``/) }, { match: concat(BEGIN_GENERIC_TYPE_SYMBOL_RE, hljs.UNDERSCORE_IDENT_RE) }],
|
|
246
|
+
relevance: 0
|
|
247
|
+
};
|
|
248
|
+
const makeOperatorMode = function({ includeEqual }) {
|
|
249
|
+
let allOperatorChars;
|
|
250
|
+
if (includeEqual) allOperatorChars = "!%&*+-/<=>@^|~?";
|
|
251
|
+
else allOperatorChars = "!%&*+-/<>@^|~?";
|
|
252
|
+
const OPERATOR_CHAR_RE = concat("[", ...Array.from(allOperatorChars).map(escape), "]");
|
|
253
|
+
const OPERATOR_CHAR_OR_DOT_RE = either(OPERATOR_CHAR_RE, /\./);
|
|
254
|
+
return {
|
|
255
|
+
scope: "operator",
|
|
256
|
+
match: either(either(concat(concat(OPERATOR_CHAR_OR_DOT_RE, lookahead(OPERATOR_CHAR_OR_DOT_RE)), OPERATOR_CHAR_OR_DOT_RE, "*"), concat(OPERATOR_CHAR_RE, "+")), /:\?>/, /:\?/, /:>/, /:=/, /::?/, /\$/),
|
|
257
|
+
relevance: 0
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
const OPERATOR = makeOperatorMode({ includeEqual: true });
|
|
261
|
+
const OPERATOR_WITHOUT_EQUAL = makeOperatorMode({ includeEqual: false });
|
|
262
|
+
const makeTypeAnnotationMode = function(prefix, prefixScope) {
|
|
263
|
+
return {
|
|
264
|
+
begin: concat(prefix, lookahead(concat(/\s*/, either(/\w/, /'/, /\^/, /#/, /``/, /\(/, /{\|/)))),
|
|
265
|
+
beginScope: prefixScope,
|
|
266
|
+
end: lookahead(either(/\n/, /=/)),
|
|
267
|
+
relevance: 0,
|
|
268
|
+
keywords: hljs.inherit(ALL_KEYWORDS, { type: KNOWN_TYPES }),
|
|
269
|
+
contains: [
|
|
270
|
+
COMMENT,
|
|
271
|
+
GENERIC_TYPE_SYMBOL,
|
|
272
|
+
hljs.inherit(QUOTED_IDENTIFIER, { scope: null }),
|
|
273
|
+
OPERATOR_WITHOUT_EQUAL
|
|
274
|
+
]
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
const TYPE_ANNOTATION = makeTypeAnnotationMode(/:/, "operator");
|
|
278
|
+
const DISCRIMINATED_UNION_TYPE_ANNOTATION = makeTypeAnnotationMode(/\bof\b/, "keyword");
|
|
279
|
+
const TYPE_DECLARATION = {
|
|
280
|
+
begin: [
|
|
281
|
+
/(^|\s+)/,
|
|
282
|
+
/type/,
|
|
283
|
+
/\s+/,
|
|
284
|
+
IDENTIFIER_RE
|
|
285
|
+
],
|
|
286
|
+
beginScope: {
|
|
287
|
+
2: "keyword",
|
|
288
|
+
4: "title.class"
|
|
289
|
+
},
|
|
290
|
+
end: lookahead(/\(|=|$/),
|
|
291
|
+
keywords: ALL_KEYWORDS,
|
|
292
|
+
contains: [
|
|
293
|
+
COMMENT,
|
|
294
|
+
hljs.inherit(QUOTED_IDENTIFIER, { scope: null }),
|
|
295
|
+
GENERIC_TYPE_SYMBOL,
|
|
296
|
+
{
|
|
297
|
+
scope: "operator",
|
|
298
|
+
match: /<|>/
|
|
299
|
+
},
|
|
300
|
+
TYPE_ANNOTATION
|
|
301
|
+
]
|
|
302
|
+
};
|
|
303
|
+
const COMPUTATION_EXPRESSION = {
|
|
304
|
+
scope: "computation-expression",
|
|
305
|
+
match: /\b[_a-z]\w*(?=\s*\{)/
|
|
306
|
+
};
|
|
307
|
+
const PREPROCESSOR = {
|
|
308
|
+
begin: [
|
|
309
|
+
/^\s*/,
|
|
310
|
+
concat(/#/, either(...PREPROCESSOR_KEYWORDS)),
|
|
311
|
+
/\b/
|
|
312
|
+
],
|
|
313
|
+
beginScope: { 2: "meta" },
|
|
314
|
+
end: lookahead(/\s|$/)
|
|
315
|
+
};
|
|
316
|
+
const NUMBER = { variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE] };
|
|
317
|
+
const QUOTED_STRING = {
|
|
318
|
+
scope: "string",
|
|
319
|
+
begin: /"/,
|
|
320
|
+
end: /"/,
|
|
321
|
+
contains: [hljs.BACKSLASH_ESCAPE]
|
|
322
|
+
};
|
|
323
|
+
const VERBATIM_STRING = {
|
|
324
|
+
scope: "string",
|
|
325
|
+
begin: /@"/,
|
|
326
|
+
end: /"/,
|
|
327
|
+
contains: [{ match: /""/ }, hljs.BACKSLASH_ESCAPE]
|
|
328
|
+
};
|
|
329
|
+
const TRIPLE_QUOTED_STRING = {
|
|
330
|
+
scope: "string",
|
|
331
|
+
begin: /"""/,
|
|
332
|
+
end: /"""/,
|
|
333
|
+
relevance: 2
|
|
334
|
+
};
|
|
335
|
+
const SUBST = {
|
|
336
|
+
scope: "subst",
|
|
337
|
+
begin: /\{/,
|
|
338
|
+
end: /\}/,
|
|
339
|
+
keywords: ALL_KEYWORDS
|
|
340
|
+
};
|
|
341
|
+
const INTERPOLATED_STRING = {
|
|
342
|
+
scope: "string",
|
|
343
|
+
begin: /\$"/,
|
|
344
|
+
end: /"/,
|
|
345
|
+
contains: [
|
|
346
|
+
{ match: /\{\{/ },
|
|
347
|
+
{ match: /\}\}/ },
|
|
348
|
+
hljs.BACKSLASH_ESCAPE,
|
|
349
|
+
SUBST
|
|
350
|
+
]
|
|
351
|
+
};
|
|
352
|
+
const INTERPOLATED_VERBATIM_STRING = {
|
|
353
|
+
scope: "string",
|
|
354
|
+
begin: /(\$@|@\$)"/,
|
|
355
|
+
end: /"/,
|
|
356
|
+
contains: [
|
|
357
|
+
{ match: /\{\{/ },
|
|
358
|
+
{ match: /\}\}/ },
|
|
359
|
+
{ match: /""/ },
|
|
360
|
+
hljs.BACKSLASH_ESCAPE,
|
|
361
|
+
SUBST
|
|
362
|
+
]
|
|
363
|
+
};
|
|
364
|
+
const INTERPOLATED_TRIPLE_QUOTED_STRING = {
|
|
365
|
+
scope: "string",
|
|
366
|
+
begin: /\$"""/,
|
|
367
|
+
end: /"""/,
|
|
368
|
+
contains: [
|
|
369
|
+
{ match: /\{\{/ },
|
|
370
|
+
{ match: /\}\}/ },
|
|
371
|
+
SUBST
|
|
372
|
+
],
|
|
373
|
+
relevance: 2
|
|
374
|
+
};
|
|
375
|
+
const CHAR_LITERAL = {
|
|
376
|
+
scope: "string",
|
|
377
|
+
match: concat(/'/, either(/[^\\']/, /\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8})/), /'/)
|
|
378
|
+
};
|
|
379
|
+
SUBST.contains = [
|
|
380
|
+
INTERPOLATED_VERBATIM_STRING,
|
|
381
|
+
INTERPOLATED_STRING,
|
|
382
|
+
VERBATIM_STRING,
|
|
383
|
+
QUOTED_STRING,
|
|
384
|
+
CHAR_LITERAL,
|
|
385
|
+
BANG_KEYWORD_MODE,
|
|
386
|
+
COMMENT,
|
|
387
|
+
QUOTED_IDENTIFIER,
|
|
388
|
+
TYPE_ANNOTATION,
|
|
389
|
+
COMPUTATION_EXPRESSION,
|
|
390
|
+
PREPROCESSOR,
|
|
391
|
+
NUMBER,
|
|
392
|
+
GENERIC_TYPE_SYMBOL,
|
|
393
|
+
OPERATOR
|
|
394
|
+
];
|
|
395
|
+
return {
|
|
396
|
+
name: "F#",
|
|
397
|
+
aliases: ["fs", "f#"],
|
|
398
|
+
keywords: ALL_KEYWORDS,
|
|
399
|
+
illegal: /\/\*/,
|
|
400
|
+
classNameAliases: { "computation-expression": "keyword" },
|
|
401
|
+
contains: [
|
|
402
|
+
BANG_KEYWORD_MODE,
|
|
403
|
+
{ variants: [
|
|
404
|
+
INTERPOLATED_TRIPLE_QUOTED_STRING,
|
|
405
|
+
INTERPOLATED_VERBATIM_STRING,
|
|
406
|
+
INTERPOLATED_STRING,
|
|
407
|
+
TRIPLE_QUOTED_STRING,
|
|
408
|
+
VERBATIM_STRING,
|
|
409
|
+
QUOTED_STRING,
|
|
410
|
+
CHAR_LITERAL
|
|
411
|
+
] },
|
|
412
|
+
COMMENT,
|
|
413
|
+
QUOTED_IDENTIFIER,
|
|
414
|
+
TYPE_DECLARATION,
|
|
415
|
+
{
|
|
416
|
+
scope: "meta",
|
|
417
|
+
begin: /\[</,
|
|
418
|
+
end: />\]/,
|
|
419
|
+
relevance: 2,
|
|
420
|
+
contains: [
|
|
421
|
+
QUOTED_IDENTIFIER,
|
|
422
|
+
TRIPLE_QUOTED_STRING,
|
|
423
|
+
VERBATIM_STRING,
|
|
424
|
+
QUOTED_STRING,
|
|
425
|
+
CHAR_LITERAL,
|
|
426
|
+
NUMBER
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
DISCRIMINATED_UNION_TYPE_ANNOTATION,
|
|
430
|
+
TYPE_ANNOTATION,
|
|
431
|
+
COMPUTATION_EXPRESSION,
|
|
432
|
+
PREPROCESSOR,
|
|
433
|
+
NUMBER,
|
|
434
|
+
GENERIC_TYPE_SYMBOL,
|
|
435
|
+
OPERATOR
|
|
436
|
+
]
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
//#endregion
|
|
440
|
+
export { fsharp as default };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/gams.js
|
|
2
|
+
/** @type LanguageFn */
|
|
3
|
+
function gams(hljs) {
|
|
4
|
+
const regex = hljs.regex;
|
|
5
|
+
const KEYWORDS = {
|
|
6
|
+
keyword: "abort acronym acronyms alias all and assign binary card diag display else eq file files for free ge gt if integer le loop lt maximizing minimizing model models ne negative no not option options or ord positive prod put putpage puttl repeat sameas semicont semiint smax smin solve sos1 sos2 sum system table then until using while xor yes",
|
|
7
|
+
literal: "eps inf na",
|
|
8
|
+
built_in: "abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power randBinomial randLinear randTriangle round rPower sigmoid sign signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion handleCollect handleDelete handleStatus handleSubmit heapFree heapLimit heapSize jobHandle jobKill jobStatus jobTerminate licenseLevel licenseStatus maxExecError sleep timeClose timeComp timeElapsed timeExec timeStart"
|
|
9
|
+
};
|
|
10
|
+
const PARAMS = {
|
|
11
|
+
className: "params",
|
|
12
|
+
begin: /\(/,
|
|
13
|
+
end: /\)/,
|
|
14
|
+
excludeBegin: true,
|
|
15
|
+
excludeEnd: true
|
|
16
|
+
};
|
|
17
|
+
const SYMBOLS = {
|
|
18
|
+
className: "symbol",
|
|
19
|
+
variants: [{ begin: /=[lgenxc]=/ }, { begin: /\$/ }]
|
|
20
|
+
};
|
|
21
|
+
const QSTR = {
|
|
22
|
+
className: "comment",
|
|
23
|
+
variants: [{
|
|
24
|
+
begin: "'",
|
|
25
|
+
end: "'"
|
|
26
|
+
}, {
|
|
27
|
+
begin: "\"",
|
|
28
|
+
end: "\""
|
|
29
|
+
}],
|
|
30
|
+
illegal: "\\n",
|
|
31
|
+
contains: [hljs.BACKSLASH_ESCAPE]
|
|
32
|
+
};
|
|
33
|
+
const ASSIGNMENT = {
|
|
34
|
+
begin: "/",
|
|
35
|
+
end: "/",
|
|
36
|
+
keywords: KEYWORDS,
|
|
37
|
+
contains: [
|
|
38
|
+
QSTR,
|
|
39
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
40
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
41
|
+
hljs.QUOTE_STRING_MODE,
|
|
42
|
+
hljs.APOS_STRING_MODE,
|
|
43
|
+
hljs.C_NUMBER_MODE
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
const COMMENT_WORD = /[a-z0-9&#*=?@\\><:,()$[\]_.{}!+%^-]+/;
|
|
47
|
+
const DESCTEXT = {
|
|
48
|
+
begin: /[a-z][a-z0-9_]*(\([a-z0-9_, ]*\))?[ \t]+/,
|
|
49
|
+
excludeBegin: true,
|
|
50
|
+
end: "$",
|
|
51
|
+
endsWithParent: true,
|
|
52
|
+
contains: [
|
|
53
|
+
QSTR,
|
|
54
|
+
ASSIGNMENT,
|
|
55
|
+
{
|
|
56
|
+
className: "comment",
|
|
57
|
+
begin: regex.concat(COMMENT_WORD, regex.anyNumberOfTimes(regex.concat(/[ ]+/, COMMENT_WORD))),
|
|
58
|
+
relevance: 0
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
name: "GAMS",
|
|
64
|
+
aliases: ["gms"],
|
|
65
|
+
case_insensitive: true,
|
|
66
|
+
keywords: KEYWORDS,
|
|
67
|
+
contains: [
|
|
68
|
+
hljs.COMMENT(/^\$ontext/, /^\$offtext/),
|
|
69
|
+
{
|
|
70
|
+
className: "meta",
|
|
71
|
+
begin: "^\\$[a-z0-9]+",
|
|
72
|
+
end: "$",
|
|
73
|
+
returnBegin: true,
|
|
74
|
+
contains: [{
|
|
75
|
+
className: "keyword",
|
|
76
|
+
begin: "^\\$[a-z0-9]+"
|
|
77
|
+
}]
|
|
78
|
+
},
|
|
79
|
+
hljs.COMMENT("^\\*", "$"),
|
|
80
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
81
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
82
|
+
hljs.QUOTE_STRING_MODE,
|
|
83
|
+
hljs.APOS_STRING_MODE,
|
|
84
|
+
{
|
|
85
|
+
beginKeywords: "set sets parameter parameters variable variables scalar scalars equation equations",
|
|
86
|
+
end: ";",
|
|
87
|
+
contains: [
|
|
88
|
+
hljs.COMMENT("^\\*", "$"),
|
|
89
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
90
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
91
|
+
hljs.QUOTE_STRING_MODE,
|
|
92
|
+
hljs.APOS_STRING_MODE,
|
|
93
|
+
ASSIGNMENT,
|
|
94
|
+
DESCTEXT
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
beginKeywords: "table",
|
|
99
|
+
end: ";",
|
|
100
|
+
returnBegin: true,
|
|
101
|
+
contains: [
|
|
102
|
+
{
|
|
103
|
+
beginKeywords: "table",
|
|
104
|
+
end: "$",
|
|
105
|
+
contains: [DESCTEXT]
|
|
106
|
+
},
|
|
107
|
+
hljs.COMMENT("^\\*", "$"),
|
|
108
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
109
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
110
|
+
hljs.QUOTE_STRING_MODE,
|
|
111
|
+
hljs.APOS_STRING_MODE,
|
|
112
|
+
hljs.C_NUMBER_MODE
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
className: "function",
|
|
117
|
+
begin: /^[a-z][a-z0-9_,\-+' ()$]+\.{2}/,
|
|
118
|
+
returnBegin: true,
|
|
119
|
+
contains: [
|
|
120
|
+
{
|
|
121
|
+
className: "title",
|
|
122
|
+
begin: /^[a-z0-9_]+/
|
|
123
|
+
},
|
|
124
|
+
PARAMS,
|
|
125
|
+
SYMBOLS
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
hljs.C_NUMBER_MODE,
|
|
129
|
+
SYMBOLS
|
|
130
|
+
]
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { gams as default };
|