@milkdown/crepe 7.3.3
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/LICENSE +21 -0
- package/README.md +11 -0
- package/lib/apl-p0IPP13W.js +76 -0
- package/lib/asciiarmor-lJsBxlJJ.js +34 -0
- package/lib/asn1-Q9v1zIy5.js +102 -0
- package/lib/asterisk-foNkeTjy.js +273 -0
- package/lib/brainfuck-0XqyXpNS.js +35 -0
- package/lib/clike-ak6Z6Yhe.js +639 -0
- package/lib/clojure-iYO8U8Sg.js +810 -0
- package/lib/clsx-7d8NmkQq.js +21 -0
- package/lib/cmake-SVzjkxV_.js +28 -0
- package/lib/cobol-APHEnAOX.js +74 -0
- package/lib/coffeescript-KqQa0SYG.js +182 -0
- package/lib/commonlisp-bwqNqR5V.js +79 -0
- package/lib/core/crepe.d.ts +21 -0
- package/lib/core/crepe.d.ts.map +1 -0
- package/lib/core/index.d.ts +3 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/slice.d.ts +12 -0
- package/lib/core/slice.d.ts.map +1 -0
- package/lib/crystal-BViWuDpA.js +217 -0
- package/lib/css-KHXHXfXg.js +1572 -0
- package/lib/cypher-XpTt4zQ3.js +69 -0
- package/lib/d-fLig6yqY.js +139 -0
- package/lib/diff-WoKGLpy6.js +18 -0
- package/lib/dockerfile-u6f6Vw2s.js +194 -0
- package/lib/dtd-SIJRUW6K.js +91 -0
- package/lib/dylan-4HCLhpWP.js +238 -0
- package/lib/ebnf-h_0lged5.js +77 -0
- package/lib/ecl-Lf4FF0lf.js +133 -0
- package/lib/eiffel-qlw8KUyf.js +112 -0
- package/lib/elm-QRnB3zXs.js +108 -0
- package/lib/erlang-fyVKb7eK.js +488 -0
- package/lib/factor-BEeN4upY.js +65 -0
- package/lib/fcl-lRek3hEb.js +106 -0
- package/lib/feature/block-edit/handle/component.d.ts +9 -0
- package/lib/feature/block-edit/handle/component.d.ts.map +1 -0
- package/lib/feature/block-edit/handle/index.d.ts +12 -0
- package/lib/feature/block-edit/handle/index.d.ts.map +1 -0
- package/lib/feature/block-edit/index.d.ts +3 -0
- package/lib/feature/block-edit/index.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/component.d.ts +14 -0
- package/lib/feature/block-edit/menu/component.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/config.d.ts +21 -0
- package/lib/feature/block-edit/menu/config.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/icons.d.ts +14 -0
- package/lib/feature/block-edit/menu/icons.d.ts.map +1 -0
- package/lib/feature/block-edit/menu/index.d.ts +9 -0
- package/lib/feature/block-edit/menu/index.d.ts.map +1 -0
- package/lib/feature/code-mirror/index.d.ts +3 -0
- package/lib/feature/code-mirror/index.d.ts.map +1 -0
- package/lib/feature/gap-cursor/index.d.ts +3 -0
- package/lib/feature/gap-cursor/index.d.ts.map +1 -0
- package/lib/feature/image-block/index.d.ts +3 -0
- package/lib/feature/image-block/index.d.ts.map +1 -0
- package/lib/feature/index.d.ts +18 -0
- package/lib/feature/index.d.ts.map +1 -0
- package/lib/feature/link-tooltip/consts.d.ts +5 -0
- package/lib/feature/link-tooltip/consts.d.ts.map +1 -0
- package/lib/feature/link-tooltip/index.d.ts +3 -0
- package/lib/feature/link-tooltip/index.d.ts.map +1 -0
- package/lib/feature/list-item/consts.d.ts +2 -0
- package/lib/feature/list-item/consts.d.ts.map +1 -0
- package/lib/feature/list-item/index.d.ts +3 -0
- package/lib/feature/list-item/index.d.ts.map +1 -0
- package/lib/feature/placeholder/index.d.ts +10 -0
- package/lib/feature/placeholder/index.d.ts.map +1 -0
- package/lib/feature/shared.d.ts +3 -0
- package/lib/feature/shared.d.ts.map +1 -0
- package/lib/feature/toolbar/component.d.ts +13 -0
- package/lib/feature/toolbar/component.d.ts.map +1 -0
- package/lib/feature/toolbar/consts.d.ts +5 -0
- package/lib/feature/toolbar/consts.d.ts.map +1 -0
- package/lib/feature/toolbar/index.d.ts +3 -0
- package/lib/feature/toolbar/index.d.ts.map +1 -0
- package/lib/forth-ua2bRd8T.js +60 -0
- package/lib/fortran-WnF7znuN.js +443 -0
- package/lib/gas-wowve1o7.js +183 -0
- package/lib/gherkin-m7GIChu3.js +34 -0
- package/lib/go-th443Dhb.js +158 -0
- package/lib/groovy-tR4RiZnc.js +161 -0
- package/lib/haskell-jxVBofv5.js +375 -0
- package/lib/haxe-kWPI2tq3.js +390 -0
- package/lib/hooks-82sqkbtE.js +21 -0
- package/lib/http-3GIFWUlG.js +45 -0
- package/lib/icons-HYkfuR-O.js +50 -0
- package/lib/idl-PvpMZg-l.js +947 -0
- package/lib/index-0RbcZMbq.js +8 -0
- package/lib/index-4afXjFMY.js +517 -0
- package/lib/index-7MeyepDG.js +78 -0
- package/lib/index-7QgQq3x3.js +551 -0
- package/lib/index-7pgP6qYs.js +107 -0
- package/lib/index-8DvtgRVa.js +19511 -0
- package/lib/index-8Gg-jEP4.js +288 -0
- package/lib/index-8S8qcncB.js +507 -0
- package/lib/index-9A_GmGh4.js +1039 -0
- package/lib/index-EJJfYLzA.js +928 -0
- package/lib/index-Eg39w5kL.js +984 -0
- package/lib/index-FIk_7oPb.js +168 -0
- package/lib/index-LlbrXb_n.js +368 -0
- package/lib/index-MovKtgMG.js +121 -0
- package/lib/index-N9GtIS4X.js +64 -0
- package/lib/index-Pwn25-kf.js +8 -0
- package/lib/index-SdFSDosa.js +1295 -0
- package/lib/index-W5Th22-Z.js +1744 -0
- package/lib/index-XiXSFLmI.js +20975 -0
- package/lib/index-bknOViGv.js +47 -0
- package/lib/index-bkuIUPFS.js +275 -0
- package/lib/index-jPA8J9Eo.js +8 -0
- package/lib/index-lsG76a9s.js +552 -0
- package/lib/index-oTRzPo3B.js +146 -0
- package/lib/index-rrf6_6DC.js +317 -0
- package/lib/index-vJbZIHYF.js +81 -0
- package/lib/index-vPRh55CO.js +137 -0
- package/lib/index-vxy63hib.js +323 -0
- package/lib/index-wn1_LgCS.js +99 -0
- package/lib/index-xHADmDT3.js +12 -0
- package/lib/index-yt2EpMtv.js +141 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.es.js +7 -0
- package/lib/javascript-8ZHqHagw.js +758 -0
- package/lib/jinja2-vsOFe0qD.js +154 -0
- package/lib/julia-dlp_pbN1.js +241 -0
- package/lib/livescript-Gf5R-LT6.js +273 -0
- package/lib/lua-c5Y_JsBp.js +221 -0
- package/lib/mathematica-iiGTGmUs.js +35 -0
- package/lib/mbox-ZJh86H8B.js +78 -0
- package/lib/meta-tAGyVRPE.js +511 -0
- package/lib/mirc-i0qkCa0y.js +73 -0
- package/lib/mllike-Dy551fZW.js +275 -0
- package/lib/modelica-n6tGqUT9.js +94 -0
- package/lib/mscgen-aKSbB7D9.js +104 -0
- package/lib/mumps-lNiKA6sp.js +25 -0
- package/lib/nginx--YmuCfDj.js +93 -0
- package/lib/nsis-zhS8iA09.js +62 -0
- package/lib/ntriples-E3jQl3MC.js +79 -0
- package/lib/octave-EQvkGIeG.js +144 -0
- package/lib/oz-W2cpqFf6.js +152 -0
- package/lib/pascal-lCh6ouNZ.js +79 -0
- package/lib/perl-PxEQBX0B.js +915 -0
- package/lib/pig-Y_bNcrzS.js +56 -0
- package/lib/powershell-GaQP-TZr.js +249 -0
- package/lib/properties-mbRyn54L.js +26 -0
- package/lib/prosemirror-noTDkx-k.js +4 -0
- package/lib/protobuf-8CJideyJ.js +49 -0
- package/lib/puppet-ABBaChNZ.js +45 -0
- package/lib/python-sKdHg3Ka.js +321 -0
- package/lib/q-_1yG40Nm.js +89 -0
- package/lib/r-Ziz56bHT.js +108 -0
- package/lib/rpm-ORjGOHaQ.js +57 -0
- package/lib/ruby-jlbYq0dT.js +233 -0
- package/lib/sas-2n7xeUuO.js +107 -0
- package/lib/schema-tKk3m1fu.js +62 -0
- package/lib/scheme-XCs-NPeU.js +126 -0
- package/lib/shell-0_1Um7Dq.js +184 -0
- package/lib/sieve-7uyJD1x1.js +73 -0
- package/lib/simple-mode--HIzBxba.js +95 -0
- package/lib/smalltalk-PEFzrlQ-.js +48 -0
- package/lib/solr-BLBaHahN.js +41 -0
- package/lib/sparql-4F9ZWf1b.js +204 -0
- package/lib/spreadsheet-SGSo6blj.js +49 -0
- package/lib/sql-tebLBzN0.js +291 -0
- package/lib/stex-SFJcFGOO.js +130 -0
- package/lib/stylus-rwwWYWFm.js +256 -0
- package/lib/swift-eorJ0tCv.js +238 -0
- package/lib/tcl-IwXMB8U4.js +82 -0
- package/lib/textile-ok2VyjwC.js +299 -0
- package/lib/theme/classic/index.d.ts +3 -0
- package/lib/theme/classic/index.d.ts.map +1 -0
- package/lib/theme/classic-dark/index.d.ts +3 -0
- package/lib/theme/classic-dark/index.d.ts.map +1 -0
- package/lib/theme/headless/index.d.ts +3 -0
- package/lib/theme/headless/index.d.ts.map +1 -0
- package/lib/theme/index.d.ts +8 -0
- package/lib/theme/index.d.ts.map +1 -0
- package/lib/theme/shared.d.ts +3 -0
- package/lib/theme/shared.d.ts.map +1 -0
- package/lib/tiddlywiki-DLhz8_pc.js +156 -0
- package/lib/tiki-DFAqFElY.js +183 -0
- package/lib/tippy.esm-MZ2vxByW.js +1813 -0
- package/lib/toml-ryxpTZEV.js +49 -0
- package/lib/tooltip-plugin-gcwyQdiT.js +119 -0
- package/lib/troff-ZzZyvNct.js +36 -0
- package/lib/ttcn-6gvkqqpW.js +136 -0
- package/lib/ttcn-cfg-oSu-Dq5C.js +98 -0
- package/lib/turtle-10ofr5au.js +87 -0
- package/lib/use-css-light-dom-EKWZDmbJ.js +82 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/vb-a6n6fzrD.js +74 -0
- package/lib/vbscript-dgvo8jPt.js +324 -0
- package/lib/velocity-CBncCrwO.js +97 -0
- package/lib/verilog-KlcACt6C.js +271 -0
- package/lib/vhdl-NMd7Gf35.js +117 -0
- package/lib/webidl-z1UE5DN_.js +160 -0
- package/lib/xquery-hDt5jWTp.js +431 -0
- package/lib/yacas-ftgh_qwr.js +74 -0
- package/lib/yaml-DnNTfjXK.js +53 -0
- package/lib/z80-dA1PqWe1.js +62 -0
- package/package.json +87 -0
- package/src/core/crepe.ts +98 -0
- package/src/core/index.ts +4 -0
- package/src/core/slice.ts +44 -0
- package/src/feature/block-edit/handle/component.ts +68 -0
- package/src/feature/block-edit/handle/index.ts +81 -0
- package/src/feature/block-edit/index.ts +17 -0
- package/src/feature/block-edit/menu/component.ts +210 -0
- package/src/feature/block-edit/menu/config.ts +335 -0
- package/src/feature/block-edit/menu/icons.ts +171 -0
- package/src/feature/block-edit/menu/index.ts +113 -0
- package/src/feature/block-edit/style.css +126 -0
- package/src/feature/code-mirror/index.ts +60 -0
- package/src/feature/code-mirror/style.css +159 -0
- package/src/feature/gap-cursor/index.ts +31 -0
- package/src/feature/image-block/index.ts +59 -0
- package/src/feature/image-block/style.css +215 -0
- package/src/feature/index.ts +66 -0
- package/src/feature/link-tooltip/consts.ts +47 -0
- package/src/feature/link-tooltip/index.ts +22 -0
- package/src/feature/link-tooltip/style.css +107 -0
- package/src/feature/list-item/consts.ts +15 -0
- package/src/feature/list-item/index.ts +30 -0
- package/src/feature/list-item/style.css +23 -0
- package/src/feature/placeholder/index.ts +87 -0
- package/src/feature/placeholder/style.css +9 -0
- package/src/feature/shared.ts +4 -0
- package/src/feature/toolbar/component.ts +101 -0
- package/src/feature/toolbar/consts.ts +26 -0
- package/src/feature/toolbar/index.ts +92 -0
- package/src/feature/toolbar/style.css +37 -0
- package/src/index.ts +5 -0
- package/src/theme/classic/index.ts +12 -0
- package/src/theme/classic/style.css +192 -0
- package/src/theme/classic-dark/index.ts +12 -0
- package/src/theme/classic-dark/style.css +197 -0
- package/src/theme/headless/index.ts +9 -0
- package/src/theme/index.ts +26 -0
- package/src/theme/shared.ts +4 -0
- package/src/utils/index.ts +12 -0
- package/src/vite-env.d.ts +2 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
var h = {
|
|
2
|
+
break: !0,
|
|
3
|
+
case: !0,
|
|
4
|
+
chan: !0,
|
|
5
|
+
const: !0,
|
|
6
|
+
continue: !0,
|
|
7
|
+
default: !0,
|
|
8
|
+
defer: !0,
|
|
9
|
+
else: !0,
|
|
10
|
+
fallthrough: !0,
|
|
11
|
+
for: !0,
|
|
12
|
+
func: !0,
|
|
13
|
+
go: !0,
|
|
14
|
+
goto: !0,
|
|
15
|
+
if: !0,
|
|
16
|
+
import: !0,
|
|
17
|
+
interface: !0,
|
|
18
|
+
map: !0,
|
|
19
|
+
package: !0,
|
|
20
|
+
range: !0,
|
|
21
|
+
return: !0,
|
|
22
|
+
select: !0,
|
|
23
|
+
struct: !0,
|
|
24
|
+
switch: !0,
|
|
25
|
+
type: !0,
|
|
26
|
+
var: !0,
|
|
27
|
+
bool: !0,
|
|
28
|
+
byte: !0,
|
|
29
|
+
complex64: !0,
|
|
30
|
+
complex128: !0,
|
|
31
|
+
float32: !0,
|
|
32
|
+
float64: !0,
|
|
33
|
+
int8: !0,
|
|
34
|
+
int16: !0,
|
|
35
|
+
int32: !0,
|
|
36
|
+
int64: !0,
|
|
37
|
+
string: !0,
|
|
38
|
+
uint8: !0,
|
|
39
|
+
uint16: !0,
|
|
40
|
+
uint32: !0,
|
|
41
|
+
uint64: !0,
|
|
42
|
+
int: !0,
|
|
43
|
+
uint: !0,
|
|
44
|
+
uintptr: !0,
|
|
45
|
+
error: !0,
|
|
46
|
+
rune: !0,
|
|
47
|
+
any: !0,
|
|
48
|
+
comparable: !0
|
|
49
|
+
}, k = {
|
|
50
|
+
true: !0,
|
|
51
|
+
false: !0,
|
|
52
|
+
iota: !0,
|
|
53
|
+
nil: !0,
|
|
54
|
+
append: !0,
|
|
55
|
+
cap: !0,
|
|
56
|
+
close: !0,
|
|
57
|
+
complex: !0,
|
|
58
|
+
copy: !0,
|
|
59
|
+
delete: !0,
|
|
60
|
+
imag: !0,
|
|
61
|
+
len: !0,
|
|
62
|
+
make: !0,
|
|
63
|
+
new: !0,
|
|
64
|
+
panic: !0,
|
|
65
|
+
print: !0,
|
|
66
|
+
println: !0,
|
|
67
|
+
real: !0,
|
|
68
|
+
recover: !0
|
|
69
|
+
}, f = /[+\-*&^%:=<>!|\/]/, u;
|
|
70
|
+
function l(e, t) {
|
|
71
|
+
var n = e.next();
|
|
72
|
+
if (n == '"' || n == "'" || n == "`")
|
|
73
|
+
return t.tokenize = x(n), t.tokenize(e, t);
|
|
74
|
+
if (/[\d\.]/.test(n))
|
|
75
|
+
return n == "." ? e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/) : n == "0" ? e.match(/^[xX][0-9a-fA-F]+/) || e.match(/^0[0-7]+/) : e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/), "number";
|
|
76
|
+
if (/[\[\]{}\(\),;\:\.]/.test(n))
|
|
77
|
+
return u = n, null;
|
|
78
|
+
if (n == "/") {
|
|
79
|
+
if (e.eat("*"))
|
|
80
|
+
return t.tokenize = a, a(e, t);
|
|
81
|
+
if (e.eat("/"))
|
|
82
|
+
return e.skipToEnd(), "comment";
|
|
83
|
+
}
|
|
84
|
+
if (f.test(n))
|
|
85
|
+
return e.eatWhile(f), "operator";
|
|
86
|
+
e.eatWhile(/[\w\$_\xa1-\uffff]/);
|
|
87
|
+
var r = e.current();
|
|
88
|
+
return h.propertyIsEnumerable(r) ? ((r == "case" || r == "default") && (u = "case"), "keyword") : k.propertyIsEnumerable(r) ? "atom" : "variable";
|
|
89
|
+
}
|
|
90
|
+
function x(e) {
|
|
91
|
+
return function(t, n) {
|
|
92
|
+
for (var r = !1, i, o = !1; (i = t.next()) != null; ) {
|
|
93
|
+
if (i == e && !r) {
|
|
94
|
+
o = !0;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
r = !r && e != "`" && i == "\\";
|
|
98
|
+
}
|
|
99
|
+
return (o || !(r || e == "`")) && (n.tokenize = l), "string";
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function a(e, t) {
|
|
103
|
+
for (var n = !1, r; r = e.next(); ) {
|
|
104
|
+
if (r == "/" && n) {
|
|
105
|
+
t.tokenize = l;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
n = r == "*";
|
|
109
|
+
}
|
|
110
|
+
return "comment";
|
|
111
|
+
}
|
|
112
|
+
function d(e, t, n, r, i) {
|
|
113
|
+
this.indented = e, this.column = t, this.type = n, this.align = r, this.prev = i;
|
|
114
|
+
}
|
|
115
|
+
function c(e, t, n) {
|
|
116
|
+
return e.context = new d(e.indented, t, n, null, e.context);
|
|
117
|
+
}
|
|
118
|
+
function p(e) {
|
|
119
|
+
if (e.context.prev) {
|
|
120
|
+
var t = e.context.type;
|
|
121
|
+
return (t == ")" || t == "]" || t == "}") && (e.indented = e.context.indented), e.context = e.context.prev;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const s = {
|
|
125
|
+
name: "go",
|
|
126
|
+
startState: function(e) {
|
|
127
|
+
return {
|
|
128
|
+
tokenize: null,
|
|
129
|
+
context: new d(-e, 0, "top", !1),
|
|
130
|
+
indented: 0,
|
|
131
|
+
startOfLine: !0
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
token: function(e, t) {
|
|
135
|
+
var n = t.context;
|
|
136
|
+
if (e.sol() && (n.align == null && (n.align = !1), t.indented = e.indentation(), t.startOfLine = !0, n.type == "case" && (n.type = "}")), e.eatSpace())
|
|
137
|
+
return null;
|
|
138
|
+
u = null;
|
|
139
|
+
var r = (t.tokenize || l)(e, t);
|
|
140
|
+
return r == "comment" || (n.align == null && (n.align = !0), u == "{" ? c(t, e.column(), "}") : u == "[" ? c(t, e.column(), "]") : u == "(" ? c(t, e.column(), ")") : u == "case" ? n.type = "case" : (u == "}" && n.type == "}" || u == n.type) && p(t), t.startOfLine = !1), r;
|
|
141
|
+
},
|
|
142
|
+
indent: function(e, t, n) {
|
|
143
|
+
if (e.tokenize != l && e.tokenize != null)
|
|
144
|
+
return null;
|
|
145
|
+
var r = e.context, i = t && t.charAt(0);
|
|
146
|
+
if (r.type == "case" && /^(?:case|default)\b/.test(t))
|
|
147
|
+
return r.indented;
|
|
148
|
+
var o = i == r.type;
|
|
149
|
+
return r.align ? r.column + (o ? 0 : 1) : r.indented + (o ? 0 : n.unit);
|
|
150
|
+
},
|
|
151
|
+
languageData: {
|
|
152
|
+
indentOnInput: /^\s([{}]|case |default\s*:)$/,
|
|
153
|
+
commentTokens: { line: "//", block: { open: "/*", close: "*/" } }
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
export {
|
|
157
|
+
s as go
|
|
158
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
function a(e) {
|
|
2
|
+
for (var n = {}, t = e.split(" "), i = 0; i < t.length; ++i)
|
|
3
|
+
n[t[i]] = !0;
|
|
4
|
+
return n;
|
|
5
|
+
}
|
|
6
|
+
var b = a(
|
|
7
|
+
"abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws trait transient try void volatile while"
|
|
8
|
+
), g = a("catch class def do else enum finally for if interface switch trait try while"), x = a("return break continue"), z = a("null true false this"), r;
|
|
9
|
+
function k(e, n) {
|
|
10
|
+
var t = e.next();
|
|
11
|
+
if (t == '"' || t == "'")
|
|
12
|
+
return y(t, e, n);
|
|
13
|
+
if (/[\[\]{}\(\),;\:\.]/.test(t))
|
|
14
|
+
return r = t, null;
|
|
15
|
+
if (/\d/.test(t))
|
|
16
|
+
return e.eatWhile(/[\w\.]/), e.eat(/eE/) && (e.eat(/\+\-/), e.eatWhile(/\d/)), "number";
|
|
17
|
+
if (t == "/") {
|
|
18
|
+
if (e.eat("*"))
|
|
19
|
+
return n.tokenize.push(v), v(e, n);
|
|
20
|
+
if (e.eat("/"))
|
|
21
|
+
return e.skipToEnd(), "comment";
|
|
22
|
+
if (h(n.lastToken, !1))
|
|
23
|
+
return y(t, e, n);
|
|
24
|
+
}
|
|
25
|
+
if (t == "-" && e.eat(">"))
|
|
26
|
+
return r = "->", null;
|
|
27
|
+
if (/[+\-*&%=<>!?|\/~]/.test(t))
|
|
28
|
+
return e.eatWhile(/[+\-*&%=<>|~]/), "operator";
|
|
29
|
+
if (e.eatWhile(/[\w\$_]/), t == "@")
|
|
30
|
+
return e.eatWhile(/[\w\$_\.]/), "meta";
|
|
31
|
+
if (n.lastToken == ".")
|
|
32
|
+
return "property";
|
|
33
|
+
if (e.eat(":"))
|
|
34
|
+
return r = "proplabel", "property";
|
|
35
|
+
var i = e.current();
|
|
36
|
+
return z.propertyIsEnumerable(i) ? "atom" : b.propertyIsEnumerable(i) ? (g.propertyIsEnumerable(i) ? r = "newstatement" : x.propertyIsEnumerable(i) && (r = "standalone"), "keyword") : "variable";
|
|
37
|
+
}
|
|
38
|
+
k.isBase = !0;
|
|
39
|
+
function y(e, n, t) {
|
|
40
|
+
var i = !1;
|
|
41
|
+
if (e != "/" && n.eat(e))
|
|
42
|
+
if (n.eat(e))
|
|
43
|
+
i = !0;
|
|
44
|
+
else
|
|
45
|
+
return "string";
|
|
46
|
+
function o(l, d) {
|
|
47
|
+
for (var f = !1, c, s = !i; (c = l.next()) != null; ) {
|
|
48
|
+
if (c == e && !f) {
|
|
49
|
+
if (!i)
|
|
50
|
+
break;
|
|
51
|
+
if (l.match(e + e)) {
|
|
52
|
+
s = !0;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (e == '"' && c == "$" && !f) {
|
|
57
|
+
if (l.eat("{"))
|
|
58
|
+
return d.tokenize.push(m()), "string";
|
|
59
|
+
if (l.match(/^\w/, !1))
|
|
60
|
+
return d.tokenize.push(E), "string";
|
|
61
|
+
}
|
|
62
|
+
f = !f && c == "\\";
|
|
63
|
+
}
|
|
64
|
+
return s && d.tokenize.pop(), "string";
|
|
65
|
+
}
|
|
66
|
+
return t.tokenize.push(o), o(n, t);
|
|
67
|
+
}
|
|
68
|
+
function m() {
|
|
69
|
+
var e = 1;
|
|
70
|
+
function n(t, i) {
|
|
71
|
+
if (t.peek() == "}") {
|
|
72
|
+
if (e--, e == 0)
|
|
73
|
+
return i.tokenize.pop(), i.tokenize[i.tokenize.length - 1](t, i);
|
|
74
|
+
} else
|
|
75
|
+
t.peek() == "{" && e++;
|
|
76
|
+
return k(t, i);
|
|
77
|
+
}
|
|
78
|
+
return n.isBase = !0, n;
|
|
79
|
+
}
|
|
80
|
+
function E(e, n) {
|
|
81
|
+
var t = e.match(/^(\.|[\w\$_]+)/);
|
|
82
|
+
return t ? t[0] == "." ? null : "variable" : (n.tokenize.pop(), n.tokenize[n.tokenize.length - 1](e, n));
|
|
83
|
+
}
|
|
84
|
+
function v(e, n) {
|
|
85
|
+
for (var t = !1, i; i = e.next(); ) {
|
|
86
|
+
if (i == "/" && t) {
|
|
87
|
+
n.tokenize.pop();
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
t = i == "*";
|
|
91
|
+
}
|
|
92
|
+
return "comment";
|
|
93
|
+
}
|
|
94
|
+
function h(e, n) {
|
|
95
|
+
return !e || e == "operator" || e == "->" || /[\.\[\{\(,;:]/.test(e) || e == "newstatement" || e == "keyword" || e == "proplabel" || e == "standalone" && !n;
|
|
96
|
+
}
|
|
97
|
+
function w(e, n, t, i, o) {
|
|
98
|
+
this.indented = e, this.column = n, this.type = t, this.align = i, this.prev = o;
|
|
99
|
+
}
|
|
100
|
+
function p(e, n, t) {
|
|
101
|
+
return e.context = new w(e.indented, n, t, null, e.context);
|
|
102
|
+
}
|
|
103
|
+
function u(e) {
|
|
104
|
+
var n = e.context.type;
|
|
105
|
+
return (n == ")" || n == "]" || n == "}") && (e.indented = e.context.indented), e.context = e.context.prev;
|
|
106
|
+
}
|
|
107
|
+
const T = {
|
|
108
|
+
name: "groovy",
|
|
109
|
+
startState: function(e) {
|
|
110
|
+
return {
|
|
111
|
+
tokenize: [k],
|
|
112
|
+
context: new w(-e, 0, "top", !1),
|
|
113
|
+
indented: 0,
|
|
114
|
+
startOfLine: !0,
|
|
115
|
+
lastToken: null
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
token: function(e, n) {
|
|
119
|
+
var t = n.context;
|
|
120
|
+
if (e.sol() && (t.align == null && (t.align = !1), n.indented = e.indentation(), n.startOfLine = !0, t.type == "statement" && !h(n.lastToken, !0) && (u(n), t = n.context)), e.eatSpace())
|
|
121
|
+
return null;
|
|
122
|
+
r = null;
|
|
123
|
+
var i = n.tokenize[n.tokenize.length - 1](e, n);
|
|
124
|
+
if (i == "comment")
|
|
125
|
+
return i;
|
|
126
|
+
if (t.align == null && (t.align = !0), (r == ";" || r == ":") && t.type == "statement")
|
|
127
|
+
u(n);
|
|
128
|
+
else if (r == "->" && t.type == "statement" && t.prev.type == "}")
|
|
129
|
+
u(n), n.context.align = !1;
|
|
130
|
+
else if (r == "{")
|
|
131
|
+
p(n, e.column(), "}");
|
|
132
|
+
else if (r == "[")
|
|
133
|
+
p(n, e.column(), "]");
|
|
134
|
+
else if (r == "(")
|
|
135
|
+
p(n, e.column(), ")");
|
|
136
|
+
else if (r == "}") {
|
|
137
|
+
for (; t.type == "statement"; )
|
|
138
|
+
t = u(n);
|
|
139
|
+
for (t.type == "}" && (t = u(n)); t.type == "statement"; )
|
|
140
|
+
t = u(n);
|
|
141
|
+
} else
|
|
142
|
+
r == t.type ? u(n) : (t.type == "}" || t.type == "top" || t.type == "statement" && r == "newstatement") && p(n, e.column(), "statement");
|
|
143
|
+
return n.startOfLine = !1, n.lastToken = r || i, i;
|
|
144
|
+
},
|
|
145
|
+
indent: function(e, n, t) {
|
|
146
|
+
if (!e.tokenize[e.tokenize.length - 1].isBase)
|
|
147
|
+
return null;
|
|
148
|
+
var i = n && n.charAt(0), o = e.context;
|
|
149
|
+
o.type == "statement" && !h(e.lastToken, !0) && (o = o.prev);
|
|
150
|
+
var l = i == o.type;
|
|
151
|
+
return o.type == "statement" ? o.indented + (i == "{" ? 0 : t.unit) : o.align ? o.column + (l ? 0 : 1) : o.indented + (l ? 0 : t.unit);
|
|
152
|
+
},
|
|
153
|
+
languageData: {
|
|
154
|
+
indentOnInput: /^\s*[{}]$/,
|
|
155
|
+
commentTokens: { line: "//", block: { open: "/*", close: "*/" } },
|
|
156
|
+
closeBrackets: { brackets: ["(", "[", "{", "'", '"', "'''", '"""'] }
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
T as groovy
|
|
161
|
+
};
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
function f(e, n, t) {
|
|
2
|
+
return n(t), t(e, n);
|
|
3
|
+
}
|
|
4
|
+
var g = /[a-z_]/, c = /[A-Z]/, l = /\d/, v = /[0-9A-Fa-f]/, w = /[0-7]/, d = /[a-z_A-Z0-9'\xa1-\uffff]/, o = /[-!#$%&*+.\/<=>?@\\^|~:]/, E = /[(),;[\]`{}]/, h = /[ \t\v\f]/;
|
|
5
|
+
function i(e, n) {
|
|
6
|
+
if (e.eatWhile(h))
|
|
7
|
+
return null;
|
|
8
|
+
var t = e.next();
|
|
9
|
+
if (E.test(t)) {
|
|
10
|
+
if (t == "{" && e.eat("-")) {
|
|
11
|
+
var r = "comment";
|
|
12
|
+
return e.eat("#") && (r = "meta"), f(e, n, s(r, 1));
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
if (t == "'")
|
|
17
|
+
return e.eat("\\"), e.next(), e.eat("'") ? "string" : "error";
|
|
18
|
+
if (t == '"')
|
|
19
|
+
return f(e, n, p);
|
|
20
|
+
if (c.test(t))
|
|
21
|
+
return e.eatWhile(d), e.eat(".") ? "qualifier" : "type";
|
|
22
|
+
if (g.test(t))
|
|
23
|
+
return e.eatWhile(d), "variable";
|
|
24
|
+
if (l.test(t)) {
|
|
25
|
+
if (t == "0") {
|
|
26
|
+
if (e.eat(/[xX]/))
|
|
27
|
+
return e.eatWhile(v), "integer";
|
|
28
|
+
if (e.eat(/[oO]/))
|
|
29
|
+
return e.eatWhile(w), "number";
|
|
30
|
+
}
|
|
31
|
+
e.eatWhile(l);
|
|
32
|
+
var r = "number";
|
|
33
|
+
return e.match(/^\.\d+/) && (r = "number"), e.eat(/[eE]/) && (r = "number", e.eat(/[-+]/), e.eatWhile(l)), r;
|
|
34
|
+
}
|
|
35
|
+
return t == "." && e.eat(".") ? "keyword" : o.test(t) ? t == "-" && e.eat(/-/) && (e.eatWhile(/-/), !e.eat(o)) ? (e.skipToEnd(), "comment") : (e.eatWhile(o), "variable") : "error";
|
|
36
|
+
}
|
|
37
|
+
function s(e, n) {
|
|
38
|
+
return n == 0 ? i : function(t, r) {
|
|
39
|
+
for (var a = n; !t.eol(); ) {
|
|
40
|
+
var u = t.next();
|
|
41
|
+
if (u == "{" && t.eat("-"))
|
|
42
|
+
++a;
|
|
43
|
+
else if (u == "-" && t.eat("}") && (--a, a == 0))
|
|
44
|
+
return r(i), e;
|
|
45
|
+
}
|
|
46
|
+
return r(s(e, a)), e;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function p(e, n) {
|
|
50
|
+
for (; !e.eol(); ) {
|
|
51
|
+
var t = e.next();
|
|
52
|
+
if (t == '"')
|
|
53
|
+
return n(i), "string";
|
|
54
|
+
if (t == "\\") {
|
|
55
|
+
if (e.eol() || e.eat(h))
|
|
56
|
+
return n(x), "string";
|
|
57
|
+
e.eat("&") || e.next();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return n(i), "error";
|
|
61
|
+
}
|
|
62
|
+
function x(e, n) {
|
|
63
|
+
return e.eat("\\") ? f(e, n, p) : (e.next(), n(i), "error");
|
|
64
|
+
}
|
|
65
|
+
var m = function() {
|
|
66
|
+
var e = {};
|
|
67
|
+
function n(t) {
|
|
68
|
+
return function() {
|
|
69
|
+
for (var r = 0; r < arguments.length; r++)
|
|
70
|
+
e[arguments[r]] = t;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return n("keyword")(
|
|
74
|
+
"case",
|
|
75
|
+
"class",
|
|
76
|
+
"data",
|
|
77
|
+
"default",
|
|
78
|
+
"deriving",
|
|
79
|
+
"do",
|
|
80
|
+
"else",
|
|
81
|
+
"foreign",
|
|
82
|
+
"if",
|
|
83
|
+
"import",
|
|
84
|
+
"in",
|
|
85
|
+
"infix",
|
|
86
|
+
"infixl",
|
|
87
|
+
"infixr",
|
|
88
|
+
"instance",
|
|
89
|
+
"let",
|
|
90
|
+
"module",
|
|
91
|
+
"newtype",
|
|
92
|
+
"of",
|
|
93
|
+
"then",
|
|
94
|
+
"type",
|
|
95
|
+
"where",
|
|
96
|
+
"_"
|
|
97
|
+
), n("keyword")(
|
|
98
|
+
"..",
|
|
99
|
+
":",
|
|
100
|
+
"::",
|
|
101
|
+
"=",
|
|
102
|
+
"\\",
|
|
103
|
+
"<-",
|
|
104
|
+
"->",
|
|
105
|
+
"@",
|
|
106
|
+
"~",
|
|
107
|
+
"=>"
|
|
108
|
+
), n("builtin")(
|
|
109
|
+
"!!",
|
|
110
|
+
"$!",
|
|
111
|
+
"$",
|
|
112
|
+
"&&",
|
|
113
|
+
"+",
|
|
114
|
+
"++",
|
|
115
|
+
"-",
|
|
116
|
+
".",
|
|
117
|
+
"/",
|
|
118
|
+
"/=",
|
|
119
|
+
"<",
|
|
120
|
+
"<*",
|
|
121
|
+
"<=",
|
|
122
|
+
"<$>",
|
|
123
|
+
"<*>",
|
|
124
|
+
"=<<",
|
|
125
|
+
"==",
|
|
126
|
+
">",
|
|
127
|
+
">=",
|
|
128
|
+
">>",
|
|
129
|
+
">>=",
|
|
130
|
+
"^",
|
|
131
|
+
"^^",
|
|
132
|
+
"||",
|
|
133
|
+
"*",
|
|
134
|
+
"*>",
|
|
135
|
+
"**"
|
|
136
|
+
), n("builtin")(
|
|
137
|
+
"Applicative",
|
|
138
|
+
"Bool",
|
|
139
|
+
"Bounded",
|
|
140
|
+
"Char",
|
|
141
|
+
"Double",
|
|
142
|
+
"EQ",
|
|
143
|
+
"Either",
|
|
144
|
+
"Enum",
|
|
145
|
+
"Eq",
|
|
146
|
+
"False",
|
|
147
|
+
"FilePath",
|
|
148
|
+
"Float",
|
|
149
|
+
"Floating",
|
|
150
|
+
"Fractional",
|
|
151
|
+
"Functor",
|
|
152
|
+
"GT",
|
|
153
|
+
"IO",
|
|
154
|
+
"IOError",
|
|
155
|
+
"Int",
|
|
156
|
+
"Integer",
|
|
157
|
+
"Integral",
|
|
158
|
+
"Just",
|
|
159
|
+
"LT",
|
|
160
|
+
"Left",
|
|
161
|
+
"Maybe",
|
|
162
|
+
"Monad",
|
|
163
|
+
"Nothing",
|
|
164
|
+
"Num",
|
|
165
|
+
"Ord",
|
|
166
|
+
"Ordering",
|
|
167
|
+
"Rational",
|
|
168
|
+
"Read",
|
|
169
|
+
"ReadS",
|
|
170
|
+
"Real",
|
|
171
|
+
"RealFloat",
|
|
172
|
+
"RealFrac",
|
|
173
|
+
"Right",
|
|
174
|
+
"Show",
|
|
175
|
+
"ShowS",
|
|
176
|
+
"String",
|
|
177
|
+
"True"
|
|
178
|
+
), n("builtin")(
|
|
179
|
+
"abs",
|
|
180
|
+
"acos",
|
|
181
|
+
"acosh",
|
|
182
|
+
"all",
|
|
183
|
+
"and",
|
|
184
|
+
"any",
|
|
185
|
+
"appendFile",
|
|
186
|
+
"asTypeOf",
|
|
187
|
+
"asin",
|
|
188
|
+
"asinh",
|
|
189
|
+
"atan",
|
|
190
|
+
"atan2",
|
|
191
|
+
"atanh",
|
|
192
|
+
"break",
|
|
193
|
+
"catch",
|
|
194
|
+
"ceiling",
|
|
195
|
+
"compare",
|
|
196
|
+
"concat",
|
|
197
|
+
"concatMap",
|
|
198
|
+
"const",
|
|
199
|
+
"cos",
|
|
200
|
+
"cosh",
|
|
201
|
+
"curry",
|
|
202
|
+
"cycle",
|
|
203
|
+
"decodeFloat",
|
|
204
|
+
"div",
|
|
205
|
+
"divMod",
|
|
206
|
+
"drop",
|
|
207
|
+
"dropWhile",
|
|
208
|
+
"either",
|
|
209
|
+
"elem",
|
|
210
|
+
"encodeFloat",
|
|
211
|
+
"enumFrom",
|
|
212
|
+
"enumFromThen",
|
|
213
|
+
"enumFromThenTo",
|
|
214
|
+
"enumFromTo",
|
|
215
|
+
"error",
|
|
216
|
+
"even",
|
|
217
|
+
"exp",
|
|
218
|
+
"exponent",
|
|
219
|
+
"fail",
|
|
220
|
+
"filter",
|
|
221
|
+
"flip",
|
|
222
|
+
"floatDigits",
|
|
223
|
+
"floatRadix",
|
|
224
|
+
"floatRange",
|
|
225
|
+
"floor",
|
|
226
|
+
"fmap",
|
|
227
|
+
"foldl",
|
|
228
|
+
"foldl1",
|
|
229
|
+
"foldr",
|
|
230
|
+
"foldr1",
|
|
231
|
+
"fromEnum",
|
|
232
|
+
"fromInteger",
|
|
233
|
+
"fromIntegral",
|
|
234
|
+
"fromRational",
|
|
235
|
+
"fst",
|
|
236
|
+
"gcd",
|
|
237
|
+
"getChar",
|
|
238
|
+
"getContents",
|
|
239
|
+
"getLine",
|
|
240
|
+
"head",
|
|
241
|
+
"id",
|
|
242
|
+
"init",
|
|
243
|
+
"interact",
|
|
244
|
+
"ioError",
|
|
245
|
+
"isDenormalized",
|
|
246
|
+
"isIEEE",
|
|
247
|
+
"isInfinite",
|
|
248
|
+
"isNaN",
|
|
249
|
+
"isNegativeZero",
|
|
250
|
+
"iterate",
|
|
251
|
+
"last",
|
|
252
|
+
"lcm",
|
|
253
|
+
"length",
|
|
254
|
+
"lex",
|
|
255
|
+
"lines",
|
|
256
|
+
"log",
|
|
257
|
+
"logBase",
|
|
258
|
+
"lookup",
|
|
259
|
+
"map",
|
|
260
|
+
"mapM",
|
|
261
|
+
"mapM_",
|
|
262
|
+
"max",
|
|
263
|
+
"maxBound",
|
|
264
|
+
"maximum",
|
|
265
|
+
"maybe",
|
|
266
|
+
"min",
|
|
267
|
+
"minBound",
|
|
268
|
+
"minimum",
|
|
269
|
+
"mod",
|
|
270
|
+
"negate",
|
|
271
|
+
"not",
|
|
272
|
+
"notElem",
|
|
273
|
+
"null",
|
|
274
|
+
"odd",
|
|
275
|
+
"or",
|
|
276
|
+
"otherwise",
|
|
277
|
+
"pi",
|
|
278
|
+
"pred",
|
|
279
|
+
"print",
|
|
280
|
+
"product",
|
|
281
|
+
"properFraction",
|
|
282
|
+
"pure",
|
|
283
|
+
"putChar",
|
|
284
|
+
"putStr",
|
|
285
|
+
"putStrLn",
|
|
286
|
+
"quot",
|
|
287
|
+
"quotRem",
|
|
288
|
+
"read",
|
|
289
|
+
"readFile",
|
|
290
|
+
"readIO",
|
|
291
|
+
"readList",
|
|
292
|
+
"readLn",
|
|
293
|
+
"readParen",
|
|
294
|
+
"reads",
|
|
295
|
+
"readsPrec",
|
|
296
|
+
"realToFrac",
|
|
297
|
+
"recip",
|
|
298
|
+
"rem",
|
|
299
|
+
"repeat",
|
|
300
|
+
"replicate",
|
|
301
|
+
"return",
|
|
302
|
+
"reverse",
|
|
303
|
+
"round",
|
|
304
|
+
"scaleFloat",
|
|
305
|
+
"scanl",
|
|
306
|
+
"scanl1",
|
|
307
|
+
"scanr",
|
|
308
|
+
"scanr1",
|
|
309
|
+
"seq",
|
|
310
|
+
"sequence",
|
|
311
|
+
"sequence_",
|
|
312
|
+
"show",
|
|
313
|
+
"showChar",
|
|
314
|
+
"showList",
|
|
315
|
+
"showParen",
|
|
316
|
+
"showString",
|
|
317
|
+
"shows",
|
|
318
|
+
"showsPrec",
|
|
319
|
+
"significand",
|
|
320
|
+
"signum",
|
|
321
|
+
"sin",
|
|
322
|
+
"sinh",
|
|
323
|
+
"snd",
|
|
324
|
+
"span",
|
|
325
|
+
"splitAt",
|
|
326
|
+
"sqrt",
|
|
327
|
+
"subtract",
|
|
328
|
+
"succ",
|
|
329
|
+
"sum",
|
|
330
|
+
"tail",
|
|
331
|
+
"take",
|
|
332
|
+
"takeWhile",
|
|
333
|
+
"tan",
|
|
334
|
+
"tanh",
|
|
335
|
+
"toEnum",
|
|
336
|
+
"toInteger",
|
|
337
|
+
"toRational",
|
|
338
|
+
"truncate",
|
|
339
|
+
"uncurry",
|
|
340
|
+
"undefined",
|
|
341
|
+
"unlines",
|
|
342
|
+
"until",
|
|
343
|
+
"unwords",
|
|
344
|
+
"unzip",
|
|
345
|
+
"unzip3",
|
|
346
|
+
"userError",
|
|
347
|
+
"words",
|
|
348
|
+
"writeFile",
|
|
349
|
+
"zip",
|
|
350
|
+
"zip3",
|
|
351
|
+
"zipWith",
|
|
352
|
+
"zipWith3"
|
|
353
|
+
), e;
|
|
354
|
+
}();
|
|
355
|
+
const F = {
|
|
356
|
+
name: "haskell",
|
|
357
|
+
startState: function() {
|
|
358
|
+
return { f: i };
|
|
359
|
+
},
|
|
360
|
+
copyState: function(e) {
|
|
361
|
+
return { f: e.f };
|
|
362
|
+
},
|
|
363
|
+
token: function(e, n) {
|
|
364
|
+
var t = n.f(e, function(a) {
|
|
365
|
+
n.f = a;
|
|
366
|
+
}), r = e.current();
|
|
367
|
+
return m.hasOwnProperty(r) ? m[r] : t;
|
|
368
|
+
},
|
|
369
|
+
languageData: {
|
|
370
|
+
commentTokens: { line: "--", block: { open: "{-", close: "-}" } }
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
export {
|
|
374
|
+
F as haskell
|
|
375
|
+
};
|