@c4a/extract 0.6.0-beta.8 → 0.6.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +8 -19
- package/index.js +229 -1976
- package/package.json +16 -2
- package/wasm/tree-sitter.wasm +0 -0
package/index.js
CHANGED
|
@@ -295,8 +295,8 @@ var require_directives = __commonJS((exports) => {
|
|
|
295
295
|
if (parts.length < 2)
|
|
296
296
|
return false;
|
|
297
297
|
}
|
|
298
|
-
const [
|
|
299
|
-
this.tags[
|
|
298
|
+
const [handle, prefix] = parts;
|
|
299
|
+
this.tags[handle] = prefix;
|
|
300
300
|
return true;
|
|
301
301
|
}
|
|
302
302
|
case "%YAML": {
|
|
@@ -337,10 +337,10 @@ var require_directives = __commonJS((exports) => {
|
|
|
337
337
|
onError("Verbatim tags must end with a >");
|
|
338
338
|
return verbatim;
|
|
339
339
|
}
|
|
340
|
-
const [,
|
|
340
|
+
const [, handle, suffix] = source2.match(/^(.*!)([^!]*)$/s);
|
|
341
341
|
if (!suffix)
|
|
342
342
|
onError(`The ${source2} tag has no suffix`);
|
|
343
|
-
const prefix = this.tags[
|
|
343
|
+
const prefix = this.tags[handle];
|
|
344
344
|
if (prefix) {
|
|
345
345
|
try {
|
|
346
346
|
return prefix + decodeURIComponent(suffix);
|
|
@@ -349,15 +349,15 @@ var require_directives = __commonJS((exports) => {
|
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
if (
|
|
352
|
+
if (handle === "!")
|
|
353
353
|
return source2;
|
|
354
354
|
onError(`Could not resolve tag: ${source2}`);
|
|
355
355
|
return null;
|
|
356
356
|
}
|
|
357
357
|
tagString(tag) {
|
|
358
|
-
for (const [
|
|
358
|
+
for (const [handle, prefix] of Object.entries(this.tags)) {
|
|
359
359
|
if (tag.startsWith(prefix))
|
|
360
|
-
return
|
|
360
|
+
return handle + escapeTagName(tag.substring(prefix.length));
|
|
361
361
|
}
|
|
362
362
|
return tag[0] === "!" ? tag : `!<${tag}>`;
|
|
363
363
|
}
|
|
@@ -374,11 +374,11 @@ var require_directives = __commonJS((exports) => {
|
|
|
374
374
|
tagNames = Object.keys(tags);
|
|
375
375
|
} else
|
|
376
376
|
tagNames = [];
|
|
377
|
-
for (const [
|
|
378
|
-
if (
|
|
377
|
+
for (const [handle, prefix] of tagEntries) {
|
|
378
|
+
if (handle === "!!" && prefix === "tag:yaml.org,2002:")
|
|
379
379
|
continue;
|
|
380
380
|
if (!doc || tagNames.some((tn) => tn.startsWith(prefix)))
|
|
381
|
-
lines.push(`%TAG ${
|
|
381
|
+
lines.push(`%TAG ${handle} ${prefix}`);
|
|
382
382
|
}
|
|
383
383
|
return lines.join(`
|
|
384
384
|
`);
|
|
@@ -567,10 +567,10 @@ var require_Alias = __commonJS((exports) => {
|
|
|
567
567
|
var anchors = require_anchors();
|
|
568
568
|
var visit = require_visit();
|
|
569
569
|
var identity = require_identity();
|
|
570
|
-
var
|
|
570
|
+
var Node = require_Node();
|
|
571
571
|
var toJS = require_toJS();
|
|
572
572
|
|
|
573
|
-
class Alias extends
|
|
573
|
+
class Alias extends Node.NodeBase {
|
|
574
574
|
constructor(source2) {
|
|
575
575
|
super(identity.ALIAS);
|
|
576
576
|
this.source = source2;
|
|
@@ -673,11 +673,11 @@ var require_Alias = __commonJS((exports) => {
|
|
|
673
673
|
// ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.js
|
|
674
674
|
var require_Scalar = __commonJS((exports) => {
|
|
675
675
|
var identity = require_identity();
|
|
676
|
-
var
|
|
676
|
+
var Node = require_Node();
|
|
677
677
|
var toJS = require_toJS();
|
|
678
678
|
var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object";
|
|
679
679
|
|
|
680
|
-
class Scalar extends
|
|
680
|
+
class Scalar extends Node.NodeBase {
|
|
681
681
|
constructor(value) {
|
|
682
682
|
super(identity.SCALAR);
|
|
683
683
|
this.value = value;
|
|
@@ -774,7 +774,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
774
774
|
var require_Collection = __commonJS((exports) => {
|
|
775
775
|
var createNode = require_createNode();
|
|
776
776
|
var identity = require_identity();
|
|
777
|
-
var
|
|
777
|
+
var Node = require_Node();
|
|
778
778
|
function collectionFromPath(schema, path, value) {
|
|
779
779
|
let v = value;
|
|
780
780
|
for (let i = path.length - 1;i >= 0; --i) {
|
|
@@ -799,7 +799,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
799
799
|
}
|
|
800
800
|
var isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done;
|
|
801
801
|
|
|
802
|
-
class Collection extends
|
|
802
|
+
class Collection extends Node.NodeBase {
|
|
803
803
|
constructor(type, schema) {
|
|
804
804
|
super(type);
|
|
805
805
|
Object.defineProperty(this, "schema", {
|
|
@@ -1016,10 +1016,10 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
1016
1016
|
}
|
|
1017
1017
|
function consumeMoreIndentedLines(text, i, indent) {
|
|
1018
1018
|
let end = i;
|
|
1019
|
-
let
|
|
1020
|
-
let ch = text[
|
|
1019
|
+
let start = i + 1;
|
|
1020
|
+
let ch = text[start];
|
|
1021
1021
|
while (ch === " " || ch === "\t") {
|
|
1022
|
-
if (i <
|
|
1022
|
+
if (i < start + indent) {
|
|
1023
1023
|
ch = text[++i];
|
|
1024
1024
|
} else {
|
|
1025
1025
|
do {
|
|
@@ -1027,8 +1027,8 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
1027
1027
|
} while (ch && ch !== `
|
|
1028
1028
|
`);
|
|
1029
1029
|
end = i;
|
|
1030
|
-
|
|
1031
|
-
ch = text[
|
|
1030
|
+
start = i + 1;
|
|
1031
|
+
ch = text[start];
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
1034
|
return end;
|
|
@@ -1056,13 +1056,13 @@ var require_stringifyString = __commonJS((exports) => {
|
|
|
1056
1056
|
const strLen = str.length;
|
|
1057
1057
|
if (strLen <= limit)
|
|
1058
1058
|
return false;
|
|
1059
|
-
for (let i = 0,
|
|
1059
|
+
for (let i = 0, start = 0;i < strLen; ++i) {
|
|
1060
1060
|
if (str[i] === `
|
|
1061
1061
|
`) {
|
|
1062
|
-
if (i -
|
|
1062
|
+
if (i - start > limit)
|
|
1063
1063
|
return true;
|
|
1064
|
-
|
|
1065
|
-
if (strLen -
|
|
1064
|
+
start = i + 1;
|
|
1065
|
+
if (strLen - start <= limit)
|
|
1066
1066
|
return false;
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
@@ -1076,19 +1076,19 @@ var require_stringifyString = __commonJS((exports) => {
|
|
|
1076
1076
|
const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
|
|
1077
1077
|
const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
|
|
1078
1078
|
let str = "";
|
|
1079
|
-
let
|
|
1079
|
+
let start = 0;
|
|
1080
1080
|
for (let i = 0, ch = json[i];ch; ch = json[++i]) {
|
|
1081
1081
|
if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") {
|
|
1082
|
-
str += json.slice(
|
|
1082
|
+
str += json.slice(start, i) + "\\ ";
|
|
1083
1083
|
i += 1;
|
|
1084
|
-
|
|
1084
|
+
start = i;
|
|
1085
1085
|
ch = "\\";
|
|
1086
1086
|
}
|
|
1087
1087
|
if (ch === "\\")
|
|
1088
1088
|
switch (json[i + 1]) {
|
|
1089
1089
|
case "u":
|
|
1090
1090
|
{
|
|
1091
|
-
str += json.slice(
|
|
1091
|
+
str += json.slice(start, i);
|
|
1092
1092
|
const code = json.substr(i + 2, 4);
|
|
1093
1093
|
switch (code) {
|
|
1094
1094
|
case "0000":
|
|
@@ -1122,14 +1122,14 @@ var require_stringifyString = __commonJS((exports) => {
|
|
|
1122
1122
|
str += json.substr(i, 6);
|
|
1123
1123
|
}
|
|
1124
1124
|
i += 5;
|
|
1125
|
-
|
|
1125
|
+
start = i + 1;
|
|
1126
1126
|
}
|
|
1127
1127
|
break;
|
|
1128
1128
|
case "n":
|
|
1129
1129
|
if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) {
|
|
1130
1130
|
i += 1;
|
|
1131
1131
|
} else {
|
|
1132
|
-
str += json.slice(
|
|
1132
|
+
str += json.slice(start, i) + `
|
|
1133
1133
|
|
|
1134
1134
|
`;
|
|
1135
1135
|
while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== '"') {
|
|
@@ -1141,14 +1141,14 @@ var require_stringifyString = __commonJS((exports) => {
|
|
|
1141
1141
|
if (json[i + 2] === " ")
|
|
1142
1142
|
str += "\\";
|
|
1143
1143
|
i += 1;
|
|
1144
|
-
|
|
1144
|
+
start = i + 1;
|
|
1145
1145
|
}
|
|
1146
1146
|
break;
|
|
1147
1147
|
default:
|
|
1148
1148
|
i += 1;
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
|
-
str =
|
|
1151
|
+
str = start ? str + json.slice(start) : json;
|
|
1152
1152
|
return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
|
|
1153
1153
|
}
|
|
1154
1154
|
function singleQuotedString(value, ctx) {
|
|
@@ -1237,10 +1237,10 @@ ${indent}`) + "'";
|
|
|
1237
1237
|
else
|
|
1238
1238
|
break;
|
|
1239
1239
|
}
|
|
1240
|
-
let
|
|
1241
|
-
if (
|
|
1242
|
-
value = value.substring(
|
|
1243
|
-
|
|
1240
|
+
let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
|
|
1241
|
+
if (start) {
|
|
1242
|
+
value = value.substring(start.length);
|
|
1243
|
+
start = start.replace(/\n+/g, `$&${indent}`);
|
|
1244
1244
|
}
|
|
1245
1245
|
const indentSize = indent ? "2" : "1";
|
|
1246
1246
|
let header = (startWithSpace ? indentSize : "") + chomp;
|
|
@@ -1259,14 +1259,14 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/
|
|
|
1259
1259
|
literalFallback = true;
|
|
1260
1260
|
};
|
|
1261
1261
|
}
|
|
1262
|
-
const
|
|
1262
|
+
const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
|
|
1263
1263
|
if (!literalFallback)
|
|
1264
1264
|
return `>${header}
|
|
1265
|
-
${indent}${
|
|
1265
|
+
${indent}${body}`;
|
|
1266
1266
|
}
|
|
1267
1267
|
value = value.replace(/\n+/g, `$&${indent}`);
|
|
1268
1268
|
return `|${header}
|
|
1269
|
-
${indent}${
|
|
1269
|
+
${indent}${start}${value}${end}`;
|
|
1270
1270
|
}
|
|
1271
1271
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
1272
1272
|
const { type, value } = item;
|
|
@@ -1878,16 +1878,16 @@ ${indent}${line}` : `
|
|
|
1878
1878
|
lines.push(str);
|
|
1879
1879
|
linesAtValue = lines.length;
|
|
1880
1880
|
}
|
|
1881
|
-
const { start
|
|
1881
|
+
const { start, end } = flowChars;
|
|
1882
1882
|
if (lines.length === 0) {
|
|
1883
|
-
return
|
|
1883
|
+
return start + end;
|
|
1884
1884
|
} else {
|
|
1885
1885
|
if (!reqNewline) {
|
|
1886
1886
|
const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
|
|
1887
1887
|
reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
|
|
1888
1888
|
}
|
|
1889
1889
|
if (reqNewline) {
|
|
1890
|
-
let str =
|
|
1890
|
+
let str = start;
|
|
1891
1891
|
for (const line of lines)
|
|
1892
1892
|
str += line ? `
|
|
1893
1893
|
${indentStep}${indent}${line}` : `
|
|
@@ -1895,7 +1895,7 @@ ${indentStep}${indent}${line}` : `
|
|
|
1895
1895
|
return `${str}
|
|
1896
1896
|
${indent}${end}`;
|
|
1897
1897
|
} else {
|
|
1898
|
-
return `${
|
|
1898
|
+
return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
|
|
1899
1899
|
}
|
|
1900
1900
|
}
|
|
1901
1901
|
}
|
|
@@ -2423,7 +2423,7 @@ var require_binary = __commonJS((exports) => {
|
|
|
2423
2423
|
var node_buffer = __require("buffer");
|
|
2424
2424
|
var Scalar = require_Scalar();
|
|
2425
2425
|
var stringifyString = require_stringifyString();
|
|
2426
|
-
var
|
|
2426
|
+
var binary = {
|
|
2427
2427
|
identify: (value) => value instanceof Uint8Array,
|
|
2428
2428
|
default: false,
|
|
2429
2429
|
tag: "tag:yaml.org,2002:binary",
|
|
@@ -2432,10 +2432,10 @@ var require_binary = __commonJS((exports) => {
|
|
|
2432
2432
|
return node_buffer.Buffer.from(src, "base64");
|
|
2433
2433
|
} else if (typeof atob === "function") {
|
|
2434
2434
|
const str = atob(src.replace(/[\n\r]/g, ""));
|
|
2435
|
-
const
|
|
2435
|
+
const buffer = new Uint8Array(str.length);
|
|
2436
2436
|
for (let i = 0;i < str.length; ++i)
|
|
2437
|
-
|
|
2438
|
-
return
|
|
2437
|
+
buffer[i] = str.charCodeAt(i);
|
|
2438
|
+
return buffer;
|
|
2439
2439
|
} else {
|
|
2440
2440
|
onError("This environment does not support reading binary tags; either Buffer or atob is required");
|
|
2441
2441
|
return src;
|
|
@@ -2470,7 +2470,7 @@ var require_binary = __commonJS((exports) => {
|
|
|
2470
2470
|
return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
|
|
2471
2471
|
}
|
|
2472
2472
|
};
|
|
2473
|
-
exports.binary =
|
|
2473
|
+
exports.binary = binary;
|
|
2474
2474
|
});
|
|
2475
2475
|
|
|
2476
2476
|
// ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
@@ -2942,7 +2942,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
2942
2942
|
var _null = require_null();
|
|
2943
2943
|
var seq = require_seq();
|
|
2944
2944
|
var string = require_string();
|
|
2945
|
-
var
|
|
2945
|
+
var binary = require_binary();
|
|
2946
2946
|
var bool = require_bool2();
|
|
2947
2947
|
var float = require_float2();
|
|
2948
2948
|
var int = require_int2();
|
|
@@ -2965,7 +2965,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
2965
2965
|
float.floatNaN,
|
|
2966
2966
|
float.floatExp,
|
|
2967
2967
|
float.float,
|
|
2968
|
-
|
|
2968
|
+
binary.binary,
|
|
2969
2969
|
merge.merge,
|
|
2970
2970
|
omap.omap,
|
|
2971
2971
|
pairs.pairs,
|
|
@@ -2988,7 +2988,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
2988
2988
|
var int = require_int();
|
|
2989
2989
|
var schema = require_schema();
|
|
2990
2990
|
var schema$1 = require_schema2();
|
|
2991
|
-
var
|
|
2991
|
+
var binary = require_binary();
|
|
2992
2992
|
var merge = require_merge();
|
|
2993
2993
|
var omap = require_omap();
|
|
2994
2994
|
var pairs = require_pairs();
|
|
@@ -3003,7 +3003,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
3003
3003
|
["yaml-1.1", schema$2.schema]
|
|
3004
3004
|
]);
|
|
3005
3005
|
var tagsByName = {
|
|
3006
|
-
binary:
|
|
3006
|
+
binary: binary.binary,
|
|
3007
3007
|
bool: bool.boolTag,
|
|
3008
3008
|
float: float.float,
|
|
3009
3009
|
floatExp: float.floatExp,
|
|
@@ -3023,7 +3023,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
3023
3023
|
timestamp: timestamp.timestamp
|
|
3024
3024
|
};
|
|
3025
3025
|
var coreKnownTags = {
|
|
3026
|
-
"tag:yaml.org,2002:binary":
|
|
3026
|
+
"tag:yaml.org,2002:binary": binary.binary,
|
|
3027
3027
|
"tag:yaml.org,2002:merge": merge.merge,
|
|
3028
3028
|
"tag:yaml.org,2002:omap": omap.omap,
|
|
3029
3029
|
"tag:yaml.org,2002:pairs": pairs.pairs,
|
|
@@ -3138,13 +3138,13 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
3138
3138
|
contentComment = doc.contents.comment;
|
|
3139
3139
|
}
|
|
3140
3140
|
const onChompKeep = contentComment ? undefined : () => chompKeep = true;
|
|
3141
|
-
let
|
|
3141
|
+
let body = stringify.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
|
|
3142
3142
|
if (contentComment)
|
|
3143
|
-
|
|
3144
|
-
if ((
|
|
3145
|
-
lines[lines.length - 1] = `--- ${
|
|
3143
|
+
body += stringifyComment.lineComment(body, "", commentString(contentComment));
|
|
3144
|
+
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
|
|
3145
|
+
lines[lines.length - 1] = `--- ${body}`;
|
|
3146
3146
|
} else
|
|
3147
|
-
lines.push(
|
|
3147
|
+
lines.push(body);
|
|
3148
3148
|
} else {
|
|
3149
3149
|
lines.push(stringify.stringify(doc.contents, ctx));
|
|
3150
3150
|
}
|
|
@@ -3494,7 +3494,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
3494
3494
|
let newlineAfterProp = null;
|
|
3495
3495
|
let comma = null;
|
|
3496
3496
|
let found = null;
|
|
3497
|
-
let
|
|
3497
|
+
let start = null;
|
|
3498
3498
|
for (const token of tokens) {
|
|
3499
3499
|
if (reqSpace) {
|
|
3500
3500
|
if (token.type !== "space" && token.type !== "newline" && token.type !== "comma")
|
|
@@ -3546,7 +3546,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
3546
3546
|
if (token.source.endsWith(":"))
|
|
3547
3547
|
onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true);
|
|
3548
3548
|
anchor = token;
|
|
3549
|
-
|
|
3549
|
+
start ?? (start = token.offset);
|
|
3550
3550
|
atNewline = false;
|
|
3551
3551
|
hasSpace = false;
|
|
3552
3552
|
reqSpace = true;
|
|
@@ -3555,7 +3555,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
3555
3555
|
if (tag)
|
|
3556
3556
|
onError(token, "MULTIPLE_TAGS", "A node can have at most one tag");
|
|
3557
3557
|
tag = token;
|
|
3558
|
-
|
|
3558
|
+
start ?? (start = token.offset);
|
|
3559
3559
|
atNewline = false;
|
|
3560
3560
|
hasSpace = false;
|
|
3561
3561
|
reqSpace = true;
|
|
@@ -3602,7 +3602,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
3602
3602
|
tag,
|
|
3603
3603
|
newlineAfterProp,
|
|
3604
3604
|
end,
|
|
3605
|
-
start:
|
|
3605
|
+
start: start ?? end
|
|
3606
3606
|
};
|
|
3607
3607
|
}
|
|
3608
3608
|
exports.resolveProps = resolveProps;
|
|
@@ -3693,8 +3693,8 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
|
3693
3693
|
let offset = bm.offset;
|
|
3694
3694
|
let commentEnd = null;
|
|
3695
3695
|
for (const collItem of bm.items) {
|
|
3696
|
-
const { start
|
|
3697
|
-
const keyProps = resolveProps.resolveProps(
|
|
3696
|
+
const { start, key, sep, value } = collItem;
|
|
3697
|
+
const keyProps = resolveProps.resolveProps(start, {
|
|
3698
3698
|
indicator: "explicit-key-ind",
|
|
3699
3699
|
next: key ?? sep?.[0],
|
|
3700
3700
|
offset,
|
|
@@ -3722,14 +3722,14 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
|
3722
3722
|
continue;
|
|
3723
3723
|
}
|
|
3724
3724
|
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {
|
|
3725
|
-
onError(key ??
|
|
3725
|
+
onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
3726
3726
|
}
|
|
3727
3727
|
} else if (keyProps.found?.indent !== bm.indent) {
|
|
3728
3728
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
3729
3729
|
}
|
|
3730
3730
|
ctx.atKey = true;
|
|
3731
3731
|
const keyStart = keyProps.end;
|
|
3732
|
-
const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart,
|
|
3732
|
+
const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
3733
3733
|
if (ctx.schema.compat)
|
|
3734
3734
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
|
|
3735
3735
|
ctx.atKey = false;
|
|
@@ -3797,8 +3797,8 @@ var require_resolve_block_seq = __commonJS((exports) => {
|
|
|
3797
3797
|
ctx.atKey = false;
|
|
3798
3798
|
let offset = bs.offset;
|
|
3799
3799
|
let commentEnd = null;
|
|
3800
|
-
for (const { start
|
|
3801
|
-
const props = resolveProps.resolveProps(
|
|
3800
|
+
for (const { start, value } of bs.items) {
|
|
3801
|
+
const props = resolveProps.resolveProps(start, {
|
|
3802
3802
|
indicator: "seq-item-ind",
|
|
3803
3803
|
next: value,
|
|
3804
3804
|
offset,
|
|
@@ -3819,7 +3819,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
|
|
|
3819
3819
|
continue;
|
|
3820
3820
|
}
|
|
3821
3821
|
}
|
|
3822
|
-
const node2 = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
3822
|
+
const node2 = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
|
|
3823
3823
|
if (ctx.schema.compat)
|
|
3824
3824
|
utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
|
|
3825
3825
|
offset = node2.range[2];
|
|
@@ -3897,8 +3897,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
3897
3897
|
let offset = fc.offset + fc.start.source.length;
|
|
3898
3898
|
for (let i = 0;i < fc.items.length; ++i) {
|
|
3899
3899
|
const collItem = fc.items[i];
|
|
3900
|
-
const { start
|
|
3901
|
-
const props = resolveProps.resolveProps(
|
|
3900
|
+
const { start, key, sep, value } = collItem;
|
|
3901
|
+
const props = resolveProps.resolveProps(start, {
|
|
3902
3902
|
flow: fcName,
|
|
3903
3903
|
indicator: "explicit-key-ind",
|
|
3904
3904
|
next: key ?? sep?.[0],
|
|
@@ -3935,7 +3935,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
3935
3935
|
if (props.comment) {
|
|
3936
3936
|
let prevItemComment = "";
|
|
3937
3937
|
loop:
|
|
3938
|
-
for (const st of
|
|
3938
|
+
for (const st of start) {
|
|
3939
3939
|
switch (st.type) {
|
|
3940
3940
|
case "comma":
|
|
3941
3941
|
case "space":
|
|
@@ -3969,7 +3969,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
3969
3969
|
} else {
|
|
3970
3970
|
ctx.atKey = true;
|
|
3971
3971
|
const keyStart = props.end;
|
|
3972
|
-
const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart,
|
|
3972
|
+
const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
3973
3973
|
if (isBlock(key))
|
|
3974
3974
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
3975
3975
|
ctx.atKey = false;
|
|
@@ -4128,10 +4128,10 @@ var require_compose_collection = __commonJS((exports) => {
|
|
|
4128
4128
|
var require_resolve_block_scalar = __commonJS((exports) => {
|
|
4129
4129
|
var Scalar = require_Scalar();
|
|
4130
4130
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
4131
|
-
const
|
|
4131
|
+
const start = scalar.offset;
|
|
4132
4132
|
const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
|
|
4133
4133
|
if (!header)
|
|
4134
|
-
return { value: "", type: null, comment: "", range: [
|
|
4134
|
+
return { value: "", type: null, comment: "", range: [start, start, start] };
|
|
4135
4135
|
const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
|
|
4136
4136
|
const lines = scalar.source ? splitLines(scalar.source) : [];
|
|
4137
4137
|
let chompStart = lines.length;
|
|
@@ -4145,10 +4145,10 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
4145
4145
|
if (chompStart === 0) {
|
|
4146
4146
|
const value2 = header.chomp === "+" && lines.length > 0 ? `
|
|
4147
4147
|
`.repeat(Math.max(1, lines.length - 1)) : "";
|
|
4148
|
-
let end2 =
|
|
4148
|
+
let end2 = start + header.length;
|
|
4149
4149
|
if (scalar.source)
|
|
4150
4150
|
end2 += scalar.source.length;
|
|
4151
|
-
return { value: value2, type, comment: header.comment, range: [
|
|
4151
|
+
return { value: value2, type, comment: header.comment, range: [start, end2, end2] };
|
|
4152
4152
|
}
|
|
4153
4153
|
let trimIndent = scalar.indent + header.indent;
|
|
4154
4154
|
let offset = scalar.offset + header.length;
|
|
@@ -4243,8 +4243,8 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
4243
4243
|
value += `
|
|
4244
4244
|
`;
|
|
4245
4245
|
}
|
|
4246
|
-
const end =
|
|
4247
|
-
return { value, type, comment: header.comment, range: [
|
|
4246
|
+
const end = start + header.length + scalar.source.length;
|
|
4247
|
+
return { value, type, comment: header.comment, range: [start, end, end] };
|
|
4248
4248
|
}
|
|
4249
4249
|
function parseBlockScalarHeader({ offset, props }, strict, onError) {
|
|
4250
4250
|
if (props[0].type !== "block-scalar-header") {
|
|
@@ -4742,7 +4742,7 @@ var require_compose_doc = __commonJS((exports) => {
|
|
|
4742
4742
|
var composeNode = require_compose_node();
|
|
4743
4743
|
var resolveEnd = require_resolve_end();
|
|
4744
4744
|
var resolveProps = require_resolve_props();
|
|
4745
|
-
function composeDoc(options, directives, { offset, start
|
|
4745
|
+
function composeDoc(options, directives, { offset, start, value, end }, onError) {
|
|
4746
4746
|
const opts = Object.assign({ _directives: directives }, options);
|
|
4747
4747
|
const doc = new Document.Document(undefined, opts);
|
|
4748
4748
|
const ctx = {
|
|
@@ -4752,7 +4752,7 @@ var require_compose_doc = __commonJS((exports) => {
|
|
|
4752
4752
|
options: doc.options,
|
|
4753
4753
|
schema: doc.schema
|
|
4754
4754
|
};
|
|
4755
|
-
const props = resolveProps.resolveProps(
|
|
4755
|
+
const props = resolveProps.resolveProps(start, {
|
|
4756
4756
|
indicator: "doc-start",
|
|
4757
4757
|
next: value ?? end?.[0],
|
|
4758
4758
|
offset,
|
|
@@ -4765,7 +4765,7 @@ var require_compose_doc = __commonJS((exports) => {
|
|
|
4765
4765
|
if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline)
|
|
4766
4766
|
onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker");
|
|
4767
4767
|
}
|
|
4768
|
-
doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end,
|
|
4768
|
+
doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);
|
|
4769
4769
|
const contentEnd = doc.contents.range[2];
|
|
4770
4770
|
const re = resolveEnd.resolveEnd(end, contentEnd, false, onError);
|
|
4771
4771
|
if (re.comment)
|
|
@@ -5009,7 +5009,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5009
5009
|
const he = source2.indexOf(`
|
|
5010
5010
|
`);
|
|
5011
5011
|
const head = source2.substring(0, he);
|
|
5012
|
-
const
|
|
5012
|
+
const body = source2.substring(he + 1) + `
|
|
5013
5013
|
`;
|
|
5014
5014
|
const props = [
|
|
5015
5015
|
{ type: "block-scalar-header", offset, indent, source: head }
|
|
@@ -5017,7 +5017,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5017
5017
|
if (!addEndtoBlockProps(props, end))
|
|
5018
5018
|
props.push({ type: "newline", offset: -1, indent, source: `
|
|
5019
5019
|
` });
|
|
5020
|
-
return { type: "block-scalar", offset, indent, props, source:
|
|
5020
|
+
return { type: "block-scalar", offset, indent, props, source: body };
|
|
5021
5021
|
}
|
|
5022
5022
|
case '"':
|
|
5023
5023
|
return { type: "double-quoted-scalar", offset, indent, source: source2, end };
|
|
@@ -5075,14 +5075,14 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5075
5075
|
const he = source2.indexOf(`
|
|
5076
5076
|
`);
|
|
5077
5077
|
const head = source2.substring(0, he);
|
|
5078
|
-
const
|
|
5078
|
+
const body = source2.substring(he + 1) + `
|
|
5079
5079
|
`;
|
|
5080
5080
|
if (token.type === "block-scalar") {
|
|
5081
5081
|
const header = token.props[0];
|
|
5082
5082
|
if (header.type !== "block-scalar-header")
|
|
5083
5083
|
throw new Error("Invalid block scalar header");
|
|
5084
5084
|
header.source = head;
|
|
5085
|
-
token.source =
|
|
5085
|
+
token.source = body;
|
|
5086
5086
|
} else {
|
|
5087
5087
|
const { offset } = token;
|
|
5088
5088
|
const indent = "indent" in token ? token.indent : -1;
|
|
@@ -5095,7 +5095,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5095
5095
|
for (const key of Object.keys(token))
|
|
5096
5096
|
if (key !== "type" && key !== "offset")
|
|
5097
5097
|
delete token[key];
|
|
5098
|
-
Object.assign(token, { type: "block-scalar", indent, props, source:
|
|
5098
|
+
Object.assign(token, { type: "block-scalar", indent, props, source: body });
|
|
5099
5099
|
}
|
|
5100
5100
|
}
|
|
5101
5101
|
function addEndtoBlockProps(props, end) {
|
|
@@ -5197,9 +5197,9 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
|
5197
5197
|
}
|
|
5198
5198
|
}
|
|
5199
5199
|
}
|
|
5200
|
-
function stringifyItem({ start
|
|
5200
|
+
function stringifyItem({ start, key, sep, value }) {
|
|
5201
5201
|
let res = "";
|
|
5202
|
-
for (const st of
|
|
5202
|
+
for (const st of start)
|
|
5203
5203
|
res += st.source;
|
|
5204
5204
|
if (key)
|
|
5205
5205
|
res += stringifyToken(key);
|
|
@@ -5979,8 +5979,8 @@ var require_line_counter = __commonJS((exports) => {
|
|
|
5979
5979
|
return { line: low + 1, col: 1 };
|
|
5980
5980
|
if (low === 0)
|
|
5981
5981
|
return { line: 0, col: offset };
|
|
5982
|
-
const
|
|
5983
|
-
return { line: low, col: offset -
|
|
5982
|
+
const start = this.lineStarts[low - 1];
|
|
5983
|
+
return { line: low, col: offset - start + 1 };
|
|
5984
5984
|
};
|
|
5985
5985
|
}
|
|
5986
5986
|
}
|
|
@@ -6075,7 +6075,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6075
6075
|
}
|
|
6076
6076
|
}
|
|
6077
6077
|
|
|
6078
|
-
class
|
|
6078
|
+
class Parser {
|
|
6079
6079
|
constructor(onNewLine) {
|
|
6080
6080
|
this.atNewLine = true;
|
|
6081
6081
|
this.atScalar = false;
|
|
@@ -6333,7 +6333,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6333
6333
|
*scalar(scalar) {
|
|
6334
6334
|
if (this.type === "map-value-ind") {
|
|
6335
6335
|
const prev = getPrevProps(this.peek(2));
|
|
6336
|
-
const
|
|
6336
|
+
const start = getFirstKeyStartProps(prev);
|
|
6337
6337
|
let sep;
|
|
6338
6338
|
if (scalar.end) {
|
|
6339
6339
|
sep = scalar.end;
|
|
@@ -6345,7 +6345,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6345
6345
|
type: "block-map",
|
|
6346
6346
|
offset: scalar.offset,
|
|
6347
6347
|
indent: scalar.indent,
|
|
6348
|
-
items: [{ start
|
|
6348
|
+
items: [{ start, key: scalar, sep }]
|
|
6349
6349
|
};
|
|
6350
6350
|
this.onKeyLine = true;
|
|
6351
6351
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -6421,7 +6421,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6421
6421
|
if (this.indent >= map.indent) {
|
|
6422
6422
|
const atMapIndent = !this.onKeyLine && this.indent === map.indent;
|
|
6423
6423
|
const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind";
|
|
6424
|
-
let
|
|
6424
|
+
let start = [];
|
|
6425
6425
|
if (atNextItem && it.sep && !it.value) {
|
|
6426
6426
|
const nl = [];
|
|
6427
6427
|
for (let i = 0;i < it.sep.length; ++i) {
|
|
@@ -6441,14 +6441,14 @@ var require_parser = __commonJS((exports) => {
|
|
|
6441
6441
|
}
|
|
6442
6442
|
}
|
|
6443
6443
|
if (nl.length >= 2)
|
|
6444
|
-
|
|
6444
|
+
start = it.sep.splice(nl[1]);
|
|
6445
6445
|
}
|
|
6446
6446
|
switch (this.type) {
|
|
6447
6447
|
case "anchor":
|
|
6448
6448
|
case "tag":
|
|
6449
6449
|
if (atNextItem || it.value) {
|
|
6450
|
-
|
|
6451
|
-
map.items.push({ start
|
|
6450
|
+
start.push(this.sourceToken);
|
|
6451
|
+
map.items.push({ start });
|
|
6452
6452
|
this.onKeyLine = true;
|
|
6453
6453
|
} else if (it.sep) {
|
|
6454
6454
|
it.sep.push(this.sourceToken);
|
|
@@ -6461,8 +6461,8 @@ var require_parser = __commonJS((exports) => {
|
|
|
6461
6461
|
it.start.push(this.sourceToken);
|
|
6462
6462
|
it.explicitKey = true;
|
|
6463
6463
|
} else if (atNextItem || it.value) {
|
|
6464
|
-
|
|
6465
|
-
map.items.push({ start
|
|
6464
|
+
start.push(this.sourceToken);
|
|
6465
|
+
map.items.push({ start, explicitKey: true });
|
|
6466
6466
|
} else {
|
|
6467
6467
|
this.stack.push({
|
|
6468
6468
|
type: "block-map",
|
|
@@ -6479,12 +6479,12 @@ var require_parser = __commonJS((exports) => {
|
|
|
6479
6479
|
if (includesToken(it.start, "newline")) {
|
|
6480
6480
|
Object.assign(it, { key: null, sep: [this.sourceToken] });
|
|
6481
6481
|
} else {
|
|
6482
|
-
const
|
|
6482
|
+
const start2 = getFirstKeyStartProps(it.start);
|
|
6483
6483
|
this.stack.push({
|
|
6484
6484
|
type: "block-map",
|
|
6485
6485
|
offset: this.offset,
|
|
6486
6486
|
indent: this.indent,
|
|
6487
|
-
items: [{ start:
|
|
6487
|
+
items: [{ start: start2, key: null, sep: [this.sourceToken] }]
|
|
6488
6488
|
});
|
|
6489
6489
|
}
|
|
6490
6490
|
} else if (it.value) {
|
|
@@ -6494,10 +6494,10 @@ var require_parser = __commonJS((exports) => {
|
|
|
6494
6494
|
type: "block-map",
|
|
6495
6495
|
offset: this.offset,
|
|
6496
6496
|
indent: this.indent,
|
|
6497
|
-
items: [{ start
|
|
6497
|
+
items: [{ start, key: null, sep: [this.sourceToken] }]
|
|
6498
6498
|
});
|
|
6499
6499
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6500
|
-
const
|
|
6500
|
+
const start2 = getFirstKeyStartProps(it.start);
|
|
6501
6501
|
const key = it.key;
|
|
6502
6502
|
const sep = it.sep;
|
|
6503
6503
|
sep.push(this.sourceToken);
|
|
@@ -6507,10 +6507,10 @@ var require_parser = __commonJS((exports) => {
|
|
|
6507
6507
|
type: "block-map",
|
|
6508
6508
|
offset: this.offset,
|
|
6509
6509
|
indent: this.indent,
|
|
6510
|
-
items: [{ start:
|
|
6510
|
+
items: [{ start: start2, key, sep }]
|
|
6511
6511
|
});
|
|
6512
|
-
} else if (
|
|
6513
|
-
it.sep = it.sep.concat(
|
|
6512
|
+
} else if (start.length > 0) {
|
|
6513
|
+
it.sep = it.sep.concat(start, this.sourceToken);
|
|
6514
6514
|
} else {
|
|
6515
6515
|
it.sep.push(this.sourceToken);
|
|
6516
6516
|
}
|
|
@@ -6518,7 +6518,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6518
6518
|
if (!it.sep) {
|
|
6519
6519
|
Object.assign(it, { key: null, sep: [this.sourceToken] });
|
|
6520
6520
|
} else if (it.value || atNextItem) {
|
|
6521
|
-
map.items.push({ start
|
|
6521
|
+
map.items.push({ start, key: null, sep: [this.sourceToken] });
|
|
6522
6522
|
} else if (includesToken(it.sep, "map-value-ind")) {
|
|
6523
6523
|
this.stack.push({
|
|
6524
6524
|
type: "block-map",
|
|
@@ -6536,14 +6536,14 @@ var require_parser = __commonJS((exports) => {
|
|
|
6536
6536
|
case "scalar":
|
|
6537
6537
|
case "single-quoted-scalar":
|
|
6538
6538
|
case "double-quoted-scalar": {
|
|
6539
|
-
const
|
|
6539
|
+
const fs = this.flowScalar(this.type);
|
|
6540
6540
|
if (atNextItem || it.value) {
|
|
6541
|
-
map.items.push({ start
|
|
6541
|
+
map.items.push({ start, key: fs, sep: [] });
|
|
6542
6542
|
this.onKeyLine = true;
|
|
6543
6543
|
} else if (it.sep) {
|
|
6544
|
-
this.stack.push(
|
|
6544
|
+
this.stack.push(fs);
|
|
6545
6545
|
} else {
|
|
6546
|
-
Object.assign(it, { key:
|
|
6546
|
+
Object.assign(it, { key: fs, sep: [] });
|
|
6547
6547
|
this.onKeyLine = true;
|
|
6548
6548
|
}
|
|
6549
6549
|
return;
|
|
@@ -6562,7 +6562,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6562
6562
|
return;
|
|
6563
6563
|
}
|
|
6564
6564
|
} else if (atMapIndent) {
|
|
6565
|
-
map.items.push({ start
|
|
6565
|
+
map.items.push({ start });
|
|
6566
6566
|
}
|
|
6567
6567
|
this.stack.push(bv);
|
|
6568
6568
|
return;
|
|
@@ -6671,13 +6671,13 @@ var require_parser = __commonJS((exports) => {
|
|
|
6671
6671
|
case "scalar":
|
|
6672
6672
|
case "single-quoted-scalar":
|
|
6673
6673
|
case "double-quoted-scalar": {
|
|
6674
|
-
const
|
|
6674
|
+
const fs = this.flowScalar(this.type);
|
|
6675
6675
|
if (!it || it.value)
|
|
6676
|
-
fc.items.push({ start: [], key:
|
|
6676
|
+
fc.items.push({ start: [], key: fs, sep: [] });
|
|
6677
6677
|
else if (it.sep)
|
|
6678
|
-
this.stack.push(
|
|
6678
|
+
this.stack.push(fs);
|
|
6679
6679
|
else
|
|
6680
|
-
Object.assign(it, { key:
|
|
6680
|
+
Object.assign(it, { key: fs, sep: [] });
|
|
6681
6681
|
return;
|
|
6682
6682
|
}
|
|
6683
6683
|
case "flow-map-end":
|
|
@@ -6699,7 +6699,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6699
6699
|
yield* this.step();
|
|
6700
6700
|
} else if (this.type === "map-value-ind" && parent.type !== "flow-collection") {
|
|
6701
6701
|
const prev = getPrevProps(parent);
|
|
6702
|
-
const
|
|
6702
|
+
const start = getFirstKeyStartProps(prev);
|
|
6703
6703
|
fixFlowSeqItems(fc);
|
|
6704
6704
|
const sep = fc.end.splice(1, fc.end.length);
|
|
6705
6705
|
sep.push(this.sourceToken);
|
|
@@ -6707,7 +6707,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6707
6707
|
type: "block-map",
|
|
6708
6708
|
offset: fc.offset,
|
|
6709
6709
|
indent: fc.indent,
|
|
6710
|
-
items: [{ start
|
|
6710
|
+
items: [{ start, key: fc, sep }]
|
|
6711
6711
|
};
|
|
6712
6712
|
this.onKeyLine = true;
|
|
6713
6713
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -6768,35 +6768,35 @@ var require_parser = __commonJS((exports) => {
|
|
|
6768
6768
|
case "explicit-key-ind": {
|
|
6769
6769
|
this.onKeyLine = true;
|
|
6770
6770
|
const prev = getPrevProps(parent);
|
|
6771
|
-
const
|
|
6772
|
-
|
|
6771
|
+
const start = getFirstKeyStartProps(prev);
|
|
6772
|
+
start.push(this.sourceToken);
|
|
6773
6773
|
return {
|
|
6774
6774
|
type: "block-map",
|
|
6775
6775
|
offset: this.offset,
|
|
6776
6776
|
indent: this.indent,
|
|
6777
|
-
items: [{ start
|
|
6777
|
+
items: [{ start, explicitKey: true }]
|
|
6778
6778
|
};
|
|
6779
6779
|
}
|
|
6780
6780
|
case "map-value-ind": {
|
|
6781
6781
|
this.onKeyLine = true;
|
|
6782
6782
|
const prev = getPrevProps(parent);
|
|
6783
|
-
const
|
|
6783
|
+
const start = getFirstKeyStartProps(prev);
|
|
6784
6784
|
return {
|
|
6785
6785
|
type: "block-map",
|
|
6786
6786
|
offset: this.offset,
|
|
6787
6787
|
indent: this.indent,
|
|
6788
|
-
items: [{ start
|
|
6788
|
+
items: [{ start, key: null, sep: [this.sourceToken] }]
|
|
6789
6789
|
};
|
|
6790
6790
|
}
|
|
6791
6791
|
}
|
|
6792
6792
|
return null;
|
|
6793
6793
|
}
|
|
6794
|
-
atIndentedComment(
|
|
6794
|
+
atIndentedComment(start, indent) {
|
|
6795
6795
|
if (this.type !== "comment")
|
|
6796
6796
|
return false;
|
|
6797
6797
|
if (this.indent <= indent)
|
|
6798
6798
|
return false;
|
|
6799
|
-
return
|
|
6799
|
+
return start.every((st) => st.type === "newline" || st.type === "space");
|
|
6800
6800
|
}
|
|
6801
6801
|
*documentEnd(docEnd) {
|
|
6802
6802
|
if (this.type !== "doc-mode") {
|
|
@@ -6833,7 +6833,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6833
6833
|
}
|
|
6834
6834
|
}
|
|
6835
6835
|
}
|
|
6836
|
-
exports.Parser =
|
|
6836
|
+
exports.Parser = Parser;
|
|
6837
6837
|
});
|
|
6838
6838
|
|
|
6839
6839
|
// ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/public-api.js
|
|
@@ -6980,7 +6980,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
6980
6980
|
});
|
|
6981
6981
|
|
|
6982
6982
|
// ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
|
|
6983
|
-
var require_constants = __commonJS((exports,
|
|
6983
|
+
var require_constants = __commonJS((exports, module) => {
|
|
6984
6984
|
var WIN_SLASH = "\\\\/";
|
|
6985
6985
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
6986
6986
|
var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
@@ -7050,7 +7050,7 @@ var require_constants = __commonJS((exports, module2) => {
|
|
|
7050
7050
|
word: "A-Za-z0-9_",
|
|
7051
7051
|
xdigit: "A-Fa-f0-9"
|
|
7052
7052
|
};
|
|
7053
|
-
|
|
7053
|
+
module.exports = {
|
|
7054
7054
|
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
7055
7055
|
MAX_LENGTH: 1024 * 64,
|
|
7056
7056
|
POSIX_REGEX_SOURCE,
|
|
@@ -7188,7 +7188,7 @@ var require_utils = __commonJS((exports) => {
|
|
|
7188
7188
|
});
|
|
7189
7189
|
|
|
7190
7190
|
// ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/scan.js
|
|
7191
|
-
var require_scan = __commonJS((exports,
|
|
7191
|
+
var require_scan = __commonJS((exports, module) => {
|
|
7192
7192
|
var utils = require_utils();
|
|
7193
7193
|
var {
|
|
7194
7194
|
CHAR_ASTERISK,
|
|
@@ -7224,7 +7224,7 @@ var require_scan = __commonJS((exports, module2) => {
|
|
|
7224
7224
|
const parts = [];
|
|
7225
7225
|
let str = input;
|
|
7226
7226
|
let index = -1;
|
|
7227
|
-
let
|
|
7227
|
+
let start = 0;
|
|
7228
7228
|
let lastIndex = 0;
|
|
7229
7229
|
let isBrace = false;
|
|
7230
7230
|
let isBracket = false;
|
|
@@ -7308,8 +7308,8 @@ var require_scan = __commonJS((exports, module2) => {
|
|
|
7308
7308
|
token = { value: "", depth: 0, isGlob: false };
|
|
7309
7309
|
if (finished === true)
|
|
7310
7310
|
continue;
|
|
7311
|
-
if (prev === CHAR_DOT && index ===
|
|
7312
|
-
|
|
7311
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
7312
|
+
start += 2;
|
|
7313
7313
|
continue;
|
|
7314
7314
|
}
|
|
7315
7315
|
lastIndex = index + 1;
|
|
@@ -7321,7 +7321,7 @@ var require_scan = __commonJS((exports, module2) => {
|
|
|
7321
7321
|
isGlob = token.isGlob = true;
|
|
7322
7322
|
isExtglob = token.isExtglob = true;
|
|
7323
7323
|
finished = true;
|
|
7324
|
-
if (code === CHAR_EXCLAMATION_MARK && index ===
|
|
7324
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
7325
7325
|
negatedExtglob = true;
|
|
7326
7326
|
}
|
|
7327
7327
|
if (scanToEnd === true) {
|
|
@@ -7379,9 +7379,9 @@ var require_scan = __commonJS((exports, module2) => {
|
|
|
7379
7379
|
}
|
|
7380
7380
|
break;
|
|
7381
7381
|
}
|
|
7382
|
-
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index ===
|
|
7382
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
7383
7383
|
negated = token.negated = true;
|
|
7384
|
-
|
|
7384
|
+
start++;
|
|
7385
7385
|
continue;
|
|
7386
7386
|
}
|
|
7387
7387
|
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
@@ -7417,10 +7417,10 @@ var require_scan = __commonJS((exports, module2) => {
|
|
|
7417
7417
|
let base = str;
|
|
7418
7418
|
let prefix = "";
|
|
7419
7419
|
let glob = "";
|
|
7420
|
-
if (
|
|
7421
|
-
prefix = str.slice(0,
|
|
7422
|
-
str = str.slice(
|
|
7423
|
-
lastIndex -=
|
|
7420
|
+
if (start > 0) {
|
|
7421
|
+
prefix = str.slice(0, start);
|
|
7422
|
+
str = str.slice(start);
|
|
7423
|
+
lastIndex -= start;
|
|
7424
7424
|
}
|
|
7425
7425
|
if (base && isGlob === true && lastIndex > 0) {
|
|
7426
7426
|
base = str.slice(0, lastIndex);
|
|
@@ -7446,7 +7446,7 @@ var require_scan = __commonJS((exports, module2) => {
|
|
|
7446
7446
|
const state = {
|
|
7447
7447
|
prefix,
|
|
7448
7448
|
input,
|
|
7449
|
-
start
|
|
7449
|
+
start,
|
|
7450
7450
|
base,
|
|
7451
7451
|
glob,
|
|
7452
7452
|
isBrace,
|
|
@@ -7467,11 +7467,11 @@ var require_scan = __commonJS((exports, module2) => {
|
|
|
7467
7467
|
if (opts.parts === true || opts.tokens === true) {
|
|
7468
7468
|
let prevIndex;
|
|
7469
7469
|
for (let idx = 0;idx < slashes.length; idx++) {
|
|
7470
|
-
const n = prevIndex ? prevIndex + 1 :
|
|
7470
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
7471
7471
|
const i = slashes[idx];
|
|
7472
7472
|
const value = input.slice(n, i);
|
|
7473
7473
|
if (opts.tokens) {
|
|
7474
|
-
if (idx === 0 &&
|
|
7474
|
+
if (idx === 0 && start !== 0) {
|
|
7475
7475
|
tokens[idx].isPrefix = true;
|
|
7476
7476
|
tokens[idx].value = prefix;
|
|
7477
7477
|
} else {
|
|
@@ -7499,11 +7499,11 @@ var require_scan = __commonJS((exports, module2) => {
|
|
|
7499
7499
|
}
|
|
7500
7500
|
return state;
|
|
7501
7501
|
};
|
|
7502
|
-
|
|
7502
|
+
module.exports = scan;
|
|
7503
7503
|
});
|
|
7504
7504
|
|
|
7505
7505
|
// ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/parse.js
|
|
7506
|
-
var require_parse = __commonJS((exports,
|
|
7506
|
+
var require_parse = __commonJS((exports, module) => {
|
|
7507
7507
|
var constants = require_constants();
|
|
7508
7508
|
var utils = require_utils();
|
|
7509
7509
|
var {
|
|
@@ -7513,16 +7513,16 @@ var require_parse = __commonJS((exports, module2) => {
|
|
|
7513
7513
|
REGEX_SPECIAL_CHARS_BACKREF,
|
|
7514
7514
|
REPLACEMENTS
|
|
7515
7515
|
} = constants;
|
|
7516
|
-
var expandRange = (
|
|
7516
|
+
var expandRange = (args, options) => {
|
|
7517
7517
|
if (typeof options.expandRange === "function") {
|
|
7518
|
-
return options.expandRange(...
|
|
7518
|
+
return options.expandRange(...args, options);
|
|
7519
7519
|
}
|
|
7520
|
-
|
|
7521
|
-
const value = `[${
|
|
7520
|
+
args.sort();
|
|
7521
|
+
const value = `[${args.join("-")}]`;
|
|
7522
7522
|
try {
|
|
7523
7523
|
new RegExp(value);
|
|
7524
7524
|
} catch (ex) {
|
|
7525
|
-
return
|
|
7525
|
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
7526
7526
|
}
|
|
7527
7527
|
return value;
|
|
7528
7528
|
};
|
|
@@ -7714,12 +7714,12 @@ var require_parse = __commonJS((exports, module2) => {
|
|
|
7714
7714
|
}
|
|
7715
7715
|
return depth;
|
|
7716
7716
|
};
|
|
7717
|
-
var analyzeRepeatedExtglob = (
|
|
7717
|
+
var analyzeRepeatedExtglob = (body, options) => {
|
|
7718
7718
|
if (options.maxExtglobRecursion === false) {
|
|
7719
7719
|
return { risky: false };
|
|
7720
7720
|
}
|
|
7721
7721
|
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
7722
|
-
const branches = splitTopLevel(
|
|
7722
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
7723
7723
|
if (branches.length > 1) {
|
|
7724
7724
|
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
|
|
7725
7725
|
return { risky: true };
|
|
@@ -7877,8 +7877,8 @@ var require_parse = __commonJS((exports, module2) => {
|
|
|
7877
7877
|
};
|
|
7878
7878
|
const extglobClose = (token) => {
|
|
7879
7879
|
const literal = input.slice(token.startIndex, state.index + 1);
|
|
7880
|
-
const
|
|
7881
|
-
const analysis = analyzeRepeatedExtglob(
|
|
7880
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
7881
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
7882
7882
|
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
7883
7883
|
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : undefined;
|
|
7884
7884
|
const open = tokens[token.tokensIndex];
|
|
@@ -8144,11 +8144,11 @@ var require_parse = __commonJS((exports, module2) => {
|
|
|
8144
8144
|
state.backtrack = true;
|
|
8145
8145
|
}
|
|
8146
8146
|
if (brace.comma !== true && brace.dots !== true) {
|
|
8147
|
-
const
|
|
8147
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
8148
8148
|
const toks = state.tokens.slice(brace.tokensIndex);
|
|
8149
8149
|
brace.value = brace.output = "\\{";
|
|
8150
8150
|
value = output = "\\}";
|
|
8151
|
-
state.output =
|
|
8151
|
+
state.output = out;
|
|
8152
8152
|
for (const t of toks) {
|
|
8153
8153
|
state.output += t.output || t.value;
|
|
8154
8154
|
}
|
|
@@ -8501,11 +8501,11 @@ var require_parse = __commonJS((exports, module2) => {
|
|
|
8501
8501
|
}
|
|
8502
8502
|
return source2;
|
|
8503
8503
|
};
|
|
8504
|
-
|
|
8504
|
+
module.exports = parse;
|
|
8505
8505
|
});
|
|
8506
8506
|
|
|
8507
8507
|
// ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js
|
|
8508
|
-
var require_picomatch = __commonJS((exports,
|
|
8508
|
+
var require_picomatch = __commonJS((exports, module) => {
|
|
8509
8509
|
var scan = require_scan();
|
|
8510
8510
|
var parse = require_parse();
|
|
8511
8511
|
var utils = require_utils();
|
|
@@ -8634,18 +8634,18 @@ var require_picomatch = __commonJS((exports, module2) => {
|
|
|
8634
8634
|
try {
|
|
8635
8635
|
const opts = options || {};
|
|
8636
8636
|
return new RegExp(source2, opts.flags || (opts.nocase ? "i" : ""));
|
|
8637
|
-
} catch (
|
|
8637
|
+
} catch (err) {
|
|
8638
8638
|
if (options && options.debug === true)
|
|
8639
|
-
throw
|
|
8639
|
+
throw err;
|
|
8640
8640
|
return /$^/;
|
|
8641
8641
|
}
|
|
8642
8642
|
};
|
|
8643
8643
|
picomatch.constants = constants;
|
|
8644
|
-
|
|
8644
|
+
module.exports = picomatch;
|
|
8645
8645
|
});
|
|
8646
8646
|
|
|
8647
8647
|
// ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/index.js
|
|
8648
|
-
var require_picomatch2 = __commonJS((exports,
|
|
8648
|
+
var require_picomatch2 = __commonJS((exports, module) => {
|
|
8649
8649
|
var pico = require_picomatch();
|
|
8650
8650
|
var utils = require_utils();
|
|
8651
8651
|
function picomatch(glob, options, returnState = false) {
|
|
@@ -8655,1754 +8655,7 @@ var require_picomatch2 = __commonJS((exports, module2) => {
|
|
|
8655
8655
|
return pico(glob, options, returnState);
|
|
8656
8656
|
}
|
|
8657
8657
|
Object.assign(picomatch, pico);
|
|
8658
|
-
|
|
8659
|
-
});
|
|
8660
|
-
|
|
8661
|
-
// ../../node_modules/.bun/web-tree-sitter@0.20.8/node_modules/web-tree-sitter/tree-sitter.js
|
|
8662
|
-
var require_tree_sitter = __commonJS((exports, module2) => {
|
|
8663
|
-
var __dirname = "/Users/bytedance/github/c4a/context/node_modules/.bun/web-tree-sitter@0.20.8/node_modules/web-tree-sitter";
|
|
8664
|
-
var Module = Module !== undefined ? Module : {};
|
|
8665
|
-
var TreeSitter = function() {
|
|
8666
|
-
var initPromise, document = typeof window == "object" ? { currentScript: window.document.currentScript } : null;
|
|
8667
|
-
|
|
8668
|
-
class Parser {
|
|
8669
|
-
constructor() {
|
|
8670
|
-
this.initialize();
|
|
8671
|
-
}
|
|
8672
|
-
initialize() {
|
|
8673
|
-
throw new Error("cannot construct a Parser before calling `init()`");
|
|
8674
|
-
}
|
|
8675
|
-
static init(moduleOptions) {
|
|
8676
|
-
return initPromise || (Module = Object.assign({}, Module, moduleOptions), initPromise = new Promise((resolveInitPromise) => {
|
|
8677
|
-
var moduleOverrides = Object.assign({}, Module), arguments_ = [], thisProgram = "./this.program", quit_ = (e, t) => {
|
|
8678
|
-
throw t;
|
|
8679
|
-
}, ENVIRONMENT_IS_WEB = typeof window == "object", ENVIRONMENT_IS_WORKER = typeof importScripts == "function", ENVIRONMENT_IS_NODE = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", scriptDirectory = "", read_, readAsync, readBinary, setWindowTitle;
|
|
8680
|
-
function locateFile(e) {
|
|
8681
|
-
return Module.locateFile ? Module.locateFile(e, scriptDirectory) : scriptDirectory + e;
|
|
8682
|
-
}
|
|
8683
|
-
function logExceptionOnExit(e) {
|
|
8684
|
-
if (e instanceof ExitStatus)
|
|
8685
|
-
return;
|
|
8686
|
-
err("exiting due to exception: " + e);
|
|
8687
|
-
}
|
|
8688
|
-
if (ENVIRONMENT_IS_NODE) {
|
|
8689
|
-
var fs = __require("fs"), nodePath = __require("path");
|
|
8690
|
-
scriptDirectory = ENVIRONMENT_IS_WORKER ? nodePath.dirname(scriptDirectory) + "/" : __dirname + "/", read_ = (e, t) => (e = isFileURI(e) ? new URL(e) : nodePath.normalize(e), fs.readFileSync(e, t ? undefined : "utf8")), readBinary = (e) => {
|
|
8691
|
-
var t = read_(e, true);
|
|
8692
|
-
return t.buffer || (t = new Uint8Array(t)), t;
|
|
8693
|
-
}, readAsync = (e, t, r) => {
|
|
8694
|
-
e = isFileURI(e) ? new URL(e) : nodePath.normalize(e), fs.readFile(e, function(e2, _) {
|
|
8695
|
-
e2 ? r(e2) : t(_.buffer);
|
|
8696
|
-
});
|
|
8697
|
-
}, process.argv.length > 1 && (thisProgram = process.argv[1].replace(/\\/g, "/")), arguments_ = process.argv.slice(2), typeof module2 != "undefined" && (module2.exports = Module), quit_ = (e, t) => {
|
|
8698
|
-
if (keepRuntimeAlive())
|
|
8699
|
-
throw process.exitCode = e, t;
|
|
8700
|
-
logExceptionOnExit(t), process.exit(e);
|
|
8701
|
-
}, Module.inspect = function() {
|
|
8702
|
-
return "[Emscripten Module object]";
|
|
8703
|
-
};
|
|
8704
|
-
} else
|
|
8705
|
-
(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && (ENVIRONMENT_IS_WORKER ? scriptDirectory = self.location.href : document !== undefined && document.currentScript && (scriptDirectory = document.currentScript.src), scriptDirectory = scriptDirectory.indexOf("blob:") !== 0 ? scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", read_ = (e) => {
|
|
8706
|
-
var t = new XMLHttpRequest;
|
|
8707
|
-
return t.open("GET", e, false), t.send(null), t.responseText;
|
|
8708
|
-
}, ENVIRONMENT_IS_WORKER && (readBinary = (e) => {
|
|
8709
|
-
var t = new XMLHttpRequest;
|
|
8710
|
-
return t.open("GET", e, false), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);
|
|
8711
|
-
}), readAsync = (e, t, r) => {
|
|
8712
|
-
var _ = new XMLHttpRequest;
|
|
8713
|
-
_.open("GET", e, true), _.responseType = "arraybuffer", _.onload = () => {
|
|
8714
|
-
_.status == 200 || _.status == 0 && _.response ? t(_.response) : r();
|
|
8715
|
-
}, _.onerror = r, _.send(null);
|
|
8716
|
-
}, setWindowTitle = (e) => document.title = e);
|
|
8717
|
-
var out = Module.print || console.log.bind(console), err = Module.printErr || console.warn.bind(console);
|
|
8718
|
-
Object.assign(Module, moduleOverrides), moduleOverrides = null, Module.arguments && (arguments_ = Module.arguments), Module.thisProgram && (thisProgram = Module.thisProgram), Module.quit && (quit_ = Module.quit);
|
|
8719
|
-
var STACK_ALIGN = 16, dynamicLibraries = Module.dynamicLibraries || [], wasmBinary;
|
|
8720
|
-
Module.wasmBinary && (wasmBinary = Module.wasmBinary);
|
|
8721
|
-
var noExitRuntime = Module.noExitRuntime || true, wasmMemory;
|
|
8722
|
-
typeof WebAssembly != "object" && abort("no native wasm support detected");
|
|
8723
|
-
var ABORT = false, EXITSTATUS, UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined, buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
|
|
8724
|
-
function UTF8ArrayToString(e, t, r) {
|
|
8725
|
-
for (var _ = t + r, n = t;e[n] && !(n >= _); )
|
|
8726
|
-
++n;
|
|
8727
|
-
if (n - t > 16 && e.buffer && UTF8Decoder)
|
|
8728
|
-
return UTF8Decoder.decode(e.subarray(t, n));
|
|
8729
|
-
for (var s = "";t < n; ) {
|
|
8730
|
-
var a = e[t++];
|
|
8731
|
-
if (128 & a) {
|
|
8732
|
-
var o = 63 & e[t++];
|
|
8733
|
-
if ((224 & a) != 192) {
|
|
8734
|
-
var i = 63 & e[t++];
|
|
8735
|
-
if ((a = (240 & a) == 224 ? (15 & a) << 12 | o << 6 | i : (7 & a) << 18 | o << 12 | i << 6 | 63 & e[t++]) < 65536)
|
|
8736
|
-
s += String.fromCharCode(a);
|
|
8737
|
-
else {
|
|
8738
|
-
var l = a - 65536;
|
|
8739
|
-
s += String.fromCharCode(55296 | l >> 10, 56320 | 1023 & l);
|
|
8740
|
-
}
|
|
8741
|
-
} else
|
|
8742
|
-
s += String.fromCharCode((31 & a) << 6 | o);
|
|
8743
|
-
} else
|
|
8744
|
-
s += String.fromCharCode(a);
|
|
8745
|
-
}
|
|
8746
|
-
return s;
|
|
8747
|
-
}
|
|
8748
|
-
function UTF8ToString(e, t) {
|
|
8749
|
-
return e ? UTF8ArrayToString(HEAPU8, e, t) : "";
|
|
8750
|
-
}
|
|
8751
|
-
function stringToUTF8Array(e, t, r, _) {
|
|
8752
|
-
if (!(_ > 0))
|
|
8753
|
-
return 0;
|
|
8754
|
-
for (var n = r, s = r + _ - 1, a = 0;a < e.length; ++a) {
|
|
8755
|
-
var o = e.charCodeAt(a);
|
|
8756
|
-
if (o >= 55296 && o <= 57343)
|
|
8757
|
-
o = 65536 + ((1023 & o) << 10) | 1023 & e.charCodeAt(++a);
|
|
8758
|
-
if (o <= 127) {
|
|
8759
|
-
if (r >= s)
|
|
8760
|
-
break;
|
|
8761
|
-
t[r++] = o;
|
|
8762
|
-
} else if (o <= 2047) {
|
|
8763
|
-
if (r + 1 >= s)
|
|
8764
|
-
break;
|
|
8765
|
-
t[r++] = 192 | o >> 6, t[r++] = 128 | 63 & o;
|
|
8766
|
-
} else if (o <= 65535) {
|
|
8767
|
-
if (r + 2 >= s)
|
|
8768
|
-
break;
|
|
8769
|
-
t[r++] = 224 | o >> 12, t[r++] = 128 | o >> 6 & 63, t[r++] = 128 | 63 & o;
|
|
8770
|
-
} else {
|
|
8771
|
-
if (r + 3 >= s)
|
|
8772
|
-
break;
|
|
8773
|
-
t[r++] = 240 | o >> 18, t[r++] = 128 | o >> 12 & 63, t[r++] = 128 | o >> 6 & 63, t[r++] = 128 | 63 & o;
|
|
8774
|
-
}
|
|
8775
|
-
}
|
|
8776
|
-
return t[r] = 0, r - n;
|
|
8777
|
-
}
|
|
8778
|
-
function stringToUTF8(e, t, r) {
|
|
8779
|
-
return stringToUTF8Array(e, HEAPU8, t, r);
|
|
8780
|
-
}
|
|
8781
|
-
function lengthBytesUTF8(e) {
|
|
8782
|
-
for (var t = 0, r = 0;r < e.length; ++r) {
|
|
8783
|
-
var _ = e.charCodeAt(r);
|
|
8784
|
-
_ <= 127 ? t++ : _ <= 2047 ? t += 2 : _ >= 55296 && _ <= 57343 ? (t += 4, ++r) : t += 3;
|
|
8785
|
-
}
|
|
8786
|
-
return t;
|
|
8787
|
-
}
|
|
8788
|
-
function updateGlobalBufferAndViews(e) {
|
|
8789
|
-
buffer = e, Module.HEAP8 = HEAP8 = new Int8Array(e), Module.HEAP16 = HEAP16 = new Int16Array(e), Module.HEAP32 = HEAP32 = new Int32Array(e), Module.HEAPU8 = HEAPU8 = new Uint8Array(e), Module.HEAPU16 = HEAPU16 = new Uint16Array(e), Module.HEAPU32 = HEAPU32 = new Uint32Array(e), Module.HEAPF32 = HEAPF32 = new Float32Array(e), Module.HEAPF64 = HEAPF64 = new Float64Array(e);
|
|
8790
|
-
}
|
|
8791
|
-
var INITIAL_MEMORY = Module.INITIAL_MEMORY || 33554432;
|
|
8792
|
-
wasmMemory = Module.wasmMemory ? Module.wasmMemory : new WebAssembly.Memory({ initial: INITIAL_MEMORY / 65536, maximum: 32768 }), wasmMemory && (buffer = wasmMemory.buffer), INITIAL_MEMORY = buffer.byteLength, updateGlobalBufferAndViews(buffer);
|
|
8793
|
-
var wasmTable = new WebAssembly.Table({ initial: 20, element: "anyfunc" }), __ATPRERUN__ = [], __ATINIT__ = [], __ATMAIN__ = [], __ATPOSTRUN__ = [], __RELOC_FUNCS__ = [], runtimeInitialized = false;
|
|
8794
|
-
function keepRuntimeAlive() {
|
|
8795
|
-
return noExitRuntime;
|
|
8796
|
-
}
|
|
8797
|
-
function preRun() {
|
|
8798
|
-
if (Module.preRun)
|
|
8799
|
-
for (typeof Module.preRun == "function" && (Module.preRun = [Module.preRun]);Module.preRun.length; )
|
|
8800
|
-
addOnPreRun(Module.preRun.shift());
|
|
8801
|
-
callRuntimeCallbacks(__ATPRERUN__);
|
|
8802
|
-
}
|
|
8803
|
-
function initRuntime() {
|
|
8804
|
-
runtimeInitialized = true, callRuntimeCallbacks(__RELOC_FUNCS__), callRuntimeCallbacks(__ATINIT__);
|
|
8805
|
-
}
|
|
8806
|
-
function preMain() {
|
|
8807
|
-
callRuntimeCallbacks(__ATMAIN__);
|
|
8808
|
-
}
|
|
8809
|
-
function postRun() {
|
|
8810
|
-
if (Module.postRun)
|
|
8811
|
-
for (typeof Module.postRun == "function" && (Module.postRun = [Module.postRun]);Module.postRun.length; )
|
|
8812
|
-
addOnPostRun(Module.postRun.shift());
|
|
8813
|
-
callRuntimeCallbacks(__ATPOSTRUN__);
|
|
8814
|
-
}
|
|
8815
|
-
function addOnPreRun(e) {
|
|
8816
|
-
__ATPRERUN__.unshift(e);
|
|
8817
|
-
}
|
|
8818
|
-
function addOnInit(e) {
|
|
8819
|
-
__ATINIT__.unshift(e);
|
|
8820
|
-
}
|
|
8821
|
-
function addOnPostRun(e) {
|
|
8822
|
-
__ATPOSTRUN__.unshift(e);
|
|
8823
|
-
}
|
|
8824
|
-
var runDependencies = 0, runDependencyWatcher = null, dependenciesFulfilled = null;
|
|
8825
|
-
function addRunDependency(e) {
|
|
8826
|
-
runDependencies++, Module.monitorRunDependencies && Module.monitorRunDependencies(runDependencies);
|
|
8827
|
-
}
|
|
8828
|
-
function removeRunDependency(e) {
|
|
8829
|
-
if (runDependencies--, Module.monitorRunDependencies && Module.monitorRunDependencies(runDependencies), runDependencies == 0 && (runDependencyWatcher !== null && (clearInterval(runDependencyWatcher), runDependencyWatcher = null), dependenciesFulfilled)) {
|
|
8830
|
-
var t = dependenciesFulfilled;
|
|
8831
|
-
dependenciesFulfilled = null, t();
|
|
8832
|
-
}
|
|
8833
|
-
}
|
|
8834
|
-
function abort(e) {
|
|
8835
|
-
throw Module.onAbort && Module.onAbort(e), err(e = "Aborted(" + e + ")"), ABORT = true, EXITSTATUS = 1, e += ". Build with -sASSERTIONS for more info.", new WebAssembly.RuntimeError(e);
|
|
8836
|
-
}
|
|
8837
|
-
var dataURIPrefix = "data:application/octet-stream;base64,", wasmBinaryFile, tempDouble, tempI64;
|
|
8838
|
-
function isDataURI(e) {
|
|
8839
|
-
return e.startsWith(dataURIPrefix);
|
|
8840
|
-
}
|
|
8841
|
-
function isFileURI(e) {
|
|
8842
|
-
return e.startsWith("file://");
|
|
8843
|
-
}
|
|
8844
|
-
function getBinary(e) {
|
|
8845
|
-
try {
|
|
8846
|
-
if (e == wasmBinaryFile && wasmBinary)
|
|
8847
|
-
return new Uint8Array(wasmBinary);
|
|
8848
|
-
if (readBinary)
|
|
8849
|
-
return readBinary(e);
|
|
8850
|
-
throw "both async and sync fetching of the wasm failed";
|
|
8851
|
-
} catch (e2) {
|
|
8852
|
-
abort(e2);
|
|
8853
|
-
}
|
|
8854
|
-
}
|
|
8855
|
-
function getBinaryPromise() {
|
|
8856
|
-
if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
|
|
8857
|
-
if (typeof fetch == "function" && !isFileURI(wasmBinaryFile))
|
|
8858
|
-
return fetch(wasmBinaryFile, { credentials: "same-origin" }).then(function(e) {
|
|
8859
|
-
if (!e.ok)
|
|
8860
|
-
throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
|
|
8861
|
-
return e.arrayBuffer();
|
|
8862
|
-
}).catch(function() {
|
|
8863
|
-
return getBinary(wasmBinaryFile);
|
|
8864
|
-
});
|
|
8865
|
-
if (readAsync)
|
|
8866
|
-
return new Promise(function(e, t) {
|
|
8867
|
-
readAsync(wasmBinaryFile, function(t2) {
|
|
8868
|
-
e(new Uint8Array(t2));
|
|
8869
|
-
}, t);
|
|
8870
|
-
});
|
|
8871
|
-
}
|
|
8872
|
-
return Promise.resolve().then(function() {
|
|
8873
|
-
return getBinary(wasmBinaryFile);
|
|
8874
|
-
});
|
|
8875
|
-
}
|
|
8876
|
-
function createWasm() {
|
|
8877
|
-
var e = { env: asmLibraryArg, wasi_snapshot_preview1: asmLibraryArg, "GOT.mem": new Proxy(asmLibraryArg, GOTHandler), "GOT.func": new Proxy(asmLibraryArg, GOTHandler) };
|
|
8878
|
-
function t(e2, t2) {
|
|
8879
|
-
var r2 = e2.exports;
|
|
8880
|
-
r2 = relocateExports(r2, 1024);
|
|
8881
|
-
var _2 = getDylinkMetadata(t2);
|
|
8882
|
-
_2.neededDynlibs && (dynamicLibraries = _2.neededDynlibs.concat(dynamicLibraries)), mergeLibSymbols(r2, "main"), Module.asm = r2, addOnInit(Module.asm.__wasm_call_ctors), __RELOC_FUNCS__.push(Module.asm.__wasm_apply_data_relocs), removeRunDependency("wasm-instantiate");
|
|
8883
|
-
}
|
|
8884
|
-
function r(e2) {
|
|
8885
|
-
t(e2.instance, e2.module);
|
|
8886
|
-
}
|
|
8887
|
-
function _(t2) {
|
|
8888
|
-
return getBinaryPromise().then(function(t3) {
|
|
8889
|
-
return WebAssembly.instantiate(t3, e);
|
|
8890
|
-
}).then(function(e2) {
|
|
8891
|
-
return e2;
|
|
8892
|
-
}).then(t2, function(e2) {
|
|
8893
|
-
err("failed to asynchronously prepare wasm: " + e2), abort(e2);
|
|
8894
|
-
});
|
|
8895
|
-
}
|
|
8896
|
-
if (addRunDependency("wasm-instantiate"), Module.instantiateWasm)
|
|
8897
|
-
try {
|
|
8898
|
-
return Module.instantiateWasm(e, t);
|
|
8899
|
-
} catch (e2) {
|
|
8900
|
-
return err("Module.instantiateWasm callback failed with error: " + e2), false;
|
|
8901
|
-
}
|
|
8902
|
-
return wasmBinary || typeof WebAssembly.instantiateStreaming != "function" || isDataURI(wasmBinaryFile) || isFileURI(wasmBinaryFile) || ENVIRONMENT_IS_NODE || typeof fetch != "function" ? _(r) : fetch(wasmBinaryFile, { credentials: "same-origin" }).then(function(t2) {
|
|
8903
|
-
return WebAssembly.instantiateStreaming(t2, e).then(r, function(e2) {
|
|
8904
|
-
return err("wasm streaming compile failed: " + e2), err("falling back to ArrayBuffer instantiation"), _(r);
|
|
8905
|
-
});
|
|
8906
|
-
}), {};
|
|
8907
|
-
}
|
|
8908
|
-
wasmBinaryFile = "tree-sitter.wasm", isDataURI(wasmBinaryFile) || (wasmBinaryFile = locateFile(wasmBinaryFile));
|
|
8909
|
-
var ASM_CONSTS = {};
|
|
8910
|
-
function ExitStatus(e) {
|
|
8911
|
-
this.name = "ExitStatus", this.message = "Program terminated with exit(" + e + ")", this.status = e;
|
|
8912
|
-
}
|
|
8913
|
-
var GOT = {}, CurrentModuleWeakSymbols = new Set([]), GOTHandler = { get: function(e, t) {
|
|
8914
|
-
var r = GOT[t];
|
|
8915
|
-
return r || (r = GOT[t] = new WebAssembly.Global({ value: "i32", mutable: true })), CurrentModuleWeakSymbols.has(t) || (r.required = true), r;
|
|
8916
|
-
} };
|
|
8917
|
-
function callRuntimeCallbacks(e) {
|
|
8918
|
-
for (;e.length > 0; )
|
|
8919
|
-
e.shift()(Module);
|
|
8920
|
-
}
|
|
8921
|
-
function getDylinkMetadata(e) {
|
|
8922
|
-
var t = 0, r = 0;
|
|
8923
|
-
function _() {
|
|
8924
|
-
for (var r2 = 0, _2 = 1;; ) {
|
|
8925
|
-
var n2 = e[t++];
|
|
8926
|
-
if (r2 += (127 & n2) * _2, _2 *= 128, !(128 & n2))
|
|
8927
|
-
break;
|
|
8928
|
-
}
|
|
8929
|
-
return r2;
|
|
8930
|
-
}
|
|
8931
|
-
function n() {
|
|
8932
|
-
var r2 = _();
|
|
8933
|
-
return UTF8ArrayToString(e, (t += r2) - r2, r2);
|
|
8934
|
-
}
|
|
8935
|
-
function s(e2, t2) {
|
|
8936
|
-
if (e2)
|
|
8937
|
-
throw new Error(t2);
|
|
8938
|
-
}
|
|
8939
|
-
var a = "dylink.0";
|
|
8940
|
-
if (e instanceof WebAssembly.Module) {
|
|
8941
|
-
var o = WebAssembly.Module.customSections(e, a);
|
|
8942
|
-
o.length === 0 && (a = "dylink", o = WebAssembly.Module.customSections(e, a)), s(o.length === 0, "need dylink section"), r = (e = new Uint8Array(o[0])).length;
|
|
8943
|
-
} else {
|
|
8944
|
-
s(!(new Uint32Array(new Uint8Array(e.subarray(0, 24)).buffer)[0] == 1836278016), "need to see wasm magic number"), s(e[8] !== 0, "need the dylink section to be first"), t = 9;
|
|
8945
|
-
var i = _();
|
|
8946
|
-
r = t + i, a = n();
|
|
8947
|
-
}
|
|
8948
|
-
var l = { neededDynlibs: [], tlsExports: new Set, weakImports: new Set };
|
|
8949
|
-
if (a == "dylink") {
|
|
8950
|
-
l.memorySize = _(), l.memoryAlign = _(), l.tableSize = _(), l.tableAlign = _();
|
|
8951
|
-
for (var u = _(), d = 0;d < u; ++d) {
|
|
8952
|
-
var c = n();
|
|
8953
|
-
l.neededDynlibs.push(c);
|
|
8954
|
-
}
|
|
8955
|
-
} else {
|
|
8956
|
-
s(a !== "dylink.0");
|
|
8957
|
-
for (;t < r; ) {
|
|
8958
|
-
var m = e[t++], p = _();
|
|
8959
|
-
if (m === 1)
|
|
8960
|
-
l.memorySize = _(), l.memoryAlign = _(), l.tableSize = _(), l.tableAlign = _();
|
|
8961
|
-
else if (m === 2)
|
|
8962
|
-
for (u = _(), d = 0;d < u; ++d)
|
|
8963
|
-
c = n(), l.neededDynlibs.push(c);
|
|
8964
|
-
else if (m === 3)
|
|
8965
|
-
for (var f = _();f--; ) {
|
|
8966
|
-
var h = n();
|
|
8967
|
-
256 & _() && l.tlsExports.add(h);
|
|
8968
|
-
}
|
|
8969
|
-
else if (m === 4)
|
|
8970
|
-
for (f = _();f--; ) {
|
|
8971
|
-
n(), h = n();
|
|
8972
|
-
(3 & _()) == 1 && l.weakImports.add(h);
|
|
8973
|
-
}
|
|
8974
|
-
else
|
|
8975
|
-
t += p;
|
|
8976
|
-
}
|
|
8977
|
-
}
|
|
8978
|
-
return l;
|
|
8979
|
-
}
|
|
8980
|
-
function getValue(e, t = "i8") {
|
|
8981
|
-
switch (t.endsWith("*") && (t = "*"), t) {
|
|
8982
|
-
case "i1":
|
|
8983
|
-
case "i8":
|
|
8984
|
-
return HEAP8[e >> 0];
|
|
8985
|
-
case "i16":
|
|
8986
|
-
return HEAP16[e >> 1];
|
|
8987
|
-
case "i32":
|
|
8988
|
-
case "i64":
|
|
8989
|
-
return HEAP32[e >> 2];
|
|
8990
|
-
case "float":
|
|
8991
|
-
return HEAPF32[e >> 2];
|
|
8992
|
-
case "double":
|
|
8993
|
-
return HEAPF64[e >> 3];
|
|
8994
|
-
case "*":
|
|
8995
|
-
return HEAPU32[e >> 2];
|
|
8996
|
-
default:
|
|
8997
|
-
abort("invalid type for getValue: " + t);
|
|
8998
|
-
}
|
|
8999
|
-
return null;
|
|
9000
|
-
}
|
|
9001
|
-
function asmjsMangle(e) {
|
|
9002
|
-
return e.indexOf("dynCall_") == 0 || ["stackAlloc", "stackSave", "stackRestore", "getTempRet0", "setTempRet0"].includes(e) ? e : "_" + e;
|
|
9003
|
-
}
|
|
9004
|
-
function mergeLibSymbols(e, t) {
|
|
9005
|
-
for (var r in e)
|
|
9006
|
-
if (e.hasOwnProperty(r)) {
|
|
9007
|
-
asmLibraryArg.hasOwnProperty(r) || (asmLibraryArg[r] = e[r]);
|
|
9008
|
-
var _ = asmjsMangle(r);
|
|
9009
|
-
Module.hasOwnProperty(_) || (Module[_] = e[r]), r == "__main_argc_argv" && (Module._main = e[r]);
|
|
9010
|
-
}
|
|
9011
|
-
}
|
|
9012
|
-
var LDSO = { loadedLibsByName: {}, loadedLibsByHandle: {} };
|
|
9013
|
-
function dynCallLegacy(e, t, r) {
|
|
9014
|
-
var _ = Module["dynCall_" + e];
|
|
9015
|
-
return r && r.length ? _.apply(null, [t].concat(r)) : _.call(null, t);
|
|
9016
|
-
}
|
|
9017
|
-
var wasmTableMirror = [];
|
|
9018
|
-
function getWasmTableEntry(e) {
|
|
9019
|
-
var t = wasmTableMirror[e];
|
|
9020
|
-
return t || (e >= wasmTableMirror.length && (wasmTableMirror.length = e + 1), wasmTableMirror[e] = t = wasmTable.get(e)), t;
|
|
9021
|
-
}
|
|
9022
|
-
function dynCall(e, t, r) {
|
|
9023
|
-
return e.includes("j") ? dynCallLegacy(e, t, r) : getWasmTableEntry(t).apply(null, r);
|
|
9024
|
-
}
|
|
9025
|
-
function createInvokeFunction(e) {
|
|
9026
|
-
return function() {
|
|
9027
|
-
var t = stackSave();
|
|
9028
|
-
try {
|
|
9029
|
-
return dynCall(e, arguments[0], Array.prototype.slice.call(arguments, 1));
|
|
9030
|
-
} catch (e2) {
|
|
9031
|
-
if (stackRestore(t), e2 !== e2 + 0)
|
|
9032
|
-
throw e2;
|
|
9033
|
-
_setThrew(1, 0);
|
|
9034
|
-
}
|
|
9035
|
-
};
|
|
9036
|
-
}
|
|
9037
|
-
var ___heap_base = 78144;
|
|
9038
|
-
function zeroMemory(e, t) {
|
|
9039
|
-
return HEAPU8.fill(0, e, e + t), e;
|
|
9040
|
-
}
|
|
9041
|
-
function getMemory(e) {
|
|
9042
|
-
if (runtimeInitialized)
|
|
9043
|
-
return zeroMemory(_malloc(e), e);
|
|
9044
|
-
var t = ___heap_base, r = t + e + 15 & -16;
|
|
9045
|
-
return ___heap_base = r, GOT.__heap_base.value = r, t;
|
|
9046
|
-
}
|
|
9047
|
-
function isInternalSym(e) {
|
|
9048
|
-
return ["__cpp_exception", "__c_longjmp", "__wasm_apply_data_relocs", "__dso_handle", "__tls_size", "__tls_align", "__set_stack_limits", "_emscripten_tls_init", "__wasm_init_tls", "__wasm_call_ctors", "__start_em_asm", "__stop_em_asm"].includes(e);
|
|
9049
|
-
}
|
|
9050
|
-
function uleb128Encode(e, t) {
|
|
9051
|
-
e < 128 ? t.push(e) : t.push(e % 128 | 128, e >> 7);
|
|
9052
|
-
}
|
|
9053
|
-
function sigToWasmTypes(e) {
|
|
9054
|
-
for (var t = { i: "i32", j: "i32", f: "f32", d: "f64", p: "i32" }, r = { parameters: [], results: e[0] == "v" ? [] : [t[e[0]]] }, _ = 1;_ < e.length; ++_)
|
|
9055
|
-
r.parameters.push(t[e[_]]), e[_] === "j" && r.parameters.push("i32");
|
|
9056
|
-
return r;
|
|
9057
|
-
}
|
|
9058
|
-
function generateFuncType(e, t) {
|
|
9059
|
-
var r = e.slice(0, 1), _ = e.slice(1), n = { i: 127, p: 127, j: 126, f: 125, d: 124 };
|
|
9060
|
-
t.push(96), uleb128Encode(_.length, t);
|
|
9061
|
-
for (var s = 0;s < _.length; ++s)
|
|
9062
|
-
t.push(n[_[s]]);
|
|
9063
|
-
r == "v" ? t.push(0) : t.push(1, n[r]);
|
|
9064
|
-
}
|
|
9065
|
-
function convertJsFunctionToWasm(e, t) {
|
|
9066
|
-
if (typeof WebAssembly.Function == "function")
|
|
9067
|
-
return new WebAssembly.Function(sigToWasmTypes(t), e);
|
|
9068
|
-
var r = [1];
|
|
9069
|
-
generateFuncType(t, r);
|
|
9070
|
-
var _ = [0, 97, 115, 109, 1, 0, 0, 0, 1];
|
|
9071
|
-
uleb128Encode(r.length, _), _.push.apply(_, r), _.push(2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0);
|
|
9072
|
-
var n = new WebAssembly.Module(new Uint8Array(_));
|
|
9073
|
-
return new WebAssembly.Instance(n, { e: { f: e } }).exports.f;
|
|
9074
|
-
}
|
|
9075
|
-
function updateTableMap(e, t) {
|
|
9076
|
-
if (functionsInTableMap)
|
|
9077
|
-
for (var r = e;r < e + t; r++) {
|
|
9078
|
-
var _ = getWasmTableEntry(r);
|
|
9079
|
-
_ && functionsInTableMap.set(_, r);
|
|
9080
|
-
}
|
|
9081
|
-
}
|
|
9082
|
-
var functionsInTableMap = undefined, freeTableIndexes = [];
|
|
9083
|
-
function getEmptyTableSlot() {
|
|
9084
|
-
if (freeTableIndexes.length)
|
|
9085
|
-
return freeTableIndexes.pop();
|
|
9086
|
-
try {
|
|
9087
|
-
wasmTable.grow(1);
|
|
9088
|
-
} catch (e) {
|
|
9089
|
-
if (!(e instanceof RangeError))
|
|
9090
|
-
throw e;
|
|
9091
|
-
throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";
|
|
9092
|
-
}
|
|
9093
|
-
return wasmTable.length - 1;
|
|
9094
|
-
}
|
|
9095
|
-
function setWasmTableEntry(e, t) {
|
|
9096
|
-
wasmTable.set(e, t), wasmTableMirror[e] = wasmTable.get(e);
|
|
9097
|
-
}
|
|
9098
|
-
function addFunction(e, t) {
|
|
9099
|
-
if (functionsInTableMap || (functionsInTableMap = new WeakMap, updateTableMap(0, wasmTable.length)), functionsInTableMap.has(e))
|
|
9100
|
-
return functionsInTableMap.get(e);
|
|
9101
|
-
var r = getEmptyTableSlot();
|
|
9102
|
-
try {
|
|
9103
|
-
setWasmTableEntry(r, e);
|
|
9104
|
-
} catch (_) {
|
|
9105
|
-
if (!(_ instanceof TypeError))
|
|
9106
|
-
throw _;
|
|
9107
|
-
setWasmTableEntry(r, convertJsFunctionToWasm(e, t));
|
|
9108
|
-
}
|
|
9109
|
-
return functionsInTableMap.set(e, r), r;
|
|
9110
|
-
}
|
|
9111
|
-
function updateGOT(e, t) {
|
|
9112
|
-
for (var r in e)
|
|
9113
|
-
if (!isInternalSym(r)) {
|
|
9114
|
-
var _ = e[r];
|
|
9115
|
-
r.startsWith("orig$") && (r = r.split("$")[1], t = true), GOT[r] || (GOT[r] = new WebAssembly.Global({ value: "i32", mutable: true })), (t || GOT[r].value == 0) && (typeof _ == "function" ? GOT[r].value = addFunction(_) : typeof _ == "number" ? GOT[r].value = _ : err("unhandled export type for `" + r + "`: " + typeof _));
|
|
9116
|
-
}
|
|
9117
|
-
}
|
|
9118
|
-
function relocateExports(e, t, r) {
|
|
9119
|
-
var _ = {};
|
|
9120
|
-
for (var n in e) {
|
|
9121
|
-
var s = e[n];
|
|
9122
|
-
typeof s == "object" && (s = s.value), typeof s == "number" && (s += t), _[n] = s;
|
|
9123
|
-
}
|
|
9124
|
-
return updateGOT(_, r), _;
|
|
9125
|
-
}
|
|
9126
|
-
function resolveGlobalSymbol(e, t) {
|
|
9127
|
-
var r;
|
|
9128
|
-
return t && (r = asmLibraryArg["orig$" + e]), r || (r = asmLibraryArg[e]) && r.stub && (r = undefined), r || (r = Module[asmjsMangle(e)]), !r && e.startsWith("invoke_") && (r = createInvokeFunction(e.split("_")[1])), r;
|
|
9129
|
-
}
|
|
9130
|
-
function alignMemory(e, t) {
|
|
9131
|
-
return Math.ceil(e / t) * t;
|
|
9132
|
-
}
|
|
9133
|
-
function loadWebAssemblyModule(binary, flags, handle) {
|
|
9134
|
-
var metadata = getDylinkMetadata(binary);
|
|
9135
|
-
function loadModule() {
|
|
9136
|
-
var firstLoad = !handle || !HEAP8[handle + 12 >> 0];
|
|
9137
|
-
if (firstLoad) {
|
|
9138
|
-
var memAlign = Math.pow(2, metadata.memoryAlign);
|
|
9139
|
-
memAlign = Math.max(memAlign, STACK_ALIGN);
|
|
9140
|
-
var memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0, tableBase = metadata.tableSize ? wasmTable.length : 0;
|
|
9141
|
-
handle && (HEAP8[handle + 12 >> 0] = 1, HEAPU32[handle + 16 >> 2] = memoryBase, HEAP32[handle + 20 >> 2] = metadata.memorySize, HEAPU32[handle + 24 >> 2] = tableBase, HEAP32[handle + 28 >> 2] = metadata.tableSize);
|
|
9142
|
-
} else
|
|
9143
|
-
memoryBase = HEAPU32[handle + 16 >> 2], tableBase = HEAPU32[handle + 24 >> 2];
|
|
9144
|
-
var tableGrowthNeeded = tableBase + metadata.tableSize - wasmTable.length, moduleExports;
|
|
9145
|
-
function resolveSymbol(e) {
|
|
9146
|
-
var t = resolveGlobalSymbol(e, false);
|
|
9147
|
-
return t || (t = moduleExports[e]), t;
|
|
9148
|
-
}
|
|
9149
|
-
tableGrowthNeeded > 0 && wasmTable.grow(tableGrowthNeeded);
|
|
9150
|
-
var proxyHandler = { get: function(e, t) {
|
|
9151
|
-
switch (t) {
|
|
9152
|
-
case "__memory_base":
|
|
9153
|
-
return memoryBase;
|
|
9154
|
-
case "__table_base":
|
|
9155
|
-
return tableBase;
|
|
9156
|
-
}
|
|
9157
|
-
if (t in asmLibraryArg)
|
|
9158
|
-
return asmLibraryArg[t];
|
|
9159
|
-
var r;
|
|
9160
|
-
t in e || (e[t] = function() {
|
|
9161
|
-
return r || (r = resolveSymbol(t)), r.apply(null, arguments);
|
|
9162
|
-
});
|
|
9163
|
-
return e[t];
|
|
9164
|
-
} }, proxy = new Proxy({}, proxyHandler), info = { "GOT.mem": new Proxy({}, GOTHandler), "GOT.func": new Proxy({}, GOTHandler), env: proxy, wasi_snapshot_preview1: proxy };
|
|
9165
|
-
function postInstantiation(instance) {
|
|
9166
|
-
function addEmAsm(addr, body) {
|
|
9167
|
-
for (var args = [], arity = 0;arity < 16 && body.indexOf("$" + arity) != -1; arity++)
|
|
9168
|
-
args.push("$" + arity);
|
|
9169
|
-
args = args.join(",");
|
|
9170
|
-
var func = "(" + args + " ) => { " + body + "};";
|
|
9171
|
-
ASM_CONSTS[start] = eval(func);
|
|
9172
|
-
}
|
|
9173
|
-
if (updateTableMap(tableBase, metadata.tableSize), moduleExports = relocateExports(instance.exports, memoryBase), flags.allowUndefined || reportUndefinedSymbols(), "__start_em_asm" in moduleExports)
|
|
9174
|
-
for (var { __start_em_asm: start, __stop_em_asm: stop } = moduleExports;start < stop; ) {
|
|
9175
|
-
var jsString = UTF8ToString(start);
|
|
9176
|
-
addEmAsm(start, jsString), start = HEAPU8.indexOf(0, start) + 1;
|
|
9177
|
-
}
|
|
9178
|
-
var applyRelocs = moduleExports.__wasm_apply_data_relocs;
|
|
9179
|
-
applyRelocs && (runtimeInitialized ? applyRelocs() : __RELOC_FUNCS__.push(applyRelocs));
|
|
9180
|
-
var init = moduleExports.__wasm_call_ctors;
|
|
9181
|
-
return init && (runtimeInitialized ? init() : __ATINIT__.push(init)), moduleExports;
|
|
9182
|
-
}
|
|
9183
|
-
if (flags.loadAsync) {
|
|
9184
|
-
if (binary instanceof WebAssembly.Module) {
|
|
9185
|
-
var instance = new WebAssembly.Instance(binary, info);
|
|
9186
|
-
return Promise.resolve(postInstantiation(instance));
|
|
9187
|
-
}
|
|
9188
|
-
return WebAssembly.instantiate(binary, info).then(function(e) {
|
|
9189
|
-
return postInstantiation(e.instance);
|
|
9190
|
-
});
|
|
9191
|
-
}
|
|
9192
|
-
var module = binary instanceof WebAssembly.Module ? binary : new WebAssembly.Module(binary), instance = new WebAssembly.Instance(module, info);
|
|
9193
|
-
return postInstantiation(instance);
|
|
9194
|
-
}
|
|
9195
|
-
return CurrentModuleWeakSymbols = metadata.weakImports, flags.loadAsync ? metadata.neededDynlibs.reduce(function(e, t) {
|
|
9196
|
-
return e.then(function() {
|
|
9197
|
-
return loadDynamicLibrary(t, flags);
|
|
9198
|
-
});
|
|
9199
|
-
}, Promise.resolve()).then(function() {
|
|
9200
|
-
return loadModule();
|
|
9201
|
-
}) : (metadata.neededDynlibs.forEach(function(e) {
|
|
9202
|
-
loadDynamicLibrary(e, flags);
|
|
9203
|
-
}), loadModule());
|
|
9204
|
-
}
|
|
9205
|
-
function loadDynamicLibrary(e, t, r) {
|
|
9206
|
-
t = t || { global: true, nodelete: true };
|
|
9207
|
-
var _ = LDSO.loadedLibsByName[e];
|
|
9208
|
-
if (_)
|
|
9209
|
-
return t.global && !_.global && (_.global = true, _.module !== "loading" && mergeLibSymbols(_.module, e)), t.nodelete && _.refcount !== 1 / 0 && (_.refcount = 1 / 0), _.refcount++, r && (LDSO.loadedLibsByHandle[r] = _), !t.loadAsync || Promise.resolve(true);
|
|
9210
|
-
function n(e2) {
|
|
9211
|
-
if (t.fs && t.fs.findObject(e2)) {
|
|
9212
|
-
var r2 = t.fs.readFile(e2, { encoding: "binary" });
|
|
9213
|
-
return r2 instanceof Uint8Array || (r2 = new Uint8Array(r2)), t.loadAsync ? Promise.resolve(r2) : r2;
|
|
9214
|
-
}
|
|
9215
|
-
if (e2 = locateFile(e2), t.loadAsync)
|
|
9216
|
-
return new Promise(function(t2, r3) {
|
|
9217
|
-
readAsync(e2, (e3) => t2(new Uint8Array(e3)), r3);
|
|
9218
|
-
});
|
|
9219
|
-
if (!readBinary)
|
|
9220
|
-
throw new Error(e2 + ": file not found, and synchronous loading of external files is not available");
|
|
9221
|
-
return readBinary(e2);
|
|
9222
|
-
}
|
|
9223
|
-
function s() {
|
|
9224
|
-
if (typeof preloadedWasm != "undefined" && preloadedWasm[e]) {
|
|
9225
|
-
var _2 = preloadedWasm[e];
|
|
9226
|
-
return t.loadAsync ? Promise.resolve(_2) : _2;
|
|
9227
|
-
}
|
|
9228
|
-
return t.loadAsync ? n(e).then(function(e2) {
|
|
9229
|
-
return loadWebAssemblyModule(e2, t, r);
|
|
9230
|
-
}) : loadWebAssemblyModule(n(e), t, r);
|
|
9231
|
-
}
|
|
9232
|
-
function a(t2) {
|
|
9233
|
-
_.global && mergeLibSymbols(t2, e), _.module = t2;
|
|
9234
|
-
}
|
|
9235
|
-
return _ = { refcount: t.nodelete ? 1 / 0 : 1, name: e, module: "loading", global: t.global }, LDSO.loadedLibsByName[e] = _, r && (LDSO.loadedLibsByHandle[r] = _), t.loadAsync ? s().then(function(e2) {
|
|
9236
|
-
return a(e2), true;
|
|
9237
|
-
}) : (a(s()), true);
|
|
9238
|
-
}
|
|
9239
|
-
function reportUndefinedSymbols() {
|
|
9240
|
-
for (var e in GOT)
|
|
9241
|
-
if (GOT[e].value == 0) {
|
|
9242
|
-
var t = resolveGlobalSymbol(e, true);
|
|
9243
|
-
if (!t && !GOT[e].required)
|
|
9244
|
-
continue;
|
|
9245
|
-
if (typeof t == "function")
|
|
9246
|
-
GOT[e].value = addFunction(t, t.sig);
|
|
9247
|
-
else {
|
|
9248
|
-
if (typeof t != "number")
|
|
9249
|
-
throw new Error("bad export type for `" + e + "`: " + typeof t);
|
|
9250
|
-
GOT[e].value = t;
|
|
9251
|
-
}
|
|
9252
|
-
}
|
|
9253
|
-
}
|
|
9254
|
-
function preloadDylibs() {
|
|
9255
|
-
dynamicLibraries.length ? (addRunDependency("preloadDylibs"), dynamicLibraries.reduce(function(e, t) {
|
|
9256
|
-
return e.then(function() {
|
|
9257
|
-
return loadDynamicLibrary(t, { loadAsync: true, global: true, nodelete: true, allowUndefined: true });
|
|
9258
|
-
});
|
|
9259
|
-
}, Promise.resolve()).then(function() {
|
|
9260
|
-
reportUndefinedSymbols(), removeRunDependency("preloadDylibs");
|
|
9261
|
-
})) : reportUndefinedSymbols();
|
|
9262
|
-
}
|
|
9263
|
-
function setValue(e, t, r = "i8") {
|
|
9264
|
-
switch (r.endsWith("*") && (r = "*"), r) {
|
|
9265
|
-
case "i1":
|
|
9266
|
-
case "i8":
|
|
9267
|
-
HEAP8[e >> 0] = t;
|
|
9268
|
-
break;
|
|
9269
|
-
case "i16":
|
|
9270
|
-
HEAP16[e >> 1] = t;
|
|
9271
|
-
break;
|
|
9272
|
-
case "i32":
|
|
9273
|
-
HEAP32[e >> 2] = t;
|
|
9274
|
-
break;
|
|
9275
|
-
case "i64":
|
|
9276
|
-
tempI64 = [t >>> 0, (tempDouble = t, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[e >> 2] = tempI64[0], HEAP32[e + 4 >> 2] = tempI64[1];
|
|
9277
|
-
break;
|
|
9278
|
-
case "float":
|
|
9279
|
-
HEAPF32[e >> 2] = t;
|
|
9280
|
-
break;
|
|
9281
|
-
case "double":
|
|
9282
|
-
HEAPF64[e >> 3] = t;
|
|
9283
|
-
break;
|
|
9284
|
-
case "*":
|
|
9285
|
-
HEAPU32[e >> 2] = t;
|
|
9286
|
-
break;
|
|
9287
|
-
default:
|
|
9288
|
-
abort("invalid type for setValue: " + r);
|
|
9289
|
-
}
|
|
9290
|
-
}
|
|
9291
|
-
var ___memory_base = new WebAssembly.Global({ value: "i32", mutable: false }, 1024), ___stack_pointer = new WebAssembly.Global({ value: "i32", mutable: true }, 78144), ___table_base = new WebAssembly.Global({ value: "i32", mutable: false }, 1), nowIsMonotonic = true, _emscripten_get_now;
|
|
9292
|
-
function __emscripten_get_now_is_monotonic() {
|
|
9293
|
-
return nowIsMonotonic;
|
|
9294
|
-
}
|
|
9295
|
-
function _abort() {
|
|
9296
|
-
abort("");
|
|
9297
|
-
}
|
|
9298
|
-
function _emscripten_date_now() {
|
|
9299
|
-
return Date.now();
|
|
9300
|
-
}
|
|
9301
|
-
function _emscripten_memcpy_big(e, t, r) {
|
|
9302
|
-
HEAPU8.copyWithin(e, t, t + r);
|
|
9303
|
-
}
|
|
9304
|
-
function getHeapMax() {
|
|
9305
|
-
return 2147483648;
|
|
9306
|
-
}
|
|
9307
|
-
function emscripten_realloc_buffer(e) {
|
|
9308
|
-
try {
|
|
9309
|
-
return wasmMemory.grow(e - buffer.byteLength + 65535 >>> 16), updateGlobalBufferAndViews(wasmMemory.buffer), 1;
|
|
9310
|
-
} catch (e2) {}
|
|
9311
|
-
}
|
|
9312
|
-
function _emscripten_resize_heap(e) {
|
|
9313
|
-
var t = HEAPU8.length;
|
|
9314
|
-
e >>>= 0;
|
|
9315
|
-
var r = getHeapMax();
|
|
9316
|
-
if (e > r)
|
|
9317
|
-
return false;
|
|
9318
|
-
for (var _ = 1;_ <= 4; _ *= 2) {
|
|
9319
|
-
var n = t * (1 + 0.2 / _);
|
|
9320
|
-
if (n = Math.min(n, e + 100663296), emscripten_realloc_buffer(Math.min(r, (s = Math.max(e, n)) + ((a = 65536) - s % a) % a)))
|
|
9321
|
-
return true;
|
|
9322
|
-
}
|
|
9323
|
-
var s, a;
|
|
9324
|
-
return false;
|
|
9325
|
-
}
|
|
9326
|
-
__emscripten_get_now_is_monotonic.sig = "i", Module._abort = _abort, _abort.sig = "v", _emscripten_date_now.sig = "d", _emscripten_get_now = ENVIRONMENT_IS_NODE ? () => {
|
|
9327
|
-
var e = process.hrtime();
|
|
9328
|
-
return 1000 * e[0] + e[1] / 1e6;
|
|
9329
|
-
} : () => performance.now(), _emscripten_get_now.sig = "d", _emscripten_memcpy_big.sig = "vppp", _emscripten_resize_heap.sig = "ip";
|
|
9330
|
-
var SYSCALLS = { DEFAULT_POLLMASK: 5, calculateAt: function(e, t, r) {
|
|
9331
|
-
if (PATH.isAbs(t))
|
|
9332
|
-
return t;
|
|
9333
|
-
var _;
|
|
9334
|
-
e === -100 ? _ = FS.cwd() : _ = SYSCALLS.getStreamFromFD(e).path;
|
|
9335
|
-
if (t.length == 0) {
|
|
9336
|
-
if (!r)
|
|
9337
|
-
throw new FS.ErrnoError(44);
|
|
9338
|
-
return _;
|
|
9339
|
-
}
|
|
9340
|
-
return PATH.join2(_, t);
|
|
9341
|
-
}, doStat: function(e, t, r) {
|
|
9342
|
-
try {
|
|
9343
|
-
var _ = e(t);
|
|
9344
|
-
} catch (e2) {
|
|
9345
|
-
if (e2 && e2.node && PATH.normalize(t) !== PATH.normalize(FS.getPath(e2.node)))
|
|
9346
|
-
return -54;
|
|
9347
|
-
throw e2;
|
|
9348
|
-
}
|
|
9349
|
-
HEAP32[r >> 2] = _.dev, HEAP32[r + 8 >> 2] = _.ino, HEAP32[r + 12 >> 2] = _.mode, HEAPU32[r + 16 >> 2] = _.nlink, HEAP32[r + 20 >> 2] = _.uid, HEAP32[r + 24 >> 2] = _.gid, HEAP32[r + 28 >> 2] = _.rdev, tempI64 = [_.size >>> 0, (tempDouble = _.size, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 40 >> 2] = tempI64[0], HEAP32[r + 44 >> 2] = tempI64[1], HEAP32[r + 48 >> 2] = 4096, HEAP32[r + 52 >> 2] = _.blocks;
|
|
9350
|
-
var n = _.atime.getTime(), s = _.mtime.getTime(), a = _.ctime.getTime();
|
|
9351
|
-
return tempI64 = [Math.floor(n / 1000) >>> 0, (tempDouble = Math.floor(n / 1000), +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 56 >> 2] = tempI64[0], HEAP32[r + 60 >> 2] = tempI64[1], HEAPU32[r + 64 >> 2] = n % 1000 * 1000, tempI64 = [Math.floor(s / 1000) >>> 0, (tempDouble = Math.floor(s / 1000), +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 72 >> 2] = tempI64[0], HEAP32[r + 76 >> 2] = tempI64[1], HEAPU32[r + 80 >> 2] = s % 1000 * 1000, tempI64 = [Math.floor(a / 1000) >>> 0, (tempDouble = Math.floor(a / 1000), +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 88 >> 2] = tempI64[0], HEAP32[r + 92 >> 2] = tempI64[1], HEAPU32[r + 96 >> 2] = a % 1000 * 1000, tempI64 = [_.ino >>> 0, (tempDouble = _.ino, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 104 >> 2] = tempI64[0], HEAP32[r + 108 >> 2] = tempI64[1], 0;
|
|
9352
|
-
}, doMsync: function(e, t, r, _, n) {
|
|
9353
|
-
if (!FS.isFile(t.node.mode))
|
|
9354
|
-
throw new FS.ErrnoError(43);
|
|
9355
|
-
if (2 & _)
|
|
9356
|
-
return 0;
|
|
9357
|
-
var s = HEAPU8.slice(e, e + r);
|
|
9358
|
-
FS.msync(t, s, n, r, _);
|
|
9359
|
-
}, varargs: undefined, get: function() {
|
|
9360
|
-
return SYSCALLS.varargs += 4, HEAP32[SYSCALLS.varargs - 4 >> 2];
|
|
9361
|
-
}, getStr: function(e) {
|
|
9362
|
-
return UTF8ToString(e);
|
|
9363
|
-
}, getStreamFromFD: function(e) {
|
|
9364
|
-
var t = FS.getStream(e);
|
|
9365
|
-
if (!t)
|
|
9366
|
-
throw new FS.ErrnoError(8);
|
|
9367
|
-
return t;
|
|
9368
|
-
} };
|
|
9369
|
-
function _proc_exit(e) {
|
|
9370
|
-
EXITSTATUS = e, keepRuntimeAlive() || (Module.onExit && Module.onExit(e), ABORT = true), quit_(e, new ExitStatus(e));
|
|
9371
|
-
}
|
|
9372
|
-
function exitJS(e, t) {
|
|
9373
|
-
EXITSTATUS = e, _proc_exit(e);
|
|
9374
|
-
}
|
|
9375
|
-
_proc_exit.sig = "vi";
|
|
9376
|
-
var _exit = exitJS;
|
|
9377
|
-
function _fd_close(e) {
|
|
9378
|
-
try {
|
|
9379
|
-
var t = SYSCALLS.getStreamFromFD(e);
|
|
9380
|
-
return FS.close(t), 0;
|
|
9381
|
-
} catch (e2) {
|
|
9382
|
-
if (typeof FS == "undefined" || !(e2 instanceof FS.ErrnoError))
|
|
9383
|
-
throw e2;
|
|
9384
|
-
return e2.errno;
|
|
9385
|
-
}
|
|
9386
|
-
}
|
|
9387
|
-
function convertI32PairToI53Checked(e, t) {
|
|
9388
|
-
return t + 2097152 >>> 0 < 4194305 - !!e ? (e >>> 0) + 4294967296 * t : NaN;
|
|
9389
|
-
}
|
|
9390
|
-
function _fd_seek(e, t, r, _, n) {
|
|
9391
|
-
try {
|
|
9392
|
-
var s = convertI32PairToI53Checked(t, r);
|
|
9393
|
-
if (isNaN(s))
|
|
9394
|
-
return 61;
|
|
9395
|
-
var a = SYSCALLS.getStreamFromFD(e);
|
|
9396
|
-
return FS.llseek(a, s, _), tempI64 = [a.position >>> 0, (tempDouble = a.position, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[n >> 2] = tempI64[0], HEAP32[n + 4 >> 2] = tempI64[1], a.getdents && s === 0 && _ === 0 && (a.getdents = null), 0;
|
|
9397
|
-
} catch (e2) {
|
|
9398
|
-
if (typeof FS == "undefined" || !(e2 instanceof FS.ErrnoError))
|
|
9399
|
-
throw e2;
|
|
9400
|
-
return e2.errno;
|
|
9401
|
-
}
|
|
9402
|
-
}
|
|
9403
|
-
function doWritev(e, t, r, _) {
|
|
9404
|
-
for (var n = 0, s = 0;s < r; s++) {
|
|
9405
|
-
var a = HEAPU32[t >> 2], o = HEAPU32[t + 4 >> 2];
|
|
9406
|
-
t += 8;
|
|
9407
|
-
var i = FS.write(e, HEAP8, a, o, _);
|
|
9408
|
-
if (i < 0)
|
|
9409
|
-
return -1;
|
|
9410
|
-
n += i, _ !== undefined && (_ += i);
|
|
9411
|
-
}
|
|
9412
|
-
return n;
|
|
9413
|
-
}
|
|
9414
|
-
function _fd_write(e, t, r, _) {
|
|
9415
|
-
try {
|
|
9416
|
-
var n = doWritev(SYSCALLS.getStreamFromFD(e), t, r);
|
|
9417
|
-
return HEAPU32[_ >> 2] = n, 0;
|
|
9418
|
-
} catch (e2) {
|
|
9419
|
-
if (typeof FS == "undefined" || !(e2 instanceof FS.ErrnoError))
|
|
9420
|
-
throw e2;
|
|
9421
|
-
return e2.errno;
|
|
9422
|
-
}
|
|
9423
|
-
}
|
|
9424
|
-
function _tree_sitter_log_callback(e, t) {
|
|
9425
|
-
if (currentLogCallback) {
|
|
9426
|
-
const r = UTF8ToString(t);
|
|
9427
|
-
currentLogCallback(r, e !== 0);
|
|
9428
|
-
}
|
|
9429
|
-
}
|
|
9430
|
-
function _tree_sitter_parse_callback(e, t, r, _, n) {
|
|
9431
|
-
var s = currentParseCallback(t, { row: r, column: _ });
|
|
9432
|
-
typeof s == "string" ? (setValue(n, s.length, "i32"), stringToUTF16(s, e, 10240)) : setValue(n, 0, "i32");
|
|
9433
|
-
}
|
|
9434
|
-
function handleException(e) {
|
|
9435
|
-
if (e instanceof ExitStatus || e == "unwind")
|
|
9436
|
-
return EXITSTATUS;
|
|
9437
|
-
quit_(1, e);
|
|
9438
|
-
}
|
|
9439
|
-
function allocateUTF8OnStack(e) {
|
|
9440
|
-
var t = lengthBytesUTF8(e) + 1, r = stackAlloc(t);
|
|
9441
|
-
return stringToUTF8Array(e, HEAP8, r, t), r;
|
|
9442
|
-
}
|
|
9443
|
-
function stringToUTF16(e, t, r) {
|
|
9444
|
-
if (r === undefined && (r = 2147483647), r < 2)
|
|
9445
|
-
return 0;
|
|
9446
|
-
for (var _ = t, n = (r -= 2) < 2 * e.length ? r / 2 : e.length, s = 0;s < n; ++s) {
|
|
9447
|
-
var a = e.charCodeAt(s);
|
|
9448
|
-
HEAP16[t >> 1] = a, t += 2;
|
|
9449
|
-
}
|
|
9450
|
-
return HEAP16[t >> 1] = 0, t - _;
|
|
9451
|
-
}
|
|
9452
|
-
function AsciiToString(e) {
|
|
9453
|
-
for (var t = "";; ) {
|
|
9454
|
-
var r = HEAPU8[e++ >> 0];
|
|
9455
|
-
if (!r)
|
|
9456
|
-
return t;
|
|
9457
|
-
t += String.fromCharCode(r);
|
|
9458
|
-
}
|
|
9459
|
-
}
|
|
9460
|
-
_exit.sig = "vi", _fd_close.sig = "ii", _fd_seek.sig = "iijip", _fd_write.sig = "iippp";
|
|
9461
|
-
var asmLibraryArg = { __heap_base: ___heap_base, __indirect_function_table: wasmTable, __memory_base: ___memory_base, __stack_pointer: ___stack_pointer, __table_base: ___table_base, _emscripten_get_now_is_monotonic: __emscripten_get_now_is_monotonic, abort: _abort, emscripten_get_now: _emscripten_get_now, emscripten_memcpy_big: _emscripten_memcpy_big, emscripten_resize_heap: _emscripten_resize_heap, exit: _exit, fd_close: _fd_close, fd_seek: _fd_seek, fd_write: _fd_write, memory: wasmMemory, tree_sitter_log_callback: _tree_sitter_log_callback, tree_sitter_parse_callback: _tree_sitter_parse_callback }, asm = createWasm(), ___wasm_call_ctors = Module.___wasm_call_ctors = function() {
|
|
9462
|
-
return (___wasm_call_ctors = Module.___wasm_call_ctors = Module.asm.__wasm_call_ctors).apply(null, arguments);
|
|
9463
|
-
}, ___wasm_apply_data_relocs = Module.___wasm_apply_data_relocs = function() {
|
|
9464
|
-
return (___wasm_apply_data_relocs = Module.___wasm_apply_data_relocs = Module.asm.__wasm_apply_data_relocs).apply(null, arguments);
|
|
9465
|
-
}, _malloc = Module._malloc = function() {
|
|
9466
|
-
return (_malloc = Module._malloc = Module.asm.malloc).apply(null, arguments);
|
|
9467
|
-
}, _calloc = Module._calloc = function() {
|
|
9468
|
-
return (_calloc = Module._calloc = Module.asm.calloc).apply(null, arguments);
|
|
9469
|
-
}, _realloc = Module._realloc = function() {
|
|
9470
|
-
return (_realloc = Module._realloc = Module.asm.realloc).apply(null, arguments);
|
|
9471
|
-
}, _free = Module._free = function() {
|
|
9472
|
-
return (_free = Module._free = Module.asm.free).apply(null, arguments);
|
|
9473
|
-
}, _ts_language_symbol_count = Module._ts_language_symbol_count = function() {
|
|
9474
|
-
return (_ts_language_symbol_count = Module._ts_language_symbol_count = Module.asm.ts_language_symbol_count).apply(null, arguments);
|
|
9475
|
-
}, _ts_language_version = Module._ts_language_version = function() {
|
|
9476
|
-
return (_ts_language_version = Module._ts_language_version = Module.asm.ts_language_version).apply(null, arguments);
|
|
9477
|
-
}, _ts_language_field_count = Module._ts_language_field_count = function() {
|
|
9478
|
-
return (_ts_language_field_count = Module._ts_language_field_count = Module.asm.ts_language_field_count).apply(null, arguments);
|
|
9479
|
-
}, _ts_language_symbol_name = Module._ts_language_symbol_name = function() {
|
|
9480
|
-
return (_ts_language_symbol_name = Module._ts_language_symbol_name = Module.asm.ts_language_symbol_name).apply(null, arguments);
|
|
9481
|
-
}, _ts_language_symbol_for_name = Module._ts_language_symbol_for_name = function() {
|
|
9482
|
-
return (_ts_language_symbol_for_name = Module._ts_language_symbol_for_name = Module.asm.ts_language_symbol_for_name).apply(null, arguments);
|
|
9483
|
-
}, _ts_language_symbol_type = Module._ts_language_symbol_type = function() {
|
|
9484
|
-
return (_ts_language_symbol_type = Module._ts_language_symbol_type = Module.asm.ts_language_symbol_type).apply(null, arguments);
|
|
9485
|
-
}, _ts_language_field_name_for_id = Module._ts_language_field_name_for_id = function() {
|
|
9486
|
-
return (_ts_language_field_name_for_id = Module._ts_language_field_name_for_id = Module.asm.ts_language_field_name_for_id).apply(null, arguments);
|
|
9487
|
-
}, _memset = Module._memset = function() {
|
|
9488
|
-
return (_memset = Module._memset = Module.asm.memset).apply(null, arguments);
|
|
9489
|
-
}, _memcpy = Module._memcpy = function() {
|
|
9490
|
-
return (_memcpy = Module._memcpy = Module.asm.memcpy).apply(null, arguments);
|
|
9491
|
-
}, _ts_parser_delete = Module._ts_parser_delete = function() {
|
|
9492
|
-
return (_ts_parser_delete = Module._ts_parser_delete = Module.asm.ts_parser_delete).apply(null, arguments);
|
|
9493
|
-
}, _ts_parser_reset = Module._ts_parser_reset = function() {
|
|
9494
|
-
return (_ts_parser_reset = Module._ts_parser_reset = Module.asm.ts_parser_reset).apply(null, arguments);
|
|
9495
|
-
}, _ts_parser_set_language = Module._ts_parser_set_language = function() {
|
|
9496
|
-
return (_ts_parser_set_language = Module._ts_parser_set_language = Module.asm.ts_parser_set_language).apply(null, arguments);
|
|
9497
|
-
}, _ts_parser_timeout_micros = Module._ts_parser_timeout_micros = function() {
|
|
9498
|
-
return (_ts_parser_timeout_micros = Module._ts_parser_timeout_micros = Module.asm.ts_parser_timeout_micros).apply(null, arguments);
|
|
9499
|
-
}, _ts_parser_set_timeout_micros = Module._ts_parser_set_timeout_micros = function() {
|
|
9500
|
-
return (_ts_parser_set_timeout_micros = Module._ts_parser_set_timeout_micros = Module.asm.ts_parser_set_timeout_micros).apply(null, arguments);
|
|
9501
|
-
}, _memmove = Module._memmove = function() {
|
|
9502
|
-
return (_memmove = Module._memmove = Module.asm.memmove).apply(null, arguments);
|
|
9503
|
-
}, _memcmp = Module._memcmp = function() {
|
|
9504
|
-
return (_memcmp = Module._memcmp = Module.asm.memcmp).apply(null, arguments);
|
|
9505
|
-
}, _ts_query_new = Module._ts_query_new = function() {
|
|
9506
|
-
return (_ts_query_new = Module._ts_query_new = Module.asm.ts_query_new).apply(null, arguments);
|
|
9507
|
-
}, _ts_query_delete = Module._ts_query_delete = function() {
|
|
9508
|
-
return (_ts_query_delete = Module._ts_query_delete = Module.asm.ts_query_delete).apply(null, arguments);
|
|
9509
|
-
}, _iswspace = Module._iswspace = function() {
|
|
9510
|
-
return (_iswspace = Module._iswspace = Module.asm.iswspace).apply(null, arguments);
|
|
9511
|
-
}, _iswalnum = Module._iswalnum = function() {
|
|
9512
|
-
return (_iswalnum = Module._iswalnum = Module.asm.iswalnum).apply(null, arguments);
|
|
9513
|
-
}, _ts_query_pattern_count = Module._ts_query_pattern_count = function() {
|
|
9514
|
-
return (_ts_query_pattern_count = Module._ts_query_pattern_count = Module.asm.ts_query_pattern_count).apply(null, arguments);
|
|
9515
|
-
}, _ts_query_capture_count = Module._ts_query_capture_count = function() {
|
|
9516
|
-
return (_ts_query_capture_count = Module._ts_query_capture_count = Module.asm.ts_query_capture_count).apply(null, arguments);
|
|
9517
|
-
}, _ts_query_string_count = Module._ts_query_string_count = function() {
|
|
9518
|
-
return (_ts_query_string_count = Module._ts_query_string_count = Module.asm.ts_query_string_count).apply(null, arguments);
|
|
9519
|
-
}, _ts_query_capture_name_for_id = Module._ts_query_capture_name_for_id = function() {
|
|
9520
|
-
return (_ts_query_capture_name_for_id = Module._ts_query_capture_name_for_id = Module.asm.ts_query_capture_name_for_id).apply(null, arguments);
|
|
9521
|
-
}, _ts_query_string_value_for_id = Module._ts_query_string_value_for_id = function() {
|
|
9522
|
-
return (_ts_query_string_value_for_id = Module._ts_query_string_value_for_id = Module.asm.ts_query_string_value_for_id).apply(null, arguments);
|
|
9523
|
-
}, _ts_query_predicates_for_pattern = Module._ts_query_predicates_for_pattern = function() {
|
|
9524
|
-
return (_ts_query_predicates_for_pattern = Module._ts_query_predicates_for_pattern = Module.asm.ts_query_predicates_for_pattern).apply(null, arguments);
|
|
9525
|
-
}, _ts_tree_copy = Module._ts_tree_copy = function() {
|
|
9526
|
-
return (_ts_tree_copy = Module._ts_tree_copy = Module.asm.ts_tree_copy).apply(null, arguments);
|
|
9527
|
-
}, _ts_tree_delete = Module._ts_tree_delete = function() {
|
|
9528
|
-
return (_ts_tree_delete = Module._ts_tree_delete = Module.asm.ts_tree_delete).apply(null, arguments);
|
|
9529
|
-
}, _ts_init = Module._ts_init = function() {
|
|
9530
|
-
return (_ts_init = Module._ts_init = Module.asm.ts_init).apply(null, arguments);
|
|
9531
|
-
}, _ts_parser_new_wasm = Module._ts_parser_new_wasm = function() {
|
|
9532
|
-
return (_ts_parser_new_wasm = Module._ts_parser_new_wasm = Module.asm.ts_parser_new_wasm).apply(null, arguments);
|
|
9533
|
-
}, _ts_parser_enable_logger_wasm = Module._ts_parser_enable_logger_wasm = function() {
|
|
9534
|
-
return (_ts_parser_enable_logger_wasm = Module._ts_parser_enable_logger_wasm = Module.asm.ts_parser_enable_logger_wasm).apply(null, arguments);
|
|
9535
|
-
}, _ts_parser_parse_wasm = Module._ts_parser_parse_wasm = function() {
|
|
9536
|
-
return (_ts_parser_parse_wasm = Module._ts_parser_parse_wasm = Module.asm.ts_parser_parse_wasm).apply(null, arguments);
|
|
9537
|
-
}, _ts_language_type_is_named_wasm = Module._ts_language_type_is_named_wasm = function() {
|
|
9538
|
-
return (_ts_language_type_is_named_wasm = Module._ts_language_type_is_named_wasm = Module.asm.ts_language_type_is_named_wasm).apply(null, arguments);
|
|
9539
|
-
}, _ts_language_type_is_visible_wasm = Module._ts_language_type_is_visible_wasm = function() {
|
|
9540
|
-
return (_ts_language_type_is_visible_wasm = Module._ts_language_type_is_visible_wasm = Module.asm.ts_language_type_is_visible_wasm).apply(null, arguments);
|
|
9541
|
-
}, _ts_tree_root_node_wasm = Module._ts_tree_root_node_wasm = function() {
|
|
9542
|
-
return (_ts_tree_root_node_wasm = Module._ts_tree_root_node_wasm = Module.asm.ts_tree_root_node_wasm).apply(null, arguments);
|
|
9543
|
-
}, _ts_tree_edit_wasm = Module._ts_tree_edit_wasm = function() {
|
|
9544
|
-
return (_ts_tree_edit_wasm = Module._ts_tree_edit_wasm = Module.asm.ts_tree_edit_wasm).apply(null, arguments);
|
|
9545
|
-
}, _ts_tree_get_changed_ranges_wasm = Module._ts_tree_get_changed_ranges_wasm = function() {
|
|
9546
|
-
return (_ts_tree_get_changed_ranges_wasm = Module._ts_tree_get_changed_ranges_wasm = Module.asm.ts_tree_get_changed_ranges_wasm).apply(null, arguments);
|
|
9547
|
-
}, _ts_tree_cursor_new_wasm = Module._ts_tree_cursor_new_wasm = function() {
|
|
9548
|
-
return (_ts_tree_cursor_new_wasm = Module._ts_tree_cursor_new_wasm = Module.asm.ts_tree_cursor_new_wasm).apply(null, arguments);
|
|
9549
|
-
}, _ts_tree_cursor_delete_wasm = Module._ts_tree_cursor_delete_wasm = function() {
|
|
9550
|
-
return (_ts_tree_cursor_delete_wasm = Module._ts_tree_cursor_delete_wasm = Module.asm.ts_tree_cursor_delete_wasm).apply(null, arguments);
|
|
9551
|
-
}, _ts_tree_cursor_reset_wasm = Module._ts_tree_cursor_reset_wasm = function() {
|
|
9552
|
-
return (_ts_tree_cursor_reset_wasm = Module._ts_tree_cursor_reset_wasm = Module.asm.ts_tree_cursor_reset_wasm).apply(null, arguments);
|
|
9553
|
-
}, _ts_tree_cursor_goto_first_child_wasm = Module._ts_tree_cursor_goto_first_child_wasm = function() {
|
|
9554
|
-
return (_ts_tree_cursor_goto_first_child_wasm = Module._ts_tree_cursor_goto_first_child_wasm = Module.asm.ts_tree_cursor_goto_first_child_wasm).apply(null, arguments);
|
|
9555
|
-
}, _ts_tree_cursor_goto_next_sibling_wasm = Module._ts_tree_cursor_goto_next_sibling_wasm = function() {
|
|
9556
|
-
return (_ts_tree_cursor_goto_next_sibling_wasm = Module._ts_tree_cursor_goto_next_sibling_wasm = Module.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null, arguments);
|
|
9557
|
-
}, _ts_tree_cursor_goto_parent_wasm = Module._ts_tree_cursor_goto_parent_wasm = function() {
|
|
9558
|
-
return (_ts_tree_cursor_goto_parent_wasm = Module._ts_tree_cursor_goto_parent_wasm = Module.asm.ts_tree_cursor_goto_parent_wasm).apply(null, arguments);
|
|
9559
|
-
}, _ts_tree_cursor_current_node_type_id_wasm = Module._ts_tree_cursor_current_node_type_id_wasm = function() {
|
|
9560
|
-
return (_ts_tree_cursor_current_node_type_id_wasm = Module._ts_tree_cursor_current_node_type_id_wasm = Module.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null, arguments);
|
|
9561
|
-
}, _ts_tree_cursor_current_node_is_named_wasm = Module._ts_tree_cursor_current_node_is_named_wasm = function() {
|
|
9562
|
-
return (_ts_tree_cursor_current_node_is_named_wasm = Module._ts_tree_cursor_current_node_is_named_wasm = Module.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null, arguments);
|
|
9563
|
-
}, _ts_tree_cursor_current_node_is_missing_wasm = Module._ts_tree_cursor_current_node_is_missing_wasm = function() {
|
|
9564
|
-
return (_ts_tree_cursor_current_node_is_missing_wasm = Module._ts_tree_cursor_current_node_is_missing_wasm = Module.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null, arguments);
|
|
9565
|
-
}, _ts_tree_cursor_current_node_id_wasm = Module._ts_tree_cursor_current_node_id_wasm = function() {
|
|
9566
|
-
return (_ts_tree_cursor_current_node_id_wasm = Module._ts_tree_cursor_current_node_id_wasm = Module.asm.ts_tree_cursor_current_node_id_wasm).apply(null, arguments);
|
|
9567
|
-
}, _ts_tree_cursor_start_position_wasm = Module._ts_tree_cursor_start_position_wasm = function() {
|
|
9568
|
-
return (_ts_tree_cursor_start_position_wasm = Module._ts_tree_cursor_start_position_wasm = Module.asm.ts_tree_cursor_start_position_wasm).apply(null, arguments);
|
|
9569
|
-
}, _ts_tree_cursor_end_position_wasm = Module._ts_tree_cursor_end_position_wasm = function() {
|
|
9570
|
-
return (_ts_tree_cursor_end_position_wasm = Module._ts_tree_cursor_end_position_wasm = Module.asm.ts_tree_cursor_end_position_wasm).apply(null, arguments);
|
|
9571
|
-
}, _ts_tree_cursor_start_index_wasm = Module._ts_tree_cursor_start_index_wasm = function() {
|
|
9572
|
-
return (_ts_tree_cursor_start_index_wasm = Module._ts_tree_cursor_start_index_wasm = Module.asm.ts_tree_cursor_start_index_wasm).apply(null, arguments);
|
|
9573
|
-
}, _ts_tree_cursor_end_index_wasm = Module._ts_tree_cursor_end_index_wasm = function() {
|
|
9574
|
-
return (_ts_tree_cursor_end_index_wasm = Module._ts_tree_cursor_end_index_wasm = Module.asm.ts_tree_cursor_end_index_wasm).apply(null, arguments);
|
|
9575
|
-
}, _ts_tree_cursor_current_field_id_wasm = Module._ts_tree_cursor_current_field_id_wasm = function() {
|
|
9576
|
-
return (_ts_tree_cursor_current_field_id_wasm = Module._ts_tree_cursor_current_field_id_wasm = Module.asm.ts_tree_cursor_current_field_id_wasm).apply(null, arguments);
|
|
9577
|
-
}, _ts_tree_cursor_current_node_wasm = Module._ts_tree_cursor_current_node_wasm = function() {
|
|
9578
|
-
return (_ts_tree_cursor_current_node_wasm = Module._ts_tree_cursor_current_node_wasm = Module.asm.ts_tree_cursor_current_node_wasm).apply(null, arguments);
|
|
9579
|
-
}, _ts_node_symbol_wasm = Module._ts_node_symbol_wasm = function() {
|
|
9580
|
-
return (_ts_node_symbol_wasm = Module._ts_node_symbol_wasm = Module.asm.ts_node_symbol_wasm).apply(null, arguments);
|
|
9581
|
-
}, _ts_node_child_count_wasm = Module._ts_node_child_count_wasm = function() {
|
|
9582
|
-
return (_ts_node_child_count_wasm = Module._ts_node_child_count_wasm = Module.asm.ts_node_child_count_wasm).apply(null, arguments);
|
|
9583
|
-
}, _ts_node_named_child_count_wasm = Module._ts_node_named_child_count_wasm = function() {
|
|
9584
|
-
return (_ts_node_named_child_count_wasm = Module._ts_node_named_child_count_wasm = Module.asm.ts_node_named_child_count_wasm).apply(null, arguments);
|
|
9585
|
-
}, _ts_node_child_wasm = Module._ts_node_child_wasm = function() {
|
|
9586
|
-
return (_ts_node_child_wasm = Module._ts_node_child_wasm = Module.asm.ts_node_child_wasm).apply(null, arguments);
|
|
9587
|
-
}, _ts_node_named_child_wasm = Module._ts_node_named_child_wasm = function() {
|
|
9588
|
-
return (_ts_node_named_child_wasm = Module._ts_node_named_child_wasm = Module.asm.ts_node_named_child_wasm).apply(null, arguments);
|
|
9589
|
-
}, _ts_node_child_by_field_id_wasm = Module._ts_node_child_by_field_id_wasm = function() {
|
|
9590
|
-
return (_ts_node_child_by_field_id_wasm = Module._ts_node_child_by_field_id_wasm = Module.asm.ts_node_child_by_field_id_wasm).apply(null, arguments);
|
|
9591
|
-
}, _ts_node_next_sibling_wasm = Module._ts_node_next_sibling_wasm = function() {
|
|
9592
|
-
return (_ts_node_next_sibling_wasm = Module._ts_node_next_sibling_wasm = Module.asm.ts_node_next_sibling_wasm).apply(null, arguments);
|
|
9593
|
-
}, _ts_node_prev_sibling_wasm = Module._ts_node_prev_sibling_wasm = function() {
|
|
9594
|
-
return (_ts_node_prev_sibling_wasm = Module._ts_node_prev_sibling_wasm = Module.asm.ts_node_prev_sibling_wasm).apply(null, arguments);
|
|
9595
|
-
}, _ts_node_next_named_sibling_wasm = Module._ts_node_next_named_sibling_wasm = function() {
|
|
9596
|
-
return (_ts_node_next_named_sibling_wasm = Module._ts_node_next_named_sibling_wasm = Module.asm.ts_node_next_named_sibling_wasm).apply(null, arguments);
|
|
9597
|
-
}, _ts_node_prev_named_sibling_wasm = Module._ts_node_prev_named_sibling_wasm = function() {
|
|
9598
|
-
return (_ts_node_prev_named_sibling_wasm = Module._ts_node_prev_named_sibling_wasm = Module.asm.ts_node_prev_named_sibling_wasm).apply(null, arguments);
|
|
9599
|
-
}, _ts_node_parent_wasm = Module._ts_node_parent_wasm = function() {
|
|
9600
|
-
return (_ts_node_parent_wasm = Module._ts_node_parent_wasm = Module.asm.ts_node_parent_wasm).apply(null, arguments);
|
|
9601
|
-
}, _ts_node_descendant_for_index_wasm = Module._ts_node_descendant_for_index_wasm = function() {
|
|
9602
|
-
return (_ts_node_descendant_for_index_wasm = Module._ts_node_descendant_for_index_wasm = Module.asm.ts_node_descendant_for_index_wasm).apply(null, arguments);
|
|
9603
|
-
}, _ts_node_named_descendant_for_index_wasm = Module._ts_node_named_descendant_for_index_wasm = function() {
|
|
9604
|
-
return (_ts_node_named_descendant_for_index_wasm = Module._ts_node_named_descendant_for_index_wasm = Module.asm.ts_node_named_descendant_for_index_wasm).apply(null, arguments);
|
|
9605
|
-
}, _ts_node_descendant_for_position_wasm = Module._ts_node_descendant_for_position_wasm = function() {
|
|
9606
|
-
return (_ts_node_descendant_for_position_wasm = Module._ts_node_descendant_for_position_wasm = Module.asm.ts_node_descendant_for_position_wasm).apply(null, arguments);
|
|
9607
|
-
}, _ts_node_named_descendant_for_position_wasm = Module._ts_node_named_descendant_for_position_wasm = function() {
|
|
9608
|
-
return (_ts_node_named_descendant_for_position_wasm = Module._ts_node_named_descendant_for_position_wasm = Module.asm.ts_node_named_descendant_for_position_wasm).apply(null, arguments);
|
|
9609
|
-
}, _ts_node_start_point_wasm = Module._ts_node_start_point_wasm = function() {
|
|
9610
|
-
return (_ts_node_start_point_wasm = Module._ts_node_start_point_wasm = Module.asm.ts_node_start_point_wasm).apply(null, arguments);
|
|
9611
|
-
}, _ts_node_end_point_wasm = Module._ts_node_end_point_wasm = function() {
|
|
9612
|
-
return (_ts_node_end_point_wasm = Module._ts_node_end_point_wasm = Module.asm.ts_node_end_point_wasm).apply(null, arguments);
|
|
9613
|
-
}, _ts_node_start_index_wasm = Module._ts_node_start_index_wasm = function() {
|
|
9614
|
-
return (_ts_node_start_index_wasm = Module._ts_node_start_index_wasm = Module.asm.ts_node_start_index_wasm).apply(null, arguments);
|
|
9615
|
-
}, _ts_node_end_index_wasm = Module._ts_node_end_index_wasm = function() {
|
|
9616
|
-
return (_ts_node_end_index_wasm = Module._ts_node_end_index_wasm = Module.asm.ts_node_end_index_wasm).apply(null, arguments);
|
|
9617
|
-
}, _ts_node_to_string_wasm = Module._ts_node_to_string_wasm = function() {
|
|
9618
|
-
return (_ts_node_to_string_wasm = Module._ts_node_to_string_wasm = Module.asm.ts_node_to_string_wasm).apply(null, arguments);
|
|
9619
|
-
}, _ts_node_children_wasm = Module._ts_node_children_wasm = function() {
|
|
9620
|
-
return (_ts_node_children_wasm = Module._ts_node_children_wasm = Module.asm.ts_node_children_wasm).apply(null, arguments);
|
|
9621
|
-
}, _ts_node_named_children_wasm = Module._ts_node_named_children_wasm = function() {
|
|
9622
|
-
return (_ts_node_named_children_wasm = Module._ts_node_named_children_wasm = Module.asm.ts_node_named_children_wasm).apply(null, arguments);
|
|
9623
|
-
}, _ts_node_descendants_of_type_wasm = Module._ts_node_descendants_of_type_wasm = function() {
|
|
9624
|
-
return (_ts_node_descendants_of_type_wasm = Module._ts_node_descendants_of_type_wasm = Module.asm.ts_node_descendants_of_type_wasm).apply(null, arguments);
|
|
9625
|
-
}, _ts_node_is_named_wasm = Module._ts_node_is_named_wasm = function() {
|
|
9626
|
-
return (_ts_node_is_named_wasm = Module._ts_node_is_named_wasm = Module.asm.ts_node_is_named_wasm).apply(null, arguments);
|
|
9627
|
-
}, _ts_node_has_changes_wasm = Module._ts_node_has_changes_wasm = function() {
|
|
9628
|
-
return (_ts_node_has_changes_wasm = Module._ts_node_has_changes_wasm = Module.asm.ts_node_has_changes_wasm).apply(null, arguments);
|
|
9629
|
-
}, _ts_node_has_error_wasm = Module._ts_node_has_error_wasm = function() {
|
|
9630
|
-
return (_ts_node_has_error_wasm = Module._ts_node_has_error_wasm = Module.asm.ts_node_has_error_wasm).apply(null, arguments);
|
|
9631
|
-
}, _ts_node_is_missing_wasm = Module._ts_node_is_missing_wasm = function() {
|
|
9632
|
-
return (_ts_node_is_missing_wasm = Module._ts_node_is_missing_wasm = Module.asm.ts_node_is_missing_wasm).apply(null, arguments);
|
|
9633
|
-
}, _ts_query_matches_wasm = Module._ts_query_matches_wasm = function() {
|
|
9634
|
-
return (_ts_query_matches_wasm = Module._ts_query_matches_wasm = Module.asm.ts_query_matches_wasm).apply(null, arguments);
|
|
9635
|
-
}, _ts_query_captures_wasm = Module._ts_query_captures_wasm = function() {
|
|
9636
|
-
return (_ts_query_captures_wasm = Module._ts_query_captures_wasm = Module.asm.ts_query_captures_wasm).apply(null, arguments);
|
|
9637
|
-
}, ___cxa_atexit = Module.___cxa_atexit = function() {
|
|
9638
|
-
return (___cxa_atexit = Module.___cxa_atexit = Module.asm.__cxa_atexit).apply(null, arguments);
|
|
9639
|
-
}, _iswdigit = Module._iswdigit = function() {
|
|
9640
|
-
return (_iswdigit = Module._iswdigit = Module.asm.iswdigit).apply(null, arguments);
|
|
9641
|
-
}, _iswalpha = Module._iswalpha = function() {
|
|
9642
|
-
return (_iswalpha = Module._iswalpha = Module.asm.iswalpha).apply(null, arguments);
|
|
9643
|
-
}, _iswlower = Module._iswlower = function() {
|
|
9644
|
-
return (_iswlower = Module._iswlower = Module.asm.iswlower).apply(null, arguments);
|
|
9645
|
-
}, _memchr = Module._memchr = function() {
|
|
9646
|
-
return (_memchr = Module._memchr = Module.asm.memchr).apply(null, arguments);
|
|
9647
|
-
}, _strlen = Module._strlen = function() {
|
|
9648
|
-
return (_strlen = Module._strlen = Module.asm.strlen).apply(null, arguments);
|
|
9649
|
-
}, _towupper = Module._towupper = function() {
|
|
9650
|
-
return (_towupper = Module._towupper = Module.asm.towupper).apply(null, arguments);
|
|
9651
|
-
}, _setThrew = Module._setThrew = function() {
|
|
9652
|
-
return (_setThrew = Module._setThrew = Module.asm.setThrew).apply(null, arguments);
|
|
9653
|
-
}, stackSave = Module.stackSave = function() {
|
|
9654
|
-
return (stackSave = Module.stackSave = Module.asm.stackSave).apply(null, arguments);
|
|
9655
|
-
}, stackRestore = Module.stackRestore = function() {
|
|
9656
|
-
return (stackRestore = Module.stackRestore = Module.asm.stackRestore).apply(null, arguments);
|
|
9657
|
-
}, stackAlloc = Module.stackAlloc = function() {
|
|
9658
|
-
return (stackAlloc = Module.stackAlloc = Module.asm.stackAlloc).apply(null, arguments);
|
|
9659
|
-
}, __Znwm = Module.__Znwm = function() {
|
|
9660
|
-
return (__Znwm = Module.__Znwm = Module.asm._Znwm).apply(null, arguments);
|
|
9661
|
-
}, __ZdlPv = Module.__ZdlPv = function() {
|
|
9662
|
-
return (__ZdlPv = Module.__ZdlPv = Module.asm._ZdlPv).apply(null, arguments);
|
|
9663
|
-
}, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev = function() {
|
|
9664
|
-
return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null, arguments);
|
|
9665
|
-
}, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm = function() {
|
|
9666
|
-
return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null, arguments);
|
|
9667
|
-
}, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm = function() {
|
|
9668
|
-
return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null, arguments);
|
|
9669
|
-
}, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm = function() {
|
|
9670
|
-
return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null, arguments);
|
|
9671
|
-
}, __ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm = Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm = function() {
|
|
9672
|
-
return (__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm = Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm = Module.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null, arguments);
|
|
9673
|
-
}, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc = function() {
|
|
9674
|
-
return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null, arguments);
|
|
9675
|
-
}, __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev = function() {
|
|
9676
|
-
return (__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev = Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null, arguments);
|
|
9677
|
-
}, __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw = function() {
|
|
9678
|
-
return (__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw = Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null, arguments);
|
|
9679
|
-
}, __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw = function() {
|
|
9680
|
-
return (__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw = Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw).apply(null, arguments);
|
|
9681
|
-
}, dynCall_jiji = Module.dynCall_jiji = function() {
|
|
9682
|
-
return (dynCall_jiji = Module.dynCall_jiji = Module.asm.dynCall_jiji).apply(null, arguments);
|
|
9683
|
-
}, _orig$ts_parser_timeout_micros = Module._orig$ts_parser_timeout_micros = function() {
|
|
9684
|
-
return (_orig$ts_parser_timeout_micros = Module._orig$ts_parser_timeout_micros = Module.asm.orig$ts_parser_timeout_micros).apply(null, arguments);
|
|
9685
|
-
}, _orig$ts_parser_set_timeout_micros = Module._orig$ts_parser_set_timeout_micros = function() {
|
|
9686
|
-
return (_orig$ts_parser_set_timeout_micros = Module._orig$ts_parser_set_timeout_micros = Module.asm.orig$ts_parser_set_timeout_micros).apply(null, arguments);
|
|
9687
|
-
}, calledRun;
|
|
9688
|
-
function callMain(e) {
|
|
9689
|
-
var t = Module._main;
|
|
9690
|
-
if (t) {
|
|
9691
|
-
(e = e || []).unshift(thisProgram);
|
|
9692
|
-
var r = e.length, _ = stackAlloc(4 * (r + 1)), n = _ >> 2;
|
|
9693
|
-
e.forEach((e2) => {
|
|
9694
|
-
HEAP32[n++] = allocateUTF8OnStack(e2);
|
|
9695
|
-
}), HEAP32[n] = 0;
|
|
9696
|
-
try {
|
|
9697
|
-
var s = t(r, _);
|
|
9698
|
-
return exitJS(s, true), s;
|
|
9699
|
-
} catch (e2) {
|
|
9700
|
-
return handleException(e2);
|
|
9701
|
-
}
|
|
9702
|
-
}
|
|
9703
|
-
}
|
|
9704
|
-
Module.AsciiToString = AsciiToString, Module.stringToUTF16 = stringToUTF16, dependenciesFulfilled = function e() {
|
|
9705
|
-
calledRun || run(), calledRun || (dependenciesFulfilled = e);
|
|
9706
|
-
};
|
|
9707
|
-
var dylibsLoaded = false;
|
|
9708
|
-
function run(e) {
|
|
9709
|
-
function t() {
|
|
9710
|
-
calledRun || (calledRun = true, Module.calledRun = true, ABORT || (initRuntime(), preMain(), Module.onRuntimeInitialized && Module.onRuntimeInitialized(), shouldRunNow && callMain(e), postRun()));
|
|
9711
|
-
}
|
|
9712
|
-
e = e || arguments_, runDependencies > 0 || !dylibsLoaded && (preloadDylibs(), dylibsLoaded = true, runDependencies > 0) || (preRun(), runDependencies > 0 || (Module.setStatus ? (Module.setStatus("Running..."), setTimeout(function() {
|
|
9713
|
-
setTimeout(function() {
|
|
9714
|
-
Module.setStatus("");
|
|
9715
|
-
}, 1), t();
|
|
9716
|
-
}, 1)) : t()));
|
|
9717
|
-
}
|
|
9718
|
-
if (Module.preInit)
|
|
9719
|
-
for (typeof Module.preInit == "function" && (Module.preInit = [Module.preInit]);Module.preInit.length > 0; )
|
|
9720
|
-
Module.preInit.pop()();
|
|
9721
|
-
var shouldRunNow = true;
|
|
9722
|
-
Module.noInitialRun && (shouldRunNow = false), run();
|
|
9723
|
-
const C = Module, INTERNAL = {}, SIZE_OF_INT = 4, SIZE_OF_NODE = 5 * SIZE_OF_INT, SIZE_OF_POINT = 2 * SIZE_OF_INT, SIZE_OF_RANGE = 2 * SIZE_OF_INT + 2 * SIZE_OF_POINT, ZERO_POINT = { row: 0, column: 0 }, QUERY_WORD_REGEX = /[\w-.]*/g, PREDICATE_STEP_TYPE_CAPTURE = 1, PREDICATE_STEP_TYPE_STRING = 2, LANGUAGE_FUNCTION_REGEX = /^_?tree_sitter_\w+/;
|
|
9724
|
-
var VERSION, MIN_COMPATIBLE_VERSION, TRANSFER_BUFFER, currentParseCallback, currentLogCallback;
|
|
9725
|
-
|
|
9726
|
-
class ParserImpl {
|
|
9727
|
-
static init() {
|
|
9728
|
-
TRANSFER_BUFFER = C._ts_init(), VERSION = getValue(TRANSFER_BUFFER, "i32"), MIN_COMPATIBLE_VERSION = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
|
|
9729
|
-
}
|
|
9730
|
-
initialize() {
|
|
9731
|
-
C._ts_parser_new_wasm(), this[0] = getValue(TRANSFER_BUFFER, "i32"), this[1] = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
|
|
9732
|
-
}
|
|
9733
|
-
delete() {
|
|
9734
|
-
C._ts_parser_delete(this[0]), C._free(this[1]), this[0] = 0, this[1] = 0;
|
|
9735
|
-
}
|
|
9736
|
-
setLanguage(e) {
|
|
9737
|
-
let t;
|
|
9738
|
-
if (e) {
|
|
9739
|
-
if (e.constructor !== Language)
|
|
9740
|
-
throw new Error("Argument must be a Language");
|
|
9741
|
-
{
|
|
9742
|
-
t = e[0];
|
|
9743
|
-
const r = C._ts_language_version(t);
|
|
9744
|
-
if (r < MIN_COMPATIBLE_VERSION || VERSION < r)
|
|
9745
|
-
throw new Error(`Incompatible language version ${r}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`);
|
|
9746
|
-
}
|
|
9747
|
-
} else
|
|
9748
|
-
t = 0, e = null;
|
|
9749
|
-
return this.language = e, C._ts_parser_set_language(this[0], t), this;
|
|
9750
|
-
}
|
|
9751
|
-
getLanguage() {
|
|
9752
|
-
return this.language;
|
|
9753
|
-
}
|
|
9754
|
-
parse(e, t, r) {
|
|
9755
|
-
if (typeof e == "string")
|
|
9756
|
-
currentParseCallback = (t2, r2, _2) => e.slice(t2, _2);
|
|
9757
|
-
else {
|
|
9758
|
-
if (typeof e != "function")
|
|
9759
|
-
throw new Error("Argument must be a string or a function");
|
|
9760
|
-
currentParseCallback = e;
|
|
9761
|
-
}
|
|
9762
|
-
this.logCallback ? (currentLogCallback = this.logCallback, C._ts_parser_enable_logger_wasm(this[0], 1)) : (currentLogCallback = null, C._ts_parser_enable_logger_wasm(this[0], 0));
|
|
9763
|
-
let _ = 0, n = 0;
|
|
9764
|
-
if (r && r.includedRanges) {
|
|
9765
|
-
_ = r.includedRanges.length, n = C._calloc(_, SIZE_OF_RANGE);
|
|
9766
|
-
let e2 = n;
|
|
9767
|
-
for (let t2 = 0;t2 < _; t2++)
|
|
9768
|
-
marshalRange(e2, r.includedRanges[t2]), e2 += SIZE_OF_RANGE;
|
|
9769
|
-
}
|
|
9770
|
-
const s = C._ts_parser_parse_wasm(this[0], this[1], t ? t[0] : 0, n, _);
|
|
9771
|
-
if (!s)
|
|
9772
|
-
throw currentParseCallback = null, currentLogCallback = null, new Error("Parsing failed");
|
|
9773
|
-
const a = new Tree(INTERNAL, s, this.language, currentParseCallback);
|
|
9774
|
-
return currentParseCallback = null, currentLogCallback = null, a;
|
|
9775
|
-
}
|
|
9776
|
-
reset() {
|
|
9777
|
-
C._ts_parser_reset(this[0]);
|
|
9778
|
-
}
|
|
9779
|
-
setTimeoutMicros(e) {
|
|
9780
|
-
C._ts_parser_set_timeout_micros(this[0], e);
|
|
9781
|
-
}
|
|
9782
|
-
getTimeoutMicros() {
|
|
9783
|
-
return C._ts_parser_timeout_micros(this[0]);
|
|
9784
|
-
}
|
|
9785
|
-
setLogger(e) {
|
|
9786
|
-
if (e) {
|
|
9787
|
-
if (typeof e != "function")
|
|
9788
|
-
throw new Error("Logger callback must be a function");
|
|
9789
|
-
} else
|
|
9790
|
-
e = null;
|
|
9791
|
-
return this.logCallback = e, this;
|
|
9792
|
-
}
|
|
9793
|
-
getLogger() {
|
|
9794
|
-
return this.logCallback;
|
|
9795
|
-
}
|
|
9796
|
-
}
|
|
9797
|
-
|
|
9798
|
-
class Tree {
|
|
9799
|
-
constructor(e, t, r, _) {
|
|
9800
|
-
assertInternal(e), this[0] = t, this.language = r, this.textCallback = _;
|
|
9801
|
-
}
|
|
9802
|
-
copy() {
|
|
9803
|
-
const e = C._ts_tree_copy(this[0]);
|
|
9804
|
-
return new Tree(INTERNAL, e, this.language, this.textCallback);
|
|
9805
|
-
}
|
|
9806
|
-
delete() {
|
|
9807
|
-
C._ts_tree_delete(this[0]), this[0] = 0;
|
|
9808
|
-
}
|
|
9809
|
-
edit(e) {
|
|
9810
|
-
marshalEdit(e), C._ts_tree_edit_wasm(this[0]);
|
|
9811
|
-
}
|
|
9812
|
-
get rootNode() {
|
|
9813
|
-
return C._ts_tree_root_node_wasm(this[0]), unmarshalNode(this);
|
|
9814
|
-
}
|
|
9815
|
-
getLanguage() {
|
|
9816
|
-
return this.language;
|
|
9817
|
-
}
|
|
9818
|
-
walk() {
|
|
9819
|
-
return this.rootNode.walk();
|
|
9820
|
-
}
|
|
9821
|
-
getChangedRanges(e) {
|
|
9822
|
-
if (e.constructor !== Tree)
|
|
9823
|
-
throw new TypeError("Argument must be a Tree");
|
|
9824
|
-
C._ts_tree_get_changed_ranges_wasm(this[0], e[0]);
|
|
9825
|
-
const t = getValue(TRANSFER_BUFFER, "i32"), r = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), _ = new Array(t);
|
|
9826
|
-
if (t > 0) {
|
|
9827
|
-
let e2 = r;
|
|
9828
|
-
for (let r2 = 0;r2 < t; r2++)
|
|
9829
|
-
_[r2] = unmarshalRange(e2), e2 += SIZE_OF_RANGE;
|
|
9830
|
-
C._free(r);
|
|
9831
|
-
}
|
|
9832
|
-
return _;
|
|
9833
|
-
}
|
|
9834
|
-
}
|
|
9835
|
-
|
|
9836
|
-
class Node {
|
|
9837
|
-
constructor(e, t) {
|
|
9838
|
-
assertInternal(e), this.tree = t;
|
|
9839
|
-
}
|
|
9840
|
-
get typeId() {
|
|
9841
|
-
return marshalNode(this), C._ts_node_symbol_wasm(this.tree[0]);
|
|
9842
|
-
}
|
|
9843
|
-
get type() {
|
|
9844
|
-
return this.tree.language.types[this.typeId] || "ERROR";
|
|
9845
|
-
}
|
|
9846
|
-
get endPosition() {
|
|
9847
|
-
return marshalNode(this), C._ts_node_end_point_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
|
|
9848
|
-
}
|
|
9849
|
-
get endIndex() {
|
|
9850
|
-
return marshalNode(this), C._ts_node_end_index_wasm(this.tree[0]);
|
|
9851
|
-
}
|
|
9852
|
-
get text() {
|
|
9853
|
-
return getText(this.tree, this.startIndex, this.endIndex);
|
|
9854
|
-
}
|
|
9855
|
-
isNamed() {
|
|
9856
|
-
return marshalNode(this), C._ts_node_is_named_wasm(this.tree[0]) === 1;
|
|
9857
|
-
}
|
|
9858
|
-
hasError() {
|
|
9859
|
-
return marshalNode(this), C._ts_node_has_error_wasm(this.tree[0]) === 1;
|
|
9860
|
-
}
|
|
9861
|
-
hasChanges() {
|
|
9862
|
-
return marshalNode(this), C._ts_node_has_changes_wasm(this.tree[0]) === 1;
|
|
9863
|
-
}
|
|
9864
|
-
isMissing() {
|
|
9865
|
-
return marshalNode(this), C._ts_node_is_missing_wasm(this.tree[0]) === 1;
|
|
9866
|
-
}
|
|
9867
|
-
equals(e) {
|
|
9868
|
-
return this.id === e.id;
|
|
9869
|
-
}
|
|
9870
|
-
child(e) {
|
|
9871
|
-
return marshalNode(this), C._ts_node_child_wasm(this.tree[0], e), unmarshalNode(this.tree);
|
|
9872
|
-
}
|
|
9873
|
-
namedChild(e) {
|
|
9874
|
-
return marshalNode(this), C._ts_node_named_child_wasm(this.tree[0], e), unmarshalNode(this.tree);
|
|
9875
|
-
}
|
|
9876
|
-
childForFieldId(e) {
|
|
9877
|
-
return marshalNode(this), C._ts_node_child_by_field_id_wasm(this.tree[0], e), unmarshalNode(this.tree);
|
|
9878
|
-
}
|
|
9879
|
-
childForFieldName(e) {
|
|
9880
|
-
const t = this.tree.language.fields.indexOf(e);
|
|
9881
|
-
if (t !== -1)
|
|
9882
|
-
return this.childForFieldId(t);
|
|
9883
|
-
}
|
|
9884
|
-
get childCount() {
|
|
9885
|
-
return marshalNode(this), C._ts_node_child_count_wasm(this.tree[0]);
|
|
9886
|
-
}
|
|
9887
|
-
get namedChildCount() {
|
|
9888
|
-
return marshalNode(this), C._ts_node_named_child_count_wasm(this.tree[0]);
|
|
9889
|
-
}
|
|
9890
|
-
get firstChild() {
|
|
9891
|
-
return this.child(0);
|
|
9892
|
-
}
|
|
9893
|
-
get firstNamedChild() {
|
|
9894
|
-
return this.namedChild(0);
|
|
9895
|
-
}
|
|
9896
|
-
get lastChild() {
|
|
9897
|
-
return this.child(this.childCount - 1);
|
|
9898
|
-
}
|
|
9899
|
-
get lastNamedChild() {
|
|
9900
|
-
return this.namedChild(this.namedChildCount - 1);
|
|
9901
|
-
}
|
|
9902
|
-
get children() {
|
|
9903
|
-
if (!this._children) {
|
|
9904
|
-
marshalNode(this), C._ts_node_children_wasm(this.tree[0]);
|
|
9905
|
-
const e = getValue(TRANSFER_BUFFER, "i32"), t = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
|
|
9906
|
-
if (this._children = new Array(e), e > 0) {
|
|
9907
|
-
let r = t;
|
|
9908
|
-
for (let t2 = 0;t2 < e; t2++)
|
|
9909
|
-
this._children[t2] = unmarshalNode(this.tree, r), r += SIZE_OF_NODE;
|
|
9910
|
-
C._free(t);
|
|
9911
|
-
}
|
|
9912
|
-
}
|
|
9913
|
-
return this._children;
|
|
9914
|
-
}
|
|
9915
|
-
get namedChildren() {
|
|
9916
|
-
if (!this._namedChildren) {
|
|
9917
|
-
marshalNode(this), C._ts_node_named_children_wasm(this.tree[0]);
|
|
9918
|
-
const e = getValue(TRANSFER_BUFFER, "i32"), t = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
|
|
9919
|
-
if (this._namedChildren = new Array(e), e > 0) {
|
|
9920
|
-
let r = t;
|
|
9921
|
-
for (let t2 = 0;t2 < e; t2++)
|
|
9922
|
-
this._namedChildren[t2] = unmarshalNode(this.tree, r), r += SIZE_OF_NODE;
|
|
9923
|
-
C._free(t);
|
|
9924
|
-
}
|
|
9925
|
-
}
|
|
9926
|
-
return this._namedChildren;
|
|
9927
|
-
}
|
|
9928
|
-
descendantsOfType(e, t, r) {
|
|
9929
|
-
Array.isArray(e) || (e = [e]), t || (t = ZERO_POINT), r || (r = ZERO_POINT);
|
|
9930
|
-
const _ = [], n = this.tree.language.types;
|
|
9931
|
-
for (let t2 = 0, r2 = n.length;t2 < r2; t2++)
|
|
9932
|
-
e.includes(n[t2]) && _.push(t2);
|
|
9933
|
-
const s = C._malloc(SIZE_OF_INT * _.length);
|
|
9934
|
-
for (let e2 = 0, t2 = _.length;e2 < t2; e2++)
|
|
9935
|
-
setValue(s + e2 * SIZE_OF_INT, _[e2], "i32");
|
|
9936
|
-
marshalNode(this), C._ts_node_descendants_of_type_wasm(this.tree[0], s, _.length, t.row, t.column, r.row, r.column);
|
|
9937
|
-
const a = getValue(TRANSFER_BUFFER, "i32"), o = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), i = new Array(a);
|
|
9938
|
-
if (a > 0) {
|
|
9939
|
-
let e2 = o;
|
|
9940
|
-
for (let t2 = 0;t2 < a; t2++)
|
|
9941
|
-
i[t2] = unmarshalNode(this.tree, e2), e2 += SIZE_OF_NODE;
|
|
9942
|
-
}
|
|
9943
|
-
return C._free(o), C._free(s), i;
|
|
9944
|
-
}
|
|
9945
|
-
get nextSibling() {
|
|
9946
|
-
return marshalNode(this), C._ts_node_next_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
9947
|
-
}
|
|
9948
|
-
get previousSibling() {
|
|
9949
|
-
return marshalNode(this), C._ts_node_prev_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
9950
|
-
}
|
|
9951
|
-
get nextNamedSibling() {
|
|
9952
|
-
return marshalNode(this), C._ts_node_next_named_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
9953
|
-
}
|
|
9954
|
-
get previousNamedSibling() {
|
|
9955
|
-
return marshalNode(this), C._ts_node_prev_named_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
9956
|
-
}
|
|
9957
|
-
get parent() {
|
|
9958
|
-
return marshalNode(this), C._ts_node_parent_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
9959
|
-
}
|
|
9960
|
-
descendantForIndex(e, t = e) {
|
|
9961
|
-
if (typeof e != "number" || typeof t != "number")
|
|
9962
|
-
throw new Error("Arguments must be numbers");
|
|
9963
|
-
marshalNode(this);
|
|
9964
|
-
let r = TRANSFER_BUFFER + SIZE_OF_NODE;
|
|
9965
|
-
return setValue(r, e, "i32"), setValue(r + SIZE_OF_INT, t, "i32"), C._ts_node_descendant_for_index_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
9966
|
-
}
|
|
9967
|
-
namedDescendantForIndex(e, t = e) {
|
|
9968
|
-
if (typeof e != "number" || typeof t != "number")
|
|
9969
|
-
throw new Error("Arguments must be numbers");
|
|
9970
|
-
marshalNode(this);
|
|
9971
|
-
let r = TRANSFER_BUFFER + SIZE_OF_NODE;
|
|
9972
|
-
return setValue(r, e, "i32"), setValue(r + SIZE_OF_INT, t, "i32"), C._ts_node_named_descendant_for_index_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
9973
|
-
}
|
|
9974
|
-
descendantForPosition(e, t = e) {
|
|
9975
|
-
if (!isPoint(e) || !isPoint(t))
|
|
9976
|
-
throw new Error("Arguments must be {row, column} objects");
|
|
9977
|
-
marshalNode(this);
|
|
9978
|
-
let r = TRANSFER_BUFFER + SIZE_OF_NODE;
|
|
9979
|
-
return marshalPoint(r, e), marshalPoint(r + SIZE_OF_POINT, t), C._ts_node_descendant_for_position_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
9980
|
-
}
|
|
9981
|
-
namedDescendantForPosition(e, t = e) {
|
|
9982
|
-
if (!isPoint(e) || !isPoint(t))
|
|
9983
|
-
throw new Error("Arguments must be {row, column} objects");
|
|
9984
|
-
marshalNode(this);
|
|
9985
|
-
let r = TRANSFER_BUFFER + SIZE_OF_NODE;
|
|
9986
|
-
return marshalPoint(r, e), marshalPoint(r + SIZE_OF_POINT, t), C._ts_node_named_descendant_for_position_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
9987
|
-
}
|
|
9988
|
-
walk() {
|
|
9989
|
-
return marshalNode(this), C._ts_tree_cursor_new_wasm(this.tree[0]), new TreeCursor(INTERNAL, this.tree);
|
|
9990
|
-
}
|
|
9991
|
-
toString() {
|
|
9992
|
-
marshalNode(this);
|
|
9993
|
-
const e = C._ts_node_to_string_wasm(this.tree[0]), t = AsciiToString(e);
|
|
9994
|
-
return C._free(e), t;
|
|
9995
|
-
}
|
|
9996
|
-
}
|
|
9997
|
-
|
|
9998
|
-
class TreeCursor {
|
|
9999
|
-
constructor(e, t) {
|
|
10000
|
-
assertInternal(e), this.tree = t, unmarshalTreeCursor(this);
|
|
10001
|
-
}
|
|
10002
|
-
delete() {
|
|
10003
|
-
marshalTreeCursor(this), C._ts_tree_cursor_delete_wasm(this.tree[0]), this[0] = this[1] = this[2] = 0;
|
|
10004
|
-
}
|
|
10005
|
-
reset(e) {
|
|
10006
|
-
marshalNode(e), marshalTreeCursor(this, TRANSFER_BUFFER + SIZE_OF_NODE), C._ts_tree_cursor_reset_wasm(this.tree[0]), unmarshalTreeCursor(this);
|
|
10007
|
-
}
|
|
10008
|
-
get nodeType() {
|
|
10009
|
-
return this.tree.language.types[this.nodeTypeId] || "ERROR";
|
|
10010
|
-
}
|
|
10011
|
-
get nodeTypeId() {
|
|
10012
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0]);
|
|
10013
|
-
}
|
|
10014
|
-
get nodeId() {
|
|
10015
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_current_node_id_wasm(this.tree[0]);
|
|
10016
|
-
}
|
|
10017
|
-
get nodeIsNamed() {
|
|
10018
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0]) === 1;
|
|
10019
|
-
}
|
|
10020
|
-
get nodeIsMissing() {
|
|
10021
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0]) === 1;
|
|
10022
|
-
}
|
|
10023
|
-
get nodeText() {
|
|
10024
|
-
marshalTreeCursor(this);
|
|
10025
|
-
const e = C._ts_tree_cursor_start_index_wasm(this.tree[0]), t = C._ts_tree_cursor_end_index_wasm(this.tree[0]);
|
|
10026
|
-
return getText(this.tree, e, t);
|
|
10027
|
-
}
|
|
10028
|
-
get startPosition() {
|
|
10029
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_start_position_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
|
|
10030
|
-
}
|
|
10031
|
-
get endPosition() {
|
|
10032
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_end_position_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
|
|
10033
|
-
}
|
|
10034
|
-
get startIndex() {
|
|
10035
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_start_index_wasm(this.tree[0]);
|
|
10036
|
-
}
|
|
10037
|
-
get endIndex() {
|
|
10038
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_end_index_wasm(this.tree[0]);
|
|
10039
|
-
}
|
|
10040
|
-
currentNode() {
|
|
10041
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_current_node_wasm(this.tree[0]), unmarshalNode(this.tree);
|
|
10042
|
-
}
|
|
10043
|
-
currentFieldId() {
|
|
10044
|
-
return marshalTreeCursor(this), C._ts_tree_cursor_current_field_id_wasm(this.tree[0]);
|
|
10045
|
-
}
|
|
10046
|
-
currentFieldName() {
|
|
10047
|
-
return this.tree.language.fields[this.currentFieldId()];
|
|
10048
|
-
}
|
|
10049
|
-
gotoFirstChild() {
|
|
10050
|
-
marshalTreeCursor(this);
|
|
10051
|
-
const e = C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);
|
|
10052
|
-
return unmarshalTreeCursor(this), e === 1;
|
|
10053
|
-
}
|
|
10054
|
-
gotoNextSibling() {
|
|
10055
|
-
marshalTreeCursor(this);
|
|
10056
|
-
const e = C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);
|
|
10057
|
-
return unmarshalTreeCursor(this), e === 1;
|
|
10058
|
-
}
|
|
10059
|
-
gotoParent() {
|
|
10060
|
-
marshalTreeCursor(this);
|
|
10061
|
-
const e = C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);
|
|
10062
|
-
return unmarshalTreeCursor(this), e === 1;
|
|
10063
|
-
}
|
|
10064
|
-
}
|
|
10065
|
-
|
|
10066
|
-
class Language {
|
|
10067
|
-
constructor(e, t) {
|
|
10068
|
-
assertInternal(e), this[0] = t, this.types = new Array(C._ts_language_symbol_count(this[0]));
|
|
10069
|
-
for (let e2 = 0, t2 = this.types.length;e2 < t2; e2++)
|
|
10070
|
-
C._ts_language_symbol_type(this[0], e2) < 2 && (this.types[e2] = UTF8ToString(C._ts_language_symbol_name(this[0], e2)));
|
|
10071
|
-
this.fields = new Array(C._ts_language_field_count(this[0]) + 1);
|
|
10072
|
-
for (let e2 = 0, t2 = this.fields.length;e2 < t2; e2++) {
|
|
10073
|
-
const t3 = C._ts_language_field_name_for_id(this[0], e2);
|
|
10074
|
-
this.fields[e2] = t3 !== 0 ? UTF8ToString(t3) : null;
|
|
10075
|
-
}
|
|
10076
|
-
}
|
|
10077
|
-
get version() {
|
|
10078
|
-
return C._ts_language_version(this[0]);
|
|
10079
|
-
}
|
|
10080
|
-
get fieldCount() {
|
|
10081
|
-
return this.fields.length - 1;
|
|
10082
|
-
}
|
|
10083
|
-
fieldIdForName(e) {
|
|
10084
|
-
const t = this.fields.indexOf(e);
|
|
10085
|
-
return t !== -1 ? t : null;
|
|
10086
|
-
}
|
|
10087
|
-
fieldNameForId(e) {
|
|
10088
|
-
return this.fields[e] || null;
|
|
10089
|
-
}
|
|
10090
|
-
idForNodeType(e, t) {
|
|
10091
|
-
const r = lengthBytesUTF8(e), _ = C._malloc(r + 1);
|
|
10092
|
-
stringToUTF8(e, _, r + 1);
|
|
10093
|
-
const n = C._ts_language_symbol_for_name(this[0], _, r, t);
|
|
10094
|
-
return C._free(_), n || null;
|
|
10095
|
-
}
|
|
10096
|
-
get nodeTypeCount() {
|
|
10097
|
-
return C._ts_language_symbol_count(this[0]);
|
|
10098
|
-
}
|
|
10099
|
-
nodeTypeForId(e) {
|
|
10100
|
-
const t = C._ts_language_symbol_name(this[0], e);
|
|
10101
|
-
return t ? UTF8ToString(t) : null;
|
|
10102
|
-
}
|
|
10103
|
-
nodeTypeIsNamed(e) {
|
|
10104
|
-
return !!C._ts_language_type_is_named_wasm(this[0], e);
|
|
10105
|
-
}
|
|
10106
|
-
nodeTypeIsVisible(e) {
|
|
10107
|
-
return !!C._ts_language_type_is_visible_wasm(this[0], e);
|
|
10108
|
-
}
|
|
10109
|
-
query(e) {
|
|
10110
|
-
const t = lengthBytesUTF8(e), r = C._malloc(t + 1);
|
|
10111
|
-
stringToUTF8(e, r, t + 1);
|
|
10112
|
-
const _ = C._ts_query_new(this[0], r, t, TRANSFER_BUFFER, TRANSFER_BUFFER + SIZE_OF_INT);
|
|
10113
|
-
if (!_) {
|
|
10114
|
-
const t2 = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), _2 = UTF8ToString(r, getValue(TRANSFER_BUFFER, "i32")).length, n2 = e.substr(_2, 100).split(`
|
|
10115
|
-
`)[0];
|
|
10116
|
-
let s2, a2 = n2.match(QUERY_WORD_REGEX)[0];
|
|
10117
|
-
switch (t2) {
|
|
10118
|
-
case 2:
|
|
10119
|
-
s2 = new RangeError(`Bad node name '${a2}'`);
|
|
10120
|
-
break;
|
|
10121
|
-
case 3:
|
|
10122
|
-
s2 = new RangeError(`Bad field name '${a2}'`);
|
|
10123
|
-
break;
|
|
10124
|
-
case 4:
|
|
10125
|
-
s2 = new RangeError(`Bad capture name @${a2}`);
|
|
10126
|
-
break;
|
|
10127
|
-
case 5:
|
|
10128
|
-
s2 = new TypeError(`Bad pattern structure at offset ${_2}: '${n2}'...`), a2 = "";
|
|
10129
|
-
break;
|
|
10130
|
-
default:
|
|
10131
|
-
s2 = new SyntaxError(`Bad syntax at offset ${_2}: '${n2}'...`), a2 = "";
|
|
10132
|
-
}
|
|
10133
|
-
throw s2.index = _2, s2.length = a2.length, C._free(r), s2;
|
|
10134
|
-
}
|
|
10135
|
-
const n = C._ts_query_string_count(_), s = C._ts_query_capture_count(_), a = C._ts_query_pattern_count(_), o = new Array(s), i = new Array(n);
|
|
10136
|
-
for (let e2 = 0;e2 < s; e2++) {
|
|
10137
|
-
const t2 = C._ts_query_capture_name_for_id(_, e2, TRANSFER_BUFFER), r2 = getValue(TRANSFER_BUFFER, "i32");
|
|
10138
|
-
o[e2] = UTF8ToString(t2, r2);
|
|
10139
|
-
}
|
|
10140
|
-
for (let e2 = 0;e2 < n; e2++) {
|
|
10141
|
-
const t2 = C._ts_query_string_value_for_id(_, e2, TRANSFER_BUFFER), r2 = getValue(TRANSFER_BUFFER, "i32");
|
|
10142
|
-
i[e2] = UTF8ToString(t2, r2);
|
|
10143
|
-
}
|
|
10144
|
-
const l = new Array(a), u = new Array(a), d = new Array(a), c = new Array(a), m = new Array(a);
|
|
10145
|
-
for (let e2 = 0;e2 < a; e2++) {
|
|
10146
|
-
const t2 = C._ts_query_predicates_for_pattern(_, e2, TRANSFER_BUFFER), r2 = getValue(TRANSFER_BUFFER, "i32");
|
|
10147
|
-
c[e2] = [], m[e2] = [];
|
|
10148
|
-
const n2 = [];
|
|
10149
|
-
let s2 = t2;
|
|
10150
|
-
for (let t3 = 0;t3 < r2; t3++) {
|
|
10151
|
-
const t4 = getValue(s2, "i32");
|
|
10152
|
-
s2 += SIZE_OF_INT;
|
|
10153
|
-
const r3 = getValue(s2, "i32");
|
|
10154
|
-
if (s2 += SIZE_OF_INT, t4 === PREDICATE_STEP_TYPE_CAPTURE)
|
|
10155
|
-
n2.push({ type: "capture", name: o[r3] });
|
|
10156
|
-
else if (t4 === PREDICATE_STEP_TYPE_STRING)
|
|
10157
|
-
n2.push({ type: "string", value: i[r3] });
|
|
10158
|
-
else if (n2.length > 0) {
|
|
10159
|
-
if (n2[0].type !== "string")
|
|
10160
|
-
throw new Error("Predicates must begin with a literal value");
|
|
10161
|
-
const t5 = n2[0].value;
|
|
10162
|
-
let r4 = true;
|
|
10163
|
-
switch (t5) {
|
|
10164
|
-
case "not-eq?":
|
|
10165
|
-
r4 = false;
|
|
10166
|
-
case "eq?":
|
|
10167
|
-
if (n2.length !== 3)
|
|
10168
|
-
throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got " + (n2.length - 1));
|
|
10169
|
-
if (n2[1].type !== "capture")
|
|
10170
|
-
throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${n2[1].value}"`);
|
|
10171
|
-
if (n2[2].type === "capture") {
|
|
10172
|
-
const t6 = n2[1].name, _3 = n2[2].name;
|
|
10173
|
-
m[e2].push(function(e3) {
|
|
10174
|
-
let n3, s4;
|
|
10175
|
-
for (const r5 of e3)
|
|
10176
|
-
r5.name === t6 && (n3 = r5.node), r5.name === _3 && (s4 = r5.node);
|
|
10177
|
-
return n3 === undefined || s4 === undefined || n3.text === s4.text === r4;
|
|
10178
|
-
});
|
|
10179
|
-
} else {
|
|
10180
|
-
const t6 = n2[1].name, _3 = n2[2].value;
|
|
10181
|
-
m[e2].push(function(e3) {
|
|
10182
|
-
for (const n3 of e3)
|
|
10183
|
-
if (n3.name === t6)
|
|
10184
|
-
return n3.node.text === _3 === r4;
|
|
10185
|
-
return true;
|
|
10186
|
-
});
|
|
10187
|
-
}
|
|
10188
|
-
break;
|
|
10189
|
-
case "not-match?":
|
|
10190
|
-
r4 = false;
|
|
10191
|
-
case "match?":
|
|
10192
|
-
if (n2.length !== 3)
|
|
10193
|
-
throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${n2.length - 1}.`);
|
|
10194
|
-
if (n2[1].type !== "capture")
|
|
10195
|
-
throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${n2[1].value}".`);
|
|
10196
|
-
if (n2[2].type !== "string")
|
|
10197
|
-
throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${n2[2].value}.`);
|
|
10198
|
-
const _2 = n2[1].name, s3 = new RegExp(n2[2].value);
|
|
10199
|
-
m[e2].push(function(e3) {
|
|
10200
|
-
for (const t6 of e3)
|
|
10201
|
-
if (t6.name === _2)
|
|
10202
|
-
return s3.test(t6.node.text) === r4;
|
|
10203
|
-
return true;
|
|
10204
|
-
});
|
|
10205
|
-
break;
|
|
10206
|
-
case "set!":
|
|
10207
|
-
if (n2.length < 2 || n2.length > 3)
|
|
10208
|
-
throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${n2.length - 1}.`);
|
|
10209
|
-
if (n2.some((e3) => e3.type !== "string"))
|
|
10210
|
-
throw new Error('Arguments to `#set!` predicate must be a strings.".');
|
|
10211
|
-
l[e2] || (l[e2] = {}), l[e2][n2[1].value] = n2[2] ? n2[2].value : null;
|
|
10212
|
-
break;
|
|
10213
|
-
case "is?":
|
|
10214
|
-
case "is-not?":
|
|
10215
|
-
if (n2.length < 2 || n2.length > 3)
|
|
10216
|
-
throw new Error(`Wrong number of arguments to \`#${t5}\` predicate. Expected 1 or 2. Got ${n2.length - 1}.`);
|
|
10217
|
-
if (n2.some((e3) => e3.type !== "string"))
|
|
10218
|
-
throw new Error(`Arguments to \`#${t5}\` predicate must be a strings.".`);
|
|
10219
|
-
const a2 = t5 === "is?" ? u : d;
|
|
10220
|
-
a2[e2] || (a2[e2] = {}), a2[e2][n2[1].value] = n2[2] ? n2[2].value : null;
|
|
10221
|
-
break;
|
|
10222
|
-
default:
|
|
10223
|
-
c[e2].push({ operator: t5, operands: n2.slice(1) });
|
|
10224
|
-
}
|
|
10225
|
-
n2.length = 0;
|
|
10226
|
-
}
|
|
10227
|
-
}
|
|
10228
|
-
Object.freeze(l[e2]), Object.freeze(u[e2]), Object.freeze(d[e2]);
|
|
10229
|
-
}
|
|
10230
|
-
return C._free(r), new Query(INTERNAL, _, o, m, c, Object.freeze(l), Object.freeze(u), Object.freeze(d));
|
|
10231
|
-
}
|
|
10232
|
-
static load(e) {
|
|
10233
|
-
let t;
|
|
10234
|
-
if (e instanceof Uint8Array)
|
|
10235
|
-
t = Promise.resolve(e);
|
|
10236
|
-
else {
|
|
10237
|
-
const r2 = e;
|
|
10238
|
-
if (typeof process != "undefined" && process.versions && process.versions.node) {
|
|
10239
|
-
const e2 = __require("fs");
|
|
10240
|
-
t = Promise.resolve(e2.readFileSync(r2));
|
|
10241
|
-
} else
|
|
10242
|
-
t = fetch(r2).then((e2) => e2.arrayBuffer().then((t2) => {
|
|
10243
|
-
if (e2.ok)
|
|
10244
|
-
return new Uint8Array(t2);
|
|
10245
|
-
{
|
|
10246
|
-
const r3 = new TextDecoder("utf-8").decode(t2);
|
|
10247
|
-
throw new Error(`Language.load failed with status ${e2.status}.
|
|
10248
|
-
|
|
10249
|
-
${r3}`);
|
|
10250
|
-
}
|
|
10251
|
-
}));
|
|
10252
|
-
}
|
|
10253
|
-
const r = typeof loadSideModule == "function" ? loadSideModule : loadWebAssemblyModule;
|
|
10254
|
-
return t.then((e2) => r(e2, { loadAsync: true })).then((e2) => {
|
|
10255
|
-
const t2 = Object.keys(e2), r2 = t2.find((e3) => LANGUAGE_FUNCTION_REGEX.test(e3) && !e3.includes("external_scanner_"));
|
|
10256
|
-
r2 || console.log(`Couldn't find language function in WASM file. Symbols:
|
|
10257
|
-
${JSON.stringify(t2, null, 2)}`);
|
|
10258
|
-
const _ = e2[r2]();
|
|
10259
|
-
return new Language(INTERNAL, _);
|
|
10260
|
-
});
|
|
10261
|
-
}
|
|
10262
|
-
}
|
|
10263
|
-
|
|
10264
|
-
class Query {
|
|
10265
|
-
constructor(e, t, r, _, n, s, a, o) {
|
|
10266
|
-
assertInternal(e), this[0] = t, this.captureNames = r, this.textPredicates = _, this.predicates = n, this.setProperties = s, this.assertedProperties = a, this.refutedProperties = o, this.exceededMatchLimit = false;
|
|
10267
|
-
}
|
|
10268
|
-
delete() {
|
|
10269
|
-
C._ts_query_delete(this[0]), this[0] = 0;
|
|
10270
|
-
}
|
|
10271
|
-
matches(e, t, r, _) {
|
|
10272
|
-
t || (t = ZERO_POINT), r || (r = ZERO_POINT), _ || (_ = {});
|
|
10273
|
-
let n = _.matchLimit;
|
|
10274
|
-
if (n === undefined)
|
|
10275
|
-
n = 0;
|
|
10276
|
-
else if (typeof n != "number")
|
|
10277
|
-
throw new Error("Arguments must be numbers");
|
|
10278
|
-
marshalNode(e), C._ts_query_matches_wasm(this[0], e.tree[0], t.row, t.column, r.row, r.column, n);
|
|
10279
|
-
const s = getValue(TRANSFER_BUFFER, "i32"), a = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), o = getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), i = new Array(s);
|
|
10280
|
-
this.exceededMatchLimit = !!o;
|
|
10281
|
-
let l = 0, u = a;
|
|
10282
|
-
for (let t2 = 0;t2 < s; t2++) {
|
|
10283
|
-
const r2 = getValue(u, "i32");
|
|
10284
|
-
u += SIZE_OF_INT;
|
|
10285
|
-
const _2 = getValue(u, "i32");
|
|
10286
|
-
u += SIZE_OF_INT;
|
|
10287
|
-
const n2 = new Array(_2);
|
|
10288
|
-
if (u = unmarshalCaptures(this, e.tree, u, n2), this.textPredicates[r2].every((e2) => e2(n2))) {
|
|
10289
|
-
i[l++] = { pattern: r2, captures: n2 };
|
|
10290
|
-
const e2 = this.setProperties[r2];
|
|
10291
|
-
e2 && (i[t2].setProperties = e2);
|
|
10292
|
-
const _3 = this.assertedProperties[r2];
|
|
10293
|
-
_3 && (i[t2].assertedProperties = _3);
|
|
10294
|
-
const s2 = this.refutedProperties[r2];
|
|
10295
|
-
s2 && (i[t2].refutedProperties = s2);
|
|
10296
|
-
}
|
|
10297
|
-
}
|
|
10298
|
-
return i.length = l, C._free(a), i;
|
|
10299
|
-
}
|
|
10300
|
-
captures(e, t, r, _) {
|
|
10301
|
-
t || (t = ZERO_POINT), r || (r = ZERO_POINT), _ || (_ = {});
|
|
10302
|
-
let n = _.matchLimit;
|
|
10303
|
-
if (n === undefined)
|
|
10304
|
-
n = 0;
|
|
10305
|
-
else if (typeof n != "number")
|
|
10306
|
-
throw new Error("Arguments must be numbers");
|
|
10307
|
-
marshalNode(e), C._ts_query_captures_wasm(this[0], e.tree[0], t.row, t.column, r.row, r.column, n);
|
|
10308
|
-
const s = getValue(TRANSFER_BUFFER, "i32"), a = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), o = getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), i = [];
|
|
10309
|
-
this.exceededMatchLimit = !!o;
|
|
10310
|
-
const l = [];
|
|
10311
|
-
let u = a;
|
|
10312
|
-
for (let t2 = 0;t2 < s; t2++) {
|
|
10313
|
-
const t3 = getValue(u, "i32");
|
|
10314
|
-
u += SIZE_OF_INT;
|
|
10315
|
-
const r2 = getValue(u, "i32");
|
|
10316
|
-
u += SIZE_OF_INT;
|
|
10317
|
-
const _2 = getValue(u, "i32");
|
|
10318
|
-
if (u += SIZE_OF_INT, l.length = r2, u = unmarshalCaptures(this, e.tree, u, l), this.textPredicates[t3].every((e2) => e2(l))) {
|
|
10319
|
-
const e2 = l[_2], r3 = this.setProperties[t3];
|
|
10320
|
-
r3 && (e2.setProperties = r3);
|
|
10321
|
-
const n2 = this.assertedProperties[t3];
|
|
10322
|
-
n2 && (e2.assertedProperties = n2);
|
|
10323
|
-
const s2 = this.refutedProperties[t3];
|
|
10324
|
-
s2 && (e2.refutedProperties = s2), i.push(e2);
|
|
10325
|
-
}
|
|
10326
|
-
}
|
|
10327
|
-
return C._free(a), i;
|
|
10328
|
-
}
|
|
10329
|
-
predicatesForPattern(e) {
|
|
10330
|
-
return this.predicates[e];
|
|
10331
|
-
}
|
|
10332
|
-
didExceedMatchLimit() {
|
|
10333
|
-
return this.exceededMatchLimit;
|
|
10334
|
-
}
|
|
10335
|
-
}
|
|
10336
|
-
function getText(e, t, r) {
|
|
10337
|
-
const _ = r - t;
|
|
10338
|
-
let n = e.textCallback(t, null, r);
|
|
10339
|
-
for (t += n.length;t < r; ) {
|
|
10340
|
-
const _2 = e.textCallback(t, null, r);
|
|
10341
|
-
if (!(_2 && _2.length > 0))
|
|
10342
|
-
break;
|
|
10343
|
-
t += _2.length, n += _2;
|
|
10344
|
-
}
|
|
10345
|
-
return t > r && (n = n.slice(0, _)), n;
|
|
10346
|
-
}
|
|
10347
|
-
function unmarshalCaptures(e, t, r, _) {
|
|
10348
|
-
for (let n = 0, s = _.length;n < s; n++) {
|
|
10349
|
-
const s2 = getValue(r, "i32"), a = unmarshalNode(t, r += SIZE_OF_INT);
|
|
10350
|
-
r += SIZE_OF_NODE, _[n] = { name: e.captureNames[s2], node: a };
|
|
10351
|
-
}
|
|
10352
|
-
return r;
|
|
10353
|
-
}
|
|
10354
|
-
function assertInternal(e) {
|
|
10355
|
-
if (e !== INTERNAL)
|
|
10356
|
-
throw new Error("Illegal constructor");
|
|
10357
|
-
}
|
|
10358
|
-
function isPoint(e) {
|
|
10359
|
-
return e && typeof e.row == "number" && typeof e.column == "number";
|
|
10360
|
-
}
|
|
10361
|
-
function marshalNode(e) {
|
|
10362
|
-
let t = TRANSFER_BUFFER;
|
|
10363
|
-
setValue(t, e.id, "i32"), t += SIZE_OF_INT, setValue(t, e.startIndex, "i32"), t += SIZE_OF_INT, setValue(t, e.startPosition.row, "i32"), t += SIZE_OF_INT, setValue(t, e.startPosition.column, "i32"), t += SIZE_OF_INT, setValue(t, e[0], "i32");
|
|
10364
|
-
}
|
|
10365
|
-
function unmarshalNode(e, t = TRANSFER_BUFFER) {
|
|
10366
|
-
const r = getValue(t, "i32");
|
|
10367
|
-
if (r === 0)
|
|
10368
|
-
return null;
|
|
10369
|
-
const _ = getValue(t += SIZE_OF_INT, "i32"), n = getValue(t += SIZE_OF_INT, "i32"), s = getValue(t += SIZE_OF_INT, "i32"), a = getValue(t += SIZE_OF_INT, "i32"), o = new Node(INTERNAL, e);
|
|
10370
|
-
return o.id = r, o.startIndex = _, o.startPosition = { row: n, column: s }, o[0] = a, o;
|
|
10371
|
-
}
|
|
10372
|
-
function marshalTreeCursor(e, t = TRANSFER_BUFFER) {
|
|
10373
|
-
setValue(t + 0 * SIZE_OF_INT, e[0], "i32"), setValue(t + 1 * SIZE_OF_INT, e[1], "i32"), setValue(t + 2 * SIZE_OF_INT, e[2], "i32");
|
|
10374
|
-
}
|
|
10375
|
-
function unmarshalTreeCursor(e) {
|
|
10376
|
-
e[0] = getValue(TRANSFER_BUFFER + 0 * SIZE_OF_INT, "i32"), e[1] = getValue(TRANSFER_BUFFER + 1 * SIZE_OF_INT, "i32"), e[2] = getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32");
|
|
10377
|
-
}
|
|
10378
|
-
function marshalPoint(e, t) {
|
|
10379
|
-
setValue(e, t.row, "i32"), setValue(e + SIZE_OF_INT, t.column, "i32");
|
|
10380
|
-
}
|
|
10381
|
-
function unmarshalPoint(e) {
|
|
10382
|
-
return { row: getValue(e, "i32"), column: getValue(e + SIZE_OF_INT, "i32") };
|
|
10383
|
-
}
|
|
10384
|
-
function marshalRange(e, t) {
|
|
10385
|
-
marshalPoint(e, t.startPosition), marshalPoint(e += SIZE_OF_POINT, t.endPosition), setValue(e += SIZE_OF_POINT, t.startIndex, "i32"), setValue(e += SIZE_OF_INT, t.endIndex, "i32"), e += SIZE_OF_INT;
|
|
10386
|
-
}
|
|
10387
|
-
function unmarshalRange(e) {
|
|
10388
|
-
const t = {};
|
|
10389
|
-
return t.startPosition = unmarshalPoint(e), e += SIZE_OF_POINT, t.endPosition = unmarshalPoint(e), e += SIZE_OF_POINT, t.startIndex = getValue(e, "i32"), e += SIZE_OF_INT, t.endIndex = getValue(e, "i32"), t;
|
|
10390
|
-
}
|
|
10391
|
-
function marshalEdit(e) {
|
|
10392
|
-
let t = TRANSFER_BUFFER;
|
|
10393
|
-
marshalPoint(t, e.startPosition), t += SIZE_OF_POINT, marshalPoint(t, e.oldEndPosition), t += SIZE_OF_POINT, marshalPoint(t, e.newEndPosition), t += SIZE_OF_POINT, setValue(t, e.startIndex, "i32"), t += SIZE_OF_INT, setValue(t, e.oldEndIndex, "i32"), t += SIZE_OF_INT, setValue(t, e.newEndIndex, "i32"), t += SIZE_OF_INT;
|
|
10394
|
-
}
|
|
10395
|
-
for (const e of Object.getOwnPropertyNames(ParserImpl.prototype))
|
|
10396
|
-
Object.defineProperty(Parser.prototype, e, { value: ParserImpl.prototype[e], enumerable: false, writable: false });
|
|
10397
|
-
Parser.Language = Language, Module.onRuntimeInitialized = () => {
|
|
10398
|
-
ParserImpl.init(), resolveInitPromise();
|
|
10399
|
-
};
|
|
10400
|
-
}));
|
|
10401
|
-
}
|
|
10402
|
-
}
|
|
10403
|
-
return Parser;
|
|
10404
|
-
}();
|
|
10405
|
-
typeof exports == "object" && (module2.exports = TreeSitter);
|
|
8658
|
+
module.exports = picomatch;
|
|
10406
8659
|
});
|
|
10407
8660
|
|
|
10408
8661
|
// ../core/src/types/node.ts
|
|
@@ -11404,8 +9657,8 @@ class ZodType {
|
|
|
11404
9657
|
} : {
|
|
11405
9658
|
issues: ctx.common.issues
|
|
11406
9659
|
};
|
|
11407
|
-
} catch (
|
|
11408
|
-
if (
|
|
9660
|
+
} catch (err) {
|
|
9661
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
11409
9662
|
this["~standard"].async = true;
|
|
11410
9663
|
}
|
|
11411
9664
|
ctx.common = {
|
|
@@ -11622,24 +9875,24 @@ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=)
|
|
|
11622
9875
|
var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
|
11623
9876
|
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
11624
9877
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
11625
|
-
function timeRegexSource(
|
|
9878
|
+
function timeRegexSource(args) {
|
|
11626
9879
|
let secondsRegexSource = `[0-5]\\d`;
|
|
11627
|
-
if (
|
|
11628
|
-
secondsRegexSource = `${secondsRegexSource}\\.\\d{${
|
|
11629
|
-
} else if (
|
|
9880
|
+
if (args.precision) {
|
|
9881
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
9882
|
+
} else if (args.precision == null) {
|
|
11630
9883
|
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
11631
9884
|
}
|
|
11632
|
-
const secondsQuantifier =
|
|
9885
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
|
11633
9886
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
11634
9887
|
}
|
|
11635
|
-
function timeRegex(
|
|
11636
|
-
return new RegExp(`^${timeRegexSource(
|
|
9888
|
+
function timeRegex(args) {
|
|
9889
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
11637
9890
|
}
|
|
11638
|
-
function datetimeRegex(
|
|
11639
|
-
let regex = `${dateRegexSource}T${timeRegexSource(
|
|
9891
|
+
function datetimeRegex(args) {
|
|
9892
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
|
11640
9893
|
const opts = [];
|
|
11641
|
-
opts.push(
|
|
11642
|
-
if (
|
|
9894
|
+
opts.push(args.local ? `Z?` : `Z`);
|
|
9895
|
+
if (args.offset)
|
|
11643
9896
|
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
11644
9897
|
regex = `${regex}(${opts.join("|")})`;
|
|
11645
9898
|
return new RegExp(`^${regex}$`);
|
|
@@ -13873,9 +12126,9 @@ class ZodFunction extends ZodType {
|
|
|
13873
12126
|
});
|
|
13874
12127
|
return INVALID;
|
|
13875
12128
|
}
|
|
13876
|
-
function makeArgsIssue(
|
|
12129
|
+
function makeArgsIssue(args, error) {
|
|
13877
12130
|
return makeIssue({
|
|
13878
|
-
data:
|
|
12131
|
+
data: args,
|
|
13879
12132
|
path: ctx.path,
|
|
13880
12133
|
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
13881
12134
|
issueData: {
|
|
@@ -13899,10 +12152,10 @@ class ZodFunction extends ZodType {
|
|
|
13899
12152
|
const fn = ctx.data;
|
|
13900
12153
|
if (this._def.returns instanceof ZodPromise) {
|
|
13901
12154
|
const me = this;
|
|
13902
|
-
return OK(async function(...
|
|
12155
|
+
return OK(async function(...args) {
|
|
13903
12156
|
const error = new ZodError([]);
|
|
13904
|
-
const parsedArgs = await me._def.args.parseAsync(
|
|
13905
|
-
error.addIssue(makeArgsIssue(
|
|
12157
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
12158
|
+
error.addIssue(makeArgsIssue(args, e));
|
|
13906
12159
|
throw error;
|
|
13907
12160
|
});
|
|
13908
12161
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
@@ -13914,10 +12167,10 @@ class ZodFunction extends ZodType {
|
|
|
13914
12167
|
});
|
|
13915
12168
|
} else {
|
|
13916
12169
|
const me = this;
|
|
13917
|
-
return OK(function(...
|
|
13918
|
-
const parsedArgs = me._def.args.safeParse(
|
|
12170
|
+
return OK(function(...args) {
|
|
12171
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
|
13919
12172
|
if (!parsedArgs.success) {
|
|
13920
|
-
throw new ZodError([makeArgsIssue(
|
|
12173
|
+
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
13921
12174
|
}
|
|
13922
12175
|
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
13923
12176
|
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
@@ -13946,17 +12199,17 @@ class ZodFunction extends ZodType {
|
|
|
13946
12199
|
returns: returnType
|
|
13947
12200
|
});
|
|
13948
12201
|
}
|
|
13949
|
-
implement(
|
|
13950
|
-
const validatedFunc = this.parse(
|
|
12202
|
+
implement(func) {
|
|
12203
|
+
const validatedFunc = this.parse(func);
|
|
13951
12204
|
return validatedFunc;
|
|
13952
12205
|
}
|
|
13953
|
-
strictImplement(
|
|
13954
|
-
const validatedFunc = this.parse(
|
|
12206
|
+
strictImplement(func) {
|
|
12207
|
+
const validatedFunc = this.parse(func);
|
|
13955
12208
|
return validatedFunc;
|
|
13956
12209
|
}
|
|
13957
|
-
static create(
|
|
12210
|
+
static create(args, returns, params) {
|
|
13958
12211
|
return new ZodFunction({
|
|
13959
|
-
args:
|
|
12212
|
+
args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
|
|
13960
12213
|
returns: returns || ZodUnknown.create(),
|
|
13961
12214
|
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
13962
12215
|
...processCreateParams(params)
|
|
@@ -15716,8 +13969,8 @@ function createDocumentSourceSpan(markdown, input) {
|
|
|
15716
13969
|
}
|
|
15717
13970
|
function formatSpanSourceRef(span, options = {}) {
|
|
15718
13971
|
const hash2 = options.hashLength === undefined ? span.span_hash : truncateSourceSpanHash(span.full_span_hash, options.hashLength);
|
|
15719
|
-
const
|
|
15720
|
-
return options.locator !== undefined ? `${options.locator}${
|
|
13972
|
+
const body = `#span:${span.heading_hint} L${span.line_start}-${span.line_end}@${hash2}`;
|
|
13973
|
+
return options.locator !== undefined ? `${options.locator}${body}` : body;
|
|
15721
13974
|
}
|
|
15722
13975
|
function formatCanonicalProseSourceRef(input) {
|
|
15723
13976
|
const sourceName = normalizeDocumentSourceName(input.sourceName);
|
|
@@ -15991,7 +14244,7 @@ function parseDocumentSnapshotManifest(value) {
|
|
|
15991
14244
|
const assets = value.assets === undefined ? undefined : Array.isArray(value.assets) ? value.assets.map(parseAssetEntry) : (() => {
|
|
15992
14245
|
throw new TypeError("snapshot manifest assets must be an array");
|
|
15993
14246
|
})();
|
|
15994
|
-
const
|
|
14247
|
+
const metadata = parseManifestMetadata(value.metadata);
|
|
15995
14248
|
const files = value.files.map(parseFileEntry);
|
|
15996
14249
|
const seenPaths = new Set;
|
|
15997
14250
|
for (const file of files) {
|
|
@@ -16009,7 +14262,7 @@ function parseDocumentSnapshotManifest(value) {
|
|
|
16009
14262
|
normalizer_version: value.normalizer_version,
|
|
16010
14263
|
files,
|
|
16011
14264
|
...assets !== undefined ? { assets } : {},
|
|
16012
|
-
...
|
|
14265
|
+
...metadata !== undefined ? { metadata } : {}
|
|
16013
14266
|
};
|
|
16014
14267
|
}
|
|
16015
14268
|
// src/repository.ts
|
|
@@ -16536,13 +14789,13 @@ var createModuleFileSystem = (moduleDir) => ({
|
|
|
16536
14789
|
return JSON.parse(content);
|
|
16537
14790
|
}
|
|
16538
14791
|
});
|
|
16539
|
-
var loadSourceInfo = async (modulePath,
|
|
14792
|
+
var loadSourceInfo = async (modulePath, fs) => {
|
|
16540
14793
|
const manifests = [];
|
|
16541
|
-
if (await
|
|
14794
|
+
if (await fs.exists(PACKAGE_JSON)) {
|
|
16542
14795
|
manifests.push({
|
|
16543
14796
|
type: "package.json",
|
|
16544
14797
|
path: PACKAGE_JSON,
|
|
16545
|
-
content: await
|
|
14798
|
+
content: await fs.readJson(PACKAGE_JSON)
|
|
16546
14799
|
});
|
|
16547
14800
|
}
|
|
16548
14801
|
return {
|
|
@@ -16588,11 +14841,11 @@ var extractLeadingJsDoc = (source2) => {
|
|
|
16588
14841
|
`).replace(/[ \t]+$/gmu, "").trim();
|
|
16589
14842
|
return doc.length > 0 ? doc : undefined;
|
|
16590
14843
|
};
|
|
16591
|
-
var extractModuleDoc = async (entryDetection,
|
|
14844
|
+
var extractModuleDoc = async (entryDetection, fs) => {
|
|
16592
14845
|
const entries = [...entryDetection.entries].sort((left, right) => left.path.localeCompare(right.path));
|
|
16593
14846
|
for (const entry of entries) {
|
|
16594
14847
|
try {
|
|
16595
|
-
const doc = extractLeadingJsDoc(await
|
|
14848
|
+
const doc = extractLeadingJsDoc(await fs.readFile(entry.path));
|
|
16596
14849
|
if (doc)
|
|
16597
14850
|
return doc;
|
|
16598
14851
|
} catch {}
|
|
@@ -16634,51 +14887,51 @@ var runRepositoryExtraction = async (input) => {
|
|
|
16634
14887
|
registry.register(plugin);
|
|
16635
14888
|
}
|
|
16636
14889
|
const results = [];
|
|
16637
|
-
for (const [index,
|
|
16638
|
-
const moduleDir = resolveModuleDir(repoPath,
|
|
16639
|
-
const
|
|
16640
|
-
const sourceInfo = await loadSourceInfo(
|
|
14890
|
+
for (const [index, module] of modules.entries()) {
|
|
14891
|
+
const moduleDir = resolveModuleDir(repoPath, module.path);
|
|
14892
|
+
const fs = createModuleFileSystem(moduleDir);
|
|
14893
|
+
const sourceInfo = await loadSourceInfo(module.path, fs);
|
|
16641
14894
|
const plugin = registry.resolve(sourceInfo);
|
|
16642
14895
|
if (!plugin) {
|
|
16643
14896
|
moduleErrors.push({
|
|
16644
|
-
module_name:
|
|
16645
|
-
module_path:
|
|
16646
|
-
error: `No extraction plugin available for module "${
|
|
14897
|
+
module_name: module.name,
|
|
14898
|
+
module_path: module.path,
|
|
14899
|
+
error: `No extraction plugin available for module "${module.name}"`
|
|
16647
14900
|
});
|
|
16648
14901
|
continue;
|
|
16649
14902
|
}
|
|
16650
14903
|
const manifest = sourceInfo.manifests.find((candidate) => candidate.type === PACKAGE_JSON) ?? sourceInfo.manifests[0];
|
|
16651
14904
|
if (!manifest) {
|
|
16652
14905
|
moduleErrors.push({
|
|
16653
|
-
module_name:
|
|
16654
|
-
module_path:
|
|
16655
|
-
error: `Module "${
|
|
14906
|
+
module_name: module.name,
|
|
14907
|
+
module_path: module.path,
|
|
14908
|
+
error: `Module "${module.name}" has no supported manifest for extraction`
|
|
16656
14909
|
});
|
|
16657
14910
|
continue;
|
|
16658
14911
|
}
|
|
16659
14912
|
input.onProgress?.({
|
|
16660
14913
|
phase: "scanning",
|
|
16661
14914
|
progress: Math.round(index / Math.max(modules.length, 1) * 100),
|
|
16662
|
-
module_name:
|
|
16663
|
-
module_path:
|
|
14915
|
+
module_name: module.name,
|
|
14916
|
+
module_path: module.path
|
|
16664
14917
|
});
|
|
16665
|
-
const detectedEntries = await plugin.detectEntries(manifest,
|
|
14918
|
+
const detectedEntries = await plugin.detectEntries(manifest, fs);
|
|
16666
14919
|
const entryDetection = {
|
|
16667
14920
|
...detectedEntries,
|
|
16668
14921
|
entries: selectedEntryFiles({
|
|
16669
|
-
module
|
|
14922
|
+
module,
|
|
16670
14923
|
detected: detectedEntries,
|
|
16671
14924
|
...input.entrySelection !== undefined ? { selection: input.entrySelection } : {}
|
|
16672
14925
|
})
|
|
16673
14926
|
};
|
|
16674
|
-
input.onProgress?.({ phase: "parsing", progress: 20, module_name:
|
|
16675
|
-
const moduleDoc = await extractModuleDoc(entryDetection,
|
|
16676
|
-
const rawExtraction = await plugin.extractSymbols(entryDetection.entries,
|
|
16677
|
-
const commitHash = input.moduleCommits?.[
|
|
16678
|
-
const normalized = normalizeExtractionPaths(rawExtraction, entryDetection,
|
|
16679
|
-
input.onProgress?.({ phase: "uploading", progress: 100, module_name:
|
|
14927
|
+
input.onProgress?.({ phase: "parsing", progress: 20, module_name: module.name, module_path: module.path });
|
|
14928
|
+
const moduleDoc = await extractModuleDoc(entryDetection, fs);
|
|
14929
|
+
const rawExtraction = await plugin.extractSymbols(entryDetection.entries, fs);
|
|
14930
|
+
const commitHash = input.moduleCommits?.[module.path] ?? input.commitHash ?? rawExtraction.meta.commitHash ?? null;
|
|
14931
|
+
const normalized = normalizeExtractionPaths(rawExtraction, entryDetection, module.path, commitHash);
|
|
14932
|
+
input.onProgress?.({ phase: "uploading", progress: 100, module_name: module.name, module_path: module.path });
|
|
16680
14933
|
results.push({
|
|
16681
|
-
module
|
|
14934
|
+
module,
|
|
16682
14935
|
sourceInfo,
|
|
16683
14936
|
entryDetection: normalized.entryDetection,
|
|
16684
14937
|
...moduleDoc ? { moduleDoc } : {},
|
|
@@ -16785,11 +15038,11 @@ var metaText = (manifest, source2, rows) => {
|
|
|
16785
15038
|
return manifestText(meta);
|
|
16786
15039
|
};
|
|
16787
15040
|
function flattenSymbols(symbols, packageName, modulePath) {
|
|
16788
|
-
const
|
|
15041
|
+
const out = [];
|
|
16789
15042
|
const walk = (list) => {
|
|
16790
15043
|
for (const symbol of list) {
|
|
16791
15044
|
const { members, ...rest } = symbol;
|
|
16792
|
-
|
|
15045
|
+
out.push({
|
|
16793
15046
|
...rest,
|
|
16794
15047
|
package: packageName,
|
|
16795
15048
|
package_name: packageName,
|
|
@@ -16802,7 +15055,7 @@ function flattenSymbols(symbols, packageName, modulePath) {
|
|
|
16802
15055
|
}
|
|
16803
15056
|
};
|
|
16804
15057
|
walk(symbols);
|
|
16805
|
-
return
|
|
15058
|
+
return out;
|
|
16806
15059
|
}
|
|
16807
15060
|
var buildHashId = (packageName, dirCommit, moduleContentHash, dirty = false) => {
|
|
16808
15061
|
const base = dirty && moduleContentHash ? `pkg:${packageName}:${dirCommit}:dirty:${moduleContentHash}` : `pkg:${packageName}:${dirCommit}`;
|
|
@@ -17147,7 +15400,7 @@ var runCodeExtractCliFromFile = async (inputFile) => {
|
|
|
17147
15400
|
return runCodeExtractRunner(JSON.parse(content), path3.dirname(path3.resolve(inputFile)));
|
|
17148
15401
|
};
|
|
17149
15402
|
// src/parser.ts
|
|
17150
|
-
|
|
15403
|
+
import Parser from "web-tree-sitter";
|
|
17151
15404
|
import { existsSync } from "node:fs";
|
|
17152
15405
|
import { fileURLToPath } from "node:url";
|
|
17153
15406
|
var parserInitPromise = null;
|
|
@@ -17158,10 +15411,10 @@ var resolveWasmPath = (relativePath) => fileURLToPath(new URL(relativePath, impo
|
|
|
17158
15411
|
var createParserInstance = async () => {
|
|
17159
15412
|
const localWasm = resolveWasmPath("./wasm/tree-sitter.wasm");
|
|
17160
15413
|
const initOptions = existsSync(localWasm) ? { locateFile: (scriptName) => resolveWasmPath(`./wasm/${scriptName}`) } : undefined;
|
|
17161
|
-
await
|
|
17162
|
-
const parser = new
|
|
17163
|
-
const tsLanguage = await
|
|
17164
|
-
const tsxLanguage = await
|
|
15414
|
+
await Parser.init(initOptions);
|
|
15415
|
+
const parser = new Parser;
|
|
15416
|
+
const tsLanguage = await Parser.Language.load(resolveWasmPath("./wasm/tree-sitter-typescript.wasm"));
|
|
15417
|
+
const tsxLanguage = await Parser.Language.load(resolveWasmPath("./wasm/tree-sitter-tsx.wasm"));
|
|
17165
15418
|
return { parser, tsLanguage, tsxLanguage };
|
|
17166
15419
|
};
|
|
17167
15420
|
var initParser = async () => {
|