@septkit/ui 0.0.41 → 0.0.43
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/dist/code/code-block.js +7 -0
- package/dist/code/code-block.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/code/diff.js +35 -0
- package/dist/code/highlight.js +30 -0
- package/dist/code/index.js +5 -0
- package/dist/code/xml-diff.js +5 -0
- package/dist/code/xml-diff.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/dialecte/composables/index.js +2 -1
- package/dist/dialecte/composables/use-active-document.js +24 -0
- package/dist/dialecte/create-document-store.js +3 -3
- package/dist/dialecte/index.js +2 -1
- package/dist/dialog/dialog-host.js +5 -0
- package/dist/dialog/dialog-host.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/dialog/dialog.js +5 -0
- package/dist/dialog/dialog.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/dialog/index.js +4 -0
- package/dist/dialog/use-dialog-host.js +32 -0
- package/dist/explorer/collect-expandable-node-ids.js +8 -0
- package/dist/explorer/explorer.js +1 -1
- package/dist/explorer/explorer.vue_vue_type_script_setup_true_lang.js +47 -33
- package/dist/explorer/index.js +3 -2
- package/dist/external/.pnpm/@dialecte_core@0.4.5/node_modules/@dialecte/core/dist/helpers.js +142 -0
- package/dist/external/.pnpm/@dialecte_core@0.4.5/node_modules/@dialecte/core/dist/index.js +3 -0
- package/dist/external/.pnpm/{@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/project-E32sEthh.js → @dialecte_core@0.4.5/node_modules/@dialecte/core/dist/project-wohrish5.js} +3352 -1170
- package/dist/external/.pnpm/{@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/utils-DgKwrT2n.js → @dialecte_core@0.4.5/node_modules/@dialecte/core/dist/utils-C5_11hqg.js} +73 -3
- package/dist/external/.pnpm/@dialecte_scl@0.3.3/node_modules/@dialecte/scl/dist/hooks-BTkrNj6r.js +25264 -0
- package/dist/external/.pnpm/@dialecte_scl@0.3.3/node_modules/@dialecte/scl/dist/v2019C1/index.js +3 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/arrow-right.js +11 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/copy.js +16 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/text-wrap.js +22 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/x.js +11 -0
- package/dist/external/.pnpm/@shikijs_core@3.23.0/node_modules/@shikijs/core/dist/index.js +1299 -0
- package/dist/external/.pnpm/@shikijs_engine-javascript@3.23.0/node_modules/@shikijs/engine-javascript/dist/engine-compile.js +34 -0
- package/dist/external/.pnpm/@shikijs_engine-javascript@3.23.0/node_modules/@shikijs/engine-javascript/dist/shared/engine-javascript.hzpS1_41.js +66 -0
- package/dist/external/.pnpm/@shikijs_langs@3.23.0/node_modules/@shikijs/langs/dist/java.js +3 -0
- package/dist/external/.pnpm/@shikijs_langs@3.23.0/node_modules/@shikijs/langs/dist/xml.js +5 -0
- package/dist/external/.pnpm/@shikijs_themes@3.23.0/node_modules/@shikijs/themes/dist/github-dark.js +4 -0
- package/dist/external/.pnpm/@shikijs_types@3.23.0/node_modules/@shikijs/types/dist/index.js +8 -0
- package/dist/external/.pnpm/@shikijs_vscode-textmate@10.0.2/node_modules/@shikijs/vscode-textmate/dist/index.js +1576 -0
- package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +126 -43
- package/dist/external/.pnpm/@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js +84 -55
- package/dist/external/.pnpm/ccount@2.0.1/node_modules/ccount/index.js +10 -0
- package/dist/external/.pnpm/character-entities-html4@2.1.0/node_modules/character-entities-html4/index.js +257 -0
- package/dist/external/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.js +4 -0
- package/dist/external/.pnpm/comma-separated-tokens@2.0.3/node_modules/comma-separated-tokens/index.js +7 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/comment.js +11 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/doctype.js +6 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/element.js +49 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/index.js +28 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/raw.js +7 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/root.js +6 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/text.js +8 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/index.js +48 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/closing.js +86 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/omission.js +10 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/opening.js +39 -0
- package/dist/external/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/util/siblings.js +13 -0
- package/dist/external/.pnpm/hast-util-whitespace@3.0.0/node_modules/hast-util-whitespace/lib/index.js +10 -0
- package/dist/external/.pnpm/html-void-elements@3.0.0/node_modules/html-void-elements/index.js +25 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/node-utils.js +23 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/parse.js +419 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js +487 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/traverser/traverse.js +84 -0
- package/dist/external/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/utils.js +30 -0
- package/dist/external/.pnpm/oniguruma-to-es@4.3.6/node_modules/oniguruma-to-es/dist/esm/index.js +970 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/index.js +25 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/aria.js +61 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/find.js +31 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/html.js +326 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/normalize.js +6 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/svg.js +564 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-insensitive-transform.js +7 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-sensitive-transform.js +6 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/create.js +14 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/defined-info.js +18 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/info.js +9 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/merge.js +9 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/schema.js +9 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/types.js +16 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xlink.js +19 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xml.js +15 -0
- package/dist/external/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xmlns.js +14 -0
- package/dist/external/.pnpm/regex-recursion@6.0.2/node_modules/regex-recursion/src/index.js +110 -0
- package/dist/external/.pnpm/regex-utilities@2.3.0/node_modules/regex-utilities/src/index.js +56 -0
- package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/atomic.js +94 -0
- package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/internals.js +2 -0
- package/dist/external/.pnpm/regex@6.1.0/node_modules/regex/src/utils-internals.js +10 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContent.js +72 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContentImpl.js +101 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContentModal.js +83 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogContentNonModal.js +74 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogOverlay.js +48 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogOverlayImpl.js +47 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogPortal.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogRoot.js +61 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/DialogTitle.js +28 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Dialog/utils.js +17 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Menu/utils.js +16 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Splitter/SplitterGroup.js +384 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Splitter/SplitterPanel.js +136 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Splitter/SplitterResizeHandle.js +119 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperIndicator.js +27 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperItem.js +67 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperRoot.js +136 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperTitle.js +28 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/composables/useWindowSplitterBehavior.js +37 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/composables/useWindowSplitterPanelGroupBehavior.js +82 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/arrays.js +7 -2
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/browser.js +4 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/assert.js +6 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/calculate.js +73 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/callPanelCallbacks.js +19 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/compare.js +11 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/debounce.js +11 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/dom.js +20 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/events.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/layout.js +103 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/pivot.js +8 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/rects.js +6 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/registry.js +106 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/resizePanel.js +15 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/stackingOrder.js +57 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/storage.js +50 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/style.js +35 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/units.js +57 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/utils/validation.js +39 -0
- package/dist/external/.pnpm/space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.js +6 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/constant/dangerous.js +13 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/core.js +23 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/index.js +8 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/format-smart.js +14 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-decimal.js +8 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-hexadecimal.js +8 -0
- package/dist/external/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-named.js +17 -0
- package/dist/external/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.js +16 -0
- package/dist/index.d.ts +422 -4
- package/dist/index.js +24 -7
- package/dist/merge/build-view-model.js +168 -0
- package/dist/merge/decision-toggle.js +5 -0
- package/dist/merge/decision-toggle.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/merge/element-detail.js +5 -0
- package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/merge/index.js +6 -0
- package/dist/merge/merge-progress.js +5 -0
- package/dist/merge/merge-progress.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/merge/merge-review.js +5 -0
- package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +305 -0
- package/dist/merge/merge-summary.js +5 -0
- package/dist/merge/merge-summary.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/merge/merge-tree.js +5 -0
- package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/merge/merge.service.js +69 -0
- package/dist/merge/use-document-progress.js +27 -0
- package/dist/merge/use-merge-session.js +151 -0
- package/dist/ui.css +1 -1
- package/package.json +4 -2
- package/dist/external/.pnpm/@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/helpers.js +0 -13
- package/dist/external/.pnpm/@dialecte_core@0.4.2/node_modules/@dialecte/core/dist/index.js +0 -3
|
@@ -0,0 +1,1576 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/@shikijs+vscode-textmate@10.0.2/node_modules/@shikijs/vscode-textmate/dist/index.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
return t(e);
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return Array.isArray(e) ? n(e) : e instanceof RegExp ? e : typeof e == "object" ? r(e) : e;
|
|
7
|
+
}
|
|
8
|
+
function n(e) {
|
|
9
|
+
let n = [];
|
|
10
|
+
for (let r = 0, i = e.length; r < i; r++) n[r] = t(e[r]);
|
|
11
|
+
return n;
|
|
12
|
+
}
|
|
13
|
+
function r(e) {
|
|
14
|
+
let n = {};
|
|
15
|
+
for (let r in e) n[r] = t(e[r]);
|
|
16
|
+
return n;
|
|
17
|
+
}
|
|
18
|
+
function i(e, ...t) {
|
|
19
|
+
return t.forEach((t) => {
|
|
20
|
+
for (let n in t) e[n] = t[n];
|
|
21
|
+
}), e;
|
|
22
|
+
}
|
|
23
|
+
function a(e) {
|
|
24
|
+
let t = ~e.lastIndexOf("/") || ~e.lastIndexOf("\\");
|
|
25
|
+
return t === 0 ? e : ~t === e.length - 1 ? a(e.substring(0, e.length - 1)) : e.substr(~t + 1);
|
|
26
|
+
}
|
|
27
|
+
var o = /\$(\d+)|\${(\d+):\/(downcase|upcase)}/g, s = class {
|
|
28
|
+
static hasCaptures(e) {
|
|
29
|
+
return e === null ? !1 : (o.lastIndex = 0, o.test(e));
|
|
30
|
+
}
|
|
31
|
+
static replaceCaptures(e, t, n) {
|
|
32
|
+
return e.replace(o, (e, r, i, a) => {
|
|
33
|
+
let o = n[parseInt(r || i, 10)];
|
|
34
|
+
if (o) {
|
|
35
|
+
let e = t.substring(o.start, o.end);
|
|
36
|
+
for (; e[0] === ".";) e = e.substring(1);
|
|
37
|
+
switch (a) {
|
|
38
|
+
case "downcase": return e.toLowerCase();
|
|
39
|
+
case "upcase": return e.toUpperCase();
|
|
40
|
+
default: return e;
|
|
41
|
+
}
|
|
42
|
+
} else return e;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
function c(e, t) {
|
|
47
|
+
return e < t ? -1 : +(e > t);
|
|
48
|
+
}
|
|
49
|
+
function l(e, t) {
|
|
50
|
+
if (e === null && t === null) return 0;
|
|
51
|
+
if (!e) return -1;
|
|
52
|
+
if (!t) return 1;
|
|
53
|
+
let n = e.length, r = t.length;
|
|
54
|
+
if (n === r) {
|
|
55
|
+
for (let r = 0; r < n; r++) {
|
|
56
|
+
let n = c(e[r], t[r]);
|
|
57
|
+
if (n !== 0) return n;
|
|
58
|
+
}
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
return n - r;
|
|
62
|
+
}
|
|
63
|
+
function u(e) {
|
|
64
|
+
return !!(/^#[0-9a-f]{6}$/i.test(e) || /^#[0-9a-f]{8}$/i.test(e) || /^#[0-9a-f]{3}$/i.test(e) || /^#[0-9a-f]{4}$/i.test(e));
|
|
65
|
+
}
|
|
66
|
+
function d(e) {
|
|
67
|
+
return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, "\\$&");
|
|
68
|
+
}
|
|
69
|
+
var f = class {
|
|
70
|
+
constructor(e) {
|
|
71
|
+
this.fn = e;
|
|
72
|
+
}
|
|
73
|
+
cache = /* @__PURE__ */ new Map();
|
|
74
|
+
get(e) {
|
|
75
|
+
if (this.cache.has(e)) return this.cache.get(e);
|
|
76
|
+
let t = this.fn(e);
|
|
77
|
+
return this.cache.set(e, t), t;
|
|
78
|
+
}
|
|
79
|
+
}, p = class {
|
|
80
|
+
constructor(e, t, n) {
|
|
81
|
+
this._colorMap = e, this._defaults = t, this._root = n;
|
|
82
|
+
}
|
|
83
|
+
static createFromRawTheme(e, t) {
|
|
84
|
+
return this.createFromParsedTheme(ee(e), t);
|
|
85
|
+
}
|
|
86
|
+
static createFromParsedTheme(e, t) {
|
|
87
|
+
return ne(e, t);
|
|
88
|
+
}
|
|
89
|
+
_cachedMatchRoot = new f((e) => this._root.match(e));
|
|
90
|
+
getColorMap() {
|
|
91
|
+
return this._colorMap.getColorMap();
|
|
92
|
+
}
|
|
93
|
+
getDefaults() {
|
|
94
|
+
return this._defaults;
|
|
95
|
+
}
|
|
96
|
+
match(e) {
|
|
97
|
+
if (e === null) return this._defaults;
|
|
98
|
+
let t = e.scopeName, n = this._cachedMatchRoot.get(t).find((t) => h(e.parent, t.parentScopes));
|
|
99
|
+
return n ? new _(n.fontStyle, n.foreground, n.background) : null;
|
|
100
|
+
}
|
|
101
|
+
}, m = class e {
|
|
102
|
+
constructor(e, t) {
|
|
103
|
+
this.parent = e, this.scopeName = t;
|
|
104
|
+
}
|
|
105
|
+
static push(t, n) {
|
|
106
|
+
for (let r of n) t = new e(t, r);
|
|
107
|
+
return t;
|
|
108
|
+
}
|
|
109
|
+
static from(...t) {
|
|
110
|
+
let n = null;
|
|
111
|
+
for (let r = 0; r < t.length; r++) n = new e(n, t[r]);
|
|
112
|
+
return n;
|
|
113
|
+
}
|
|
114
|
+
push(t) {
|
|
115
|
+
return new e(this, t);
|
|
116
|
+
}
|
|
117
|
+
getSegments() {
|
|
118
|
+
let e = this, t = [];
|
|
119
|
+
for (; e;) t.push(e.scopeName), e = e.parent;
|
|
120
|
+
return t.reverse(), t;
|
|
121
|
+
}
|
|
122
|
+
toString() {
|
|
123
|
+
return this.getSegments().join(" ");
|
|
124
|
+
}
|
|
125
|
+
extends(e) {
|
|
126
|
+
return this === e ? !0 : this.parent === null ? !1 : this.parent.extends(e);
|
|
127
|
+
}
|
|
128
|
+
getExtensionIfDefined(e) {
|
|
129
|
+
let t = [], n = this;
|
|
130
|
+
for (; n && n !== e;) t.push(n.scopeName), n = n.parent;
|
|
131
|
+
return n === e ? t.reverse() : void 0;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
function h(e, t) {
|
|
135
|
+
if (t.length === 0) return !0;
|
|
136
|
+
for (let n = 0; n < t.length; n++) {
|
|
137
|
+
let r = t[n], i = !1;
|
|
138
|
+
if (r === ">") {
|
|
139
|
+
if (n === t.length - 1) return !1;
|
|
140
|
+
r = t[++n], i = !0;
|
|
141
|
+
}
|
|
142
|
+
for (; e && !g(e.scopeName, r);) {
|
|
143
|
+
if (i) return !1;
|
|
144
|
+
e = e.parent;
|
|
145
|
+
}
|
|
146
|
+
if (!e) return !1;
|
|
147
|
+
e = e.parent;
|
|
148
|
+
}
|
|
149
|
+
return !0;
|
|
150
|
+
}
|
|
151
|
+
function g(e, t) {
|
|
152
|
+
return t === e || e.startsWith(t) && e[t.length] === ".";
|
|
153
|
+
}
|
|
154
|
+
var _ = class {
|
|
155
|
+
constructor(e, t, n) {
|
|
156
|
+
this.fontStyle = e, this.foregroundId = t, this.backgroundId = n;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
function ee(e) {
|
|
160
|
+
if (!e || !e.settings || !Array.isArray(e.settings)) return [];
|
|
161
|
+
let t = e.settings, n = [], r = 0;
|
|
162
|
+
for (let e = 0, i = t.length; e < i; e++) {
|
|
163
|
+
let i = t[e];
|
|
164
|
+
if (!i.settings) continue;
|
|
165
|
+
let a;
|
|
166
|
+
if (typeof i.scope == "string") {
|
|
167
|
+
let e = i.scope;
|
|
168
|
+
e = e.replace(/^[,]+/, ""), e = e.replace(/[,]+$/, ""), a = e.split(",");
|
|
169
|
+
} else a = Array.isArray(i.scope) ? i.scope : [""];
|
|
170
|
+
let o = -1;
|
|
171
|
+
if (typeof i.settings.fontStyle == "string") {
|
|
172
|
+
o = 0;
|
|
173
|
+
let e = i.settings.fontStyle.split(" ");
|
|
174
|
+
for (let t = 0, n = e.length; t < n; t++) switch (e[t]) {
|
|
175
|
+
case "italic":
|
|
176
|
+
o |= 1;
|
|
177
|
+
break;
|
|
178
|
+
case "bold":
|
|
179
|
+
o |= 2;
|
|
180
|
+
break;
|
|
181
|
+
case "underline":
|
|
182
|
+
o |= 4;
|
|
183
|
+
break;
|
|
184
|
+
case "strikethrough":
|
|
185
|
+
o |= 8;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
let s = null;
|
|
190
|
+
typeof i.settings.foreground == "string" && u(i.settings.foreground) && (s = i.settings.foreground);
|
|
191
|
+
let c = null;
|
|
192
|
+
typeof i.settings.background == "string" && u(i.settings.background) && (c = i.settings.background);
|
|
193
|
+
for (let t = 0, i = a.length; t < i; t++) {
|
|
194
|
+
let i = a[t].trim().split(" "), l = i[i.length - 1], u = null;
|
|
195
|
+
i.length > 1 && (u = i.slice(0, i.length - 1), u.reverse()), n[r++] = new te(l, u, e, o, s, c);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return n;
|
|
199
|
+
}
|
|
200
|
+
var te = class {
|
|
201
|
+
constructor(e, t, n, r, i, a) {
|
|
202
|
+
this.scope = e, this.parentScopes = t, this.index = n, this.fontStyle = r, this.foreground = i, this.background = a;
|
|
203
|
+
}
|
|
204
|
+
}, v = /* @__PURE__ */ ((e) => (e[e.NotSet = -1] = "NotSet", e[e.None = 0] = "None", e[e.Italic = 1] = "Italic", e[e.Bold = 2] = "Bold", e[e.Underline = 4] = "Underline", e[e.Strikethrough = 8] = "Strikethrough", e))(v || {});
|
|
205
|
+
function ne(e, t) {
|
|
206
|
+
e.sort((e, t) => {
|
|
207
|
+
let n = c(e.scope, t.scope);
|
|
208
|
+
return n !== 0 || (n = l(e.parentScopes, t.parentScopes), n !== 0) ? n : e.index - t.index;
|
|
209
|
+
});
|
|
210
|
+
let n = 0, r = "#000000", i = "#ffffff";
|
|
211
|
+
for (; e.length >= 1 && e[0].scope === "";) {
|
|
212
|
+
let t = e.shift();
|
|
213
|
+
t.fontStyle !== -1 && (n = t.fontStyle), t.foreground !== null && (r = t.foreground), t.background !== null && (i = t.background);
|
|
214
|
+
}
|
|
215
|
+
let a = new re(t), o = new _(n, a.getId(r), a.getId(i)), s = new b(new y(0, null, -1, 0, 0), []);
|
|
216
|
+
for (let t = 0, n = e.length; t < n; t++) {
|
|
217
|
+
let n = e[t];
|
|
218
|
+
s.insert(0, n.scope, n.parentScopes, n.fontStyle, a.getId(n.foreground), a.getId(n.background));
|
|
219
|
+
}
|
|
220
|
+
return new p(a, o, s);
|
|
221
|
+
}
|
|
222
|
+
var re = class {
|
|
223
|
+
_isFrozen;
|
|
224
|
+
_lastColorId;
|
|
225
|
+
_id2color;
|
|
226
|
+
_color2id;
|
|
227
|
+
constructor(e) {
|
|
228
|
+
if (this._lastColorId = 0, this._id2color = [], this._color2id = /* @__PURE__ */ Object.create(null), Array.isArray(e)) {
|
|
229
|
+
this._isFrozen = !0;
|
|
230
|
+
for (let t = 0, n = e.length; t < n; t++) this._color2id[e[t]] = t, this._id2color[t] = e[t];
|
|
231
|
+
} else this._isFrozen = !1;
|
|
232
|
+
}
|
|
233
|
+
getId(e) {
|
|
234
|
+
if (e === null) return 0;
|
|
235
|
+
e = e.toUpperCase();
|
|
236
|
+
let t = this._color2id[e];
|
|
237
|
+
if (t) return t;
|
|
238
|
+
if (this._isFrozen) throw Error(`Missing color in color map - ${e}`);
|
|
239
|
+
return t = ++this._lastColorId, this._color2id[e] = t, this._id2color[t] = e, t;
|
|
240
|
+
}
|
|
241
|
+
getColorMap() {
|
|
242
|
+
return this._id2color.slice(0);
|
|
243
|
+
}
|
|
244
|
+
}, ie = Object.freeze([]), y = class e {
|
|
245
|
+
scopeDepth;
|
|
246
|
+
parentScopes;
|
|
247
|
+
fontStyle;
|
|
248
|
+
foreground;
|
|
249
|
+
background;
|
|
250
|
+
constructor(e, t, n, r, i) {
|
|
251
|
+
this.scopeDepth = e, this.parentScopes = t || ie, this.fontStyle = n, this.foreground = r, this.background = i;
|
|
252
|
+
}
|
|
253
|
+
clone() {
|
|
254
|
+
return new e(this.scopeDepth, this.parentScopes, this.fontStyle, this.foreground, this.background);
|
|
255
|
+
}
|
|
256
|
+
static cloneArr(e) {
|
|
257
|
+
let t = [];
|
|
258
|
+
for (let n = 0, r = e.length; n < r; n++) t[n] = e[n].clone();
|
|
259
|
+
return t;
|
|
260
|
+
}
|
|
261
|
+
acceptOverwrite(e, t, n, r) {
|
|
262
|
+
this.scopeDepth > e ? console.log("how did this happen?") : this.scopeDepth = e, t !== -1 && (this.fontStyle = t), n !== 0 && (this.foreground = n), r !== 0 && (this.background = r);
|
|
263
|
+
}
|
|
264
|
+
}, b = class e {
|
|
265
|
+
constructor(e, t = [], n = {}) {
|
|
266
|
+
this._mainRule = e, this._children = n, this._rulesWithParentScopes = t;
|
|
267
|
+
}
|
|
268
|
+
_rulesWithParentScopes;
|
|
269
|
+
static _cmpBySpecificity(e, t) {
|
|
270
|
+
if (e.scopeDepth !== t.scopeDepth) return t.scopeDepth - e.scopeDepth;
|
|
271
|
+
let n = 0, r = 0;
|
|
272
|
+
for (; e.parentScopes[n] === ">" && n++, t.parentScopes[r] === ">" && r++, !(n >= e.parentScopes.length || r >= t.parentScopes.length);) {
|
|
273
|
+
let i = t.parentScopes[r].length - e.parentScopes[n].length;
|
|
274
|
+
if (i !== 0) return i;
|
|
275
|
+
n++, r++;
|
|
276
|
+
}
|
|
277
|
+
return t.parentScopes.length - e.parentScopes.length;
|
|
278
|
+
}
|
|
279
|
+
match(t) {
|
|
280
|
+
if (t !== "") {
|
|
281
|
+
let e = t.indexOf("."), n, r;
|
|
282
|
+
if (e === -1 ? (n = t, r = "") : (n = t.substring(0, e), r = t.substring(e + 1)), this._children.hasOwnProperty(n)) return this._children[n].match(r);
|
|
283
|
+
}
|
|
284
|
+
let n = this._rulesWithParentScopes.concat(this._mainRule);
|
|
285
|
+
return n.sort(e._cmpBySpecificity), n;
|
|
286
|
+
}
|
|
287
|
+
insert(t, n, r, i, a, o) {
|
|
288
|
+
if (n === "") {
|
|
289
|
+
this._doInsertHere(t, r, i, a, o);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
let s = n.indexOf("."), c, l;
|
|
293
|
+
s === -1 ? (c = n, l = "") : (c = n.substring(0, s), l = n.substring(s + 1));
|
|
294
|
+
let u;
|
|
295
|
+
this._children.hasOwnProperty(c) ? u = this._children[c] : (u = new e(this._mainRule.clone(), y.cloneArr(this._rulesWithParentScopes)), this._children[c] = u), u.insert(t + 1, l, r, i, a, o);
|
|
296
|
+
}
|
|
297
|
+
_doInsertHere(e, t, n, r, i) {
|
|
298
|
+
if (t === null) {
|
|
299
|
+
this._mainRule.acceptOverwrite(e, n, r, i);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
for (let a = 0, o = this._rulesWithParentScopes.length; a < o; a++) {
|
|
303
|
+
let o = this._rulesWithParentScopes[a];
|
|
304
|
+
if (l(o.parentScopes, t) === 0) {
|
|
305
|
+
o.acceptOverwrite(e, n, r, i);
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
n === -1 && (n = this._mainRule.fontStyle), r === 0 && (r = this._mainRule.foreground), i === 0 && (i = this._mainRule.background), this._rulesWithParentScopes.push(new y(e, t, n, r, i));
|
|
310
|
+
}
|
|
311
|
+
}, x = class e {
|
|
312
|
+
static toBinaryStr(e) {
|
|
313
|
+
return e.toString(2).padStart(32, "0");
|
|
314
|
+
}
|
|
315
|
+
static print(t) {
|
|
316
|
+
let n = e.getLanguageId(t), r = e.getTokenType(t), i = e.getFontStyle(t), a = e.getForeground(t), o = e.getBackground(t);
|
|
317
|
+
console.log({
|
|
318
|
+
languageId: n,
|
|
319
|
+
tokenType: r,
|
|
320
|
+
fontStyle: i,
|
|
321
|
+
foreground: a,
|
|
322
|
+
background: o
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
static getLanguageId(e) {
|
|
326
|
+
return (e & 255) >>> 0;
|
|
327
|
+
}
|
|
328
|
+
static getTokenType(e) {
|
|
329
|
+
return (e & 768) >>> 8;
|
|
330
|
+
}
|
|
331
|
+
static containsBalancedBrackets(e) {
|
|
332
|
+
return (e & 1024) != 0;
|
|
333
|
+
}
|
|
334
|
+
static getFontStyle(e) {
|
|
335
|
+
return (e & 30720) >>> 11;
|
|
336
|
+
}
|
|
337
|
+
static getForeground(e) {
|
|
338
|
+
return (e & 16744448) >>> 15;
|
|
339
|
+
}
|
|
340
|
+
static getBackground(e) {
|
|
341
|
+
return (e & 4278190080) >>> 24;
|
|
342
|
+
}
|
|
343
|
+
static set(t, n, r, i, a, o, s) {
|
|
344
|
+
let c = e.getLanguageId(t), l = e.getTokenType(t), u = +!!e.containsBalancedBrackets(t), d = e.getFontStyle(t), f = e.getForeground(t), p = e.getBackground(t);
|
|
345
|
+
return n !== 0 && (c = n), r !== 8 && (l = S(r)), i !== null && (u = +!!i), a !== -1 && (d = a), o !== 0 && (f = o), s !== 0 && (p = s), (c << 0 | l << 8 | u << 10 | d << 11 | f << 15 | p << 24) >>> 0;
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
function ae(e) {
|
|
349
|
+
return e;
|
|
350
|
+
}
|
|
351
|
+
function S(e) {
|
|
352
|
+
return e;
|
|
353
|
+
}
|
|
354
|
+
function C(e, t) {
|
|
355
|
+
let n = [], r = oe(e), i = r.next();
|
|
356
|
+
for (; i !== null;) {
|
|
357
|
+
let e = 0;
|
|
358
|
+
if (i.length === 2 && i.charAt(1) === ":") {
|
|
359
|
+
switch (i.charAt(0)) {
|
|
360
|
+
case "R":
|
|
361
|
+
e = 1;
|
|
362
|
+
break;
|
|
363
|
+
case "L":
|
|
364
|
+
e = -1;
|
|
365
|
+
break;
|
|
366
|
+
default: console.log(`Unknown priority ${i} in scope selector`);
|
|
367
|
+
}
|
|
368
|
+
i = r.next();
|
|
369
|
+
}
|
|
370
|
+
let t = o();
|
|
371
|
+
if (n.push({
|
|
372
|
+
matcher: t,
|
|
373
|
+
priority: e
|
|
374
|
+
}), i !== ",") break;
|
|
375
|
+
i = r.next();
|
|
376
|
+
}
|
|
377
|
+
return n;
|
|
378
|
+
function a() {
|
|
379
|
+
if (i === "-") {
|
|
380
|
+
i = r.next();
|
|
381
|
+
let e = a();
|
|
382
|
+
return (t) => !!e && !e(t);
|
|
383
|
+
}
|
|
384
|
+
if (i === "(") {
|
|
385
|
+
i = r.next();
|
|
386
|
+
let e = s();
|
|
387
|
+
return i === ")" && (i = r.next()), e;
|
|
388
|
+
}
|
|
389
|
+
if (w(i)) {
|
|
390
|
+
let e = [];
|
|
391
|
+
do
|
|
392
|
+
e.push(i), i = r.next();
|
|
393
|
+
while (w(i));
|
|
394
|
+
return (n) => t(e, n);
|
|
395
|
+
}
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
function o() {
|
|
399
|
+
let e = [], t = a();
|
|
400
|
+
for (; t;) e.push(t), t = a();
|
|
401
|
+
return (t) => e.every((e) => e(t));
|
|
402
|
+
}
|
|
403
|
+
function s() {
|
|
404
|
+
let e = [], t = o();
|
|
405
|
+
for (; t && (e.push(t), i === "|" || i === ",");) {
|
|
406
|
+
do
|
|
407
|
+
i = r.next();
|
|
408
|
+
while (i === "|" || i === ",");
|
|
409
|
+
t = o();
|
|
410
|
+
}
|
|
411
|
+
return (t) => e.some((e) => e(t));
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
function w(e) {
|
|
415
|
+
return !!e && !!e.match(/[\w\.:]+/);
|
|
416
|
+
}
|
|
417
|
+
function oe(e) {
|
|
418
|
+
let t = /([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g, n = t.exec(e);
|
|
419
|
+
return { next: () => {
|
|
420
|
+
if (!n) return null;
|
|
421
|
+
let r = n[0];
|
|
422
|
+
return n = t.exec(e), r;
|
|
423
|
+
} };
|
|
424
|
+
}
|
|
425
|
+
function T(e) {
|
|
426
|
+
typeof e.dispose == "function" && e.dispose();
|
|
427
|
+
}
|
|
428
|
+
var E = class {
|
|
429
|
+
constructor(e) {
|
|
430
|
+
this.scopeName = e;
|
|
431
|
+
}
|
|
432
|
+
toKey() {
|
|
433
|
+
return this.scopeName;
|
|
434
|
+
}
|
|
435
|
+
}, se = class {
|
|
436
|
+
constructor(e, t) {
|
|
437
|
+
this.scopeName = e, this.ruleName = t;
|
|
438
|
+
}
|
|
439
|
+
toKey() {
|
|
440
|
+
return `${this.scopeName}#${this.ruleName}`;
|
|
441
|
+
}
|
|
442
|
+
}, ce = class {
|
|
443
|
+
_references = [];
|
|
444
|
+
_seenReferenceKeys = /* @__PURE__ */ new Set();
|
|
445
|
+
get references() {
|
|
446
|
+
return this._references;
|
|
447
|
+
}
|
|
448
|
+
visitedRule = /* @__PURE__ */ new Set();
|
|
449
|
+
add(e) {
|
|
450
|
+
let t = e.toKey();
|
|
451
|
+
this._seenReferenceKeys.has(t) || (this._seenReferenceKeys.add(t), this._references.push(e));
|
|
452
|
+
}
|
|
453
|
+
}, le = class {
|
|
454
|
+
constructor(e, t) {
|
|
455
|
+
this.repo = e, this.initialScopeName = t, this.seenFullScopeRequests.add(this.initialScopeName), this.Q = [new E(this.initialScopeName)];
|
|
456
|
+
}
|
|
457
|
+
seenFullScopeRequests = /* @__PURE__ */ new Set();
|
|
458
|
+
seenPartialScopeRequests = /* @__PURE__ */ new Set();
|
|
459
|
+
Q;
|
|
460
|
+
processQueue() {
|
|
461
|
+
let e = this.Q;
|
|
462
|
+
this.Q = [];
|
|
463
|
+
let t = new ce();
|
|
464
|
+
for (let n of e) ue(n, this.initialScopeName, this.repo, t);
|
|
465
|
+
for (let e of t.references) if (e instanceof E) {
|
|
466
|
+
if (this.seenFullScopeRequests.has(e.scopeName)) continue;
|
|
467
|
+
this.seenFullScopeRequests.add(e.scopeName), this.Q.push(e);
|
|
468
|
+
} else {
|
|
469
|
+
if (this.seenFullScopeRequests.has(e.scopeName) || this.seenPartialScopeRequests.has(e.toKey())) continue;
|
|
470
|
+
this.seenPartialScopeRequests.add(e.toKey()), this.Q.push(e);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
function ue(e, t, n, r) {
|
|
475
|
+
let i = n.lookup(e.scopeName);
|
|
476
|
+
if (!i) {
|
|
477
|
+
if (e.scopeName === t) throw Error(`No grammar provided for <${t}>`);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
let a = n.lookup(t);
|
|
481
|
+
e instanceof E ? O({
|
|
482
|
+
baseGrammar: a,
|
|
483
|
+
selfGrammar: i
|
|
484
|
+
}, r) : D(e.ruleName, {
|
|
485
|
+
baseGrammar: a,
|
|
486
|
+
selfGrammar: i,
|
|
487
|
+
repository: i.repository
|
|
488
|
+
}, r);
|
|
489
|
+
let o = n.injections(e.scopeName);
|
|
490
|
+
if (o) for (let e of o) r.add(new E(e));
|
|
491
|
+
}
|
|
492
|
+
function D(e, t, n) {
|
|
493
|
+
if (t.repository && t.repository[e]) {
|
|
494
|
+
let r = t.repository[e];
|
|
495
|
+
k([r], t, n);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
function O(e, t) {
|
|
499
|
+
e.selfGrammar.patterns && Array.isArray(e.selfGrammar.patterns) && k(e.selfGrammar.patterns, {
|
|
500
|
+
...e,
|
|
501
|
+
repository: e.selfGrammar.repository
|
|
502
|
+
}, t), e.selfGrammar.injections && k(Object.values(e.selfGrammar.injections), {
|
|
503
|
+
...e,
|
|
504
|
+
repository: e.selfGrammar.repository
|
|
505
|
+
}, t);
|
|
506
|
+
}
|
|
507
|
+
function k(e, t, n) {
|
|
508
|
+
for (let r of e) {
|
|
509
|
+
if (n.visitedRule.has(r)) continue;
|
|
510
|
+
n.visitedRule.add(r);
|
|
511
|
+
let e = r.repository ? i({}, t.repository, r.repository) : t.repository;
|
|
512
|
+
Array.isArray(r.patterns) && k(r.patterns, {
|
|
513
|
+
...t,
|
|
514
|
+
repository: e
|
|
515
|
+
}, n);
|
|
516
|
+
let a = r.include;
|
|
517
|
+
if (!a) continue;
|
|
518
|
+
let o = A(a);
|
|
519
|
+
switch (o.kind) {
|
|
520
|
+
case 0:
|
|
521
|
+
O({
|
|
522
|
+
...t,
|
|
523
|
+
selfGrammar: t.baseGrammar
|
|
524
|
+
}, n);
|
|
525
|
+
break;
|
|
526
|
+
case 1:
|
|
527
|
+
O(t, n);
|
|
528
|
+
break;
|
|
529
|
+
case 2:
|
|
530
|
+
D(o.ruleName, {
|
|
531
|
+
...t,
|
|
532
|
+
repository: e
|
|
533
|
+
}, n);
|
|
534
|
+
break;
|
|
535
|
+
case 3:
|
|
536
|
+
case 4:
|
|
537
|
+
let r = o.scopeName === t.selfGrammar.scopeName ? t.selfGrammar : o.scopeName === t.baseGrammar.scopeName ? t.baseGrammar : void 0;
|
|
538
|
+
if (r) {
|
|
539
|
+
let i = {
|
|
540
|
+
baseGrammar: t.baseGrammar,
|
|
541
|
+
selfGrammar: r,
|
|
542
|
+
repository: e
|
|
543
|
+
};
|
|
544
|
+
o.kind === 4 ? D(o.ruleName, i, n) : O(i, n);
|
|
545
|
+
} else o.kind === 4 ? n.add(new se(o.scopeName, o.ruleName)) : n.add(new E(o.scopeName));
|
|
546
|
+
break;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
var de = class {
|
|
551
|
+
kind = 0;
|
|
552
|
+
}, fe = class {
|
|
553
|
+
kind = 1;
|
|
554
|
+
}, pe = class {
|
|
555
|
+
constructor(e) {
|
|
556
|
+
this.ruleName = e;
|
|
557
|
+
}
|
|
558
|
+
kind = 2;
|
|
559
|
+
}, me = class {
|
|
560
|
+
constructor(e) {
|
|
561
|
+
this.scopeName = e;
|
|
562
|
+
}
|
|
563
|
+
kind = 3;
|
|
564
|
+
}, he = class {
|
|
565
|
+
constructor(e, t) {
|
|
566
|
+
this.scopeName = e, this.ruleName = t;
|
|
567
|
+
}
|
|
568
|
+
kind = 4;
|
|
569
|
+
};
|
|
570
|
+
function A(e) {
|
|
571
|
+
if (e === "$base") return new de();
|
|
572
|
+
if (e === "$self") return new fe();
|
|
573
|
+
let t = e.indexOf("#");
|
|
574
|
+
return t === -1 ? new me(e) : t === 0 ? new pe(e.substring(1)) : new he(e.substring(0, t), e.substring(t + 1));
|
|
575
|
+
}
|
|
576
|
+
var ge = /\\(\d+)/, j = /\\(\d+)/g, _e = -1, M = -2;
|
|
577
|
+
function N(e) {
|
|
578
|
+
return e;
|
|
579
|
+
}
|
|
580
|
+
function P(e) {
|
|
581
|
+
return e;
|
|
582
|
+
}
|
|
583
|
+
var F = class {
|
|
584
|
+
$location;
|
|
585
|
+
id;
|
|
586
|
+
_nameIsCapturing;
|
|
587
|
+
_name;
|
|
588
|
+
_contentNameIsCapturing;
|
|
589
|
+
_contentName;
|
|
590
|
+
constructor(e, t, n, r) {
|
|
591
|
+
this.$location = e, this.id = t, this._name = n || null, this._nameIsCapturing = s.hasCaptures(this._name), this._contentName = r || null, this._contentNameIsCapturing = s.hasCaptures(this._contentName);
|
|
592
|
+
}
|
|
593
|
+
get debugName() {
|
|
594
|
+
let e = this.$location ? `${a(this.$location.filename)}:${this.$location.line}` : "unknown";
|
|
595
|
+
return `${this.constructor.name}#${this.id} @ ${e}`;
|
|
596
|
+
}
|
|
597
|
+
getName(e, t) {
|
|
598
|
+
return !this._nameIsCapturing || this._name === null || e === null || t === null ? this._name : s.replaceCaptures(this._name, e, t);
|
|
599
|
+
}
|
|
600
|
+
getContentName(e, t) {
|
|
601
|
+
return !this._contentNameIsCapturing || this._contentName === null ? this._contentName : s.replaceCaptures(this._contentName, e, t);
|
|
602
|
+
}
|
|
603
|
+
}, I = class extends F {
|
|
604
|
+
retokenizeCapturedWithRuleId;
|
|
605
|
+
constructor(e, t, n, r, i) {
|
|
606
|
+
super(e, t, n, r), this.retokenizeCapturedWithRuleId = i;
|
|
607
|
+
}
|
|
608
|
+
dispose() {}
|
|
609
|
+
collectPatterns(e, t) {
|
|
610
|
+
throw Error("Not supported!");
|
|
611
|
+
}
|
|
612
|
+
compile(e, t) {
|
|
613
|
+
throw Error("Not supported!");
|
|
614
|
+
}
|
|
615
|
+
compileAG(e, t, n, r) {
|
|
616
|
+
throw Error("Not supported!");
|
|
617
|
+
}
|
|
618
|
+
}, ve = class extends F {
|
|
619
|
+
_match;
|
|
620
|
+
captures;
|
|
621
|
+
_cachedCompiledPatterns;
|
|
622
|
+
constructor(e, t, n, r, i) {
|
|
623
|
+
super(e, t, n, null), this._match = new V(r, this.id), this.captures = i, this._cachedCompiledPatterns = null;
|
|
624
|
+
}
|
|
625
|
+
dispose() {
|
|
626
|
+
this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null);
|
|
627
|
+
}
|
|
628
|
+
get debugMatchRegExp() {
|
|
629
|
+
return `${this._match.source}`;
|
|
630
|
+
}
|
|
631
|
+
collectPatterns(e, t) {
|
|
632
|
+
t.push(this._match);
|
|
633
|
+
}
|
|
634
|
+
compile(e, t) {
|
|
635
|
+
return this._getCachedCompiledPatterns(e).compile(e);
|
|
636
|
+
}
|
|
637
|
+
compileAG(e, t, n, r) {
|
|
638
|
+
return this._getCachedCompiledPatterns(e).compileAG(e, n, r);
|
|
639
|
+
}
|
|
640
|
+
_getCachedCompiledPatterns(e) {
|
|
641
|
+
return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new H(), this.collectPatterns(e, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
|
|
642
|
+
}
|
|
643
|
+
}, L = class extends F {
|
|
644
|
+
hasMissingPatterns;
|
|
645
|
+
patterns;
|
|
646
|
+
_cachedCompiledPatterns;
|
|
647
|
+
constructor(e, t, n, r, i) {
|
|
648
|
+
super(e, t, n, r), this.patterns = i.patterns, this.hasMissingPatterns = i.hasMissingPatterns, this._cachedCompiledPatterns = null;
|
|
649
|
+
}
|
|
650
|
+
dispose() {
|
|
651
|
+
this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null);
|
|
652
|
+
}
|
|
653
|
+
collectPatterns(e, t) {
|
|
654
|
+
for (let n of this.patterns) e.getRule(n).collectPatterns(e, t);
|
|
655
|
+
}
|
|
656
|
+
compile(e, t) {
|
|
657
|
+
return this._getCachedCompiledPatterns(e).compile(e);
|
|
658
|
+
}
|
|
659
|
+
compileAG(e, t, n, r) {
|
|
660
|
+
return this._getCachedCompiledPatterns(e).compileAG(e, n, r);
|
|
661
|
+
}
|
|
662
|
+
_getCachedCompiledPatterns(e) {
|
|
663
|
+
return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new H(), this.collectPatterns(e, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
|
|
664
|
+
}
|
|
665
|
+
}, R = class extends F {
|
|
666
|
+
_begin;
|
|
667
|
+
beginCaptures;
|
|
668
|
+
_end;
|
|
669
|
+
endHasBackReferences;
|
|
670
|
+
endCaptures;
|
|
671
|
+
applyEndPatternLast;
|
|
672
|
+
hasMissingPatterns;
|
|
673
|
+
patterns;
|
|
674
|
+
_cachedCompiledPatterns;
|
|
675
|
+
constructor(e, t, n, r, i, a, o, s, c, l) {
|
|
676
|
+
super(e, t, n, r), this._begin = new V(i, this.id), this.beginCaptures = a, this._end = new V(o || "", -1), this.endHasBackReferences = this._end.hasBackReferences, this.endCaptures = s, this.applyEndPatternLast = c || !1, this.patterns = l.patterns, this.hasMissingPatterns = l.hasMissingPatterns, this._cachedCompiledPatterns = null;
|
|
677
|
+
}
|
|
678
|
+
dispose() {
|
|
679
|
+
this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null);
|
|
680
|
+
}
|
|
681
|
+
get debugBeginRegExp() {
|
|
682
|
+
return `${this._begin.source}`;
|
|
683
|
+
}
|
|
684
|
+
get debugEndRegExp() {
|
|
685
|
+
return `${this._end.source}`;
|
|
686
|
+
}
|
|
687
|
+
getEndWithResolvedBackReferences(e, t) {
|
|
688
|
+
return this._end.resolveBackReferences(e, t);
|
|
689
|
+
}
|
|
690
|
+
collectPatterns(e, t) {
|
|
691
|
+
t.push(this._begin);
|
|
692
|
+
}
|
|
693
|
+
compile(e, t) {
|
|
694
|
+
return this._getCachedCompiledPatterns(e, t).compile(e);
|
|
695
|
+
}
|
|
696
|
+
compileAG(e, t, n, r) {
|
|
697
|
+
return this._getCachedCompiledPatterns(e, t).compileAG(e, n, r);
|
|
698
|
+
}
|
|
699
|
+
_getCachedCompiledPatterns(e, t) {
|
|
700
|
+
if (!this._cachedCompiledPatterns) {
|
|
701
|
+
this._cachedCompiledPatterns = new H();
|
|
702
|
+
for (let t of this.patterns) e.getRule(t).collectPatterns(e, this._cachedCompiledPatterns);
|
|
703
|
+
this.applyEndPatternLast ? this._cachedCompiledPatterns.push(this._end.hasBackReferences ? this._end.clone() : this._end) : this._cachedCompiledPatterns.unshift(this._end.hasBackReferences ? this._end.clone() : this._end);
|
|
704
|
+
}
|
|
705
|
+
return this._end.hasBackReferences && (this.applyEndPatternLast ? this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length() - 1, t) : this._cachedCompiledPatterns.setSource(0, t)), this._cachedCompiledPatterns;
|
|
706
|
+
}
|
|
707
|
+
}, z = class extends F {
|
|
708
|
+
_begin;
|
|
709
|
+
beginCaptures;
|
|
710
|
+
whileCaptures;
|
|
711
|
+
_while;
|
|
712
|
+
whileHasBackReferences;
|
|
713
|
+
hasMissingPatterns;
|
|
714
|
+
patterns;
|
|
715
|
+
_cachedCompiledPatterns;
|
|
716
|
+
_cachedCompiledWhilePatterns;
|
|
717
|
+
constructor(e, t, n, r, i, a, o, s, c) {
|
|
718
|
+
super(e, t, n, r), this._begin = new V(i, this.id), this.beginCaptures = a, this.whileCaptures = s, this._while = new V(o, M), this.whileHasBackReferences = this._while.hasBackReferences, this.patterns = c.patterns, this.hasMissingPatterns = c.hasMissingPatterns, this._cachedCompiledPatterns = null, this._cachedCompiledWhilePatterns = null;
|
|
719
|
+
}
|
|
720
|
+
dispose() {
|
|
721
|
+
this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null), this._cachedCompiledWhilePatterns &&= (this._cachedCompiledWhilePatterns.dispose(), null);
|
|
722
|
+
}
|
|
723
|
+
get debugBeginRegExp() {
|
|
724
|
+
return `${this._begin.source}`;
|
|
725
|
+
}
|
|
726
|
+
get debugWhileRegExp() {
|
|
727
|
+
return `${this._while.source}`;
|
|
728
|
+
}
|
|
729
|
+
getWhileWithResolvedBackReferences(e, t) {
|
|
730
|
+
return this._while.resolveBackReferences(e, t);
|
|
731
|
+
}
|
|
732
|
+
collectPatterns(e, t) {
|
|
733
|
+
t.push(this._begin);
|
|
734
|
+
}
|
|
735
|
+
compile(e, t) {
|
|
736
|
+
return this._getCachedCompiledPatterns(e).compile(e);
|
|
737
|
+
}
|
|
738
|
+
compileAG(e, t, n, r) {
|
|
739
|
+
return this._getCachedCompiledPatterns(e).compileAG(e, n, r);
|
|
740
|
+
}
|
|
741
|
+
_getCachedCompiledPatterns(e) {
|
|
742
|
+
if (!this._cachedCompiledPatterns) {
|
|
743
|
+
this._cachedCompiledPatterns = new H();
|
|
744
|
+
for (let t of this.patterns) e.getRule(t).collectPatterns(e, this._cachedCompiledPatterns);
|
|
745
|
+
}
|
|
746
|
+
return this._cachedCompiledPatterns;
|
|
747
|
+
}
|
|
748
|
+
compileWhile(e, t) {
|
|
749
|
+
return this._getCachedCompiledWhilePatterns(e, t).compile(e);
|
|
750
|
+
}
|
|
751
|
+
compileWhileAG(e, t, n, r) {
|
|
752
|
+
return this._getCachedCompiledWhilePatterns(e, t).compileAG(e, n, r);
|
|
753
|
+
}
|
|
754
|
+
_getCachedCompiledWhilePatterns(e, t) {
|
|
755
|
+
return this._cachedCompiledWhilePatterns || (this._cachedCompiledWhilePatterns = new H(), this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences ? this._while.clone() : this._while)), this._while.hasBackReferences && this._cachedCompiledWhilePatterns.setSource(0, t || ""), this._cachedCompiledWhilePatterns;
|
|
756
|
+
}
|
|
757
|
+
}, B = class e {
|
|
758
|
+
static createCaptureRule(e, t, n, r, i) {
|
|
759
|
+
return e.registerRule((e) => new I(t, e, n, r, i));
|
|
760
|
+
}
|
|
761
|
+
static getCompiledRuleId(t, n, r) {
|
|
762
|
+
return t.id || n.registerRule((a) => {
|
|
763
|
+
if (t.id = a, t.match) return new ve(t.$vscodeTextmateLocation, t.id, t.name, t.match, e._compileCaptures(t.captures, n, r));
|
|
764
|
+
if (t.begin === void 0) {
|
|
765
|
+
t.repository && (r = i({}, r, t.repository));
|
|
766
|
+
let a = t.patterns;
|
|
767
|
+
return a === void 0 && t.include && (a = [{ include: t.include }]), new L(t.$vscodeTextmateLocation, t.id, t.name, t.contentName, e._compilePatterns(a, n, r));
|
|
768
|
+
}
|
|
769
|
+
return t.while ? new z(t.$vscodeTextmateLocation, t.id, t.name, t.contentName, t.begin, e._compileCaptures(t.beginCaptures || t.captures, n, r), t.while, e._compileCaptures(t.whileCaptures || t.captures, n, r), e._compilePatterns(t.patterns, n, r)) : new R(t.$vscodeTextmateLocation, t.id, t.name, t.contentName, t.begin, e._compileCaptures(t.beginCaptures || t.captures, n, r), t.end, e._compileCaptures(t.endCaptures || t.captures, n, r), t.applyEndPatternLast, e._compilePatterns(t.patterns, n, r));
|
|
770
|
+
}), t.id;
|
|
771
|
+
}
|
|
772
|
+
static _compileCaptures(t, n, r) {
|
|
773
|
+
let i = [];
|
|
774
|
+
if (t) {
|
|
775
|
+
let a = 0;
|
|
776
|
+
for (let e in t) {
|
|
777
|
+
if (e === "$vscodeTextmateLocation") continue;
|
|
778
|
+
let t = parseInt(e, 10);
|
|
779
|
+
t > a && (a = t);
|
|
780
|
+
}
|
|
781
|
+
for (let e = 0; e <= a; e++) i[e] = null;
|
|
782
|
+
for (let a in t) {
|
|
783
|
+
if (a === "$vscodeTextmateLocation") continue;
|
|
784
|
+
let o = parseInt(a, 10), s = 0;
|
|
785
|
+
t[a].patterns && (s = e.getCompiledRuleId(t[a], n, r)), i[o] = e.createCaptureRule(n, t[a].$vscodeTextmateLocation, t[a].name, t[a].contentName, s);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
return i;
|
|
789
|
+
}
|
|
790
|
+
static _compilePatterns(t, n, r) {
|
|
791
|
+
let i = [];
|
|
792
|
+
if (t) for (let a = 0, o = t.length; a < o; a++) {
|
|
793
|
+
let o = t[a], s = -1;
|
|
794
|
+
if (o.include) {
|
|
795
|
+
let t = A(o.include);
|
|
796
|
+
switch (t.kind) {
|
|
797
|
+
case 0:
|
|
798
|
+
case 1:
|
|
799
|
+
s = e.getCompiledRuleId(r[o.include], n, r);
|
|
800
|
+
break;
|
|
801
|
+
case 2:
|
|
802
|
+
let i = r[t.ruleName];
|
|
803
|
+
i && (s = e.getCompiledRuleId(i, n, r));
|
|
804
|
+
break;
|
|
805
|
+
case 3:
|
|
806
|
+
case 4:
|
|
807
|
+
let a = t.scopeName, c = t.kind === 4 ? t.ruleName : null, l = n.getExternalGrammar(a, r);
|
|
808
|
+
if (l) if (c) {
|
|
809
|
+
let t = l.repository[c];
|
|
810
|
+
t && (s = e.getCompiledRuleId(t, n, l.repository));
|
|
811
|
+
} else s = e.getCompiledRuleId(l.repository.$self, n, l.repository);
|
|
812
|
+
break;
|
|
813
|
+
}
|
|
814
|
+
} else s = e.getCompiledRuleId(o, n, r);
|
|
815
|
+
if (s !== -1) {
|
|
816
|
+
let e = n.getRule(s), t = !1;
|
|
817
|
+
if ((e instanceof L || e instanceof R || e instanceof z) && e.hasMissingPatterns && e.patterns.length === 0 && (t = !0), t) continue;
|
|
818
|
+
i.push(s);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
return {
|
|
822
|
+
patterns: i,
|
|
823
|
+
hasMissingPatterns: (t ? t.length : 0) !== i.length
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
}, V = class e {
|
|
827
|
+
source;
|
|
828
|
+
ruleId;
|
|
829
|
+
hasAnchor;
|
|
830
|
+
hasBackReferences;
|
|
831
|
+
_anchorCache;
|
|
832
|
+
constructor(e, t) {
|
|
833
|
+
if (e && typeof e == "string") {
|
|
834
|
+
let t = e.length, n = 0, r = [], i = !1;
|
|
835
|
+
for (let a = 0; a < t; a++) if (e.charAt(a) === "\\" && a + 1 < t) {
|
|
836
|
+
let t = e.charAt(a + 1);
|
|
837
|
+
t === "z" ? (r.push(e.substring(n, a)), r.push("$(?!\\n)(?<!\\n)"), n = a + 2) : (t === "A" || t === "G") && (i = !0), a++;
|
|
838
|
+
}
|
|
839
|
+
this.hasAnchor = i, n === 0 ? this.source = e : (r.push(e.substring(n, t)), this.source = r.join(""));
|
|
840
|
+
} else this.hasAnchor = !1, this.source = e;
|
|
841
|
+
this.hasAnchor ? this._anchorCache = this._buildAnchorCache() : this._anchorCache = null, this.ruleId = t, typeof this.source == "string" ? this.hasBackReferences = ge.test(this.source) : this.hasBackReferences = !1;
|
|
842
|
+
}
|
|
843
|
+
clone() {
|
|
844
|
+
return new e(this.source, this.ruleId);
|
|
845
|
+
}
|
|
846
|
+
setSource(e) {
|
|
847
|
+
this.source !== e && (this.source = e, this.hasAnchor && (this._anchorCache = this._buildAnchorCache()));
|
|
848
|
+
}
|
|
849
|
+
resolveBackReferences(e, t) {
|
|
850
|
+
if (typeof this.source != "string") throw Error("This method should only be called if the source is a string");
|
|
851
|
+
let n = t.map((t) => e.substring(t.start, t.end));
|
|
852
|
+
return j.lastIndex = 0, this.source.replace(j, (e, t) => d(n[parseInt(t, 10)] || ""));
|
|
853
|
+
}
|
|
854
|
+
_buildAnchorCache() {
|
|
855
|
+
if (typeof this.source != "string") throw Error("This method should only be called if the source is a string");
|
|
856
|
+
let e = [], t = [], n = [], r = [], i, a, o, s;
|
|
857
|
+
for (i = 0, a = this.source.length; i < a; i++) o = this.source.charAt(i), e[i] = o, t[i] = o, n[i] = o, r[i] = o, o === "\\" && i + 1 < a && (s = this.source.charAt(i + 1), s === "A" ? (e[i + 1] = "", t[i + 1] = "", n[i + 1] = "A", r[i + 1] = "A") : s === "G" ? (e[i + 1] = "", t[i + 1] = "G", n[i + 1] = "", r[i + 1] = "G") : (e[i + 1] = s, t[i + 1] = s, n[i + 1] = s, r[i + 1] = s), i++);
|
|
858
|
+
return {
|
|
859
|
+
A0_G0: e.join(""),
|
|
860
|
+
A0_G1: t.join(""),
|
|
861
|
+
A1_G0: n.join(""),
|
|
862
|
+
A1_G1: r.join("")
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
resolveAnchors(e, t) {
|
|
866
|
+
return !this.hasAnchor || !this._anchorCache || typeof this.source != "string" ? this.source : e ? t ? this._anchorCache.A1_G1 : this._anchorCache.A1_G0 : t ? this._anchorCache.A0_G1 : this._anchorCache.A0_G0;
|
|
867
|
+
}
|
|
868
|
+
}, H = class {
|
|
869
|
+
_items;
|
|
870
|
+
_hasAnchors;
|
|
871
|
+
_cached;
|
|
872
|
+
_anchorCache;
|
|
873
|
+
constructor() {
|
|
874
|
+
this._items = [], this._hasAnchors = !1, this._cached = null, this._anchorCache = {
|
|
875
|
+
A0_G0: null,
|
|
876
|
+
A0_G1: null,
|
|
877
|
+
A1_G0: null,
|
|
878
|
+
A1_G1: null
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
dispose() {
|
|
882
|
+
this._disposeCaches();
|
|
883
|
+
}
|
|
884
|
+
_disposeCaches() {
|
|
885
|
+
this._cached &&= (this._cached.dispose(), null), this._anchorCache.A0_G0 && (this._anchorCache.A0_G0.dispose(), this._anchorCache.A0_G0 = null), this._anchorCache.A0_G1 && (this._anchorCache.A0_G1.dispose(), this._anchorCache.A0_G1 = null), this._anchorCache.A1_G0 && (this._anchorCache.A1_G0.dispose(), this._anchorCache.A1_G0 = null), this._anchorCache.A1_G1 && (this._anchorCache.A1_G1.dispose(), this._anchorCache.A1_G1 = null);
|
|
886
|
+
}
|
|
887
|
+
push(e) {
|
|
888
|
+
this._items.push(e), this._hasAnchors = this._hasAnchors || e.hasAnchor;
|
|
889
|
+
}
|
|
890
|
+
unshift(e) {
|
|
891
|
+
this._items.unshift(e), this._hasAnchors = this._hasAnchors || e.hasAnchor;
|
|
892
|
+
}
|
|
893
|
+
length() {
|
|
894
|
+
return this._items.length;
|
|
895
|
+
}
|
|
896
|
+
setSource(e, t) {
|
|
897
|
+
this._items[e].source !== t && (this._disposeCaches(), this._items[e].setSource(t));
|
|
898
|
+
}
|
|
899
|
+
compile(e) {
|
|
900
|
+
if (!this._cached) {
|
|
901
|
+
let t = this._items.map((e) => e.source);
|
|
902
|
+
this._cached = new U(e, t, this._items.map((e) => e.ruleId));
|
|
903
|
+
}
|
|
904
|
+
return this._cached;
|
|
905
|
+
}
|
|
906
|
+
compileAG(e, t, n) {
|
|
907
|
+
return this._hasAnchors ? t ? n ? (this._anchorCache.A1_G1 || (this._anchorCache.A1_G1 = this._resolveAnchors(e, t, n)), this._anchorCache.A1_G1) : (this._anchorCache.A1_G0 || (this._anchorCache.A1_G0 = this._resolveAnchors(e, t, n)), this._anchorCache.A1_G0) : n ? (this._anchorCache.A0_G1 || (this._anchorCache.A0_G1 = this._resolveAnchors(e, t, n)), this._anchorCache.A0_G1) : (this._anchorCache.A0_G0 || (this._anchorCache.A0_G0 = this._resolveAnchors(e, t, n)), this._anchorCache.A0_G0) : this.compile(e);
|
|
908
|
+
}
|
|
909
|
+
_resolveAnchors(e, t, n) {
|
|
910
|
+
return new U(e, this._items.map((e) => e.resolveAnchors(t, n)), this._items.map((e) => e.ruleId));
|
|
911
|
+
}
|
|
912
|
+
}, U = class {
|
|
913
|
+
constructor(e, t, n) {
|
|
914
|
+
this.regExps = t, this.rules = n, this.scanner = e.createOnigScanner(t);
|
|
915
|
+
}
|
|
916
|
+
scanner;
|
|
917
|
+
dispose() {
|
|
918
|
+
typeof this.scanner.dispose == "function" && this.scanner.dispose();
|
|
919
|
+
}
|
|
920
|
+
toString() {
|
|
921
|
+
let e = [];
|
|
922
|
+
for (let t = 0, n = this.rules.length; t < n; t++) e.push(" - " + this.rules[t] + ": " + this.regExps[t]);
|
|
923
|
+
return e.join("\n");
|
|
924
|
+
}
|
|
925
|
+
findNextMatchSync(e, t, n) {
|
|
926
|
+
let r = this.scanner.findNextMatchSync(e, t, n);
|
|
927
|
+
return r ? {
|
|
928
|
+
ruleId: this.rules[r.index],
|
|
929
|
+
captureIndices: r.captureIndices
|
|
930
|
+
} : null;
|
|
931
|
+
}
|
|
932
|
+
}, W = class {
|
|
933
|
+
constructor(e, t) {
|
|
934
|
+
this.languageId = e, this.tokenType = t;
|
|
935
|
+
}
|
|
936
|
+
}, ye = class e {
|
|
937
|
+
_defaultAttributes;
|
|
938
|
+
_embeddedLanguagesMatcher;
|
|
939
|
+
constructor(e, t) {
|
|
940
|
+
this._defaultAttributes = new W(e, 8), this._embeddedLanguagesMatcher = new be(Object.entries(t || {}));
|
|
941
|
+
}
|
|
942
|
+
getDefaultAttributes() {
|
|
943
|
+
return this._defaultAttributes;
|
|
944
|
+
}
|
|
945
|
+
getBasicScopeAttributes(t) {
|
|
946
|
+
return t === null ? e._NULL_SCOPE_METADATA : this._getBasicScopeAttributes.get(t);
|
|
947
|
+
}
|
|
948
|
+
static _NULL_SCOPE_METADATA = new W(0, 0);
|
|
949
|
+
_getBasicScopeAttributes = new f((e) => new W(this._scopeToLanguage(e), this._toStandardTokenType(e)));
|
|
950
|
+
_scopeToLanguage(e) {
|
|
951
|
+
return this._embeddedLanguagesMatcher.match(e) || 0;
|
|
952
|
+
}
|
|
953
|
+
_toStandardTokenType(t) {
|
|
954
|
+
let n = t.match(e.STANDARD_TOKEN_TYPE_REGEXP);
|
|
955
|
+
if (!n) return 8;
|
|
956
|
+
switch (n[1]) {
|
|
957
|
+
case "comment": return 1;
|
|
958
|
+
case "string": return 2;
|
|
959
|
+
case "regex": return 3;
|
|
960
|
+
case "meta.embedded": return 0;
|
|
961
|
+
}
|
|
962
|
+
throw Error("Unexpected match for standard token type!");
|
|
963
|
+
}
|
|
964
|
+
static STANDARD_TOKEN_TYPE_REGEXP = /\b(comment|string|regex|meta\.embedded)\b/;
|
|
965
|
+
}, be = class {
|
|
966
|
+
values;
|
|
967
|
+
scopesRegExp;
|
|
968
|
+
constructor(e) {
|
|
969
|
+
if (e.length === 0) this.values = null, this.scopesRegExp = null;
|
|
970
|
+
else {
|
|
971
|
+
this.values = new Map(e);
|
|
972
|
+
let t = e.map(([e, t]) => d(e));
|
|
973
|
+
t.sort(), t.reverse(), this.scopesRegExp = RegExp(`^((${t.join(")|(")}))($|\\.)`, "");
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
match(e) {
|
|
977
|
+
if (!this.scopesRegExp) return;
|
|
978
|
+
let t = e.match(this.scopesRegExp);
|
|
979
|
+
if (t) return this.values.get(t[1]);
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
typeof process < "u" && process.env.VSCODE_TEXTMATE_DEBUG;
|
|
983
|
+
var G = class {
|
|
984
|
+
constructor(e, t) {
|
|
985
|
+
this.stack = e, this.stoppedEarly = t;
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
function K(e, t, n, r, i, a, o, s) {
|
|
989
|
+
let c = t.content.length, l = !1, u = -1;
|
|
990
|
+
if (o) {
|
|
991
|
+
let o = xe(e, t, n, r, i, a);
|
|
992
|
+
i = o.stack, r = o.linePos, n = o.isFirstLine, u = o.anchorPosition;
|
|
993
|
+
}
|
|
994
|
+
let d = Date.now();
|
|
995
|
+
for (; !l;) {
|
|
996
|
+
if (s !== 0 && Date.now() - d > s) return new G(i, !0);
|
|
997
|
+
f();
|
|
998
|
+
}
|
|
999
|
+
return new G(i, !1);
|
|
1000
|
+
function f() {
|
|
1001
|
+
let o = Se(e, t, n, r, i, u);
|
|
1002
|
+
if (!o) {
|
|
1003
|
+
a.produce(i, c), l = !0;
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
let s = o.captureIndices, d = o.matchedRuleId, f = s && s.length > 0 ? s[0].end > r : !1;
|
|
1007
|
+
if (d === _e) {
|
|
1008
|
+
let o = i.getRule(e);
|
|
1009
|
+
a.produce(i, s[0].start), i = i.withContentNameScopesList(i.nameScopesList), J(e, t, n, i, a, o.endCaptures, s), a.produce(i, s[0].end);
|
|
1010
|
+
let d = i;
|
|
1011
|
+
if (i = i.parent, u = d.getAnchorPos(), !f && d.getEnterPos() === r) {
|
|
1012
|
+
i = d, a.produce(i, c), l = !0;
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
} else {
|
|
1016
|
+
let o = e.getRule(d);
|
|
1017
|
+
a.produce(i, s[0].start);
|
|
1018
|
+
let p = i, m = o.getName(t.content, s), h = i.contentNameScopesList.pushAttributed(m, e);
|
|
1019
|
+
if (i = i.push(d, r, u, s[0].end === c, null, h, h), o instanceof R) {
|
|
1020
|
+
let r = o;
|
|
1021
|
+
J(e, t, n, i, a, r.beginCaptures, s), a.produce(i, s[0].end), u = s[0].end;
|
|
1022
|
+
let d = r.getContentName(t.content, s), m = h.pushAttributed(d, e);
|
|
1023
|
+
if (i = i.withContentNameScopesList(m), r.endHasBackReferences && (i = i.withEndRule(r.getEndWithResolvedBackReferences(t.content, s))), !f && p.hasSameRuleAs(i)) {
|
|
1024
|
+
i = i.pop(), a.produce(i, c), l = !0;
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
} else if (o instanceof z) {
|
|
1028
|
+
let r = o;
|
|
1029
|
+
J(e, t, n, i, a, r.beginCaptures, s), a.produce(i, s[0].end), u = s[0].end;
|
|
1030
|
+
let d = r.getContentName(t.content, s), m = h.pushAttributed(d, e);
|
|
1031
|
+
if (i = i.withContentNameScopesList(m), r.whileHasBackReferences && (i = i.withEndRule(r.getWhileWithResolvedBackReferences(t.content, s))), !f && p.hasSameRuleAs(i)) {
|
|
1032
|
+
i = i.pop(), a.produce(i, c), l = !0;
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
} else if (J(e, t, n, i, a, o.captures, s), a.produce(i, s[0].end), i = i.pop(), !f) {
|
|
1036
|
+
i = i.safePop(), a.produce(i, c), l = !0;
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
s[0].end > r && (r = s[0].end, n = !1);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
function xe(e, t, n, r, i, a) {
|
|
1044
|
+
let o = i.beginRuleCapturedEOL ? 0 : -1, s = [];
|
|
1045
|
+
for (let t = i; t; t = t.pop()) {
|
|
1046
|
+
let n = t.getRule(e);
|
|
1047
|
+
n instanceof z && s.push({
|
|
1048
|
+
rule: n,
|
|
1049
|
+
stack: t
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
for (let c = s.pop(); c; c = s.pop()) {
|
|
1053
|
+
let { ruleScanner: s, findOptions: l } = Te(c.rule, e, c.stack.endRule, n, r === o), u = s.findNextMatchSync(t, r, l);
|
|
1054
|
+
if (u) {
|
|
1055
|
+
if (u.ruleId !== M) {
|
|
1056
|
+
i = c.stack.pop();
|
|
1057
|
+
break;
|
|
1058
|
+
}
|
|
1059
|
+
u.captureIndices && u.captureIndices.length && (a.produce(c.stack, u.captureIndices[0].start), J(e, t, n, c.stack, a, c.rule.whileCaptures, u.captureIndices), a.produce(c.stack, u.captureIndices[0].end), o = u.captureIndices[0].end, u.captureIndices[0].end > r && (r = u.captureIndices[0].end, n = !1));
|
|
1060
|
+
} else {
|
|
1061
|
+
i = c.stack.pop();
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
return {
|
|
1066
|
+
stack: i,
|
|
1067
|
+
linePos: r,
|
|
1068
|
+
anchorPosition: o,
|
|
1069
|
+
isFirstLine: n
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
function Se(e, t, n, r, i, a) {
|
|
1073
|
+
let o = Ce(e, t, n, r, i, a), s = e.getInjections();
|
|
1074
|
+
if (s.length === 0) return o;
|
|
1075
|
+
let c = we(s, e, t, n, r, i, a);
|
|
1076
|
+
if (!c) return o;
|
|
1077
|
+
if (!o) return c;
|
|
1078
|
+
let l = o.captureIndices[0].start, u = c.captureIndices[0].start;
|
|
1079
|
+
return u < l || c.priorityMatch && u === l ? c : o;
|
|
1080
|
+
}
|
|
1081
|
+
function Ce(e, t, n, r, i, a) {
|
|
1082
|
+
let { ruleScanner: o, findOptions: s } = q(i.getRule(e), e, i.endRule, n, r === a), c = o.findNextMatchSync(t, r, s);
|
|
1083
|
+
return c ? {
|
|
1084
|
+
captureIndices: c.captureIndices,
|
|
1085
|
+
matchedRuleId: c.ruleId
|
|
1086
|
+
} : null;
|
|
1087
|
+
}
|
|
1088
|
+
function we(e, t, n, r, i, a, o) {
|
|
1089
|
+
let s = Number.MAX_VALUE, c = null, l, u = 0, d = a.contentNameScopesList.getScopeNames();
|
|
1090
|
+
for (let a = 0, f = e.length; a < f; a++) {
|
|
1091
|
+
let f = e[a];
|
|
1092
|
+
if (!f.matcher(d)) continue;
|
|
1093
|
+
let { ruleScanner: p, findOptions: m } = q(t.getRule(f.ruleId), t, null, r, i === o), h = p.findNextMatchSync(n, i, m);
|
|
1094
|
+
if (!h) continue;
|
|
1095
|
+
let g = h.captureIndices[0].start;
|
|
1096
|
+
if (!(g >= s) && (s = g, c = h.captureIndices, l = h.ruleId, u = f.priority, s === i)) break;
|
|
1097
|
+
}
|
|
1098
|
+
return c ? {
|
|
1099
|
+
priorityMatch: u === -1,
|
|
1100
|
+
captureIndices: c,
|
|
1101
|
+
matchedRuleId: l
|
|
1102
|
+
} : null;
|
|
1103
|
+
}
|
|
1104
|
+
function q(e, t, n, r, i) {
|
|
1105
|
+
return {
|
|
1106
|
+
ruleScanner: e.compileAG(t, n, r, i),
|
|
1107
|
+
findOptions: 0
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
function Te(e, t, n, r, i) {
|
|
1111
|
+
return {
|
|
1112
|
+
ruleScanner: e.compileWhileAG(t, n, r, i),
|
|
1113
|
+
findOptions: 0
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
function J(e, t, n, r, i, a, o) {
|
|
1117
|
+
if (a.length === 0) return;
|
|
1118
|
+
let s = t.content, c = Math.min(a.length, o.length), l = [], u = o[0].end;
|
|
1119
|
+
for (let t = 0; t < c; t++) {
|
|
1120
|
+
let c = a[t];
|
|
1121
|
+
if (c === null) continue;
|
|
1122
|
+
let d = o[t];
|
|
1123
|
+
if (d.length === 0) continue;
|
|
1124
|
+
if (d.start > u) break;
|
|
1125
|
+
for (; l.length > 0 && l[l.length - 1].endPos <= d.start;) i.produceFromScopes(l[l.length - 1].scopes, l[l.length - 1].endPos), l.pop();
|
|
1126
|
+
if (l.length > 0 ? i.produceFromScopes(l[l.length - 1].scopes, d.start) : i.produce(r, d.start), c.retokenizeCapturedWithRuleId) {
|
|
1127
|
+
let t = c.getName(s, o), a = r.contentNameScopesList.pushAttributed(t, e), l = c.getContentName(s, o), u = a.pushAttributed(l, e), f = r.push(c.retokenizeCapturedWithRuleId, d.start, -1, !1, null, a, u), p = e.createOnigString(s.substring(0, d.end));
|
|
1128
|
+
K(e, p, n && d.start === 0, d.start, f, i, !1, 0), T(p);
|
|
1129
|
+
continue;
|
|
1130
|
+
}
|
|
1131
|
+
let f = c.getName(s, o);
|
|
1132
|
+
if (f !== null) {
|
|
1133
|
+
let t = (l.length > 0 ? l[l.length - 1].scopes : r.contentNameScopesList).pushAttributed(f, e);
|
|
1134
|
+
l.push(new Ee(t, d.end));
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
for (; l.length > 0;) i.produceFromScopes(l[l.length - 1].scopes, l[l.length - 1].endPos), l.pop();
|
|
1138
|
+
}
|
|
1139
|
+
var Ee = class {
|
|
1140
|
+
scopes;
|
|
1141
|
+
endPos;
|
|
1142
|
+
constructor(e, t) {
|
|
1143
|
+
this.scopes = e, this.endPos = t;
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
function De(e, t, n, r, i, a, o, s) {
|
|
1147
|
+
return new ke(e, t, n, r, i, a, o, s);
|
|
1148
|
+
}
|
|
1149
|
+
function Y(e, t, n, r, i) {
|
|
1150
|
+
let a = C(t, X), o = B.getCompiledRuleId(n, r, i.repository);
|
|
1151
|
+
for (let n of a) e.push({
|
|
1152
|
+
debugSelector: t,
|
|
1153
|
+
matcher: n.matcher,
|
|
1154
|
+
ruleId: o,
|
|
1155
|
+
grammar: i,
|
|
1156
|
+
priority: n.priority
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
function X(e, t) {
|
|
1160
|
+
if (t.length < e.length) return !1;
|
|
1161
|
+
let n = 0;
|
|
1162
|
+
return e.every((e) => {
|
|
1163
|
+
for (let r = n; r < t.length; r++) if (Oe(t[r], e)) return n = r + 1, !0;
|
|
1164
|
+
return !1;
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
function Oe(e, t) {
|
|
1168
|
+
if (!e) return !1;
|
|
1169
|
+
if (e === t) return !0;
|
|
1170
|
+
let n = t.length;
|
|
1171
|
+
return e.length > n && e.substr(0, n) === t && e[n] === ".";
|
|
1172
|
+
}
|
|
1173
|
+
var ke = class {
|
|
1174
|
+
constructor(e, t, n, r, i, a, o, s) {
|
|
1175
|
+
if (this._rootScopeName = e, this.balancedBracketSelectors = a, this._onigLib = s, this._basicScopeAttributesProvider = new ye(n, r), this._rootId = -1, this._lastRuleId = 0, this._ruleId2desc = [null], this._includedGrammars = {}, this._grammarRepository = o, this._grammar = Z(t, null), this._injections = null, this._tokenTypeMatchers = [], i) for (let e of Object.keys(i)) {
|
|
1176
|
+
let t = C(e, X);
|
|
1177
|
+
for (let n of t) this._tokenTypeMatchers.push({
|
|
1178
|
+
matcher: n.matcher,
|
|
1179
|
+
type: i[e]
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
_rootId;
|
|
1184
|
+
_lastRuleId;
|
|
1185
|
+
_ruleId2desc;
|
|
1186
|
+
_includedGrammars;
|
|
1187
|
+
_grammarRepository;
|
|
1188
|
+
_grammar;
|
|
1189
|
+
_injections;
|
|
1190
|
+
_basicScopeAttributesProvider;
|
|
1191
|
+
_tokenTypeMatchers;
|
|
1192
|
+
get themeProvider() {
|
|
1193
|
+
return this._grammarRepository;
|
|
1194
|
+
}
|
|
1195
|
+
dispose() {
|
|
1196
|
+
for (let e of this._ruleId2desc) e && e.dispose();
|
|
1197
|
+
}
|
|
1198
|
+
createOnigScanner(e) {
|
|
1199
|
+
return this._onigLib.createOnigScanner(e);
|
|
1200
|
+
}
|
|
1201
|
+
createOnigString(e) {
|
|
1202
|
+
return this._onigLib.createOnigString(e);
|
|
1203
|
+
}
|
|
1204
|
+
getMetadataForScope(e) {
|
|
1205
|
+
return this._basicScopeAttributesProvider.getBasicScopeAttributes(e);
|
|
1206
|
+
}
|
|
1207
|
+
_collectInjections() {
|
|
1208
|
+
let e = {
|
|
1209
|
+
lookup: (e) => e === this._rootScopeName ? this._grammar : this.getExternalGrammar(e),
|
|
1210
|
+
injections: (e) => this._grammarRepository.injections(e)
|
|
1211
|
+
}, t = [], n = this._rootScopeName, r = e.lookup(n);
|
|
1212
|
+
if (r) {
|
|
1213
|
+
let e = r.injections;
|
|
1214
|
+
if (e) for (let n in e) Y(t, n, e[n], this, r);
|
|
1215
|
+
let i = this._grammarRepository.injections(n);
|
|
1216
|
+
i && i.forEach((e) => {
|
|
1217
|
+
let n = this.getExternalGrammar(e);
|
|
1218
|
+
if (n) {
|
|
1219
|
+
let e = n.injectionSelector;
|
|
1220
|
+
e && Y(t, e, n, this, n);
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
return t.sort((e, t) => e.priority - t.priority), t;
|
|
1225
|
+
}
|
|
1226
|
+
getInjections() {
|
|
1227
|
+
return this._injections === null && (this._injections = this._collectInjections()), this._injections;
|
|
1228
|
+
}
|
|
1229
|
+
registerRule(e) {
|
|
1230
|
+
let t = ++this._lastRuleId, n = e(N(t));
|
|
1231
|
+
return this._ruleId2desc[t] = n, n;
|
|
1232
|
+
}
|
|
1233
|
+
getRule(e) {
|
|
1234
|
+
return this._ruleId2desc[P(e)];
|
|
1235
|
+
}
|
|
1236
|
+
getExternalGrammar(e, t) {
|
|
1237
|
+
if (this._includedGrammars[e]) return this._includedGrammars[e];
|
|
1238
|
+
if (this._grammarRepository) {
|
|
1239
|
+
let n = this._grammarRepository.lookup(e);
|
|
1240
|
+
if (n) return this._includedGrammars[e] = Z(n, t && t.$base), this._includedGrammars[e];
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
tokenizeLine(e, t, n = 0) {
|
|
1244
|
+
let r = this._tokenize(e, t, !1, n);
|
|
1245
|
+
return {
|
|
1246
|
+
tokens: r.lineTokens.getResult(r.ruleStack, r.lineLength),
|
|
1247
|
+
ruleStack: r.ruleStack,
|
|
1248
|
+
stoppedEarly: r.stoppedEarly
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
tokenizeLine2(e, t, n = 0) {
|
|
1252
|
+
let r = this._tokenize(e, t, !0, n);
|
|
1253
|
+
return {
|
|
1254
|
+
tokens: r.lineTokens.getBinaryResult(r.ruleStack, r.lineLength),
|
|
1255
|
+
ruleStack: r.ruleStack,
|
|
1256
|
+
stoppedEarly: r.stoppedEarly
|
|
1257
|
+
};
|
|
1258
|
+
}
|
|
1259
|
+
_tokenize(e, t, n, r) {
|
|
1260
|
+
this._rootId === -1 && (this._rootId = B.getCompiledRuleId(this._grammar.repository.$self, this, this._grammar.repository), this.getInjections());
|
|
1261
|
+
let i;
|
|
1262
|
+
if (!t || t === $.NULL) {
|
|
1263
|
+
i = !0;
|
|
1264
|
+
let e = this._basicScopeAttributesProvider.getDefaultAttributes(), n = this.themeProvider.getDefaults(), r = x.set(0, e.languageId, e.tokenType, null, n.fontStyle, n.foregroundId, n.backgroundId), a = this.getRule(this._rootId).getName(null, null), o;
|
|
1265
|
+
o = a ? Q.createRootAndLookUpScopeName(a, r, this) : Q.createRoot("unknown", r), t = new $(null, this._rootId, -1, -1, !1, null, o, o);
|
|
1266
|
+
} else i = !1, t.reset();
|
|
1267
|
+
e += "\n";
|
|
1268
|
+
let a = this.createOnigString(e), o = a.content.length, s = new je(n, e, this._tokenTypeMatchers, this.balancedBracketSelectors), c = K(this, a, i, 0, t, s, !0, r);
|
|
1269
|
+
return T(a), {
|
|
1270
|
+
lineLength: o,
|
|
1271
|
+
lineTokens: s,
|
|
1272
|
+
ruleStack: c.stack,
|
|
1273
|
+
stoppedEarly: c.stoppedEarly
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
};
|
|
1277
|
+
function Z(t, n) {
|
|
1278
|
+
return t = e(t), t.repository = t.repository || {}, t.repository.$self = {
|
|
1279
|
+
$vscodeTextmateLocation: t.$vscodeTextmateLocation,
|
|
1280
|
+
patterns: t.patterns,
|
|
1281
|
+
name: t.scopeName
|
|
1282
|
+
}, t.repository.$base = n || t.repository.$self, t;
|
|
1283
|
+
}
|
|
1284
|
+
var Q = class e {
|
|
1285
|
+
constructor(e, t, n) {
|
|
1286
|
+
this.parent = e, this.scopePath = t, this.tokenAttributes = n;
|
|
1287
|
+
}
|
|
1288
|
+
static fromExtension(t, n) {
|
|
1289
|
+
let r = t, i = t?.scopePath ?? null;
|
|
1290
|
+
for (let t of n) i = m.push(i, t.scopeNames), r = new e(r, i, t.encodedTokenAttributes);
|
|
1291
|
+
return r;
|
|
1292
|
+
}
|
|
1293
|
+
static createRoot(t, n) {
|
|
1294
|
+
return new e(null, new m(null, t), n);
|
|
1295
|
+
}
|
|
1296
|
+
static createRootAndLookUpScopeName(t, n, r) {
|
|
1297
|
+
let i = r.getMetadataForScope(t), a = new m(null, t), o = r.themeProvider.themeMatch(a), s = e.mergeAttributes(n, i, o);
|
|
1298
|
+
return new e(null, a, s);
|
|
1299
|
+
}
|
|
1300
|
+
get scopeName() {
|
|
1301
|
+
return this.scopePath.scopeName;
|
|
1302
|
+
}
|
|
1303
|
+
toString() {
|
|
1304
|
+
return this.getScopeNames().join(" ");
|
|
1305
|
+
}
|
|
1306
|
+
equals(t) {
|
|
1307
|
+
return e.equals(this, t);
|
|
1308
|
+
}
|
|
1309
|
+
static equals(e, t) {
|
|
1310
|
+
do {
|
|
1311
|
+
if (e === t || !e && !t) return !0;
|
|
1312
|
+
if (!e || !t || e.scopeName !== t.scopeName || e.tokenAttributes !== t.tokenAttributes) return !1;
|
|
1313
|
+
e = e.parent, t = t.parent;
|
|
1314
|
+
} while (!0);
|
|
1315
|
+
}
|
|
1316
|
+
static mergeAttributes(e, t, n) {
|
|
1317
|
+
let r = -1, i = 0, a = 0;
|
|
1318
|
+
return n !== null && (r = n.fontStyle, i = n.foregroundId, a = n.backgroundId), x.set(e, t.languageId, t.tokenType, null, r, i, a);
|
|
1319
|
+
}
|
|
1320
|
+
pushAttributed(t, n) {
|
|
1321
|
+
if (t === null) return this;
|
|
1322
|
+
if (t.indexOf(" ") === -1) return e._pushAttributed(this, t, n);
|
|
1323
|
+
let r = t.split(/ /g), i = this;
|
|
1324
|
+
for (let t of r) i = e._pushAttributed(i, t, n);
|
|
1325
|
+
return i;
|
|
1326
|
+
}
|
|
1327
|
+
static _pushAttributed(t, n, r) {
|
|
1328
|
+
let i = r.getMetadataForScope(n), a = t.scopePath.push(n), o = r.themeProvider.themeMatch(a), s = e.mergeAttributes(t.tokenAttributes, i, o);
|
|
1329
|
+
return new e(t, a, s);
|
|
1330
|
+
}
|
|
1331
|
+
getScopeNames() {
|
|
1332
|
+
return this.scopePath.getSegments();
|
|
1333
|
+
}
|
|
1334
|
+
getExtensionIfDefined(e) {
|
|
1335
|
+
let t = [], n = this;
|
|
1336
|
+
for (; n && n !== e;) t.push({
|
|
1337
|
+
encodedTokenAttributes: n.tokenAttributes,
|
|
1338
|
+
scopeNames: n.scopePath.getExtensionIfDefined(n.parent?.scopePath ?? null)
|
|
1339
|
+
}), n = n.parent;
|
|
1340
|
+
return n === e ? t.reverse() : void 0;
|
|
1341
|
+
}
|
|
1342
|
+
}, $ = class e {
|
|
1343
|
+
constructor(e, t, n, r, i, a, o, s) {
|
|
1344
|
+
this.parent = e, this.ruleId = t, this.beginRuleCapturedEOL = i, this.endRule = a, this.nameScopesList = o, this.contentNameScopesList = s, this.depth = this.parent ? this.parent.depth + 1 : 1, this._enterPos = n, this._anchorPos = r;
|
|
1345
|
+
}
|
|
1346
|
+
_stackElementBrand = void 0;
|
|
1347
|
+
static NULL = new e(null, 0, 0, 0, !1, null, null, null);
|
|
1348
|
+
_enterPos;
|
|
1349
|
+
_anchorPos;
|
|
1350
|
+
depth;
|
|
1351
|
+
equals(t) {
|
|
1352
|
+
return t === null ? !1 : e._equals(this, t);
|
|
1353
|
+
}
|
|
1354
|
+
static _equals(e, t) {
|
|
1355
|
+
return e === t ? !0 : this._structuralEquals(e, t) ? Q.equals(e.contentNameScopesList, t.contentNameScopesList) : !1;
|
|
1356
|
+
}
|
|
1357
|
+
static _structuralEquals(e, t) {
|
|
1358
|
+
do {
|
|
1359
|
+
if (e === t || !e && !t) return !0;
|
|
1360
|
+
if (!e || !t || e.depth !== t.depth || e.ruleId !== t.ruleId || e.endRule !== t.endRule) return !1;
|
|
1361
|
+
e = e.parent, t = t.parent;
|
|
1362
|
+
} while (!0);
|
|
1363
|
+
}
|
|
1364
|
+
clone() {
|
|
1365
|
+
return this;
|
|
1366
|
+
}
|
|
1367
|
+
static _reset(e) {
|
|
1368
|
+
for (; e;) e._enterPos = -1, e._anchorPos = -1, e = e.parent;
|
|
1369
|
+
}
|
|
1370
|
+
reset() {
|
|
1371
|
+
e._reset(this);
|
|
1372
|
+
}
|
|
1373
|
+
pop() {
|
|
1374
|
+
return this.parent;
|
|
1375
|
+
}
|
|
1376
|
+
safePop() {
|
|
1377
|
+
return this.parent ? this.parent : this;
|
|
1378
|
+
}
|
|
1379
|
+
push(t, n, r, i, a, o, s) {
|
|
1380
|
+
return new e(this, t, n, r, i, a, o, s);
|
|
1381
|
+
}
|
|
1382
|
+
getEnterPos() {
|
|
1383
|
+
return this._enterPos;
|
|
1384
|
+
}
|
|
1385
|
+
getAnchorPos() {
|
|
1386
|
+
return this._anchorPos;
|
|
1387
|
+
}
|
|
1388
|
+
getRule(e) {
|
|
1389
|
+
return e.getRule(this.ruleId);
|
|
1390
|
+
}
|
|
1391
|
+
toString() {
|
|
1392
|
+
let e = [];
|
|
1393
|
+
return this._writeString(e, 0), "[" + e.join(",") + "]";
|
|
1394
|
+
}
|
|
1395
|
+
_writeString(e, t) {
|
|
1396
|
+
return this.parent && (t = this.parent._writeString(e, t)), e[t++] = `(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`, t;
|
|
1397
|
+
}
|
|
1398
|
+
withContentNameScopesList(e) {
|
|
1399
|
+
return this.contentNameScopesList === e ? this : this.parent.push(this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, this.endRule, this.nameScopesList, e);
|
|
1400
|
+
}
|
|
1401
|
+
withEndRule(t) {
|
|
1402
|
+
return this.endRule === t ? this : new e(this.parent, this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, t, this.nameScopesList, this.contentNameScopesList);
|
|
1403
|
+
}
|
|
1404
|
+
hasSameRuleAs(e) {
|
|
1405
|
+
let t = this;
|
|
1406
|
+
for (; t && t._enterPos === e._enterPos;) {
|
|
1407
|
+
if (t.ruleId === e.ruleId) return !0;
|
|
1408
|
+
t = t.parent;
|
|
1409
|
+
}
|
|
1410
|
+
return !1;
|
|
1411
|
+
}
|
|
1412
|
+
toStateStackFrame() {
|
|
1413
|
+
return {
|
|
1414
|
+
ruleId: P(this.ruleId),
|
|
1415
|
+
beginRuleCapturedEOL: this.beginRuleCapturedEOL,
|
|
1416
|
+
endRule: this.endRule,
|
|
1417
|
+
nameScopesList: this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList ?? null) ?? [],
|
|
1418
|
+
contentNameScopesList: this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList) ?? []
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
static pushFrame(t, n) {
|
|
1422
|
+
let r = Q.fromExtension(t?.nameScopesList ?? null, n.nameScopesList);
|
|
1423
|
+
return new e(t, N(n.ruleId), n.enterPos ?? -1, n.anchorPos ?? -1, n.beginRuleCapturedEOL, n.endRule, r, Q.fromExtension(r, n.contentNameScopesList));
|
|
1424
|
+
}
|
|
1425
|
+
}, Ae = class {
|
|
1426
|
+
balancedBracketScopes;
|
|
1427
|
+
unbalancedBracketScopes;
|
|
1428
|
+
allowAny = !1;
|
|
1429
|
+
constructor(e, t) {
|
|
1430
|
+
this.balancedBracketScopes = e.flatMap((e) => e === "*" ? (this.allowAny = !0, []) : C(e, X).map((e) => e.matcher)), this.unbalancedBracketScopes = t.flatMap((e) => C(e, X).map((e) => e.matcher));
|
|
1431
|
+
}
|
|
1432
|
+
get matchesAlways() {
|
|
1433
|
+
return this.allowAny && this.unbalancedBracketScopes.length === 0;
|
|
1434
|
+
}
|
|
1435
|
+
get matchesNever() {
|
|
1436
|
+
return this.balancedBracketScopes.length === 0 && !this.allowAny;
|
|
1437
|
+
}
|
|
1438
|
+
match(e) {
|
|
1439
|
+
for (let t of this.unbalancedBracketScopes) if (t(e)) return !1;
|
|
1440
|
+
for (let t of this.balancedBracketScopes) if (t(e)) return !0;
|
|
1441
|
+
return this.allowAny;
|
|
1442
|
+
}
|
|
1443
|
+
}, je = class {
|
|
1444
|
+
constructor(e, t, n, r) {
|
|
1445
|
+
this.balancedBracketSelectors = r, this._emitBinaryTokens = e, this._tokenTypeOverrides = n, this._lineText = null, this._tokens = [], this._binaryTokens = [], this._lastTokenEndIndex = 0;
|
|
1446
|
+
}
|
|
1447
|
+
_emitBinaryTokens;
|
|
1448
|
+
_lineText;
|
|
1449
|
+
_tokens;
|
|
1450
|
+
_binaryTokens;
|
|
1451
|
+
_lastTokenEndIndex;
|
|
1452
|
+
_tokenTypeOverrides;
|
|
1453
|
+
produce(e, t) {
|
|
1454
|
+
this.produceFromScopes(e.contentNameScopesList, t);
|
|
1455
|
+
}
|
|
1456
|
+
produceFromScopes(e, t) {
|
|
1457
|
+
if (this._lastTokenEndIndex >= t) return;
|
|
1458
|
+
if (this._emitBinaryTokens) {
|
|
1459
|
+
let n = e?.tokenAttributes ?? 0, r = !1;
|
|
1460
|
+
if (this.balancedBracketSelectors?.matchesAlways && (r = !0), this._tokenTypeOverrides.length > 0 || this.balancedBracketSelectors && !this.balancedBracketSelectors.matchesAlways && !this.balancedBracketSelectors.matchesNever) {
|
|
1461
|
+
let t = e?.getScopeNames() ?? [];
|
|
1462
|
+
for (let e of this._tokenTypeOverrides) e.matcher(t) && (n = x.set(n, 0, ae(e.type), null, -1, 0, 0));
|
|
1463
|
+
this.balancedBracketSelectors && (r = this.balancedBracketSelectors.match(t));
|
|
1464
|
+
}
|
|
1465
|
+
if (r && (n = x.set(n, 0, 8, r, -1, 0, 0)), this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 1] === n) {
|
|
1466
|
+
this._lastTokenEndIndex = t;
|
|
1467
|
+
return;
|
|
1468
|
+
}
|
|
1469
|
+
this._binaryTokens.push(this._lastTokenEndIndex), this._binaryTokens.push(n), this._lastTokenEndIndex = t;
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
let n = e?.getScopeNames() ?? [];
|
|
1473
|
+
this._tokens.push({
|
|
1474
|
+
startIndex: this._lastTokenEndIndex,
|
|
1475
|
+
endIndex: t,
|
|
1476
|
+
scopes: n
|
|
1477
|
+
}), this._lastTokenEndIndex = t;
|
|
1478
|
+
}
|
|
1479
|
+
getResult(e, t) {
|
|
1480
|
+
return this._tokens.length > 0 && this._tokens[this._tokens.length - 1].startIndex === t - 1 && this._tokens.pop(), this._tokens.length === 0 && (this._lastTokenEndIndex = -1, this.produce(e, t), this._tokens[this._tokens.length - 1].startIndex = 0), this._tokens;
|
|
1481
|
+
}
|
|
1482
|
+
getBinaryResult(e, t) {
|
|
1483
|
+
this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 2] === t - 1 && (this._binaryTokens.pop(), this._binaryTokens.pop()), this._binaryTokens.length === 0 && (this._lastTokenEndIndex = -1, this.produce(e, t), this._binaryTokens[this._binaryTokens.length - 2] = 0);
|
|
1484
|
+
let n = new Uint32Array(this._binaryTokens.length);
|
|
1485
|
+
for (let e = 0, t = this._binaryTokens.length; e < t; e++) n[e] = this._binaryTokens[e];
|
|
1486
|
+
return n;
|
|
1487
|
+
}
|
|
1488
|
+
}, Me = class {
|
|
1489
|
+
constructor(e, t) {
|
|
1490
|
+
this._onigLib = t, this._theme = e;
|
|
1491
|
+
}
|
|
1492
|
+
_grammars = /* @__PURE__ */ new Map();
|
|
1493
|
+
_rawGrammars = /* @__PURE__ */ new Map();
|
|
1494
|
+
_injectionGrammars = /* @__PURE__ */ new Map();
|
|
1495
|
+
_theme;
|
|
1496
|
+
dispose() {
|
|
1497
|
+
for (let e of this._grammars.values()) e.dispose();
|
|
1498
|
+
}
|
|
1499
|
+
setTheme(e) {
|
|
1500
|
+
this._theme = e;
|
|
1501
|
+
}
|
|
1502
|
+
getColorMap() {
|
|
1503
|
+
return this._theme.getColorMap();
|
|
1504
|
+
}
|
|
1505
|
+
addGrammar(e, t) {
|
|
1506
|
+
this._rawGrammars.set(e.scopeName, e), t && this._injectionGrammars.set(e.scopeName, t);
|
|
1507
|
+
}
|
|
1508
|
+
lookup(e) {
|
|
1509
|
+
return this._rawGrammars.get(e);
|
|
1510
|
+
}
|
|
1511
|
+
injections(e) {
|
|
1512
|
+
return this._injectionGrammars.get(e);
|
|
1513
|
+
}
|
|
1514
|
+
getDefaults() {
|
|
1515
|
+
return this._theme.getDefaults();
|
|
1516
|
+
}
|
|
1517
|
+
themeMatch(e) {
|
|
1518
|
+
return this._theme.match(e);
|
|
1519
|
+
}
|
|
1520
|
+
grammarForScopeName(e, t, n, r, i) {
|
|
1521
|
+
if (!this._grammars.has(e)) {
|
|
1522
|
+
let a = this._rawGrammars.get(e);
|
|
1523
|
+
if (!a) return null;
|
|
1524
|
+
this._grammars.set(e, De(e, a, t, n, r, i, this, this._onigLib));
|
|
1525
|
+
}
|
|
1526
|
+
return this._grammars.get(e);
|
|
1527
|
+
}
|
|
1528
|
+
}, Ne = class {
|
|
1529
|
+
_options;
|
|
1530
|
+
_syncRegistry;
|
|
1531
|
+
_ensureGrammarCache;
|
|
1532
|
+
constructor(e) {
|
|
1533
|
+
this._options = e, this._syncRegistry = new Me(p.createFromRawTheme(e.theme, e.colorMap), e.onigLib), this._ensureGrammarCache = /* @__PURE__ */ new Map();
|
|
1534
|
+
}
|
|
1535
|
+
dispose() {
|
|
1536
|
+
this._syncRegistry.dispose();
|
|
1537
|
+
}
|
|
1538
|
+
setTheme(e, t) {
|
|
1539
|
+
this._syncRegistry.setTheme(p.createFromRawTheme(e, t));
|
|
1540
|
+
}
|
|
1541
|
+
getColorMap() {
|
|
1542
|
+
return this._syncRegistry.getColorMap();
|
|
1543
|
+
}
|
|
1544
|
+
loadGrammarWithEmbeddedLanguages(e, t, n) {
|
|
1545
|
+
return this.loadGrammarWithConfiguration(e, t, { embeddedLanguages: n });
|
|
1546
|
+
}
|
|
1547
|
+
loadGrammarWithConfiguration(e, t, n) {
|
|
1548
|
+
return this._loadGrammar(e, t, n.embeddedLanguages, n.tokenTypes, new Ae(n.balancedBracketSelectors || [], n.unbalancedBracketSelectors || []));
|
|
1549
|
+
}
|
|
1550
|
+
loadGrammar(e) {
|
|
1551
|
+
return this._loadGrammar(e, 0, null, null, null);
|
|
1552
|
+
}
|
|
1553
|
+
_loadGrammar(e, t, n, r, i) {
|
|
1554
|
+
let a = new le(this._syncRegistry, e);
|
|
1555
|
+
for (; a.Q.length > 0;) a.Q.map((e) => this._loadSingleGrammar(e.scopeName)), a.processQueue();
|
|
1556
|
+
return this._grammarForScopeName(e, t, n, r, i);
|
|
1557
|
+
}
|
|
1558
|
+
_loadSingleGrammar(e) {
|
|
1559
|
+
this._ensureGrammarCache.has(e) || (this._doLoadSingleGrammar(e), this._ensureGrammarCache.set(e, !0));
|
|
1560
|
+
}
|
|
1561
|
+
_doLoadSingleGrammar(e) {
|
|
1562
|
+
let t = this._options.loadGrammar(e);
|
|
1563
|
+
if (t) {
|
|
1564
|
+
let n = typeof this._options.getInjections == "function" ? this._options.getInjections(e) : void 0;
|
|
1565
|
+
this._syncRegistry.addGrammar(t, n);
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
addGrammar(e, t = [], n = 0, r = null) {
|
|
1569
|
+
return this._syncRegistry.addGrammar(e, t), this._grammarForScopeName(e.scopeName, n, r);
|
|
1570
|
+
}
|
|
1571
|
+
_grammarForScopeName(e, t = 0, n = null, r = null, i = null) {
|
|
1572
|
+
return this._syncRegistry.grammarForScopeName(e, t, n, r, i);
|
|
1573
|
+
}
|
|
1574
|
+
}, Pe = $.NULL;
|
|
1575
|
+
//#endregion
|
|
1576
|
+
export { x as EncodedTokenMetadata, v as FontStyle, Pe as INITIAL, Ne as Registry, p as Theme, T as disposeOnigString };
|