@mark1russell7/vex-compiler 0.11.2 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +8 -4
- package/build/index.js.map +1 -1
- package/package.json +4 -4
- package/src/facts.ts +2 -2
- package/src/lower.ts +1 -0
- package/src/module.ts +2 -2
package/build/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { CELL_KIND, MAX_NESTING, addrExprs, axisTargets, children, compile, find
|
|
|
12
12
|
const MAX_CALLS = 1e4;
|
|
13
13
|
/**
|
|
14
14
|
* The list ops that give a list, or read a position or a key of a list (LIST.SORT, LIST.TAKE, LIST.NTH, LIST.BUILD,
|
|
15
|
-
* LIST.GET).
|
|
15
|
+
* LIST.GET, LIST.INDEXOF, LIST.FILL).
|
|
16
16
|
*/
|
|
17
17
|
const ORDER_OPS = /* @__PURE__ */ new Set([
|
|
18
18
|
"sortBy",
|
|
@@ -22,7 +22,9 @@ const ORDER_OPS = /* @__PURE__ */ new Set([
|
|
|
22
22
|
"append",
|
|
23
23
|
"flat",
|
|
24
24
|
"without",
|
|
25
|
-
"get"
|
|
25
|
+
"get",
|
|
26
|
+
"indexOf",
|
|
27
|
+
"fill"
|
|
26
28
|
]);
|
|
27
29
|
/**
|
|
28
30
|
* This function gives the reason that tier 2 cannot take a program with lists as values. The reason is the axis `list`,
|
|
@@ -1339,6 +1341,7 @@ var Lowerer = class {
|
|
|
1339
1341
|
case "flat":
|
|
1340
1342
|
case "without":
|
|
1341
1343
|
case "get":
|
|
1344
|
+
case "indexOf":
|
|
1342
1345
|
/* v8 ignore next -- @preserve */
|
|
1343
1346
|
throw new Unsupported(`the list op "${op}"`);
|
|
1344
1347
|
}
|
|
@@ -2384,13 +2387,14 @@ const BOOLEAN_LIST_OPS = /* @__PURE__ */ new Set([
|
|
|
2384
2387
|
"all",
|
|
2385
2388
|
"none"
|
|
2386
2389
|
]);
|
|
2387
|
-
/** The list ops that build a list from lists (LIST.BUILD),
|
|
2390
|
+
/** The list ops that build a list from lists (LIST.BUILD), `get` (LIST.GET) and `indexOf` (LIST.INDEXOF). A module gives a reason for them. */
|
|
2388
2391
|
const BUILD_OPS = /* @__PURE__ */ new Set([
|
|
2389
2392
|
"drop",
|
|
2390
2393
|
"append",
|
|
2391
2394
|
"flat",
|
|
2392
2395
|
"without",
|
|
2393
|
-
"get"
|
|
2396
|
+
"get",
|
|
2397
|
+
"indexOf"
|
|
2394
2398
|
]);
|
|
2395
2399
|
/** This function tells if the step of a list op throws for a value of the kind `kind`, which is the wrong kind. */
|
|
2396
2400
|
const stepThrows = (op, kind) => NUMBER_STEPS.has(op) && kind !== "number" || BOOLEAN_LIST_OPS.has(op) && kind !== "boolean";
|