@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,624 @@
1
+ //#region ../../node_modules/.pnpm/highlight.js@11.11.2/node_modules/highlight.js/es/languages/sql.js
2
+ function sql(hljs) {
3
+ const regex = hljs.regex;
4
+ const COMMENT_MODE = hljs.COMMENT("--", "$");
5
+ const STRING = {
6
+ scope: "string",
7
+ variants: [{
8
+ begin: /'/,
9
+ end: /'/,
10
+ contains: [{ match: /''/ }]
11
+ }]
12
+ };
13
+ const QUOTED_IDENTIFIER = {
14
+ begin: /"/,
15
+ end: /"/,
16
+ contains: [{ match: /""/ }]
17
+ };
18
+ const LITERALS = [
19
+ "true",
20
+ "false",
21
+ "unknown"
22
+ ];
23
+ const MULTI_WORD_TYPES = [
24
+ "double precision",
25
+ "large object",
26
+ "with timezone",
27
+ "without timezone"
28
+ ];
29
+ const TYPES = [
30
+ "bigint",
31
+ "binary",
32
+ "blob",
33
+ "boolean",
34
+ "char",
35
+ "character",
36
+ "clob",
37
+ "date",
38
+ "dec",
39
+ "decfloat",
40
+ "decimal",
41
+ "float",
42
+ "int",
43
+ "integer",
44
+ "interval",
45
+ "nchar",
46
+ "nclob",
47
+ "national",
48
+ "numeric",
49
+ "real",
50
+ "row",
51
+ "smallint",
52
+ "time",
53
+ "timestamp",
54
+ "varchar",
55
+ "varying",
56
+ "varbinary"
57
+ ];
58
+ const NON_RESERVED_WORDS = [
59
+ "add",
60
+ "asc",
61
+ "collation",
62
+ "desc",
63
+ "final",
64
+ "first",
65
+ "last",
66
+ "view"
67
+ ];
68
+ const RESERVED_WORDS = [
69
+ "abs",
70
+ "acos",
71
+ "all",
72
+ "allocate",
73
+ "alter",
74
+ "and",
75
+ "any",
76
+ "are",
77
+ "array",
78
+ "array_agg",
79
+ "array_max_cardinality",
80
+ "as",
81
+ "asensitive",
82
+ "asin",
83
+ "asymmetric",
84
+ "at",
85
+ "atan",
86
+ "atomic",
87
+ "authorization",
88
+ "avg",
89
+ "begin",
90
+ "begin_frame",
91
+ "begin_partition",
92
+ "between",
93
+ "bigint",
94
+ "binary",
95
+ "blob",
96
+ "boolean",
97
+ "both",
98
+ "by",
99
+ "call",
100
+ "called",
101
+ "cardinality",
102
+ "cascaded",
103
+ "case",
104
+ "cast",
105
+ "ceil",
106
+ "ceiling",
107
+ "char",
108
+ "char_length",
109
+ "character",
110
+ "character_length",
111
+ "check",
112
+ "classifier",
113
+ "clob",
114
+ "close",
115
+ "coalesce",
116
+ "collate",
117
+ "collect",
118
+ "column",
119
+ "commit",
120
+ "condition",
121
+ "connect",
122
+ "constraint",
123
+ "contains",
124
+ "convert",
125
+ "copy",
126
+ "corr",
127
+ "corresponding",
128
+ "cos",
129
+ "cosh",
130
+ "count",
131
+ "covar_pop",
132
+ "covar_samp",
133
+ "create",
134
+ "cross",
135
+ "cube",
136
+ "cume_dist",
137
+ "current",
138
+ "current_catalog",
139
+ "current_date",
140
+ "current_default_transform_group",
141
+ "current_path",
142
+ "current_role",
143
+ "current_row",
144
+ "current_schema",
145
+ "current_time",
146
+ "current_timestamp",
147
+ "current_path",
148
+ "current_role",
149
+ "current_transform_group_for_type",
150
+ "current_user",
151
+ "cursor",
152
+ "cycle",
153
+ "date",
154
+ "day",
155
+ "deallocate",
156
+ "dec",
157
+ "decimal",
158
+ "decfloat",
159
+ "declare",
160
+ "default",
161
+ "define",
162
+ "delete",
163
+ "dense_rank",
164
+ "deref",
165
+ "describe",
166
+ "deterministic",
167
+ "disconnect",
168
+ "distinct",
169
+ "double",
170
+ "drop",
171
+ "dynamic",
172
+ "each",
173
+ "element",
174
+ "else",
175
+ "empty",
176
+ "end",
177
+ "end_frame",
178
+ "end_partition",
179
+ "end-exec",
180
+ "equals",
181
+ "escape",
182
+ "every",
183
+ "except",
184
+ "exec",
185
+ "execute",
186
+ "exists",
187
+ "exp",
188
+ "external",
189
+ "extract",
190
+ "false",
191
+ "fetch",
192
+ "filter",
193
+ "first_value",
194
+ "float",
195
+ "floor",
196
+ "for",
197
+ "foreign",
198
+ "frame_row",
199
+ "free",
200
+ "from",
201
+ "full",
202
+ "function",
203
+ "fusion",
204
+ "get",
205
+ "global",
206
+ "grant",
207
+ "group",
208
+ "grouping",
209
+ "groups",
210
+ "having",
211
+ "hold",
212
+ "hour",
213
+ "identity",
214
+ "in",
215
+ "indicator",
216
+ "initial",
217
+ "inner",
218
+ "inout",
219
+ "insensitive",
220
+ "insert",
221
+ "int",
222
+ "integer",
223
+ "intersect",
224
+ "intersection",
225
+ "interval",
226
+ "into",
227
+ "is",
228
+ "join",
229
+ "json_array",
230
+ "json_arrayagg",
231
+ "json_exists",
232
+ "json_object",
233
+ "json_objectagg",
234
+ "json_query",
235
+ "json_table",
236
+ "json_table_primitive",
237
+ "json_value",
238
+ "lag",
239
+ "language",
240
+ "large",
241
+ "last_value",
242
+ "lateral",
243
+ "lead",
244
+ "leading",
245
+ "left",
246
+ "like",
247
+ "like_regex",
248
+ "listagg",
249
+ "ln",
250
+ "local",
251
+ "localtime",
252
+ "localtimestamp",
253
+ "log",
254
+ "log10",
255
+ "lower",
256
+ "match",
257
+ "match_number",
258
+ "match_recognize",
259
+ "matches",
260
+ "max",
261
+ "member",
262
+ "merge",
263
+ "method",
264
+ "min",
265
+ "minute",
266
+ "mod",
267
+ "modifies",
268
+ "module",
269
+ "month",
270
+ "multiset",
271
+ "national",
272
+ "natural",
273
+ "nchar",
274
+ "nclob",
275
+ "new",
276
+ "no",
277
+ "none",
278
+ "normalize",
279
+ "not",
280
+ "nth_value",
281
+ "ntile",
282
+ "null",
283
+ "nullif",
284
+ "numeric",
285
+ "octet_length",
286
+ "occurrences_regex",
287
+ "of",
288
+ "offset",
289
+ "old",
290
+ "omit",
291
+ "on",
292
+ "one",
293
+ "only",
294
+ "open",
295
+ "or",
296
+ "order",
297
+ "out",
298
+ "outer",
299
+ "over",
300
+ "overlaps",
301
+ "overlay",
302
+ "parameter",
303
+ "partition",
304
+ "pattern",
305
+ "per",
306
+ "percent",
307
+ "percent_rank",
308
+ "percentile_cont",
309
+ "percentile_disc",
310
+ "period",
311
+ "portion",
312
+ "position",
313
+ "position_regex",
314
+ "power",
315
+ "precedes",
316
+ "precision",
317
+ "prepare",
318
+ "primary",
319
+ "procedure",
320
+ "ptf",
321
+ "range",
322
+ "rank",
323
+ "reads",
324
+ "real",
325
+ "recursive",
326
+ "ref",
327
+ "references",
328
+ "referencing",
329
+ "regr_avgx",
330
+ "regr_avgy",
331
+ "regr_count",
332
+ "regr_intercept",
333
+ "regr_r2",
334
+ "regr_slope",
335
+ "regr_sxx",
336
+ "regr_sxy",
337
+ "regr_syy",
338
+ "release",
339
+ "result",
340
+ "return",
341
+ "returns",
342
+ "revoke",
343
+ "right",
344
+ "rollback",
345
+ "rollup",
346
+ "row",
347
+ "row_number",
348
+ "rows",
349
+ "running",
350
+ "savepoint",
351
+ "scope",
352
+ "scroll",
353
+ "search",
354
+ "second",
355
+ "seek",
356
+ "select",
357
+ "sensitive",
358
+ "session_user",
359
+ "set",
360
+ "show",
361
+ "similar",
362
+ "sin",
363
+ "sinh",
364
+ "skip",
365
+ "smallint",
366
+ "some",
367
+ "specific",
368
+ "specifictype",
369
+ "sql",
370
+ "sqlexception",
371
+ "sqlstate",
372
+ "sqlwarning",
373
+ "sqrt",
374
+ "start",
375
+ "static",
376
+ "stddev_pop",
377
+ "stddev_samp",
378
+ "submultiset",
379
+ "subset",
380
+ "substring",
381
+ "substring_regex",
382
+ "succeeds",
383
+ "sum",
384
+ "symmetric",
385
+ "system",
386
+ "system_time",
387
+ "system_user",
388
+ "table",
389
+ "tablesample",
390
+ "tan",
391
+ "tanh",
392
+ "then",
393
+ "time",
394
+ "timestamp",
395
+ "timezone_hour",
396
+ "timezone_minute",
397
+ "to",
398
+ "trailing",
399
+ "translate",
400
+ "translate_regex",
401
+ "translation",
402
+ "treat",
403
+ "trigger",
404
+ "trim",
405
+ "trim_array",
406
+ "true",
407
+ "truncate",
408
+ "uescape",
409
+ "union",
410
+ "unique",
411
+ "unknown",
412
+ "unnest",
413
+ "update",
414
+ "upper",
415
+ "user",
416
+ "using",
417
+ "value",
418
+ "values",
419
+ "value_of",
420
+ "var_pop",
421
+ "var_samp",
422
+ "varbinary",
423
+ "varchar",
424
+ "varying",
425
+ "versioning",
426
+ "when",
427
+ "whenever",
428
+ "where",
429
+ "width_bucket",
430
+ "window",
431
+ "with",
432
+ "within",
433
+ "without",
434
+ "year"
435
+ ];
436
+ const RESERVED_FUNCTIONS = [
437
+ "abs",
438
+ "acos",
439
+ "array_agg",
440
+ "asin",
441
+ "atan",
442
+ "avg",
443
+ "cast",
444
+ "ceil",
445
+ "ceiling",
446
+ "coalesce",
447
+ "corr",
448
+ "cos",
449
+ "cosh",
450
+ "count",
451
+ "covar_pop",
452
+ "covar_samp",
453
+ "cume_dist",
454
+ "dense_rank",
455
+ "deref",
456
+ "element",
457
+ "exp",
458
+ "extract",
459
+ "first_value",
460
+ "floor",
461
+ "json_array",
462
+ "json_arrayagg",
463
+ "json_exists",
464
+ "json_object",
465
+ "json_objectagg",
466
+ "json_query",
467
+ "json_table",
468
+ "json_table_primitive",
469
+ "json_value",
470
+ "lag",
471
+ "last_value",
472
+ "lead",
473
+ "listagg",
474
+ "ln",
475
+ "log",
476
+ "log10",
477
+ "lower",
478
+ "max",
479
+ "min",
480
+ "mod",
481
+ "nth_value",
482
+ "ntile",
483
+ "nullif",
484
+ "percent_rank",
485
+ "percentile_cont",
486
+ "percentile_disc",
487
+ "position",
488
+ "position_regex",
489
+ "power",
490
+ "rank",
491
+ "regr_avgx",
492
+ "regr_avgy",
493
+ "regr_count",
494
+ "regr_intercept",
495
+ "regr_r2",
496
+ "regr_slope",
497
+ "regr_sxx",
498
+ "regr_sxy",
499
+ "regr_syy",
500
+ "row_number",
501
+ "sin",
502
+ "sinh",
503
+ "sqrt",
504
+ "stddev_pop",
505
+ "stddev_samp",
506
+ "substring",
507
+ "substring_regex",
508
+ "sum",
509
+ "tan",
510
+ "tanh",
511
+ "translate",
512
+ "translate_regex",
513
+ "treat",
514
+ "trim",
515
+ "trim_array",
516
+ "unnest",
517
+ "upper",
518
+ "value_of",
519
+ "var_pop",
520
+ "var_samp",
521
+ "width_bucket"
522
+ ];
523
+ const POSSIBLE_WITHOUT_PARENS = [
524
+ "current_catalog",
525
+ "current_date",
526
+ "current_default_transform_group",
527
+ "current_path",
528
+ "current_role",
529
+ "current_schema",
530
+ "current_transform_group_for_type",
531
+ "current_user",
532
+ "session_user",
533
+ "system_time",
534
+ "system_user",
535
+ "current_time",
536
+ "localtime",
537
+ "current_timestamp",
538
+ "localtimestamp"
539
+ ];
540
+ const COMBOS = [
541
+ "create table",
542
+ "insert into",
543
+ "primary key",
544
+ "foreign key",
545
+ "not null",
546
+ "alter table",
547
+ "add constraint",
548
+ "grouping sets",
549
+ "on overflow",
550
+ "character set",
551
+ "respect nulls",
552
+ "ignore nulls",
553
+ "nulls first",
554
+ "nulls last",
555
+ "depth first",
556
+ "breadth first"
557
+ ];
558
+ const FUNCTIONS = RESERVED_FUNCTIONS;
559
+ const KEYWORDS = [...RESERVED_WORDS, ...NON_RESERVED_WORDS].filter((keyword) => {
560
+ return !RESERVED_FUNCTIONS.includes(keyword);
561
+ });
562
+ const VARIABLE = {
563
+ scope: "variable",
564
+ match: /@[a-z0-9][a-z0-9_]*/
565
+ };
566
+ const OPERATOR = {
567
+ scope: "operator",
568
+ match: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
569
+ relevance: 0
570
+ };
571
+ const FUNCTION_CALL = {
572
+ match: regex.concat(/\b/, regex.either(...FUNCTIONS), /\s*\(/),
573
+ relevance: 0,
574
+ keywords: { built_in: FUNCTIONS }
575
+ };
576
+ function kws_to_regex(list) {
577
+ return regex.concat(/\b/, regex.either(...list.map((kw) => {
578
+ return kw.replace(/\s+/, "\\s+");
579
+ })), /\b/);
580
+ }
581
+ const MULTI_WORD_KEYWORDS = {
582
+ scope: "keyword",
583
+ match: kws_to_regex(COMBOS),
584
+ relevance: 0
585
+ };
586
+ function reduceRelevancy(list, { exceptions, when } = {}) {
587
+ const qualifyFn = when;
588
+ exceptions = exceptions || [];
589
+ return list.map((item) => {
590
+ if (item.match(/\|\d+$/) || exceptions.includes(item)) return item;
591
+ else if (qualifyFn(item)) return `${item}|0`;
592
+ else return item;
593
+ });
594
+ }
595
+ return {
596
+ name: "SQL",
597
+ case_insensitive: true,
598
+ illegal: /[{}]|<\//,
599
+ keywords: {
600
+ $pattern: /\b[\w\.]+/,
601
+ keyword: reduceRelevancy(KEYWORDS, { when: (x) => x.length < 3 }),
602
+ literal: LITERALS,
603
+ type: TYPES,
604
+ built_in: POSSIBLE_WITHOUT_PARENS
605
+ },
606
+ contains: [
607
+ {
608
+ scope: "type",
609
+ match: kws_to_regex(MULTI_WORD_TYPES)
610
+ },
611
+ MULTI_WORD_KEYWORDS,
612
+ FUNCTION_CALL,
613
+ VARIABLE,
614
+ STRING,
615
+ QUOTED_IDENTIFIER,
616
+ hljs.C_NUMBER_MODE,
617
+ hljs.C_BLOCK_COMMENT_MODE,
618
+ COMMENT_MODE,
619
+ OPERATOR
620
+ ]
621
+ };
622
+ }
623
+ //#endregion
624
+ export { sql as default };