@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.
Files changed (220) hide show
  1. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +34 -3
  2. package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +55 -0
  3. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +7 -2
  4. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +29 -0
  5. package/components/ui-tree-item/ui-tree-item.html +5 -5
  6. package/components/ui-tree-item/ui-tree-item.js +20 -3
  7. package/dist/index.js +1 -1
  8. package/editor/chunks/extensions.js +24 -3
  9. package/editor/extensions/preset.d.ts +2 -0
  10. package/editor/extensions/table-commands.d.ts +1 -1
  11. package/editor/table-overlay.d.ts +8 -3
  12. package/package.json +2 -1
  13. package/styles/ui-editor-table-overlay.css +30 -0
  14. package/styles/ui-editor-table-toolbar.css +7 -2
  15. package/styles/ui-tree-item.css +5 -5
  16. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  17. package/vanilla/UiEditorTableOverlay.js +9 -3
  18. package/vue/UiEditorTableOverlay.d.ts +8 -0
  19. package/vue/UiEditorTableOverlay.vue +45 -2
  20. package/vue/UiEditorTableToolbar.vue +7 -2
  21. package/vue/UiTreeItem.vue +5 -5
  22. package/vue/chunks/1c.js +106 -0
  23. package/vue/chunks/UiEditorTableOverlay.js +14 -4
  24. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  25. package/vue/chunks/UiTreeItem.js +1 -1
  26. package/vue/chunks/abnf.js +61 -0
  27. package/vue/chunks/accesslog.js +72 -0
  28. package/vue/chunks/actionscript.js +139 -0
  29. package/vue/chunks/ada.js +183 -0
  30. package/vue/chunks/angelscript.js +141 -0
  31. package/vue/chunks/apache.js +88 -0
  32. package/vue/chunks/applescript.js +99 -0
  33. package/vue/chunks/arcade.js +405 -0
  34. package/vue/chunks/arduino.js +871 -0
  35. package/vue/chunks/armasm.js +65 -0
  36. package/vue/chunks/asciidoc.js +181 -0
  37. package/vue/chunks/aspectj.js +202 -0
  38. package/vue/chunks/autohotkey.js +54 -0
  39. package/vue/chunks/autoit.js +132 -0
  40. package/vue/chunks/avrasm.js +46 -0
  41. package/vue/chunks/awk.js +58 -0
  42. package/vue/chunks/axapta.js +167 -0
  43. package/vue/chunks/bash.js +358 -0
  44. package/vue/chunks/basic.js +221 -0
  45. package/vue/chunks/bnf.js +27 -0
  46. package/vue/chunks/brainfuck.js +40 -0
  47. package/vue/chunks/c.js +265 -0
  48. package/vue/chunks/cal.js +136 -0
  49. package/vue/chunks/capnproto.js +86 -0
  50. package/vue/chunks/ceylon.js +125 -0
  51. package/vue/chunks/clean.js +54 -0
  52. package/vue/chunks/clojure-repl.js +17 -0
  53. package/vue/chunks/clojure.js +133 -0
  54. package/vue/chunks/cmake.js +23 -0
  55. package/vue/chunks/coffeescript.js +291 -0
  56. package/vue/chunks/coq.js +436 -0
  57. package/vue/chunks/cos.js +77 -0
  58. package/vue/chunks/cpp.js +492 -0
  59. package/vue/chunks/crmsh.js +80 -0
  60. package/vue/chunks/crystal.js +260 -0
  61. package/vue/chunks/csharp.js +376 -0
  62. package/vue/chunks/csp.js +52 -0
  63. package/vue/chunks/css.js +890 -0
  64. package/vue/chunks/d.js +184 -0
  65. package/vue/chunks/dart.js +226 -0
  66. package/vue/chunks/delphi.js +227 -0
  67. package/vue/chunks/diff.js +40 -0
  68. package/vue/chunks/django.js +43 -0
  69. package/vue/chunks/dns.js +66 -0
  70. package/vue/chunks/dockerfile.js +35 -0
  71. package/vue/chunks/dos.js +147 -0
  72. package/vue/chunks/dsconfig.js +55 -0
  73. package/vue/chunks/dts.js +119 -0
  74. package/vue/chunks/dust.js +33 -0
  75. package/vue/chunks/ebnf.js +40 -0
  76. package/vue/chunks/elixir.js +241 -0
  77. package/vue/chunks/elm.js +103 -0
  78. package/vue/chunks/erb.js +17 -0
  79. package/vue/chunks/erlang-repl.js +41 -0
  80. package/vue/chunks/erlang.js +236 -0
  81. package/vue/chunks/excel.js +562 -0
  82. package/vue/chunks/fix.js +30 -0
  83. package/vue/chunks/flix.js +60 -0
  84. package/vue/chunks/fortran.js +543 -0
  85. package/vue/chunks/fsharp.js +440 -0
  86. package/vue/chunks/gams.js +134 -0
  87. package/vue/chunks/gauss.js +167 -0
  88. package/vue/chunks/gcode.js +131 -0
  89. package/vue/chunks/gherkin.js +41 -0
  90. package/vue/chunks/glsl.js +25 -0
  91. package/vue/chunks/gml.js +3119 -0
  92. package/vue/chunks/go.js +140 -0
  93. package/vue/chunks/golo.js +72 -0
  94. package/vue/chunks/gradle.js +181 -0
  95. package/vue/chunks/graphql.js +68 -0
  96. package/vue/chunks/groovy.js +159 -0
  97. package/vue/chunks/haml.js +96 -0
  98. package/vue/chunks/handlebars.js +191 -0
  99. package/vue/chunks/haskell.js +149 -0
  100. package/vue/chunks/haxe.js +142 -0
  101. package/vue/chunks/hsp.js +45 -0
  102. package/vue/chunks/http.js +77 -0
  103. package/vue/chunks/hy.js +92 -0
  104. package/vue/chunks/inform7.js +45 -0
  105. package/vue/chunks/ini.js +94 -0
  106. package/vue/chunks/irpf90.js +52 -0
  107. package/vue/chunks/isbl.js +112 -0
  108. package/vue/chunks/java.js +237 -0
  109. package/vue/chunks/javascript.js +570 -0
  110. package/vue/chunks/jboss-cli.js +46 -0
  111. package/vue/chunks/json.js +45 -0
  112. package/vue/chunks/julia-repl.js +18 -0
  113. package/vue/chunks/julia.js +353 -0
  114. package/vue/chunks/kotlin.js +216 -0
  115. package/vue/chunks/lasso.js +127 -0
  116. package/vue/chunks/latex.js +206 -0
  117. package/vue/chunks/ldif.js +25 -0
  118. package/vue/chunks/leaf.js +72 -0
  119. package/vue/chunks/less.js +953 -0
  120. package/vue/chunks/lisp.js +119 -0
  121. package/vue/chunks/livecodeserver.js +86 -0
  122. package/vue/chunks/livescript.js +309 -0
  123. package/vue/chunks/llvm.js +77 -0
  124. package/vue/chunks/lsl.js +55 -0
  125. package/vue/chunks/lua.js +49 -0
  126. package/vue/chunks/makefile.js +62 -0
  127. package/vue/chunks/markdown.js +194 -0
  128. package/vue/chunks/mathematica.js +7317 -0
  129. package/vue/chunks/matlab.js +70 -0
  130. package/vue/chunks/maxima.js +38 -0
  131. package/vue/chunks/mel.js +24 -0
  132. package/vue/chunks/mercury.js +62 -0
  133. package/vue/chunks/mipsasm.js +53 -0
  134. package/vue/chunks/mizar.js +10 -0
  135. package/vue/chunks/mojolicious.js +27 -0
  136. package/vue/chunks/monkey.js +158 -0
  137. package/vue/chunks/moonscript.js +102 -0
  138. package/vue/chunks/n1ql.js +346 -0
  139. package/vue/chunks/nestedtext.js +66 -0
  140. package/vue/chunks/nginx.js +127 -0
  141. package/vue/chunks/nim.js +174 -0
  142. package/vue/chunks/nix.js +334 -0
  143. package/vue/chunks/node-repl.js +20 -0
  144. package/vue/chunks/nsis.js +515 -0
  145. package/vue/chunks/objectivec.js +235 -0
  146. package/vue/chunks/ocaml.js +52 -0
  147. package/vue/chunks/openscad.js +66 -0
  148. package/vue/chunks/oxygene.js +58 -0
  149. package/vue/chunks/parser3.js +40 -0
  150. package/vue/chunks/perl.js +454 -0
  151. package/vue/chunks/pf.js +30 -0
  152. package/vue/chunks/pgsql.js +196 -0
  153. package/vue/chunks/php-template.js +43 -0
  154. package/vue/chunks/php.js +527 -0
  155. package/vue/chunks/plaintext.js +10 -0
  156. package/vue/chunks/pony.js +60 -0
  157. package/vue/chunks/powershell.js +208 -0
  158. package/vue/chunks/processing.js +407 -0
  159. package/vue/chunks/profile.js +38 -0
  160. package/vue/chunks/prolog.js +62 -0
  161. package/vue/chunks/properties.js +45 -0
  162. package/vue/chunks/protobuf.js +63 -0
  163. package/vue/chunks/puppet.js +87 -0
  164. package/vue/chunks/purebasic.js +42 -0
  165. package/vue/chunks/python-repl.js +19 -0
  166. package/vue/chunks/python.js +357 -0
  167. package/vue/chunks/q.js +21 -0
  168. package/vue/chunks/qml.js +134 -0
  169. package/vue/chunks/r.js +145 -0
  170. package/vue/chunks/reasonml.js +134 -0
  171. package/vue/chunks/rib.js +16 -0
  172. package/vue/chunks/roboconf.js +54 -0
  173. package/vue/chunks/routeros.js +109 -0
  174. package/vue/chunks/rsl.js +138 -0
  175. package/vue/chunks/ruby.js +322 -0
  176. package/vue/chunks/ruleslanguage.js +26 -0
  177. package/vue/chunks/rust.js +296 -0
  178. package/vue/chunks/sas.js +533 -0
  179. package/vue/chunks/scala.js +173 -0
  180. package/vue/chunks/scheme.js +118 -0
  181. package/vue/chunks/scilab.js +45 -0
  182. package/vue/chunks/scss.js +900 -0
  183. package/vue/chunks/shell.js +18 -0
  184. package/vue/chunks/smali.js +113 -0
  185. package/vue/chunks/smalltalk.js +59 -0
  186. package/vue/chunks/sml.js +49 -0
  187. package/vue/chunks/sqf.js +2599 -0
  188. package/vue/chunks/sql.js +624 -0
  189. package/vue/chunks/stan.js +471 -0
  190. package/vue/chunks/stata.js +33 -0
  191. package/vue/chunks/step21.js +53 -0
  192. package/vue/chunks/stylus.js +925 -0
  193. package/vue/chunks/subunit.js +34 -0
  194. package/vue/chunks/swift.js +699 -0
  195. package/vue/chunks/taggerscript.js +37 -0
  196. package/vue/chunks/tap.js +30 -0
  197. package/vue/chunks/tcl.js +165 -0
  198. package/vue/chunks/thrift.js +65 -0
  199. package/vue/chunks/tp.js +155 -0
  200. package/vue/chunks/twig.js +232 -0
  201. package/vue/chunks/typescript.js +672 -0
  202. package/vue/chunks/vala.js +39 -0
  203. package/vue/chunks/vbnet.js +86 -0
  204. package/vue/chunks/vbscript-html.js +14 -0
  205. package/vue/chunks/vbscript.js +200 -0
  206. package/vue/chunks/verilog.js +534 -0
  207. package/vue/chunks/vhdl.js +190 -0
  208. package/vue/chunks/vim.js +54 -0
  209. package/vue/chunks/wasm.js +111 -0
  210. package/vue/chunks/wren.js +229 -0
  211. package/vue/chunks/x86asm.js +64 -0
  212. package/vue/chunks/xl.js +192 -0
  213. package/vue/chunks/xml.js +175 -0
  214. package/vue/chunks/xquery.js +303 -0
  215. package/vue/chunks/yaml.js +159 -0
  216. package/vue/chunks/zephir.js +74 -0
  217. package/vue/components.css +204 -170
  218. package/vue/editor/LoomaEditor.d.ts +7 -7
  219. package/vue/editor/code-language-catalog.d.ts +196 -0
  220. package/vue/editor/index.js +290 -20
