@mark1russell7/vex-compiler 0.17.1 → 0.17.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@mark1russell7/vex-compiler",
4
- "version": "0.17.1",
4
+ "version": "0.17.2",
5
5
  "description": "The Vex compiler: generated JavaScript for Vex programs, at run time and at build time, with the results of the interpreter.",
6
6
  "keywords": [
7
7
  "vex",
@@ -43,15 +43,15 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@mark1russell7/cue": "github:mark1russell7/cue",
46
- "@mark1russell7/vex-domains": "0.17.1",
47
- "@mark1russell7/vex-testkit": "0.17.1",
46
+ "@mark1russell7/vex-domains": "0.17.2",
47
+ "@mark1russell7/vex-testkit": "0.17.2",
48
48
  "@types/node": "^26.6.4",
49
49
  "fast-check": "^4.10.2",
50
50
  "typescript": "^7.0.2",
51
51
  "vitest": "^5.0.3"
52
52
  },
53
53
  "dependencies": {
54
- "@mark1russell7/vex": "0.17.1"
54
+ "@mark1russell7/vex": "0.17.2"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsdown",
package/src/module.ts CHANGED
@@ -299,8 +299,9 @@ const HELPERS: Readonly<Record<Exclude<Helper, "S">, string>> = {
299
299
  K: 'function K(k, n) { return typeof k === "string" && /^(0|[1-9]\\d*)$/.test(k) && +k < n ? +k : F(); }',
300
300
  // The ops on the order of a list (LIST.SORT, LIST.TAKE, LIST.NTH) work on the items with values. With strict, an
301
301
  // error item is the error of the op. A sort is stable, and the values are numbers without NaN or texts of one kind.
302
- // V gives the array of VW, so a list without error items is not copied (COMPILE.MODULE.LIST.SHARE). No op changes it.
303
- V: "function V(l, s) { const o = VW(l); if (s && o.length < l.length) F(); return o; }",
302
+ // V gives a list without error items itself, so it is not copied (COMPILE.MODULE.LIST.SHARE). No op changes it. V does
303
+ // not keep the cache of VW: a property on each new list made the list ops slower (ireko, vex-compiler 0.17.1).
304
+ V: "function V(l, s) { if (!l.some((x) => x[1] === E)) return l; if (s) F(); return l.filter((x) => x[1] !== E); }",
304
305
  SB: [
305
306
  "function SB(l, s) {",
306
307
  " const o = V(l, s);",
@@ -826,7 +827,7 @@ const NEEDS: Readonly<Record<Helper, readonly Helper[]>> = {
826
827
  F: [], C: [], T: [], L: [], Q: [], G: ["F"], B: ["F"], U: ["F"], X: ["F"], I: ["F"], K: ["F"], M: ["G"], M1: ["G"], S: ["M1", "F"],
827
828
  // Only the helpers of the list ops use V, and each of them needs F too, so the need of V only completes the list.
828
829
  // Stryker disable next-line ArrayDeclaration: see the comment above
829
- V: ["VW", "F"],
830
+ V: ["F"],
830
831
  SB: ["V", "F"], SK: ["V", "F"], TK: ["V", "F"], VW: [], NT: ["VW", "F"], CT: ["VW", "F"], FS: ["VW", "F"], FI: ["F"], LI: [],
831
832
  DR: ["V", "F"], AP: ["V"], AO: ["AP", "V"], WO: ["V"], FL: ["V"], GT: ["F"], IX: ["V", "F"],
832
833
  // Each module has C, and each move uses F (#move), so these needs only complete the list.