comarkserv 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +389 -0
- package/dist/THIRD_PARTY_LICENSES.md +932 -0
- package/dist/build-CsToYJrU.mjs +2 -0
- package/dist/build-Cv5aO0CB.mjs +205 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +894 -0
- package/dist/cloudflared-6f_lzz4F.mjs +181 -0
- package/dist/dist-B-IALNns.mjs +2 -0
- package/dist/dist-BK-bpLWg.mjs +2 -0
- package/dist/dist-BQzCbTko.mjs +1693 -0
- package/dist/dist-BWcWG5YB.mjs +671 -0
- package/dist/dist-BiVw4ojz.mjs +592 -0
- package/dist/dist-BnmL9jeq.mjs +538 -0
- package/dist/dist-BtedNLrc.mjs +276 -0
- package/dist/dist-BvdNTrap.mjs +2710 -0
- package/dist/dist-ByijHttv.mjs +69 -0
- package/dist/dist-C2E4zSX1.mjs +347 -0
- package/dist/dist-CWYRQLUT.mjs +2 -0
- package/dist/dist-CXQ7eTfT.mjs +417 -0
- package/dist/dist-CfsjQ0o8.mjs +905 -0
- package/dist/dist-CsTXDvwi.mjs +300 -0
- package/dist/dist-CtONMLh4.mjs +283 -0
- package/dist/dist-DMftjyxU.mjs +370 -0
- package/dist/dist-Dr9uTCX7.mjs +2 -0
- package/dist/dist-Dxvc11TH.mjs +339 -0
- package/dist/dist-GmbcGEAc.mjs +3 -0
- package/dist/dist-V1rkISnf.mjs +220 -0
- package/dist/dist-ZoN94PJ0.mjs +76 -0
- package/dist/dist-fh99cWMN.mjs +524 -0
- package/dist/editor-CHDyOp-8.mjs +721 -0
- package/dist/index.d.mts +301 -0
- package/dist/index.mjs +6 -0
- package/dist/languages-C0kEygG_.mjs +119 -0
- package/dist/markdown-BqKed1Vq.mjs +710 -0
- package/dist/markdown-DWuqfzps.mjs +2 -0
- package/dist/rolldown-runtime-CMFfr-1z.mjs +26 -0
- package/dist/server-Dkjk_D1Y.mjs +2628 -0
- package/dist/terminal-aKr5Xlp3.mjs +169 -0
- package/dist/themes-mEufQ_3e.mjs +2194 -0
- package/dist/twinkleplop.production-Coccf2Q9.mjs +2 -0
- package/dist/twinkleplop.production-DekYmX6O.mjs +4697 -0
- package/dist/twinkleplop.tokens-CgBUTCSg.mjs +76 -0
- package/package.json +133 -0
|
@@ -0,0 +1,671 @@
|
|
|
1
|
+
import { $ as pt, D as Ur, E as Un, F as Zr, G as ge, I as at, K as it, L as bn, M as Xr, O as Vn, S as Qr, V as ei, b as Pn, et as qn, g as Mr, k as Vr, l as Hn, lt as vr, m as Kr, mt as g, n as $n, p as Jr, pt as _, q as jn, s as Gr, tt as qr } from "./twinkleplop.production-DekYmX6O.mjs";
|
|
2
|
+
import { Q as m, ct as s, j as a, nt as o } from "./twinkleplop.tokens-CgBUTCSg.mjs";
|
|
3
|
+
import { B as de, I as _t, J as k, M as W$1, N as X$1, P as Ye, R as bt, U as fe, W as ft, Y as lt, Z as pe, _ as H$1, at as yt, c as A, k as Te$1, l as B$1, m as Ee$1, s as $e$1, u as Be, w as Oe$1, y as Je } from "./dist-BQzCbTko.mjs";
|
|
4
|
+
//#region node_modules/.pnpm/@twinkleplop+typescript@0.1.4/node_modules/@twinkleplop/typescript/dist/index.js
|
|
5
|
+
var N = [
|
|
6
|
+
"type",
|
|
7
|
+
"interface",
|
|
8
|
+
"enum",
|
|
9
|
+
"namespace",
|
|
10
|
+
"module",
|
|
11
|
+
"declare",
|
|
12
|
+
"abstract",
|
|
13
|
+
"readonly",
|
|
14
|
+
"public",
|
|
15
|
+
"private",
|
|
16
|
+
"protected",
|
|
17
|
+
"override",
|
|
18
|
+
"accessor",
|
|
19
|
+
"as",
|
|
20
|
+
"satisfies",
|
|
21
|
+
"keyof",
|
|
22
|
+
"infer",
|
|
23
|
+
"is",
|
|
24
|
+
"using",
|
|
25
|
+
"implements"
|
|
26
|
+
];
|
|
27
|
+
var P = [...de, ...N].filter((e) => !k.includes(e));
|
|
28
|
+
var F = [
|
|
29
|
+
"number",
|
|
30
|
+
"string",
|
|
31
|
+
"boolean",
|
|
32
|
+
"any",
|
|
33
|
+
"never",
|
|
34
|
+
"unknown",
|
|
35
|
+
"object",
|
|
36
|
+
"symbol",
|
|
37
|
+
"bigint"
|
|
38
|
+
];
|
|
39
|
+
var I = (e) => Xr(A, a, Jr(e));
|
|
40
|
+
var L = (e, t) => [
|
|
41
|
+
Qr(k, Jr(e)),
|
|
42
|
+
Qr(P, Jr(t)),
|
|
43
|
+
Qr(pe, Jr(t)),
|
|
44
|
+
Qr(fe, Jr(t), "boolean")
|
|
45
|
+
];
|
|
46
|
+
var R = g({
|
|
47
|
+
name: "typescript",
|
|
48
|
+
states: {
|
|
49
|
+
...Oe$1.states,
|
|
50
|
+
decorator: { rules: [Xr([
|
|
51
|
+
"_",
|
|
52
|
+
"$",
|
|
53
|
+
".",
|
|
54
|
+
Ur
|
|
55
|
+
], m), ei(qr())] },
|
|
56
|
+
function_body: Te$1(L("regex_allow", "division")),
|
|
57
|
+
paren_group: Ee$1(L(null, null)),
|
|
58
|
+
regex_allow: { rules: [
|
|
59
|
+
...B$1,
|
|
60
|
+
I(null),
|
|
61
|
+
...L(null, "division"),
|
|
62
|
+
Xr("@", m, Gr("decorator")),
|
|
63
|
+
Xr("/", s, Gr("regex_pattern")),
|
|
64
|
+
Xr([
|
|
65
|
+
"(",
|
|
66
|
+
"{",
|
|
67
|
+
"["
|
|
68
|
+
], o),
|
|
69
|
+
Xr([
|
|
70
|
+
")",
|
|
71
|
+
"}",
|
|
72
|
+
"]"
|
|
73
|
+
], o, Kr("division")),
|
|
74
|
+
...W$1("member_access"),
|
|
75
|
+
Xr([
|
|
76
|
+
";",
|
|
77
|
+
",",
|
|
78
|
+
":"
|
|
79
|
+
], o),
|
|
80
|
+
Zr([
|
|
81
|
+
"_",
|
|
82
|
+
"$",
|
|
83
|
+
Vr
|
|
84
|
+
], Kr("identifier_probe"))
|
|
85
|
+
] },
|
|
86
|
+
division: { rules: [
|
|
87
|
+
...B$1,
|
|
88
|
+
I("regex_allow"),
|
|
89
|
+
...L("regex_allow", null),
|
|
90
|
+
Xr("@", m, Gr("decorator")),
|
|
91
|
+
Xr([
|
|
92
|
+
"(",
|
|
93
|
+
"{",
|
|
94
|
+
"["
|
|
95
|
+
], o, Kr("regex_allow")),
|
|
96
|
+
Xr("/", a, Kr("regex_allow")),
|
|
97
|
+
Xr([
|
|
98
|
+
")",
|
|
99
|
+
"}",
|
|
100
|
+
"]"
|
|
101
|
+
], o),
|
|
102
|
+
Xr([
|
|
103
|
+
";",
|
|
104
|
+
",",
|
|
105
|
+
":"
|
|
106
|
+
], o, Kr("regex_allow")),
|
|
107
|
+
...W$1("member_access"),
|
|
108
|
+
Zr([
|
|
109
|
+
"_",
|
|
110
|
+
"$",
|
|
111
|
+
Vr
|
|
112
|
+
], Kr("identifier_probe"))
|
|
113
|
+
] },
|
|
114
|
+
tmpl_regex_allow: { rules: [
|
|
115
|
+
...H$1,
|
|
116
|
+
I(null),
|
|
117
|
+
...L(null, "tmpl_division"),
|
|
118
|
+
Xr("@", m, Gr("decorator")),
|
|
119
|
+
Xr("}", o, qr()),
|
|
120
|
+
Xr("/", s, Gr("regex_pattern")),
|
|
121
|
+
Xr("{", o, Gr("tmpl_regex_allow")),
|
|
122
|
+
Xr(["(", "["], o),
|
|
123
|
+
Xr([")", "]"], o, Kr("tmpl_division")),
|
|
124
|
+
...W$1("member_access_tmpl"),
|
|
125
|
+
Xr([
|
|
126
|
+
";",
|
|
127
|
+
",",
|
|
128
|
+
":"
|
|
129
|
+
], o),
|
|
130
|
+
Zr([
|
|
131
|
+
"_",
|
|
132
|
+
"$",
|
|
133
|
+
Vr
|
|
134
|
+
], Kr("identifier_probe_tmpl"))
|
|
135
|
+
] },
|
|
136
|
+
tmpl_division: { rules: [
|
|
137
|
+
...H$1,
|
|
138
|
+
I("tmpl_regex_allow"),
|
|
139
|
+
...L("tmpl_regex_allow", null),
|
|
140
|
+
Xr("@", m, Gr("decorator")),
|
|
141
|
+
Xr("}", o, qr()),
|
|
142
|
+
Xr("{", o, Gr("tmpl_regex_allow")),
|
|
143
|
+
Xr(["(", "["], o, Kr("tmpl_regex_allow")),
|
|
144
|
+
Xr("/", a, Kr("tmpl_regex_allow")),
|
|
145
|
+
Xr([")", "]"], o),
|
|
146
|
+
Xr([
|
|
147
|
+
";",
|
|
148
|
+
",",
|
|
149
|
+
":"
|
|
150
|
+
], o, Kr("tmpl_regex_allow")),
|
|
151
|
+
...W$1("member_access_tmpl"),
|
|
152
|
+
Zr([
|
|
153
|
+
"_",
|
|
154
|
+
"$",
|
|
155
|
+
Vr
|
|
156
|
+
], Kr("identifier_probe_tmpl"))
|
|
157
|
+
] }
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
var ye = Mr("identifier", "type", F);
|
|
161
|
+
var z = [
|
|
162
|
+
"if",
|
|
163
|
+
"else",
|
|
164
|
+
"for",
|
|
165
|
+
"while",
|
|
166
|
+
"do",
|
|
167
|
+
"switch",
|
|
168
|
+
"case",
|
|
169
|
+
"break",
|
|
170
|
+
"continue",
|
|
171
|
+
"throw",
|
|
172
|
+
"try",
|
|
173
|
+
"catch",
|
|
174
|
+
"finally",
|
|
175
|
+
"function",
|
|
176
|
+
"class",
|
|
177
|
+
"interface",
|
|
178
|
+
"enum",
|
|
179
|
+
"namespace",
|
|
180
|
+
"module",
|
|
181
|
+
"import",
|
|
182
|
+
"export",
|
|
183
|
+
"return"
|
|
184
|
+
];
|
|
185
|
+
var B = vr({
|
|
186
|
+
...$e$1,
|
|
187
|
+
ternary: {
|
|
188
|
+
qmark: {
|
|
189
|
+
type: "operator",
|
|
190
|
+
text: "?"
|
|
191
|
+
},
|
|
192
|
+
colon_char: ":"
|
|
193
|
+
},
|
|
194
|
+
stmt_flags: [
|
|
195
|
+
{
|
|
196
|
+
name: "var_decl",
|
|
197
|
+
arm: {
|
|
198
|
+
type: "keyword",
|
|
199
|
+
texts: [
|
|
200
|
+
"let",
|
|
201
|
+
"const",
|
|
202
|
+
"var"
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
clear: {
|
|
206
|
+
type: "keyword",
|
|
207
|
+
texts: z
|
|
208
|
+
},
|
|
209
|
+
clear_chars: ";",
|
|
210
|
+
clear_on_brace_close: !0
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "iface_head",
|
|
214
|
+
arm: {
|
|
215
|
+
type: "keyword",
|
|
216
|
+
texts: ["interface"]
|
|
217
|
+
},
|
|
218
|
+
clear: {
|
|
219
|
+
type: "keyword",
|
|
220
|
+
texts: z.filter((e) => e !== "interface")
|
|
221
|
+
},
|
|
222
|
+
clear_chars: ";",
|
|
223
|
+
clear_on_brace_close: !0
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "alias_head",
|
|
227
|
+
arm: {
|
|
228
|
+
type: "keyword",
|
|
229
|
+
texts: ["type"]
|
|
230
|
+
},
|
|
231
|
+
clear: {
|
|
232
|
+
type: "keyword",
|
|
233
|
+
texts: z
|
|
234
|
+
},
|
|
235
|
+
clear_chars: ";",
|
|
236
|
+
clear_on_brace_close: !0
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
});
|
|
240
|
+
var be = (e, t) => {
|
|
241
|
+
let { tokens: n, token_types: r } = t, i = r.indexOf("identifier"), a = r.indexOf("keyword"), o = r.indexOf("punctuation"), s = r.indexOf("operator");
|
|
242
|
+
if (i < 0 || a < 0 || o < 0) return t;
|
|
243
|
+
let c = r.indexOf("type");
|
|
244
|
+
c < 0 && (c = r.length, r.push("type"));
|
|
245
|
+
let l = $n(e, n, r), u = l.count, d = (e) => {
|
|
246
|
+
let t = 0, r = l.text_of(e);
|
|
247
|
+
for (let e of r) e === "{" ? t++ : e === "}" && t--;
|
|
248
|
+
if (t <= 0) return;
|
|
249
|
+
let a = e + 1;
|
|
250
|
+
for (; a < u && t > 0;) {
|
|
251
|
+
if (l.is_trivia(a)) {
|
|
252
|
+
a++;
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
let e = l.kind_of(a), r = l.text_of(a);
|
|
256
|
+
if (e === o) {
|
|
257
|
+
for (let e of r) if (e === "{") t++;
|
|
258
|
+
else if (e === "}" && (t--, t === 0)) break;
|
|
259
|
+
} else e === i && (n[a * 3] = c);
|
|
260
|
+
a++;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
for (let e = 0; e < u; e++) {
|
|
264
|
+
if (l.is_trivia(e) || l.kind_of(e) !== a) continue;
|
|
265
|
+
let t = l.text_of(e);
|
|
266
|
+
if (t === "type") {
|
|
267
|
+
let t = l.prev_non_trivia(e - 1), r = t < 0;
|
|
268
|
+
if (!r && t >= 0) {
|
|
269
|
+
let e = l.kind_of(t), n = l.text_of(t);
|
|
270
|
+
e === o && n.length > 0 && (n[n.length - 1] === ";" || n[n.length - 1] === "}") && (r = !0), e === a && (n === "export" || n === "declare") && (r = !0);
|
|
271
|
+
}
|
|
272
|
+
if (!r) continue;
|
|
273
|
+
let s = l.next_non_trivia(e + 1);
|
|
274
|
+
s >= 0 && l.kind_of(s) === i && (n[s * 3] = c);
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
if (t === "import" || t === "export") {
|
|
278
|
+
let r = l.next_non_trivia(e + 1);
|
|
279
|
+
if (r < 0 || l.kind_of(r) !== a || l.text_of(r) !== "type") continue;
|
|
280
|
+
let u = l.next_non_trivia(r + 1);
|
|
281
|
+
if (u < 0) continue;
|
|
282
|
+
let f = l.kind_of(u), p = l.text_of(u);
|
|
283
|
+
if (f === s && p === "*") continue;
|
|
284
|
+
if (f === o && p.length > 0 && p[0] === "{") {
|
|
285
|
+
d(u);
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
f === i && t === "import" && (n[u * 3] = c);
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return t;
|
|
293
|
+
};
|
|
294
|
+
var xe = /* @__PURE__ */ "+,-,*,/,%,**,==,!=,===,!==,<=,>=,&&,||,??,?.,+=,-=,*=,/=,%=,&=,|=,^=,&&=,||=,??=,<<,>>,>>>,<<=,>>=,>>>=,**=,++,--".split(",");
|
|
295
|
+
var Se = /* @__PURE__ */ "return.if.else.for.while.do.switch.case.break.continue.throw.try.catch.finally.function.class.interface.enum.namespace.module.let.const.var.import.export.type".split(".");
|
|
296
|
+
var V = [
|
|
297
|
+
"this",
|
|
298
|
+
"void",
|
|
299
|
+
"undefined",
|
|
300
|
+
"null",
|
|
301
|
+
"never",
|
|
302
|
+
"unknown",
|
|
303
|
+
"any",
|
|
304
|
+
"object"
|
|
305
|
+
];
|
|
306
|
+
var H = {
|
|
307
|
+
into: "types",
|
|
308
|
+
value_op_terminators: xe,
|
|
309
|
+
stmt_keyword_terminators: Se
|
|
310
|
+
};
|
|
311
|
+
var U = pt(H);
|
|
312
|
+
var W = pt({
|
|
313
|
+
...H,
|
|
314
|
+
brace_exit_on_closer: !0,
|
|
315
|
+
type_terminal_keywords: V
|
|
316
|
+
});
|
|
317
|
+
var G = pt({
|
|
318
|
+
...H,
|
|
319
|
+
exit_on_comma: !1,
|
|
320
|
+
brace_exit_on_closer: !0,
|
|
321
|
+
type_terminal_keywords: V
|
|
322
|
+
});
|
|
323
|
+
var Ce = pt({
|
|
324
|
+
...H,
|
|
325
|
+
exit_on_qmark: !0
|
|
326
|
+
});
|
|
327
|
+
var we = pt({
|
|
328
|
+
...H,
|
|
329
|
+
enter_angle: !0,
|
|
330
|
+
exit_on_comma: !1,
|
|
331
|
+
exit_on_eq: !1,
|
|
332
|
+
verify_generic_args: !0
|
|
333
|
+
});
|
|
334
|
+
var Te = jn([
|
|
335
|
+
{
|
|
336
|
+
anchor: {
|
|
337
|
+
type_name: "punctuation",
|
|
338
|
+
value_ends_with: "):",
|
|
339
|
+
ternary_colon: !1
|
|
340
|
+
},
|
|
341
|
+
when: W,
|
|
342
|
+
rewrite: { types: "type" }
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
anchor: {
|
|
346
|
+
type_name: "punctuation",
|
|
347
|
+
value: ":",
|
|
348
|
+
ternary_colon: !1
|
|
349
|
+
},
|
|
350
|
+
before: it("punctuation", ")"),
|
|
351
|
+
when: W,
|
|
352
|
+
rewrite: { types: "type" }
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
anchor: {
|
|
356
|
+
type_name: "punctuation",
|
|
357
|
+
value_ends_with: ":",
|
|
358
|
+
ternary_colon: !1,
|
|
359
|
+
frame_kinds: ["paren"],
|
|
360
|
+
frame_direct: !0
|
|
361
|
+
},
|
|
362
|
+
when: U,
|
|
363
|
+
rewrite: { types: "type" }
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
anchor: {
|
|
367
|
+
type_name: "punctuation",
|
|
368
|
+
value_ends_with: ":",
|
|
369
|
+
ternary_colon: !1,
|
|
370
|
+
frame_kinds: ["class", "interface"],
|
|
371
|
+
frame_direct: !0
|
|
372
|
+
},
|
|
373
|
+
when: U,
|
|
374
|
+
rewrite: { types: "type" }
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
anchor: {
|
|
378
|
+
type_name: "punctuation",
|
|
379
|
+
value_ends_with: ":",
|
|
380
|
+
ternary_colon: !1,
|
|
381
|
+
frame_kinds: ["top"],
|
|
382
|
+
frame_direct: !0,
|
|
383
|
+
stmt_flags_all: ["var_decl"]
|
|
384
|
+
},
|
|
385
|
+
when: U,
|
|
386
|
+
rewrite: { types: "type" }
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
anchor: {
|
|
390
|
+
type_name: "keyword",
|
|
391
|
+
value: ["as", "satisfies"]
|
|
392
|
+
},
|
|
393
|
+
when: Ce,
|
|
394
|
+
rewrite: { types: "type" }
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
anchor: {
|
|
398
|
+
type_name: "keyword",
|
|
399
|
+
value: "extends",
|
|
400
|
+
stmt_flags_all: ["iface_head"]
|
|
401
|
+
},
|
|
402
|
+
when: G,
|
|
403
|
+
rewrite: { types: "type" }
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
anchor: {
|
|
407
|
+
type_name: "keyword",
|
|
408
|
+
value: "extends"
|
|
409
|
+
},
|
|
410
|
+
before: at(it("operator", "<"), it("identifier")),
|
|
411
|
+
when: G,
|
|
412
|
+
rewrite: { types: "type" }
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
anchor: {
|
|
416
|
+
type_name: "keyword",
|
|
417
|
+
value: "extends"
|
|
418
|
+
},
|
|
419
|
+
before: at(it("punctuation", ","), it("identifier")),
|
|
420
|
+
when: G,
|
|
421
|
+
rewrite: { types: "type" }
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
anchor: {
|
|
425
|
+
type_name: "keyword",
|
|
426
|
+
value: "implements"
|
|
427
|
+
},
|
|
428
|
+
when: G,
|
|
429
|
+
rewrite: { types: "type" }
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
anchor: {
|
|
433
|
+
type_name: "operator",
|
|
434
|
+
value: "<"
|
|
435
|
+
},
|
|
436
|
+
before: it("identifier"),
|
|
437
|
+
when: we,
|
|
438
|
+
rewrite: { types: "type" }
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
anchor: {
|
|
442
|
+
type_name: "operator",
|
|
443
|
+
value: "=",
|
|
444
|
+
stmt_flags_all: ["alias_head"],
|
|
445
|
+
frame_kinds: ["top"],
|
|
446
|
+
frame_direct: !0
|
|
447
|
+
},
|
|
448
|
+
before: it("identifier"),
|
|
449
|
+
when: U,
|
|
450
|
+
rewrite: { types: "type" }
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
anchor: {
|
|
454
|
+
type_name: "operator",
|
|
455
|
+
value: "=",
|
|
456
|
+
stmt_flags_all: ["alias_head"],
|
|
457
|
+
frame_kinds: ["top"],
|
|
458
|
+
frame_direct: !0
|
|
459
|
+
},
|
|
460
|
+
before: it("operator", ">"),
|
|
461
|
+
when: U,
|
|
462
|
+
rewrite: { types: "type" }
|
|
463
|
+
}
|
|
464
|
+
], { trivia: ["comment"] });
|
|
465
|
+
var Ee = bn("property");
|
|
466
|
+
var K = 58;
|
|
467
|
+
var De = 44;
|
|
468
|
+
var q = 46;
|
|
469
|
+
var J = 63;
|
|
470
|
+
var Y = 91;
|
|
471
|
+
var Oe = 93;
|
|
472
|
+
function ke(e, t, n, r) {
|
|
473
|
+
let { input: i, tokens: a } = e, o = e.next_non_trivia(t + 1);
|
|
474
|
+
if (o < 0) return !1;
|
|
475
|
+
let s = a[o * 3 + 1], c = a[o * 3 + 2] - s, l = i.charCodeAt(s);
|
|
476
|
+
if (a[o * 3] === n) return c === 1 && l === K;
|
|
477
|
+
if (a[o * 3] !== r || l !== J) return !1;
|
|
478
|
+
if (c === 2) return i.charCodeAt(s + 1) === K;
|
|
479
|
+
if (c !== 1) return !1;
|
|
480
|
+
let u = e.next_non_trivia(o + 1);
|
|
481
|
+
return u >= 0 && a[u * 3] === n && i.charCodeAt(a[u * 3 + 1]) === K;
|
|
482
|
+
}
|
|
483
|
+
function X(e, t, n) {
|
|
484
|
+
return n - t >= 3 && e.charCodeAt(n - 1) === q && e.charCodeAt(n - 2) === q && e.charCodeAt(n - 3) === q;
|
|
485
|
+
}
|
|
486
|
+
function Ae(e, n, r, i, a, o) {
|
|
487
|
+
let { input: s, tokens: c } = e, l = n.frames[r];
|
|
488
|
+
if (l.parent < 0 || n.frames[l.parent].bracket !== 1) return !1;
|
|
489
|
+
let u = l.enter_idx;
|
|
490
|
+
if (s.charCodeAt(c[u * 3 + 1]) === Y) {
|
|
491
|
+
let t = e.prev_non_trivia(u - 1);
|
|
492
|
+
if (t >= 0 && c[t * 3] === o && c[t * 3 + 2] - c[t * 3 + 1] === 1 && s.charCodeAt(c[t * 3 + 1]) === J) return !1;
|
|
493
|
+
}
|
|
494
|
+
let d = 1;
|
|
495
|
+
for (let t = i + 1; t < e.count; t++) {
|
|
496
|
+
if (c[t * 3] !== a) continue;
|
|
497
|
+
let n = c[t * 3 + 2];
|
|
498
|
+
for (let r = c[t * 3 + 1]; r < n; r++) {
|
|
499
|
+
let i = s.charCodeAt(r);
|
|
500
|
+
if (i === Y) d++;
|
|
501
|
+
else if (i === Oe && --d === 0) {
|
|
502
|
+
if (r + 1 < n) return s.charCodeAt(r + 1) === K;
|
|
503
|
+
let i = e.next_non_trivia(t + 1);
|
|
504
|
+
return i >= 0 && c[i * 3] === a && s.charCodeAt(c[i * 3 + 1]) === K;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return !1;
|
|
509
|
+
}
|
|
510
|
+
var je = (e, t, r, i, a) => {
|
|
511
|
+
if (a === void 0) return;
|
|
512
|
+
let o = r.indexOf("identifier"), s = r.indexOf("punctuation"), c = r.indexOf("operator");
|
|
513
|
+
if (o < 0 || s < 0 || c < 0) return;
|
|
514
|
+
let l = $n(e, t, r), u = l.count, d = a.active_frame;
|
|
515
|
+
if (d.length < u) return;
|
|
516
|
+
let f = -1;
|
|
517
|
+
for (let p = 0; p < u; p++) {
|
|
518
|
+
if (t[p * 3] !== o) continue;
|
|
519
|
+
let u = d[p];
|
|
520
|
+
if (a.frames[u].bracket !== 2 || !ke(l, p, s, c)) continue;
|
|
521
|
+
let m = l.prev_non_trivia(p - 1);
|
|
522
|
+
if (m < 0) continue;
|
|
523
|
+
let h = t[m * 3 + 1], g = t[m * 3 + 2];
|
|
524
|
+
if (t[m * 3] === s) {
|
|
525
|
+
let t = e.charCodeAt(g - 1);
|
|
526
|
+
if (t === Y) {
|
|
527
|
+
if (Ae(l, a, u, p, s, c)) continue;
|
|
528
|
+
} else if (t !== De && !X(e, h, g)) continue;
|
|
529
|
+
} else if (t[m * 3] !== c || g - h !== 3 || !X(e, h, g)) continue;
|
|
530
|
+
f < 0 && (f = r.indexOf("property"), f < 0 && (f = r.length, r.push("property"))), i.emit(p, f, Ee);
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
var Me = Un((e, t, n, r, i) => {
|
|
534
|
+
Ye.__claim(e, t, n, r, i), je(e, t, n, r, i);
|
|
535
|
+
});
|
|
536
|
+
var Z = [
|
|
537
|
+
Hn(B, "type_claim"),
|
|
538
|
+
Hn(Je, "shape"),
|
|
539
|
+
Vn(ft, ["constant"]),
|
|
540
|
+
Vn(yt, ["namespace"]),
|
|
541
|
+
Vn(ye, ["type"]),
|
|
542
|
+
Vn(jn(Be, { trivia: ["comment"] }), ["function"]),
|
|
543
|
+
Vn(X$1, ["constant"]),
|
|
544
|
+
Vn(Me, ["property"]),
|
|
545
|
+
Vn(Te, ["type"]),
|
|
546
|
+
Vn(be, ["type"]),
|
|
547
|
+
Vn((e, t) => {
|
|
548
|
+
let { tokens: n, token_types: r } = t, i = r.indexOf("identifier"), a = r.indexOf("operator"), o = r.indexOf("punctuation");
|
|
549
|
+
if (i < 0 || a < 0 || o < 0) return t;
|
|
550
|
+
let s = r.indexOf("function");
|
|
551
|
+
s < 0 && (s = r.length, r.push("function"));
|
|
552
|
+
let c = $n(e, n, r), l = c.count;
|
|
553
|
+
for (let e = 0; e < l; e++) {
|
|
554
|
+
if (c.is_trivia(e) || c.kind_of(e) !== i) continue;
|
|
555
|
+
let t = c.next_non_trivia(e + 1);
|
|
556
|
+
if (t < 0 || c.kind_of(t) !== a || c.text_of(t) !== "<") continue;
|
|
557
|
+
let r = 1, u = 0, d = t + 1, f = -1, p = !1;
|
|
558
|
+
for (; d < l;) {
|
|
559
|
+
if (c.is_trivia(d)) {
|
|
560
|
+
d++;
|
|
561
|
+
continue;
|
|
562
|
+
}
|
|
563
|
+
let e = c.kind_of(d), t = c.text_of(d);
|
|
564
|
+
if (e === a) {
|
|
565
|
+
if (t === "<") r++;
|
|
566
|
+
else if (u === 0 && (t === ">" || t === ">>" || t === ">>>") && (r -= t.length, r <= 0)) {
|
|
567
|
+
f = d;
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
} else if (e === o) {
|
|
571
|
+
for (let e of t) if (e === "{") u++;
|
|
572
|
+
else if (e === "}") {
|
|
573
|
+
if (u === 0) {
|
|
574
|
+
p = !0;
|
|
575
|
+
break;
|
|
576
|
+
}
|
|
577
|
+
u--;
|
|
578
|
+
} else if (e === ";" && u === 0) {
|
|
579
|
+
p = !0;
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
if (p) break;
|
|
583
|
+
}
|
|
584
|
+
d++;
|
|
585
|
+
}
|
|
586
|
+
if (f < 0) continue;
|
|
587
|
+
let m = c.next_non_trivia(f + 1);
|
|
588
|
+
m < 0 || c.kind_of(m) !== o || !c.text_of(m).startsWith("(") || (n[e * 3] = s);
|
|
589
|
+
}
|
|
590
|
+
return t;
|
|
591
|
+
}, ["function"]),
|
|
592
|
+
Vn(lt, ["class_name"]),
|
|
593
|
+
Vn(_t, ["parameter"]),
|
|
594
|
+
Hn((e, t) => {
|
|
595
|
+
let { tokens: n, token_types: r } = t, i = r.indexOf("operator"), a = r.indexOf("punctuation");
|
|
596
|
+
if (i < 0 || a < 0) return t;
|
|
597
|
+
let o = r.indexOf("identifier"), s = r.indexOf("type"), c = r.indexOf("class_name"), l = r.indexOf("function"), u = r.indexOf("keyword"), d = $n(e, n, r), f = d.count, p = (e) => e === o || e === s || e === c || e === l, h = (e) => {
|
|
598
|
+
if (e < 0) return !0;
|
|
599
|
+
let t = d.kind_of(e), n = d.text_of(e);
|
|
600
|
+
if (t === a) {
|
|
601
|
+
let e = n.length > 0 ? n[0] : "";
|
|
602
|
+
return e === "(" || e === ")" || e === "{" || e === "}" || e === "[" || e === "]" || e === "," || e === ";" || e === "." || e === ":";
|
|
603
|
+
}
|
|
604
|
+
return t === i ? n === "=" || n === "=>" || n === "?:" || n === "|" || n === "&" || n === ">" || n === ">>" || n === ">>>" || n === "?" || n === "!" : t === u ? n === "extends" || n === "implements" : !1;
|
|
605
|
+
}, g = 0;
|
|
606
|
+
for (; g < f;) {
|
|
607
|
+
if (d.is_trivia(g)) {
|
|
608
|
+
g++;
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
if (d.kind_of(g) !== i || d.text_of(g) !== "<") {
|
|
612
|
+
g++;
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
let e = d.prev_non_trivia(g - 1);
|
|
616
|
+
if (e < 0 || !p(d.kind_of(e))) {
|
|
617
|
+
g++;
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
let t = 1, r = 0, o = g + 1, s = -1, c = [g], l = !1;
|
|
621
|
+
for (; o < f;) {
|
|
622
|
+
if (d.is_trivia(o)) {
|
|
623
|
+
o++;
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
let e = d.kind_of(o), n = d.text_of(o);
|
|
627
|
+
if (e === i) {
|
|
628
|
+
if (n === "<") t++, c.push(o);
|
|
629
|
+
else if (r === 0 && (n === ">" || n === ">>" || n === ">>>") && (t -= n.length, c.push(o), t <= 0)) {
|
|
630
|
+
s = o;
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
} else if (e === a) {
|
|
634
|
+
for (let e of n) if (e === "{") r++;
|
|
635
|
+
else if (e === "}") {
|
|
636
|
+
if (r === 0) {
|
|
637
|
+
l = !0;
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
r--;
|
|
641
|
+
} else if (e === ";" && r === 0) {
|
|
642
|
+
l = !0;
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
if (l) break;
|
|
646
|
+
}
|
|
647
|
+
o++;
|
|
648
|
+
}
|
|
649
|
+
if (l || s < 0) {
|
|
650
|
+
g++;
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
653
|
+
if (!h(d.next_non_trivia(s + 1))) {
|
|
654
|
+
g++;
|
|
655
|
+
continue;
|
|
656
|
+
}
|
|
657
|
+
for (let e of c) n[e * 3] = a;
|
|
658
|
+
g = s + 1;
|
|
659
|
+
}
|
|
660
|
+
return t;
|
|
661
|
+
}, "shape"),
|
|
662
|
+
Hn(Pn({ scan: bt }), "embed")
|
|
663
|
+
];
|
|
664
|
+
var Q = _(R);
|
|
665
|
+
var $ = qn(Q, Z);
|
|
666
|
+
function Ne(e) {
|
|
667
|
+
let t = $(e);
|
|
668
|
+
return (e, n) => ge(e, t(e), n);
|
|
669
|
+
}
|
|
670
|
+
//#endregion
|
|
671
|
+
export { R as a, Q as i, B as n, Z as o, Ne as r, $ as t };
|