@threadlabs/looma 0.18.6 → 0.19.1
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/components/ui-tree-item/ui-tree-item.html +5 -5
- package/components/ui-tree-item/ui-tree-item.js +20 -3
- 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/styles/ui-tree-item.css +5 -5
- 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/UiTreeItem.vue +5 -5
- package/vue/chunks/1c.js +106 -0
- package/vue/chunks/UiEditorTableOverlay.js +14 -4
- package/vue/chunks/UiEditorTableToolbar.js +1 -1
- package/vue/chunks/UiTreeItem.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 +204 -170
- 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,260 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/crystal.js
|
|
2
|
+
/** @type LanguageFn */
|
|
3
|
+
function crystal(hljs) {
|
|
4
|
+
const INT_SUFFIX = "(_?[ui](8|16|32|64|128))?";
|
|
5
|
+
const CRYSTAL_IDENT_RE = "[a-zA-Z_]\\w*[!?=]?";
|
|
6
|
+
const CRYSTAL_METHOD_RE = "[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~|]|//|//=|&[-+*]=?|&\\*\\*|\\[\\][=?]?";
|
|
7
|
+
const CRYSTAL_PATH_RE = "[A-Za-z_]\\w*(::\\w+)*(\\?|!)?";
|
|
8
|
+
const CRYSTAL_KEYWORDS = {
|
|
9
|
+
$pattern: CRYSTAL_IDENT_RE,
|
|
10
|
+
keyword: "abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__",
|
|
11
|
+
literal: "false nil true"
|
|
12
|
+
};
|
|
13
|
+
const SUBST = {
|
|
14
|
+
className: "subst",
|
|
15
|
+
begin: /#\{/,
|
|
16
|
+
end: /\}/,
|
|
17
|
+
keywords: CRYSTAL_KEYWORDS
|
|
18
|
+
};
|
|
19
|
+
const VARIABLE = {
|
|
20
|
+
className: "variable",
|
|
21
|
+
begin: "(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"
|
|
22
|
+
};
|
|
23
|
+
const EXPANSION = {
|
|
24
|
+
className: "template-variable",
|
|
25
|
+
variants: [{
|
|
26
|
+
begin: "\\{\\{",
|
|
27
|
+
end: "\\}\\}"
|
|
28
|
+
}, {
|
|
29
|
+
begin: "\\{%",
|
|
30
|
+
end: "%\\}"
|
|
31
|
+
}],
|
|
32
|
+
keywords: CRYSTAL_KEYWORDS
|
|
33
|
+
};
|
|
34
|
+
function recursiveParen(begin, end) {
|
|
35
|
+
const contains = [{
|
|
36
|
+
begin,
|
|
37
|
+
end
|
|
38
|
+
}];
|
|
39
|
+
contains[0].contains = contains;
|
|
40
|
+
return contains;
|
|
41
|
+
}
|
|
42
|
+
const STRING = {
|
|
43
|
+
className: "string",
|
|
44
|
+
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
|
|
45
|
+
variants: [
|
|
46
|
+
{
|
|
47
|
+
begin: /'/,
|
|
48
|
+
end: /'/
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
begin: /"/,
|
|
52
|
+
end: /"/
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
begin: /`/,
|
|
56
|
+
end: /`/
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
begin: "%[Qwi]?\\(",
|
|
60
|
+
end: "\\)",
|
|
61
|
+
contains: recursiveParen("\\(", "\\)")
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
begin: "%[Qwi]?\\[",
|
|
65
|
+
end: "\\]",
|
|
66
|
+
contains: recursiveParen("\\[", "\\]")
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
begin: "%[Qwi]?\\{",
|
|
70
|
+
end: /\}/,
|
|
71
|
+
contains: recursiveParen(/\{/, /\}/)
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
begin: "%[Qwi]?<",
|
|
75
|
+
end: ">",
|
|
76
|
+
contains: recursiveParen("<", ">")
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
begin: "%[Qwi]?\\|",
|
|
80
|
+
end: "\\|"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
begin: /<<-\w+$/,
|
|
84
|
+
end: /^\s*\w+$/
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
relevance: 0
|
|
88
|
+
};
|
|
89
|
+
const Q_STRING = {
|
|
90
|
+
className: "string",
|
|
91
|
+
variants: [
|
|
92
|
+
{
|
|
93
|
+
begin: "%q\\(",
|
|
94
|
+
end: "\\)",
|
|
95
|
+
contains: recursiveParen("\\(", "\\)")
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
begin: "%q\\[",
|
|
99
|
+
end: "\\]",
|
|
100
|
+
contains: recursiveParen("\\[", "\\]")
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
begin: "%q\\{",
|
|
104
|
+
end: /\}/,
|
|
105
|
+
contains: recursiveParen(/\{/, /\}/)
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
begin: "%q<",
|
|
109
|
+
end: ">",
|
|
110
|
+
contains: recursiveParen("<", ">")
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
begin: "%q\\|",
|
|
114
|
+
end: "\\|"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
begin: /<<-'\w+'$/,
|
|
118
|
+
end: /^\s*\w+$/
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
relevance: 0
|
|
122
|
+
};
|
|
123
|
+
const REGEXP = {
|
|
124
|
+
begin: "(?!%\\})(" + hljs.RE_STARTERS_RE + "|\\n|\\b(case|if|select|unless|until|when|while)\\b)\\s*",
|
|
125
|
+
keywords: "case if select unless until when while",
|
|
126
|
+
contains: [{
|
|
127
|
+
className: "regexp",
|
|
128
|
+
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
|
|
129
|
+
variants: [{
|
|
130
|
+
begin: "//[a-z]*",
|
|
131
|
+
relevance: 0
|
|
132
|
+
}, {
|
|
133
|
+
begin: "/(?!\\/)",
|
|
134
|
+
end: "/[a-z]*"
|
|
135
|
+
}]
|
|
136
|
+
}],
|
|
137
|
+
relevance: 0
|
|
138
|
+
};
|
|
139
|
+
const CRYSTAL_DEFAULT_CONTAINS = [
|
|
140
|
+
EXPANSION,
|
|
141
|
+
STRING,
|
|
142
|
+
Q_STRING,
|
|
143
|
+
{
|
|
144
|
+
className: "regexp",
|
|
145
|
+
contains: [hljs.BACKSLASH_ESCAPE, SUBST],
|
|
146
|
+
variants: [
|
|
147
|
+
{
|
|
148
|
+
begin: "%r\\(",
|
|
149
|
+
end: "\\)",
|
|
150
|
+
contains: recursiveParen("\\(", "\\)")
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
begin: "%r\\[",
|
|
154
|
+
end: "\\]",
|
|
155
|
+
contains: recursiveParen("\\[", "\\]")
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
begin: "%r\\{",
|
|
159
|
+
end: /\}/,
|
|
160
|
+
contains: recursiveParen(/\{/, /\}/)
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
begin: "%r<",
|
|
164
|
+
end: ">",
|
|
165
|
+
contains: recursiveParen("<", ">")
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
begin: "%r\\|",
|
|
169
|
+
end: "\\|"
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
relevance: 0
|
|
173
|
+
},
|
|
174
|
+
REGEXP,
|
|
175
|
+
{
|
|
176
|
+
className: "meta",
|
|
177
|
+
begin: "@\\[",
|
|
178
|
+
end: "\\]",
|
|
179
|
+
contains: [hljs.inherit(hljs.QUOTE_STRING_MODE, { className: "string" })]
|
|
180
|
+
},
|
|
181
|
+
VARIABLE,
|
|
182
|
+
hljs.HASH_COMMENT_MODE,
|
|
183
|
+
{
|
|
184
|
+
className: "class",
|
|
185
|
+
beginKeywords: "class module struct",
|
|
186
|
+
end: "$|;",
|
|
187
|
+
illegal: /=/,
|
|
188
|
+
contains: [
|
|
189
|
+
hljs.HASH_COMMENT_MODE,
|
|
190
|
+
hljs.inherit(hljs.TITLE_MODE, { begin: CRYSTAL_PATH_RE }),
|
|
191
|
+
{ begin: "<" }
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
className: "class",
|
|
196
|
+
beginKeywords: "lib enum union",
|
|
197
|
+
end: "$|;",
|
|
198
|
+
illegal: /=/,
|
|
199
|
+
contains: [hljs.HASH_COMMENT_MODE, hljs.inherit(hljs.TITLE_MODE, { begin: CRYSTAL_PATH_RE })]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
beginKeywords: "annotation",
|
|
203
|
+
end: "$|;",
|
|
204
|
+
illegal: /=/,
|
|
205
|
+
contains: [hljs.HASH_COMMENT_MODE, hljs.inherit(hljs.TITLE_MODE, { begin: CRYSTAL_PATH_RE })],
|
|
206
|
+
relevance: 2
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
className: "function",
|
|
210
|
+
beginKeywords: "def",
|
|
211
|
+
end: /\B\b/,
|
|
212
|
+
contains: [hljs.inherit(hljs.TITLE_MODE, {
|
|
213
|
+
begin: CRYSTAL_METHOD_RE,
|
|
214
|
+
endsParent: true
|
|
215
|
+
})]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
className: "function",
|
|
219
|
+
beginKeywords: "fun macro",
|
|
220
|
+
end: /\B\b/,
|
|
221
|
+
contains: [hljs.inherit(hljs.TITLE_MODE, {
|
|
222
|
+
begin: CRYSTAL_METHOD_RE,
|
|
223
|
+
endsParent: true
|
|
224
|
+
})],
|
|
225
|
+
relevance: 2
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
className: "symbol",
|
|
229
|
+
begin: hljs.UNDERSCORE_IDENT_RE + "(!|\\?)?:",
|
|
230
|
+
relevance: 0
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
className: "symbol",
|
|
234
|
+
begin: ":",
|
|
235
|
+
contains: [STRING, { begin: CRYSTAL_METHOD_RE }],
|
|
236
|
+
relevance: 0
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
className: "number",
|
|
240
|
+
variants: [
|
|
241
|
+
{ begin: "\\b0b([01_]+)" + INT_SUFFIX },
|
|
242
|
+
{ begin: "\\b0o([0-7_]+)" + INT_SUFFIX },
|
|
243
|
+
{ begin: "\\b0x([A-Fa-f0-9_]+)" + INT_SUFFIX },
|
|
244
|
+
{ begin: "\\b([1-9][0-9_]*[0-9]|[0-9])(\\.[0-9][0-9_]*)?([eE]_?[-+]?[0-9_]*)?(_?f(32|64))?(?!_)" },
|
|
245
|
+
{ begin: "\\b([1-9][0-9_]*|0)" + INT_SUFFIX }
|
|
246
|
+
],
|
|
247
|
+
relevance: 0
|
|
248
|
+
}
|
|
249
|
+
];
|
|
250
|
+
SUBST.contains = CRYSTAL_DEFAULT_CONTAINS;
|
|
251
|
+
EXPANSION.contains = CRYSTAL_DEFAULT_CONTAINS.slice(1);
|
|
252
|
+
return {
|
|
253
|
+
name: "Crystal",
|
|
254
|
+
aliases: ["cr"],
|
|
255
|
+
keywords: CRYSTAL_KEYWORDS,
|
|
256
|
+
contains: CRYSTAL_DEFAULT_CONTAINS
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
export { crystal as default };
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/csharp.js
|
|
2
|
+
/** @type LanguageFn */
|
|
3
|
+
function csharp(hljs) {
|
|
4
|
+
const BUILT_IN_KEYWORDS = [
|
|
5
|
+
"bool",
|
|
6
|
+
"byte",
|
|
7
|
+
"char",
|
|
8
|
+
"decimal",
|
|
9
|
+
"delegate",
|
|
10
|
+
"double",
|
|
11
|
+
"dynamic",
|
|
12
|
+
"enum",
|
|
13
|
+
"float",
|
|
14
|
+
"int",
|
|
15
|
+
"long",
|
|
16
|
+
"nint",
|
|
17
|
+
"nuint",
|
|
18
|
+
"object",
|
|
19
|
+
"sbyte",
|
|
20
|
+
"short",
|
|
21
|
+
"string",
|
|
22
|
+
"ulong",
|
|
23
|
+
"uint",
|
|
24
|
+
"ushort"
|
|
25
|
+
];
|
|
26
|
+
const FUNCTION_MODIFIERS = [
|
|
27
|
+
"public",
|
|
28
|
+
"private",
|
|
29
|
+
"protected",
|
|
30
|
+
"static",
|
|
31
|
+
"internal",
|
|
32
|
+
"protected",
|
|
33
|
+
"abstract",
|
|
34
|
+
"async",
|
|
35
|
+
"extern",
|
|
36
|
+
"override",
|
|
37
|
+
"unsafe",
|
|
38
|
+
"virtual",
|
|
39
|
+
"new",
|
|
40
|
+
"sealed",
|
|
41
|
+
"partial"
|
|
42
|
+
];
|
|
43
|
+
const KEYWORDS = {
|
|
44
|
+
keyword: [
|
|
45
|
+
"abstract",
|
|
46
|
+
"as",
|
|
47
|
+
"base",
|
|
48
|
+
"break",
|
|
49
|
+
"case",
|
|
50
|
+
"catch",
|
|
51
|
+
"class",
|
|
52
|
+
"const",
|
|
53
|
+
"continue",
|
|
54
|
+
"do",
|
|
55
|
+
"else",
|
|
56
|
+
"event",
|
|
57
|
+
"explicit",
|
|
58
|
+
"extern",
|
|
59
|
+
"finally",
|
|
60
|
+
"fixed",
|
|
61
|
+
"for",
|
|
62
|
+
"foreach",
|
|
63
|
+
"goto",
|
|
64
|
+
"if",
|
|
65
|
+
"implicit",
|
|
66
|
+
"in",
|
|
67
|
+
"interface",
|
|
68
|
+
"internal",
|
|
69
|
+
"is",
|
|
70
|
+
"lock",
|
|
71
|
+
"namespace",
|
|
72
|
+
"new",
|
|
73
|
+
"operator",
|
|
74
|
+
"out",
|
|
75
|
+
"override",
|
|
76
|
+
"params",
|
|
77
|
+
"private",
|
|
78
|
+
"protected",
|
|
79
|
+
"public",
|
|
80
|
+
"readonly",
|
|
81
|
+
"record",
|
|
82
|
+
"ref",
|
|
83
|
+
"return",
|
|
84
|
+
"scoped",
|
|
85
|
+
"sealed",
|
|
86
|
+
"sizeof",
|
|
87
|
+
"stackalloc",
|
|
88
|
+
"static",
|
|
89
|
+
"struct",
|
|
90
|
+
"switch",
|
|
91
|
+
"this",
|
|
92
|
+
"throw",
|
|
93
|
+
"try",
|
|
94
|
+
"typeof",
|
|
95
|
+
"unchecked",
|
|
96
|
+
"unsafe",
|
|
97
|
+
"using",
|
|
98
|
+
"virtual",
|
|
99
|
+
"void",
|
|
100
|
+
"volatile",
|
|
101
|
+
"while"
|
|
102
|
+
].concat([
|
|
103
|
+
"add",
|
|
104
|
+
"alias",
|
|
105
|
+
"and",
|
|
106
|
+
"ascending",
|
|
107
|
+
"args",
|
|
108
|
+
"async",
|
|
109
|
+
"await",
|
|
110
|
+
"by",
|
|
111
|
+
"descending",
|
|
112
|
+
"dynamic",
|
|
113
|
+
"equals",
|
|
114
|
+
"file",
|
|
115
|
+
"from",
|
|
116
|
+
"get",
|
|
117
|
+
"global",
|
|
118
|
+
"group",
|
|
119
|
+
"init",
|
|
120
|
+
"into",
|
|
121
|
+
"join",
|
|
122
|
+
"let",
|
|
123
|
+
"nameof",
|
|
124
|
+
"not",
|
|
125
|
+
"notnull",
|
|
126
|
+
"on",
|
|
127
|
+
"or",
|
|
128
|
+
"orderby",
|
|
129
|
+
"partial",
|
|
130
|
+
"record",
|
|
131
|
+
"remove",
|
|
132
|
+
"required",
|
|
133
|
+
"scoped",
|
|
134
|
+
"select",
|
|
135
|
+
"set",
|
|
136
|
+
"unmanaged",
|
|
137
|
+
"value|0",
|
|
138
|
+
"var",
|
|
139
|
+
"when",
|
|
140
|
+
"where",
|
|
141
|
+
"with",
|
|
142
|
+
"yield"
|
|
143
|
+
]),
|
|
144
|
+
built_in: BUILT_IN_KEYWORDS,
|
|
145
|
+
literal: [
|
|
146
|
+
"default",
|
|
147
|
+
"false",
|
|
148
|
+
"null",
|
|
149
|
+
"true"
|
|
150
|
+
]
|
|
151
|
+
};
|
|
152
|
+
const TITLE_MODE = hljs.inherit(hljs.TITLE_MODE, { begin: "[a-zA-Z](\\.?\\w)*" });
|
|
153
|
+
const NUMBERS = {
|
|
154
|
+
className: "number",
|
|
155
|
+
variants: [
|
|
156
|
+
{ begin: "\\b(0b[01']+)" },
|
|
157
|
+
{ begin: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)" },
|
|
158
|
+
{ begin: "(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)" }
|
|
159
|
+
],
|
|
160
|
+
relevance: 0
|
|
161
|
+
};
|
|
162
|
+
const RAW_STRING = {
|
|
163
|
+
className: "string",
|
|
164
|
+
begin: /"""("*)(?!")(.|\n)*?"""\1/,
|
|
165
|
+
relevance: 1
|
|
166
|
+
};
|
|
167
|
+
const VERBATIM_STRING = {
|
|
168
|
+
className: "string",
|
|
169
|
+
begin: "@\"",
|
|
170
|
+
end: "\"",
|
|
171
|
+
contains: [{ begin: "\"\"" }]
|
|
172
|
+
};
|
|
173
|
+
const VERBATIM_STRING_NO_LF = hljs.inherit(VERBATIM_STRING, { illegal: /\n/ });
|
|
174
|
+
const SUBST = {
|
|
175
|
+
className: "subst",
|
|
176
|
+
begin: /\{/,
|
|
177
|
+
end: /\}/,
|
|
178
|
+
keywords: KEYWORDS
|
|
179
|
+
};
|
|
180
|
+
const SUBST_NO_LF = hljs.inherit(SUBST, { illegal: /\n/ });
|
|
181
|
+
const INTERPOLATED_STRING = {
|
|
182
|
+
className: "string",
|
|
183
|
+
begin: /\$"/,
|
|
184
|
+
end: "\"",
|
|
185
|
+
illegal: /\n/,
|
|
186
|
+
contains: [
|
|
187
|
+
{ begin: /\{\{/ },
|
|
188
|
+
{ begin: /\}\}/ },
|
|
189
|
+
hljs.BACKSLASH_ESCAPE,
|
|
190
|
+
SUBST_NO_LF
|
|
191
|
+
]
|
|
192
|
+
};
|
|
193
|
+
const INTERPOLATED_VERBATIM_STRING = {
|
|
194
|
+
className: "string",
|
|
195
|
+
begin: /\$@"/,
|
|
196
|
+
end: "\"",
|
|
197
|
+
contains: [
|
|
198
|
+
{ begin: /\{\{/ },
|
|
199
|
+
{ begin: /\}\}/ },
|
|
200
|
+
{ begin: "\"\"" },
|
|
201
|
+
SUBST
|
|
202
|
+
]
|
|
203
|
+
};
|
|
204
|
+
const INTERPOLATED_VERBATIM_STRING_NO_LF = hljs.inherit(INTERPOLATED_VERBATIM_STRING, {
|
|
205
|
+
illegal: /\n/,
|
|
206
|
+
contains: [
|
|
207
|
+
{ begin: /\{\{/ },
|
|
208
|
+
{ begin: /\}\}/ },
|
|
209
|
+
{ begin: "\"\"" },
|
|
210
|
+
SUBST_NO_LF
|
|
211
|
+
]
|
|
212
|
+
});
|
|
213
|
+
SUBST.contains = [
|
|
214
|
+
INTERPOLATED_VERBATIM_STRING,
|
|
215
|
+
INTERPOLATED_STRING,
|
|
216
|
+
VERBATIM_STRING,
|
|
217
|
+
hljs.APOS_STRING_MODE,
|
|
218
|
+
hljs.QUOTE_STRING_MODE,
|
|
219
|
+
NUMBERS,
|
|
220
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
221
|
+
];
|
|
222
|
+
SUBST_NO_LF.contains = [
|
|
223
|
+
INTERPOLATED_VERBATIM_STRING_NO_LF,
|
|
224
|
+
INTERPOLATED_STRING,
|
|
225
|
+
VERBATIM_STRING_NO_LF,
|
|
226
|
+
hljs.APOS_STRING_MODE,
|
|
227
|
+
hljs.QUOTE_STRING_MODE,
|
|
228
|
+
NUMBERS,
|
|
229
|
+
hljs.inherit(hljs.C_BLOCK_COMMENT_MODE, { illegal: /\n/ })
|
|
230
|
+
];
|
|
231
|
+
const STRING = { variants: [
|
|
232
|
+
RAW_STRING,
|
|
233
|
+
INTERPOLATED_VERBATIM_STRING,
|
|
234
|
+
INTERPOLATED_STRING,
|
|
235
|
+
VERBATIM_STRING,
|
|
236
|
+
hljs.APOS_STRING_MODE,
|
|
237
|
+
hljs.QUOTE_STRING_MODE
|
|
238
|
+
] };
|
|
239
|
+
const GENERIC_MODIFIER = {
|
|
240
|
+
begin: "<",
|
|
241
|
+
end: ">",
|
|
242
|
+
contains: [{ beginKeywords: "in out" }, TITLE_MODE]
|
|
243
|
+
};
|
|
244
|
+
const TYPE_IDENT_RE = hljs.IDENT_RE + "(<" + hljs.IDENT_RE + "(\\s*,\\s*" + hljs.IDENT_RE + ")*>)?(\\[\\])?";
|
|
245
|
+
const AT_IDENTIFIER = {
|
|
246
|
+
begin: "@" + hljs.IDENT_RE,
|
|
247
|
+
relevance: 0
|
|
248
|
+
};
|
|
249
|
+
return {
|
|
250
|
+
name: "C#",
|
|
251
|
+
aliases: ["cs", "c#"],
|
|
252
|
+
keywords: KEYWORDS,
|
|
253
|
+
illegal: /::/,
|
|
254
|
+
contains: [
|
|
255
|
+
hljs.COMMENT("///", "$", {
|
|
256
|
+
returnBegin: true,
|
|
257
|
+
contains: [{
|
|
258
|
+
className: "doctag",
|
|
259
|
+
variants: [
|
|
260
|
+
{
|
|
261
|
+
begin: "///",
|
|
262
|
+
relevance: 0
|
|
263
|
+
},
|
|
264
|
+
{ begin: "<!--|-->" },
|
|
265
|
+
{
|
|
266
|
+
begin: "</?",
|
|
267
|
+
end: ">"
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
}]
|
|
271
|
+
}),
|
|
272
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
273
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
274
|
+
{
|
|
275
|
+
className: "meta",
|
|
276
|
+
begin: "#",
|
|
277
|
+
end: "$",
|
|
278
|
+
keywords: { keyword: "if else elif endif define undef warning error line region endregion pragma checksum" }
|
|
279
|
+
},
|
|
280
|
+
STRING,
|
|
281
|
+
NUMBERS,
|
|
282
|
+
{
|
|
283
|
+
beginKeywords: "class interface",
|
|
284
|
+
relevance: 0,
|
|
285
|
+
end: /[{;=]/,
|
|
286
|
+
illegal: /[^\s:,]/,
|
|
287
|
+
contains: [
|
|
288
|
+
{ beginKeywords: "where class" },
|
|
289
|
+
TITLE_MODE,
|
|
290
|
+
GENERIC_MODIFIER,
|
|
291
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
292
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
beginKeywords: "namespace",
|
|
297
|
+
relevance: 0,
|
|
298
|
+
end: /[{;=]/,
|
|
299
|
+
illegal: /[^\s:]/,
|
|
300
|
+
contains: [
|
|
301
|
+
TITLE_MODE,
|
|
302
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
303
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
beginKeywords: "record",
|
|
308
|
+
relevance: 0,
|
|
309
|
+
end: /[{;=]/,
|
|
310
|
+
illegal: /[^\s:]/,
|
|
311
|
+
contains: [
|
|
312
|
+
TITLE_MODE,
|
|
313
|
+
GENERIC_MODIFIER,
|
|
314
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
315
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
className: "meta",
|
|
320
|
+
begin: "^\\s*\\[(?=[\\w])",
|
|
321
|
+
excludeBegin: true,
|
|
322
|
+
end: "\\]",
|
|
323
|
+
excludeEnd: true,
|
|
324
|
+
contains: [{
|
|
325
|
+
className: "string",
|
|
326
|
+
begin: /"/,
|
|
327
|
+
end: /"/
|
|
328
|
+
}]
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
beginKeywords: "new return throw await else",
|
|
332
|
+
relevance: 0
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
className: "function",
|
|
336
|
+
begin: "(" + TYPE_IDENT_RE + "\\s+)+" + hljs.IDENT_RE + "\\s*(<[^=]+>\\s*)?\\(",
|
|
337
|
+
returnBegin: true,
|
|
338
|
+
end: /\s*[{;=]/,
|
|
339
|
+
excludeEnd: true,
|
|
340
|
+
keywords: KEYWORDS,
|
|
341
|
+
contains: [
|
|
342
|
+
{
|
|
343
|
+
beginKeywords: FUNCTION_MODIFIERS.join(" "),
|
|
344
|
+
relevance: 0
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
begin: hljs.IDENT_RE + "\\s*(<[^=]+>\\s*)?\\(",
|
|
348
|
+
returnBegin: true,
|
|
349
|
+
contains: [hljs.TITLE_MODE, GENERIC_MODIFIER],
|
|
350
|
+
relevance: 0
|
|
351
|
+
},
|
|
352
|
+
{ match: /\(\)/ },
|
|
353
|
+
{
|
|
354
|
+
className: "params",
|
|
355
|
+
begin: /\(/,
|
|
356
|
+
end: /\)/,
|
|
357
|
+
excludeBegin: true,
|
|
358
|
+
excludeEnd: true,
|
|
359
|
+
keywords: KEYWORDS,
|
|
360
|
+
relevance: 0,
|
|
361
|
+
contains: [
|
|
362
|
+
STRING,
|
|
363
|
+
NUMBERS,
|
|
364
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
365
|
+
]
|
|
366
|
+
},
|
|
367
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
368
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
369
|
+
]
|
|
370
|
+
},
|
|
371
|
+
AT_IDENTIFIER
|
|
372
|
+
]
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
//#endregion
|
|
376
|
+
export { csharp as default };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/csp.js
|
|
2
|
+
/** @type LanguageFn */
|
|
3
|
+
function csp(hljs) {
|
|
4
|
+
return {
|
|
5
|
+
name: "CSP",
|
|
6
|
+
case_insensitive: false,
|
|
7
|
+
keywords: {
|
|
8
|
+
$pattern: "[a-zA-Z][a-zA-Z0-9_-]*",
|
|
9
|
+
keyword: [
|
|
10
|
+
"base-uri",
|
|
11
|
+
"child-src",
|
|
12
|
+
"connect-src",
|
|
13
|
+
"default-src",
|
|
14
|
+
"fenced-frame-src",
|
|
15
|
+
"font-src",
|
|
16
|
+
"form-action",
|
|
17
|
+
"frame-ancestors",
|
|
18
|
+
"frame-src",
|
|
19
|
+
"img-src",
|
|
20
|
+
"manifest-src",
|
|
21
|
+
"media-src",
|
|
22
|
+
"object-src",
|
|
23
|
+
"plugin-types",
|
|
24
|
+
"report-to",
|
|
25
|
+
"report-uri",
|
|
26
|
+
"require-trusted-types-for",
|
|
27
|
+
"sandbox",
|
|
28
|
+
"script-src",
|
|
29
|
+
"script-src-attr",
|
|
30
|
+
"script-src-elem",
|
|
31
|
+
"style-src",
|
|
32
|
+
"style-src-attr",
|
|
33
|
+
"style-src-elem",
|
|
34
|
+
"trusted-types",
|
|
35
|
+
"unsafe-hashes",
|
|
36
|
+
"worker-src"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
contains: [{
|
|
40
|
+
className: "string",
|
|
41
|
+
begin: "'",
|
|
42
|
+
end: "'"
|
|
43
|
+
}, {
|
|
44
|
+
className: "attribute",
|
|
45
|
+
begin: "^Content",
|
|
46
|
+
end: ":",
|
|
47
|
+
excludeEnd: true
|
|
48
|
+
}]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { csp as default };
|