yuku-codegen 0.5.20 → 0.5.21
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/encode.js +0 -6
- package/index.d.ts +0 -1
- package/index.js +1 -3
- package/package.json +12 -12
package/encode.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// generated by tools/gen_estree_encoder.zig, do not edit
|
|
2
|
-
//
|
|
3
|
-
// Encodes an ESTree object into the Yuku transfer-format buffer.
|
|
4
2
|
const NULL = 0xFFFFFFFF;
|
|
5
3
|
const _enc = new TextEncoder();
|
|
6
4
|
const NODE_SIZE = 48;
|
|
@@ -147,7 +145,6 @@ function encode(program, lineStarts) {
|
|
|
147
145
|
}
|
|
148
146
|
function asStart(n) { return (n && typeof n.start === "number") ? n.start : 0; }
|
|
149
147
|
function asEnd(n) { return (n && typeof n.end === "number") ? n.end : 0; }
|
|
150
|
-
// called by every enc_* to register the node's `.comments` array
|
|
151
148
|
function recordComments(n, idx) {
|
|
152
149
|
if (idx !== NULL && n && Array.isArray(n.comments) && n.comments.length > 0) {
|
|
153
150
|
commentsByIdx.set(idx, n.comments);
|
|
@@ -2098,7 +2095,6 @@ function encode(program, lineStarts) {
|
|
|
2098
2095
|
recordComments(n, idx);
|
|
2099
2096
|
return idx;
|
|
2100
2097
|
}
|
|
2101
|
-
// encoded node index -> its `.comments` array
|
|
2102
2098
|
const commentsByIdx = new Map();
|
|
2103
2099
|
function encNode(n) {
|
|
2104
2100
|
if (n == null) return NULL;
|
|
@@ -2287,8 +2283,6 @@ function encode(program, lineStarts) {
|
|
|
2287
2283
|
}
|
|
2288
2284
|
const progIdx = encNode(root);
|
|
2289
2285
|
const POSITION_INV = { "before": 0, "after": 1, "inside": 2 };
|
|
2290
|
-
// counting-sort attached comments by host into a prefix-sum offsets
|
|
2291
|
-
// table, then write each at its slot in `attachedBytes`.
|
|
2292
2286
|
const attached = commentsByIdx.size > 0;
|
|
2293
2287
|
let attachedCount = 0;
|
|
2294
2288
|
let offsetsBytes = null;
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -7,11 +7,9 @@ function normalizeOptions(options) {
|
|
|
7
7
|
const c = next.comments;
|
|
8
8
|
if (c === true) next.comments = "all";
|
|
9
9
|
else if (c === false) next.comments = "none";
|
|
10
|
-
// `lineStarts` is consumed by the encoder, not the native binding, so strip
|
|
11
|
-
// it from the source-map options. Only V3 metadata reaches the binding.
|
|
12
10
|
const s = next.sourceMaps;
|
|
13
11
|
if (s) {
|
|
14
|
-
const { lineStarts, ...meta } = s;
|
|
12
|
+
const { lineStarts: _, ...meta } = s;
|
|
15
13
|
next.sourceMaps = meta;
|
|
16
14
|
} else {
|
|
17
15
|
next.sourceMaps = undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yuku-codegen",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.21",
|
|
4
4
|
"description": "High-performance JavaScript/TypeScript code generator written in Zig",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"encode.js"
|
|
18
18
|
],
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"@yuku-codegen/binding-linux-x64-gnu": "0.5.
|
|
21
|
-
"@yuku-codegen/binding-linux-arm64-gnu": "0.5.
|
|
22
|
-
"@yuku-codegen/binding-linux-arm-gnu": "0.5.
|
|
23
|
-
"@yuku-codegen/binding-linux-x64-musl": "0.5.
|
|
24
|
-
"@yuku-codegen/binding-linux-arm64-musl": "0.5.
|
|
25
|
-
"@yuku-codegen/binding-linux-arm-musl": "0.5.
|
|
26
|
-
"@yuku-codegen/binding-darwin-x64": "0.5.
|
|
27
|
-
"@yuku-codegen/binding-darwin-arm64": "0.5.
|
|
28
|
-
"@yuku-codegen/binding-win32-x64": "0.5.
|
|
29
|
-
"@yuku-codegen/binding-win32-arm64": "0.5.
|
|
30
|
-
"@yuku-codegen/binding-freebsd-x64": "0.5.
|
|
20
|
+
"@yuku-codegen/binding-linux-x64-gnu": "0.5.21",
|
|
21
|
+
"@yuku-codegen/binding-linux-arm64-gnu": "0.5.21",
|
|
22
|
+
"@yuku-codegen/binding-linux-arm-gnu": "0.5.21",
|
|
23
|
+
"@yuku-codegen/binding-linux-x64-musl": "0.5.21",
|
|
24
|
+
"@yuku-codegen/binding-linux-arm64-musl": "0.5.21",
|
|
25
|
+
"@yuku-codegen/binding-linux-arm-musl": "0.5.21",
|
|
26
|
+
"@yuku-codegen/binding-darwin-x64": "0.5.21",
|
|
27
|
+
"@yuku-codegen/binding-darwin-arm64": "0.5.21",
|
|
28
|
+
"@yuku-codegen/binding-win32-x64": "0.5.21",
|
|
29
|
+
"@yuku-codegen/binding-win32-arm64": "0.5.21",
|
|
30
|
+
"@yuku-codegen/binding-freebsd-x64": "0.5.21"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"ast",
|