limn-hl 0.1.1 → 0.2.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/README.md +105 -174
- package/dist/detect.d.ts +7 -1
- package/dist/detect.js +592 -502
- package/dist/engine.js +45 -1
- package/dist/generated/detect.d.ts +11 -0
- package/dist/generated/detect.js +2434 -0
- package/dist/generated/grammars.d.ts +119 -0
- package/dist/generated/grammars.js +613 -0
- package/dist/generated/lang.d.ts +6 -0
- package/dist/{lang/index.js → generated/lang.js} +82 -56
- package/dist/{theme/generated.d.ts → generated/themes.d.ts} +1 -1
- package/dist/lang.d.ts +1 -0
- package/dist/lang.js +1 -0
- package/dist/render/ansi.d.ts +1 -1
- package/dist/render/html.d.ts +1 -1
- package/dist/{theme/index.d.ts → theme.d.ts} +1 -1
- package/dist/theme.js +1 -0
- package/dist/vm/compile.d.ts +4 -0
- package/dist/vm/compile.js +390 -0
- package/dist/vm/exec.d.ts +3 -0
- package/dist/vm/exec.js +218 -0
- package/dist/vm/format.d.ts +255 -0
- package/dist/vm/format.js +248 -0
- package/dist/vm/index.d.ts +2 -0
- package/dist/vm/index.js +2 -0
- package/dist/vm/pat.d.ts +4 -0
- package/dist/vm/pat.js +701 -0
- package/dist/vm/quoted.d.ts +8 -0
- package/dist/vm/quoted.js +190 -0
- package/dist/vm/scan.d.ts +3 -0
- package/dist/vm/scan.js +499 -0
- package/dist/wordtable.d.ts +8 -4
- package/dist/wordtable.js +107 -30
- package/package.json +6 -6
- package/dist/lang/clike.d.ts +0 -15
- package/dist/lang/clike.js +0 -35
- package/dist/lang/clike_helpers.d.ts +0 -8
- package/dist/lang/clike_helpers.js +0 -220
- package/dist/lang/code.d.ts +0 -45
- package/dist/lang/code.js +0 -779
- package/dist/lang/config.d.ts +0 -5
- package/dist/lang/config.js +0 -164
- package/dist/lang/css.d.ts +0 -5
- package/dist/lang/css.js +0 -125
- package/dist/lang/docs.d.ts +0 -12
- package/dist/lang/docs.js +0 -462
- package/dist/lang/formats.d.ts +0 -10
- package/dist/lang/formats.js +0 -295
- package/dist/lang/html.d.ts +0 -11
- package/dist/lang/html.js +0 -298
- package/dist/lang/index.d.ts +0 -20
- package/dist/lang/js.d.ts +0 -9
- package/dist/lang/js.js +0 -532
- package/dist/lang/js_helpers.d.ts +0 -7
- package/dist/lang/js_helpers.js +0 -308
- package/dist/lang/json.d.ts +0 -3
- package/dist/lang/json.js +0 -136
- package/dist/lang/markdown.d.ts +0 -3
- package/dist/lang/markdown.js +0 -249
- package/dist/lang/python.d.ts +0 -3
- package/dist/lang/python.js +0 -335
- package/dist/lang/scripting.d.ts +0 -7
- package/dist/lang/scripting.js +0 -216
- package/dist/lang/shell.d.ts +0 -7
- package/dist/lang/shell.js +0 -404
- package/dist/lang/specs_gen.d.ts +0 -66
- package/dist/lang/specs_gen.js +0 -381
- package/dist/lang/terminal.d.ts +0 -9
- package/dist/lang/terminal.js +0 -550
- package/dist/lang/yaml.d.ts +0 -4
- package/dist/lang/yaml.js +0 -176
- package/dist/theme/index.js +0 -1
- /package/dist/{theme/generated.js → generated/themes.js} +0 -0
package/dist/engine.js
CHANGED
|
@@ -85,7 +85,7 @@ class Sink {
|
|
|
85
85
|
this.fnWhile = fnWhile;
|
|
86
86
|
}
|
|
87
87
|
emitBound(base, limit, start, end, kind) {
|
|
88
|
-
if (this.stop
|
|
88
|
+
if (this.stop) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
const clampedStart = start < 0 ? 0 : start;
|
|
@@ -100,6 +100,50 @@ class Sink {
|
|
|
100
100
|
if (absStart >= absEnd) {
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
+
const dst = this.dst;
|
|
104
|
+
if (dst !== undefined) {
|
|
105
|
+
if (absStart > this.lastEnd) {
|
|
106
|
+
const def = this.defaultKind;
|
|
107
|
+
if (kind === def) {
|
|
108
|
+
if (this.hasPending && this.pendingKind === def) {
|
|
109
|
+
this.pendingEnd = absEnd;
|
|
110
|
+
} else {
|
|
111
|
+
if (this.hasPending) {
|
|
112
|
+
dst.push({ start: this.pendingStart, end: this.pendingEnd, kind: this.pendingKind });
|
|
113
|
+
}
|
|
114
|
+
this.pendingStart = this.lastEnd;
|
|
115
|
+
this.pendingEnd = absEnd;
|
|
116
|
+
this.pendingKind = def;
|
|
117
|
+
this.hasPending = true;
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
if (this.hasPending && this.pendingKind === def) {
|
|
121
|
+
dst.push({ start: this.pendingStart, end: absStart, kind: def });
|
|
122
|
+
} else {
|
|
123
|
+
if (this.hasPending) {
|
|
124
|
+
dst.push({ start: this.pendingStart, end: this.pendingEnd, kind: this.pendingKind });
|
|
125
|
+
}
|
|
126
|
+
dst.push({ start: this.lastEnd, end: absStart, kind: def });
|
|
127
|
+
}
|
|
128
|
+
this.pendingStart = absStart;
|
|
129
|
+
this.pendingEnd = absEnd;
|
|
130
|
+
this.pendingKind = kind;
|
|
131
|
+
this.hasPending = true;
|
|
132
|
+
}
|
|
133
|
+
} else if (this.hasPending && this.pendingKind === kind) {
|
|
134
|
+
this.pendingEnd = absEnd;
|
|
135
|
+
} else {
|
|
136
|
+
if (this.hasPending) {
|
|
137
|
+
dst.push({ start: this.pendingStart, end: this.pendingEnd, kind: this.pendingKind });
|
|
138
|
+
}
|
|
139
|
+
this.pendingStart = absStart;
|
|
140
|
+
this.pendingEnd = absEnd;
|
|
141
|
+
this.pendingKind = kind;
|
|
142
|
+
this.hasPending = true;
|
|
143
|
+
}
|
|
144
|
+
this.lastEnd = absEnd;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
103
147
|
if (absStart > this.lastEnd) {
|
|
104
148
|
this.pushToken(this.lastEnd, absStart, this.defaultKind);
|
|
105
149
|
if (this.stop) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DETECT_MAX_BYTES = 4096;
|
|
2
|
+
export declare const DETECT_LANG_COUNT = 59;
|
|
3
|
+
export declare const DETECT_FEAT_COUNT = 2400;
|
|
4
|
+
export declare const DETECT_LANG_NAMES: readonly string[];
|
|
5
|
+
export declare const DETECT_LANG_BIAS: Int16Array<ArrayBuffer>;
|
|
6
|
+
export declare const DETECT_SHEBANGS: ReadonlyArray<readonly [string, string]>;
|
|
7
|
+
export declare const DETECT_PREFIXES: ReadonlyArray<readonly [string, string, boolean]>;
|
|
8
|
+
export declare const DETECT_FEAT_KEYS: readonly string[];
|
|
9
|
+
export declare const DETECT_FEAT_COUNTS: Uint8Array<ArrayBuffer>;
|
|
10
|
+
export declare const DETECT_ENTRY_LANGS: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare const DETECT_ENTRY_WEIGHTS: Int8Array<ArrayBuffer>;
|