@@ -0,0 +1,241 @@
1
+ //#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/elixir.js
2
+ /** @type LanguageFn */
3
+ function elixir(hljs) {
4
+ const regex = hljs.regex;
5
+ const ELIXIR_IDENT_RE = "[a-zA-Z_][a-zA-Z0-9_.]*(!|\\?)?";
6
+ const ELIXIR_METHOD_RE = "[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";
7
+ const KWS = {
8
+ $pattern: ELIXIR_IDENT_RE,
9
+ keyword: [
10
+ "after",
11
+ "alias",
12
+ "and",
13
+ "case",
14
+ "catch",
15
+ "cond",
16
+ "defstruct",
17
+ "defguard",
18
+ "defguardp",
19
+ "do",
20
+ "else",
21
+ "end",
22
+ "fn",
23
+ "for",
24
+ "if",
25
+ "import",
26
+ "in",
27
+ "not",
28
+ "or",
29
+ "quote",
30
+ "raise",
31
+ "receive",
32
+ "require",
33
+ "reraise",
34
+ "rescue",
35
+ "try",
36
+ "unless",
37
+ "unquote",
38
+ "unquote_splicing",
39
+ "use",
40
+ "when",
41
+ "with|0"
42
+ ],
43
+ literal: [
44
+ "false",
45
+ "nil",
46
+ "true"
47
+ ]
48
+ };
49
+ const SUBST = {
50
+ className: "subst",
51
+ begin: /#\{/,
52
+ end: /\}/,
53
+ keywords: KWS
54
+ };
55
+ const NUMBER = {
56
+ className: "number",
57
+ begin: "(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[0-9][0-9_]*(\\.[0-9_]+([eE][-+]?[0-9]+)?)?)",
58
+ relevance: 0
59
+ };
60
+ const BACKSLASH_ESCAPE = {
61
+ match: /\\[\s\S]/,
62
+ scope: "char.escape",
63
+ relevance: 0
64
+ };
65
+ const SIGIL_DELIMITER_MODES = [
66
+ {
67
+ begin: /"/,
68
+ end: /"/
69
+ },
70
+ {
71
+ begin: /'/,
72
+ end: /'/
73
+ },
74
+ {
75
+ begin: /\//,
76
+ end: /\//
77
+ },
78
+ {
79
+ begin: /\|/,
80
+ end: /\|/
81
+ },
82
+ {
83
+ begin: /\(/,
84
+ end: /\)/
85
+ },
86
+ {
87
+ begin: /\[/,
88
+ end: /\]/
89
+ },
90
+ {
91
+ begin: /\{/,
92
+ end: /\}/
93
+ },
94
+ {
95
+ begin: /</,
96
+ end: />/
97
+ }
98
+ ];
99
+ const escapeSigilEnd = (end) => {
100
+ return {
101
+ scope: "char.escape",
102
+ begin: regex.concat(/\\/, end),
103
+ relevance: 0
104
+ };
105
+ };
106
+ const LOWERCASE_SIGIL = {
107
+ className: "string",
108
+ begin: "~[a-z](?=[/|([{<\"'])",
109
+ contains: SIGIL_DELIMITER_MODES.map((x) => hljs.inherit(x, { contains: [
110
+ escapeSigilEnd(x.end),
111
+ BACKSLASH_ESCAPE,
112
+ SUBST
113
+ ] }))
114
+ };
115
+ const UPCASE_SIGIL = {
116
+ className: "string",
117
+ begin: "~[A-Z](?=[/|([{<\"'])",
118
+ contains: SIGIL_DELIMITER_MODES.map((x) => hljs.inherit(x, { contains: [escapeSigilEnd(x.end)] }))
119
+ };
120
+ const REGEX_SIGIL = {
121
+ className: "regex",
122
+ variants: [{
123
+ begin: "~r(?=[/|([{<\"'])",
124
+ contains: SIGIL_DELIMITER_MODES.map((x) => hljs.inherit(x, {
125
+ end: regex.concat(x.end, /[uismxfU]{0,7}/),
126
+ contains: [
127
+ escapeSigilEnd(x.end),
128
+ BACKSLASH_ESCAPE,
129
+ SUBST
130
+ ]
131
+ }))
132
+ }, {
133
+ begin: "~R(?=[/|([{<\"'])",
134
+ contains: SIGIL_DELIMITER_MODES.map((x) => hljs.inherit(x, {
135
+ end: regex.concat(x.end, /[uismxfU]{0,7}/),
136
+ contains: [escapeSigilEnd(x.end)]
137
+ }))
138
+ }]
139
+ };
140
+ const STRING = {
141
+ className: "string",
142
+ contains: [hljs.BACKSLASH_ESCAPE, SUBST],
143
+ variants: [
144
+ {
145
+ begin: /"""/,
146
+ end: /"""/
147
+ },
148
+ {
149
+ begin: /'''/,
150
+ end: /'''/
151
+ },
152
+ {
153
+ begin: /~S"""/,
154
+ end: /"""/,
155
+ contains: []
156
+ },
157
+ {
158
+ begin: /~S"/,
159
+ end: /"/,
160
+ contains: []
161
+ },
162
+ {
163
+ begin: /~S'''/,
164
+ end: /'''/,
165
+ contains: []
166
+ },
167
+ {
168
+ begin: /~S'/,
169
+ end: /'/,
170
+ contains: []
171
+ },
172
+ {
173
+ begin: /'/,
174
+ end: /'/
175
+ },
176
+ {
177
+ begin: /"/,
178
+ end: /"/
179
+ }
180
+ ]
181
+ };
182
+ const FUNCTION = {
183
+ className: "function",
184
+ beginKeywords: "def defp defmacro defmacrop",
185
+ end: /\B\b/,
186
+ contains: [hljs.inherit(hljs.TITLE_MODE, {
187
+ begin: ELIXIR_IDENT_RE,
188
+ endsParent: true
189
+ })]
190
+ };
191
+ const CLASS = hljs.inherit(FUNCTION, {
192
+ className: "class",
193
+ beginKeywords: "defimpl defmodule defprotocol defrecord",
194
+ end: /\bdo\b|$|;/
195
+ });
196
+ const ELIXIR_DEFAULT_CONTAINS = [
197
+ {
198
+ scope: "string",
199
+ match: /\?'/,
200
+ relevance: 0
201
+ },
202
+ STRING,
203
+ REGEX_SIGIL,
204
+ UPCASE_SIGIL,
205
+ LOWERCASE_SIGIL,
206
+ hljs.HASH_COMMENT_MODE,
207
+ CLASS,
208
+ FUNCTION,
209
+ { begin: "::" },
210
+ {
211
+ className: "symbol",
212
+ begin: ":(?![\\s:])",
213
+ contains: [STRING, { begin: ELIXIR_METHOD_RE }],
214
+ relevance: 0
215
+ },
216
+ {
217
+ className: "symbol",
218
+ begin: ELIXIR_IDENT_RE + ":(?!:)",
219
+ relevance: 0
220
+ },
221
+ {
222
+ className: "title.class",
223
+ begin: /(\b[A-Z][a-zA-Z0-9_]+)/,
224
+ relevance: 0
225
+ },
226
+ NUMBER,
227
+ {
228
+ className: "variable",
229
+ begin: "(\\$\\W)|((\\$|@@?)(\\w+))"
230
+ }
231
+ ];
232
+ SUBST.contains = ELIXIR_DEFAULT_CONTAINS;
233
+ return {
234
+ name: "Elixir",
235
+ aliases: ["ex", "exs"],
236
+ keywords: KWS,
237
+ contains: ELIXIR_DEFAULT_CONTAINS
238
+ };
239
+ }
240
+ //#endregion
241
+ export { elixir as default };
@@ -0,0 +1,103 @@
1
+ //#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/elm.js
2
+ /** @type LanguageFn */
3
+ function elm(hljs) {
4
+ const COMMENT = { variants: [hljs.COMMENT("--", "$"), hljs.COMMENT(/\{-/, /-\}/, { contains: ["self"] })] };
5
+ const CONSTRUCTOR = {
6
+ className: "type",
7
+ begin: "\\b[A-Z][\\w']*",
8
+ relevance: 0
9
+ };
10
+ const LIST = {
11
+ begin: "\\(",
12
+ end: "\\)",
13
+ illegal: "\"",
14
+ contains: [{
15
+ className: "type",
16
+ begin: "\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"
17
+ }, COMMENT]
18
+ };
19
+ const RECORD = {
20
+ begin: /\{/,
21
+ end: /\}/,
22
+ contains: LIST.contains
23
+ };
24
+ return {
25
+ name: "Elm",
26
+ keywords: [
27
+ "let",
28
+ "in",
29
+ "if",
30
+ "then",
31
+ "else",
32
+ "case",
33
+ "of",
34
+ "where",
35
+ "module",
36
+ "import",
37
+ "exposing",
38
+ "type",
39
+ "alias",
40
+ "as",
41
+ "infix",
42
+ "infixl",
43
+ "infixr",
44
+ "port",
45
+ "effect",
46
+ "command",
47
+ "subscription"
48
+ ],
49
+ contains: [
50
+ {
51
+ beginKeywords: "port effect module",
52
+ end: "exposing",
53
+ keywords: "port effect module where command subscription exposing",
54
+ contains: [LIST, COMMENT],
55
+ illegal: "\\W\\.|;"
56
+ },
57
+ {
58
+ begin: "import",
59
+ end: "$",
60
+ keywords: "import as exposing",
61
+ contains: [LIST, COMMENT],
62
+ illegal: "\\W\\.|;"
63
+ },
64
+ {
65
+ begin: "type",
66
+ end: "$",
67
+ keywords: "type alias",
68
+ contains: [
69
+ CONSTRUCTOR,
70
+ LIST,
71
+ RECORD,
72
+ COMMENT
73
+ ]
74
+ },
75
+ {
76
+ beginKeywords: "infix infixl infixr",
77
+ end: "$",
78
+ contains: [hljs.C_NUMBER_MODE, COMMENT]
79
+ },
80
+ {
81
+ begin: "port",
82
+ end: "$",
83
+ keywords: "port",
84
+ contains: [COMMENT]
85
+ },
86
+ {
87
+ className: "string",
88
+ begin: "'\\\\?.",
89
+ end: "'",
90
+ illegal: "."
91
+ },
92
+ hljs.QUOTE_STRING_MODE,
93
+ hljs.C_NUMBER_MODE,
94
+ CONSTRUCTOR,
95
+ hljs.inherit(hljs.TITLE_MODE, { begin: "^[_a-z][\\w']*" }),
96
+ COMMENT,
97
+ { begin: "->|<-" }
98
+ ],
99
+ illegal: /;/
100
+ };
101
+ }
102
+ //#endregion
103
+ export { elm as default };
@@ -0,0 +1,17 @@
1
+ //#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/erb.js
2
+ /** @type LanguageFn */
3
+ function erb(hljs) {
4
+ return {
5
+ name: "ERB",
6
+ subLanguage: "xml",
7
+ contains: [hljs.COMMENT("<%#", "%>"), {
8
+ begin: "<%[%=-]?",
9
+ end: "[%-]?%>",
10
+ subLanguage: "ruby",
11
+ excludeBegin: true,
12
+ excludeEnd: true
13
+ }]
14
+ };
15
+ }
16
+ //#endregion
17
+ export { erb as default };
@@ -0,0 +1,41 @@
1
+ //#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/erlang-repl.js
2
+ /** @type LanguageFn */
3
+ function erlangRepl(hljs) {
4
+ const regex = hljs.regex;
5
+ return {
6
+ name: "Erlang REPL",
7
+ keywords: {
8
+ built_in: "spawn spawn_link self",
9
+ keyword: "after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"
10
+ },
11
+ contains: [
12
+ {
13
+ className: "meta.prompt",
14
+ begin: "^[0-9]+> ",
15
+ relevance: 10
16
+ },
17
+ hljs.COMMENT("%", "$"),
18
+ {
19
+ className: "number",
20
+ begin: "\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)",
21
+ relevance: 0
22
+ },
23
+ hljs.APOS_STRING_MODE,
24
+ hljs.QUOTE_STRING_MODE,
25
+ { begin: regex.concat(/\?(::)?/, /([A-Z]\w*)/, /((::)[A-Z]\w*)*/) },
26
+ { begin: "->" },
27
+ { begin: "ok" },
28
+ { begin: "!" },
29
+ {
30
+ begin: "(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",
31
+ relevance: 0
32
+ },
33
+ {
34
+ begin: "[A-Z][a-zA-Z0-9_']*",
35
+ relevance: 0
36
+ }
37
+ ]
38
+ };
39
+ }
40
+ //#endregion
41
+ export { erlangRepl as default };
@@ -0,0 +1,236 @@
1
+ //#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/erlang.js
2
+ /** @type LanguageFn */
3
+ function erlang(hljs) {
4
+ const BASIC_ATOM_RE = "[a-z'][a-zA-Z0-9_']*";
5
+ const FUNCTION_NAME_RE = "(" + BASIC_ATOM_RE + ":" + BASIC_ATOM_RE + "|" + BASIC_ATOM_RE + ")";
6
+ const ERLANG_RESERVED = {
7
+ keyword: "after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor maybe else",
8
+ literal: "false true"
9
+ };
10
+ const COMMENT = hljs.COMMENT("%", "$");
11
+ const NUMBER = {
12
+ className: "number",
13
+ begin: "\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)",
14
+ relevance: 0
15
+ };
16
+ const NAMED_FUN = { begin: "fun\\s+" + BASIC_ATOM_RE + "/\\d+" };
17
+ const FUNCTION_CALL = {
18
+ begin: FUNCTION_NAME_RE + "\\(",
19
+ end: "\\)",
20
+ returnBegin: true,
21
+ relevance: 0,
22
+ contains: [{
23
+ begin: FUNCTION_NAME_RE,
24
+ relevance: 0
25
+ }, {
26
+ begin: "\\(",
27
+ end: "\\)",
28
+ endsWithParent: true,
29
+ returnEnd: true,
30
+ relevance: 0
31
+ }]
32
+ };
33
+ const TUPLE = {
34
+ begin: /\{/,
35
+ end: /\}/,
36
+ relevance: 0
37
+ };
38
+ const VAR1 = {
39
+ begin: "\\b_([A-Z][A-Za-z0-9_]*)?",
40
+ relevance: 0
41
+ };
42
+ const VAR2 = {
43
+ begin: "[A-Z][a-zA-Z0-9_]*",
44
+ relevance: 0
45
+ };
46
+ const RECORD_ACCESS = {
47
+ begin: "#" + hljs.UNDERSCORE_IDENT_RE,
48
+ relevance: 0,
49
+ returnBegin: true,
50
+ contains: [{
51
+ begin: "#" + hljs.UNDERSCORE_IDENT_RE,
52
+ relevance: 0
53
+ }, {
54
+ begin: /\{/,
55
+ end: /\}/,
56
+ relevance: 0
57
+ }]
58
+ };
59
+ const CHAR_LITERAL = {
60
+ scope: "string",
61
+ match: /\$(\\([^0-9]|[0-9]{1,3}|)|.)/
62
+ };
63
+ const TRIPLE_QUOTE = {
64
+ scope: "string",
65
+ match: /"""("*)(?!")[\s\S]*?"""\1/
66
+ };
67
+ const SIGIL = {
68
+ scope: "string",
69
+ contains: [hljs.BACKSLASH_ESCAPE],
70
+ variants: [
71
+ { match: /~\w?"""("*)(?!")[\s\S]*?"""\1/ },
72
+ {
73
+ begin: /~\w?\(/,
74
+ end: /\)/
75
+ },
76
+ {
77
+ begin: /~\w?\[/,
78
+ end: /\]/
79
+ },
80
+ {
81
+ begin: /~\w?{/,
82
+ end: /}/
83
+ },
84
+ {
85
+ begin: /~\w?</,
86
+ end: />/
87
+ },
88
+ {
89
+ begin: /~\w?\//,
90
+ end: /\//
91
+ },
92
+ {
93
+ begin: /~\w?\|/,
94
+ end: /\|/
95
+ },
96
+ {
97
+ begin: /~\w?'/,
98
+ end: /'/
99
+ },
100
+ {
101
+ begin: /~\w?"/,
102
+ end: /"/
103
+ },
104
+ {
105
+ begin: /~\w?`/,
106
+ end: /`/
107
+ },
108
+ {
109
+ begin: /~\w?#/,
110
+ end: /#/
111
+ }
112
+ ]
113
+ };
114
+ const BLOCK_STATEMENTS = {
115
+ beginKeywords: "fun receive if try case maybe",
116
+ end: "end",
117
+ keywords: ERLANG_RESERVED
118
+ };
119
+ BLOCK_STATEMENTS.contains = [
120
+ COMMENT,
121
+ NAMED_FUN,
122
+ hljs.inherit(hljs.APOS_STRING_MODE, { className: "" }),
123
+ BLOCK_STATEMENTS,
124
+ FUNCTION_CALL,
125
+ SIGIL,
126
+ TRIPLE_QUOTE,
127
+ hljs.QUOTE_STRING_MODE,
128
+ NUMBER,
129
+ TUPLE,
130
+ VAR1,
131
+ VAR2,
132
+ RECORD_ACCESS,
133
+ CHAR_LITERAL
134
+ ];
135
+ const BASIC_MODES = [
136
+ COMMENT,
137
+ NAMED_FUN,
138
+ BLOCK_STATEMENTS,
139
+ FUNCTION_CALL,
140
+ SIGIL,
141
+ TRIPLE_QUOTE,
142
+ hljs.QUOTE_STRING_MODE,
143
+ NUMBER,
144
+ TUPLE,
145
+ VAR1,
146
+ VAR2,
147
+ RECORD_ACCESS,
148
+ CHAR_LITERAL
149
+ ];
150
+ FUNCTION_CALL.contains[1].contains = BASIC_MODES;
151
+ TUPLE.contains = BASIC_MODES;
152
+ RECORD_ACCESS.contains[1].contains = BASIC_MODES;
153
+ const DIRECTIVES = [
154
+ "-module",
155
+ "-record",
156
+ "-undef",
157
+ "-export",
158
+ "-ifdef",
159
+ "-ifndef",
160
+ "-author",
161
+ "-copyright",
162
+ "-doc",
163
+ "-moduledoc",
164
+ "-vsn",
165
+ "-import",
166
+ "-include",
167
+ "-include_lib",
168
+ "-compile",
169
+ "-define",
170
+ "-else",
171
+ "-endif",
172
+ "-file",
173
+ "-behaviour",
174
+ "-behavior",
175
+ "-spec",
176
+ "-on_load",
177
+ "-nifs"
178
+ ];
179
+ const PARAMS = {
180
+ className: "params",
181
+ begin: "\\(",
182
+ end: "\\)",
183
+ contains: BASIC_MODES
184
+ };
185
+ return {
186
+ name: "Erlang",
187
+ aliases: ["erl"],
188
+ keywords: ERLANG_RESERVED,
189
+ illegal: "(</|\\*=|\\+=|-=|/\\*|\\*/|\\(\\*|\\*\\))",
190
+ contains: [
191
+ {
192
+ className: "function",
193
+ begin: "^" + BASIC_ATOM_RE + "\\s*\\(",
194
+ end: "->",
195
+ returnBegin: true,
196
+ illegal: "\\(|#|//|/\\*|\\\\|:|;",
197
+ contains: [PARAMS, hljs.inherit(hljs.TITLE_MODE, { begin: BASIC_ATOM_RE })],
198
+ starts: {
199
+ end: ";|\\.",
200
+ keywords: ERLANG_RESERVED,
201
+ contains: BASIC_MODES
202
+ }
203
+ },
204
+ COMMENT,
205
+ {
206
+ begin: "^-",
207
+ end: "\\.",
208
+ relevance: 0,
209
+ excludeEnd: true,
210
+ returnBegin: true,
211
+ keywords: {
212
+ $pattern: "-" + hljs.IDENT_RE,
213
+ keyword: DIRECTIVES.map((x) => `${x}|1.5`).join(" ")
214
+ },
215
+ contains: [
216
+ PARAMS,
217
+ SIGIL,
218
+ TRIPLE_QUOTE,
219
+ hljs.QUOTE_STRING_MODE
220
+ ]
221
+ },
222
+ NUMBER,
223
+ SIGIL,
224
+ TRIPLE_QUOTE,
225
+ hljs.QUOTE_STRING_MODE,
226
+ RECORD_ACCESS,
227
+ VAR1,
228
+ VAR2,
229
+ TUPLE,
230
+ CHAR_LITERAL,
231
+ { begin: /\.$/ }
232
+ ]
233
+ };
234
+ }
235
+ //#endregion
236
+ export { erlang as default };