@mark1russell7/coeval 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/build/index.d.ts +211 -128
- package/build/index.d.ts.map +1 -1
- package/build/index.js +348 -27
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/formula.ts +13 -19
- package/src/index.ts +1 -0
- package/src/merge.ts +387 -0
package/build/index.js
CHANGED
|
@@ -508,6 +508,338 @@ function looksLikeKind(value) {
|
|
|
508
508
|
return isRecord(value) && isRecord(field(value, "verbs"));
|
|
509
509
|
}
|
|
510
510
|
//#endregion
|
|
511
|
+
//#region src/merge.ts
|
|
512
|
+
/** The exception of a merge with conflicts. It lists each conflict of the merge, not only the first. */
|
|
513
|
+
var MergeError = class extends Error {
|
|
514
|
+
conflicts;
|
|
515
|
+
/**
|
|
516
|
+
* This constructor makes the exception.
|
|
517
|
+
*
|
|
518
|
+
* @param conflicts - The conflicts, in the order that the merge found them.
|
|
519
|
+
*/
|
|
520
|
+
constructor(conflicts) {
|
|
521
|
+
const lines = conflicts.map((item) => `At ${JSON.stringify(item.path)}, the parts ${item.parts[0]} and ${item.parts[1]}: ${item.reason}`);
|
|
522
|
+
super(`The merge has ${conflicts.length === 1 ? "1 conflict" : `${conflicts.length} conflicts`}. ${lines.join(" ")}`);
|
|
523
|
+
this.name = "MergeError";
|
|
524
|
+
this.conflicts = conflicts;
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
const NONE$1 = /* @__PURE__ */ new Set();
|
|
528
|
+
function keyOf(path) {
|
|
529
|
+
return JSON.stringify(path.map(String));
|
|
530
|
+
}
|
|
531
|
+
/** This function sets an own data property. An assignment to the key `__proto__` changes the prototype. */
|
|
532
|
+
function setOwn$2(target, key, value) {
|
|
533
|
+
if (key === "__proto__") Object.defineProperty(target, key, {
|
|
534
|
+
value,
|
|
535
|
+
enumerable: true,
|
|
536
|
+
writable: true,
|
|
537
|
+
configurable: true
|
|
538
|
+
});
|
|
539
|
+
else target[key] = value;
|
|
540
|
+
}
|
|
541
|
+
function own$1(table, key) {
|
|
542
|
+
return table !== void 0 && Object.hasOwn(table, key) ? table[key] : void 0;
|
|
543
|
+
}
|
|
544
|
+
/** This function gives a copy of a JSON value without the fields whose value is `undefined`, as JSON writes it. */
|
|
545
|
+
function defined(value) {
|
|
546
|
+
if (Array.isArray(value)) return value.map(defined);
|
|
547
|
+
if (!isRecord(value)) return value;
|
|
548
|
+
const out = {};
|
|
549
|
+
for (const key of Object.keys(value)) if (value[key] !== void 0) setOwn$2(out, key, defined(value[key]));
|
|
550
|
+
return out;
|
|
551
|
+
}
|
|
552
|
+
/** Two values are the same when they are equal by `docEquals`. A function and a host value are equal only to themselves. */
|
|
553
|
+
function same(a, b) {
|
|
554
|
+
return Object.is(a, b) || docEquals(defined(a), defined(b));
|
|
555
|
+
}
|
|
556
|
+
/** Two lists of roots are the same when they hold the same roots, in any order. */
|
|
557
|
+
function sameRoots(a, b) {
|
|
558
|
+
if (!Array.isArray(a) || !Array.isArray(b)) return same(a, b);
|
|
559
|
+
return same([...new Set(a.map(String))].sort(), [...new Set(b.map(String))].sort());
|
|
560
|
+
}
|
|
561
|
+
/** The record of a merge: the conflicts, and the part that gave each entry. */
|
|
562
|
+
var Merger = class {
|
|
563
|
+
conflicts = [];
|
|
564
|
+
sources = /* @__PURE__ */ new Map();
|
|
565
|
+
/** This method gives the part that gave the entry at a path, or the entry nearest above it. */
|
|
566
|
+
sourceOf(path) {
|
|
567
|
+
for (let length = path.length; length >= 0; length -= 1) {
|
|
568
|
+
const found = this.sources.get(keyOf(path.slice(0, length)));
|
|
569
|
+
if (found !== void 0) return found;
|
|
570
|
+
}
|
|
571
|
+
return 0;
|
|
572
|
+
}
|
|
573
|
+
/** This method records the part that gives a new entry. */
|
|
574
|
+
give(path, part) {
|
|
575
|
+
this.sources.set(keyOf(path), part);
|
|
576
|
+
}
|
|
577
|
+
/** This method records the part that replaces an entry, and forgets the parts of each entry below it. */
|
|
578
|
+
replace(path, part) {
|
|
579
|
+
const below = `${keyOf(path).slice(0, -1)},`;
|
|
580
|
+
for (const key of [...this.sources.keys()]) if (key.startsWith(below)) this.sources.delete(key);
|
|
581
|
+
this.give(path, part);
|
|
582
|
+
}
|
|
583
|
+
clash(path, part, reason) {
|
|
584
|
+
this.conflicts.push({
|
|
585
|
+
path,
|
|
586
|
+
parts: [this.sourceOf(path), part],
|
|
587
|
+
reason
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* This function merges one entry of a table into the table. A new entry joins the table. A path in `replaces` gives
|
|
593
|
+
* the later entry. Two entries that are the same give one entry. Each other pair is a conflict.
|
|
594
|
+
*/
|
|
595
|
+
function mergeLeaf(m, table, key, later, path, part, replaces, equal, reason) {
|
|
596
|
+
if (later === void 0) return;
|
|
597
|
+
const earlier = own$1(table, key);
|
|
598
|
+
if (earlier === void 0) {
|
|
599
|
+
setOwn$2(table, key, later);
|
|
600
|
+
m.give(path, part);
|
|
601
|
+
} else if (replaces.has(keyOf(path))) {
|
|
602
|
+
setOwn$2(table, key, later);
|
|
603
|
+
m.replace(path, part);
|
|
604
|
+
} else if (!equal(earlier, later)) m.clash(path, part, reason);
|
|
605
|
+
}
|
|
606
|
+
function what(entry) {
|
|
607
|
+
if (isKind(entry)) return "a kind";
|
|
608
|
+
if (isAlias(entry)) return "an alias";
|
|
609
|
+
return isNamespace(entry) ? "a namespace" : "an entry";
|
|
610
|
+
}
|
|
611
|
+
function mergeFallback(m, earlier, later, path, part, replaces) {
|
|
612
|
+
const table = earlier === void 0 ? {} : { fallback: earlier };
|
|
613
|
+
mergeLeaf(m, table, "fallback", later, path, part, replaces, same, "Two parts give two different fallback kinds.");
|
|
614
|
+
return table["fallback"];
|
|
615
|
+
}
|
|
616
|
+
function mergeEntries(m, into, from, path, part, replaces) {
|
|
617
|
+
for (const key of Object.keys(from)) {
|
|
618
|
+
const later = from[key];
|
|
619
|
+
if (later === void 0) continue;
|
|
620
|
+
const at = [...path, key];
|
|
621
|
+
const earlier = own$1(into, key);
|
|
622
|
+
if (earlier === void 0) {
|
|
623
|
+
setOwn$2(into, key, later);
|
|
624
|
+
m.give(at, part);
|
|
625
|
+
} else setOwn$2(into, key, mergeEntry(m, earlier, later, at, part, replaces));
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
/** This function merges two entries at one path. Two namespaces merge key by key, and their fallbacks merge too. */
|
|
629
|
+
function mergeEntry(m, earlier, later, path, part, replaces) {
|
|
630
|
+
if (replaces.has(keyOf(path))) {
|
|
631
|
+
m.replace(path, part);
|
|
632
|
+
return later;
|
|
633
|
+
}
|
|
634
|
+
if (same(earlier, later)) return earlier;
|
|
635
|
+
if (isNamespace(earlier) && isNamespace(later)) {
|
|
636
|
+
const kinds = { ...earlier.kinds };
|
|
637
|
+
mergeEntries(m, kinds, later.kinds, [...path, "kinds"], part, replaces);
|
|
638
|
+
const fallback = mergeFallback(m, earlier.fallback, later.fallback, [...path, "fallback"], part, replaces);
|
|
639
|
+
return fallback === void 0 ? { kinds } : {
|
|
640
|
+
kinds,
|
|
641
|
+
fallback
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
const a = what(earlier);
|
|
645
|
+
const b = what(later);
|
|
646
|
+
m.clash(path, part, a === b ? `Two parts give two different ${a === "an alias" ? "aliases" : "kinds"}.` : `One part gives ${a}, and the other part gives ${b}.`);
|
|
647
|
+
return earlier;
|
|
648
|
+
}
|
|
649
|
+
function worldOf(draft) {
|
|
650
|
+
const world = {
|
|
651
|
+
kinds: { ...draft.kinds },
|
|
652
|
+
defaults: { ...draft.defaults }
|
|
653
|
+
};
|
|
654
|
+
return draft.fallback === void 0 ? world : {
|
|
655
|
+
...world,
|
|
656
|
+
fallback: draft.fallback
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
function mergeWorldInto(m, draft, part, index, replaces, base) {
|
|
660
|
+
if (part === void 0) return;
|
|
661
|
+
if (part.kinds !== void 0) mergeEntries(m, draft.kinds, part.kinds, [...base, "kinds"], index, replaces);
|
|
662
|
+
const defaults = part.defaults ?? {};
|
|
663
|
+
for (const verb of Object.keys(defaults)) mergeLeaf(m, draft.defaults, verb, defaults[verb], [
|
|
664
|
+
...base,
|
|
665
|
+
"defaults",
|
|
666
|
+
verb
|
|
667
|
+
], index, replaces, Object.is, "Two parts give two different defaults for this verb.");
|
|
668
|
+
const fallback = mergeFallback(m, draft.fallback, part.fallback, [...base, "fallback"], index, replaces);
|
|
669
|
+
if (fallback !== void 0) draft.fallback = fallback;
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* This function merges worlds into one world, in the order of the parts. It does not change a part.
|
|
673
|
+
*
|
|
674
|
+
* - Two entries that are equal by `docEquals` give one entry.
|
|
675
|
+
* - Two namespaces merge key by key, at each depth. Their fallbacks merge as each other entry.
|
|
676
|
+
* - The defaults merge verb by verb, and the world keeps one fallback.
|
|
677
|
+
* - Each other pair of entries at one path is a conflict, unless the later part names the path in `replaces`.
|
|
678
|
+
* Then the later entry wins, with no merge below it.
|
|
679
|
+
*
|
|
680
|
+
* A part can be a function of the merge of the parts before it (`prev`, as an overlay of Nix). Thus a part can read
|
|
681
|
+
* the entry that it replaces.
|
|
682
|
+
*
|
|
683
|
+
* @param parts - The worlds, or functions that give a world from the merge before them.
|
|
684
|
+
* @returns The world. It has no `replaces`.
|
|
685
|
+
* @throws {MergeError} The merge has a conflict. The error lists each conflict.
|
|
686
|
+
*/
|
|
687
|
+
function mergeWorlds(...parts) {
|
|
688
|
+
const m = new Merger();
|
|
689
|
+
const draft = {
|
|
690
|
+
kinds: {},
|
|
691
|
+
defaults: {}
|
|
692
|
+
};
|
|
693
|
+
parts.forEach((input, index) => {
|
|
694
|
+
const part = typeof input === "function" ? input(worldOf(draft)) : input;
|
|
695
|
+
mergeWorldInto(m, draft, part, index, new Set((part.replaces ?? []).map(keyOf)), []);
|
|
696
|
+
});
|
|
697
|
+
if (m.conflicts.length > 0) throw new MergeError(m.conflicts);
|
|
698
|
+
return worldOf(draft);
|
|
699
|
+
}
|
|
700
|
+
/** The fields of a machine that merge by their own rules. Each other field is one value, or a conflict. */
|
|
701
|
+
const TABLES = /* @__PURE__ */ new Set([
|
|
702
|
+
"world",
|
|
703
|
+
"evaluators",
|
|
704
|
+
"runners",
|
|
705
|
+
"derefs",
|
|
706
|
+
"walkers",
|
|
707
|
+
"known",
|
|
708
|
+
"replaces"
|
|
709
|
+
]);
|
|
710
|
+
/**
|
|
711
|
+
* This function composes the hooks `known` in the order of their parts. The first answer that is not `true` wins. A
|
|
712
|
+
* hook does not answer for an evaluator name whose code a later part replaces.
|
|
713
|
+
*/
|
|
714
|
+
function composeKnown(hooks, replaced) {
|
|
715
|
+
const first = hooks[0];
|
|
716
|
+
if (first === void 0) return void 0;
|
|
717
|
+
if (hooks.length === 1 && replaced.size === 0) return first.known;
|
|
718
|
+
const list = [...hooks];
|
|
719
|
+
const last = new Map(replaced);
|
|
720
|
+
return (path, evaluator) => {
|
|
721
|
+
const after = last.get(evaluator);
|
|
722
|
+
for (const hook of list) {
|
|
723
|
+
if (after !== void 0 && hook.part < after) continue;
|
|
724
|
+
const answer = hook.known(path, evaluator);
|
|
725
|
+
if (answer !== true) return answer;
|
|
726
|
+
}
|
|
727
|
+
return true;
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
function machineOf(draft) {
|
|
731
|
+
const known = composeKnown(draft.hooks, draft.replaced);
|
|
732
|
+
return {
|
|
733
|
+
...draft.rest,
|
|
734
|
+
world: worldOf(draft.world),
|
|
735
|
+
evaluators: { ...draft.evaluators },
|
|
736
|
+
...draft.runners === void 0 ? {} : { runners: { ...draft.runners } },
|
|
737
|
+
...draft.derefs === void 0 ? {} : { derefs: { ...draft.derefs } },
|
|
738
|
+
...draft.walkers === void 0 ? {} : { walkers: { ...draft.walkers } },
|
|
739
|
+
...known === void 0 ? {} : { known }
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
/** This function merges the evaluators and the runners of a part. The evaluator and the runner of a name are its code. */
|
|
743
|
+
function mergeCode(m, draft, part, index, replaces) {
|
|
744
|
+
if (part.runners !== void 0) draft.runners ??= {};
|
|
745
|
+
const names = /* @__PURE__ */ new Set([...Object.keys(part.evaluators ?? {}), ...Object.keys(part.runners ?? {})]);
|
|
746
|
+
for (const name of names) {
|
|
747
|
+
const evaluator = own$1(part.evaluators, name);
|
|
748
|
+
const runner = own$1(part.runners, name);
|
|
749
|
+
if (evaluator === void 0 && runner === void 0) continue;
|
|
750
|
+
const evaluatorPath = ["evaluators", name];
|
|
751
|
+
const runnerPath = ["runners", name];
|
|
752
|
+
if (replaces.has(keyOf(evaluatorPath)) || replaces.has(keyOf(runnerPath))) {
|
|
753
|
+
if (evaluator === void 0) delete draft.evaluators[name];
|
|
754
|
+
else setOwn$2(draft.evaluators, name, evaluator);
|
|
755
|
+
if (runner !== void 0) setOwn$2(draft.runners ??= {}, name, runner);
|
|
756
|
+
else if (draft.runners !== void 0) delete draft.runners[name];
|
|
757
|
+
m.replace(evaluatorPath, index);
|
|
758
|
+
m.replace(runnerPath, index);
|
|
759
|
+
draft.replaced.set(name, index);
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
mergeLeaf(m, draft.evaluators, name, evaluator, evaluatorPath, index, NONE$1, Object.is, "Two parts give two different evaluators for this name.");
|
|
763
|
+
if (runner !== void 0) mergeLeaf(m, draft.runners ??= {}, name, runner, runnerPath, index, NONE$1, Object.is, "Two parts give two different runners for this name.");
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
/** A runner hides the evaluator of its name. Thus a name with a runner and an evaluator needs one part that gives both. */
|
|
767
|
+
function checkHidden(m, draft) {
|
|
768
|
+
const runners = draft.runners ?? {};
|
|
769
|
+
for (const name of Object.keys(runners)) {
|
|
770
|
+
const runner = runners[name];
|
|
771
|
+
const evaluator = own$1(draft.evaluators, name);
|
|
772
|
+
if (runner === void 0 || evaluator === void 0) continue;
|
|
773
|
+
if (draft.parts.some((part) => own$1(part.evaluators, name) === evaluator && own$1(part.runners, name) === runner)) continue;
|
|
774
|
+
const a = m.sourceOf(["evaluators", name]);
|
|
775
|
+
const b = m.sourceOf(["runners", name]);
|
|
776
|
+
m.conflicts.push({
|
|
777
|
+
path: ["runners", name],
|
|
778
|
+
parts: [Math.min(a, b), Math.max(a, b)],
|
|
779
|
+
reason: "The runner of one part hides the evaluator of the other part, because a runner wins over an evaluator of its name."
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* This function merges machines into one machine, in the order of the parts. It does not change a part.
|
|
785
|
+
*
|
|
786
|
+
* - The worlds merge with the rules of `mergeWorlds`. The paths of their conflicts start with `"world"`.
|
|
787
|
+
* - The tables `evaluators`, `runners`, `derefs` and `walkers` merge name by name. A function is equal only to itself.
|
|
788
|
+
* - The evaluator and the runner of a name are its code. A replacement of the name replaces both.
|
|
789
|
+
* - A runner hides the evaluator of its name. Thus one part must give both, or the merge gives a conflict.
|
|
790
|
+
* - The hooks `known` compose in the order of the parts. A hook does not answer for a name that a later part replaces.
|
|
791
|
+
* - Each other field, for example `permits`, `adopt`, `roots`, `plain` or `maxDepth`, is one value. Two different
|
|
792
|
+
* values are a conflict. An absent field has no value.
|
|
793
|
+
*
|
|
794
|
+
* A conflict stops the merge, unless the later part names its path in `replaces`. A part can be a function of the
|
|
795
|
+
* merge of the parts before it (`prev`, as an overlay of Nix). Thus a part can wrap the code that it replaces.
|
|
796
|
+
*
|
|
797
|
+
* @param parts - The machines, or functions that give a machine from the merge before them.
|
|
798
|
+
* @returns The machine.
|
|
799
|
+
* @throws {MergeError} The merge has a conflict. The error lists each conflict.
|
|
800
|
+
*/
|
|
801
|
+
function mergeMachines(...parts) {
|
|
802
|
+
const m = new Merger();
|
|
803
|
+
const draft = {
|
|
804
|
+
world: {
|
|
805
|
+
kinds: {},
|
|
806
|
+
defaults: {}
|
|
807
|
+
},
|
|
808
|
+
evaluators: {},
|
|
809
|
+
hooks: [],
|
|
810
|
+
replaced: /* @__PURE__ */ new Map(),
|
|
811
|
+
rest: {},
|
|
812
|
+
parts: []
|
|
813
|
+
};
|
|
814
|
+
parts.forEach((input, index) => {
|
|
815
|
+
const part = typeof input === "function" ? input(machineOf(draft)) : input;
|
|
816
|
+
draft.parts.push(part);
|
|
817
|
+
const replaces = new Set([...part.replaces ?? [], ...(part.world?.replaces ?? []).map((path) => ["world", ...path])].map(keyOf));
|
|
818
|
+
mergeWorldInto(m, draft.world, part.world, index, replaces, ["world"]);
|
|
819
|
+
mergeCode(m, draft, part, index, replaces);
|
|
820
|
+
if (part.derefs !== void 0) {
|
|
821
|
+
const derefs = draft.derefs ??= {};
|
|
822
|
+
for (const name of Object.keys(part.derefs)) mergeLeaf(m, derefs, name, part.derefs[name], ["derefs", name], index, replaces, Object.is, "Two parts give two different deref codes for this name.");
|
|
823
|
+
}
|
|
824
|
+
if (part.walkers !== void 0) {
|
|
825
|
+
const walkers = draft.walkers ??= {};
|
|
826
|
+
for (const name of Object.keys(part.walkers)) mergeLeaf(m, walkers, name, part.walkers[name], ["walkers", name], index, replaces, Object.is, "Two parts give two different walkers for this name.");
|
|
827
|
+
}
|
|
828
|
+
if (part.known !== void 0 && !draft.hooks.some((hook) => hook.known === part.known)) draft.hooks.push({
|
|
829
|
+
part: index,
|
|
830
|
+
known: part.known
|
|
831
|
+
});
|
|
832
|
+
const fields = part;
|
|
833
|
+
for (const key of Object.keys(fields)) {
|
|
834
|
+
if (TABLES.has(key)) continue;
|
|
835
|
+
mergeLeaf(m, draft.rest, key, fields[key], [key], index, replaces, key === "roots" ? sameRoots : same, `Two parts give two different values for ${key}.`);
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
checkHidden(m, draft);
|
|
839
|
+
if (m.conflicts.length > 0) throw new MergeError(m.conflicts);
|
|
840
|
+
return machineOf(draft);
|
|
841
|
+
}
|
|
842
|
+
//#endregion
|
|
511
843
|
//#region src/ladder.ts
|
|
512
844
|
/** The rungs of the ladder, in the order that a question visits them. */
|
|
513
845
|
const RUNGS = [
|
|
@@ -4022,37 +4354,26 @@ function formulaKnown(profile = {}) {
|
|
|
4022
4354
|
};
|
|
4023
4355
|
}
|
|
4024
4356
|
/**
|
|
4025
|
-
* This function makes a machine for a formula language.
|
|
4026
|
-
*
|
|
4027
|
-
*
|
|
4357
|
+
* This function makes a machine for a formula language. It merges the kit and the parts that the language adds with
|
|
4358
|
+
* `mergeMachines`. Thus a kind `ops.*` or a namespace `ops` of the language extends the namespace of the kit, and
|
|
4359
|
+
* the fallback of the kit stays. The hook `known` of the kit comes from the profile (`formulaKnown`). A hook `known`
|
|
4360
|
+
* of the language answers after it.
|
|
4361
|
+
*
|
|
4362
|
+
* A kind or an evaluator of the language that differs from the entry of the kit with its name is a conflict. The
|
|
4363
|
+
* language names the path in `replaces` to replace the entry, for example `["world", "kinds", "ref"]` or
|
|
4364
|
+
* `["evaluators", "formula.op"]`. Then the hook of the kit does not answer for a replaced evaluator.
|
|
4028
4365
|
*
|
|
4029
4366
|
* @param profile - The operations and the rules of the language.
|
|
4030
|
-
* @param more - The parts of a machine that the language adds
|
|
4367
|
+
* @param more - The parts of a machine that the language adds, with the paths of the entries that it replaces.
|
|
4031
4368
|
* @returns The machine.
|
|
4369
|
+
* @throws {MergeError} The language and the kit have a conflict.
|
|
4032
4370
|
*/
|
|
4033
4371
|
function formulaMachine(profile = {}, more = {}) {
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
return answer === true && theirs !== void 0 ? theirs(path, evaluator) : answer;
|
|
4040
|
-
};
|
|
4041
|
-
return {
|
|
4042
|
-
...more,
|
|
4043
|
-
world: {
|
|
4044
|
-
kinds: {
|
|
4045
|
-
...formulaKinds(),
|
|
4046
|
-
...more.world?.kinds
|
|
4047
|
-
},
|
|
4048
|
-
defaults: { ...more.world?.defaults }
|
|
4049
|
-
},
|
|
4050
|
-
evaluators: {
|
|
4051
|
-
...formulaEvaluators(profile),
|
|
4052
|
-
...more.evaluators
|
|
4053
|
-
},
|
|
4054
|
-
known
|
|
4055
|
-
};
|
|
4372
|
+
return mergeMachines({
|
|
4373
|
+
world: { kinds: formulaKinds() },
|
|
4374
|
+
evaluators: formulaEvaluators(profile),
|
|
4375
|
+
known: formulaKnown(profile)
|
|
4376
|
+
}, more);
|
|
4056
4377
|
}
|
|
4057
4378
|
//#endregion
|
|
4058
4379
|
//#region src/reference.ts
|
|
@@ -5243,6 +5564,6 @@ function generate(world, options) {
|
|
|
5243
5564
|
});
|
|
5244
5565
|
}
|
|
5245
5566
|
//#endregion
|
|
5246
|
-
export { CONSTRUCTS, ENVELOPE_KEYS, Failure, Held, PARTS, PART_INFO, ROOTS, RUNGS, STD_CAPS, STD_DEFINITIONS, STD_EVALUATORS, STD_EXT, STD_MACHINE, STD_RUNNERS, STD_WALKERS, STD_WORLD, THING, agree, ask, capKeys, check, checkSteps, classify, context, dataEdges, derefStep, describe, docEquals, effectEdges, entriesAsJson, evaluate, fail, failures, field, flatten, formulaDefinitions, formulaEvaluators, formulaKinds, formulaKnown, formulaMachine, fromJson, generate, intersectCaps, isAlias, isAllowedOrder, isClosure, isEnvelope, isHostThing, isKey, isKind, isNamespace, isRecord, isRef, isStackOverflow, isTypeRef, jsTruthy, kindDocument, kindNamed, kindOf, layers, looksLikeKind, lookupKind, makeContext, mapRefs, narrow, nearestWalker, nodeAt, ok, partCaps, partsOf, pathMatches, permits, placed, planner, prepare, random, ref, reference, refsOf, resolve, run, sameValue, splitParts, stored, tag, thrown, toJson, typeName, typePath, typed, typesOf, valueOfThing, walk, worldThing };
|
|
5567
|
+
export { CONSTRUCTS, ENVELOPE_KEYS, Failure, Held, MergeError, PARTS, PART_INFO, ROOTS, RUNGS, STD_CAPS, STD_DEFINITIONS, STD_EVALUATORS, STD_EXT, STD_MACHINE, STD_RUNNERS, STD_WALKERS, STD_WORLD, THING, agree, ask, capKeys, check, checkSteps, classify, context, dataEdges, derefStep, describe, docEquals, effectEdges, entriesAsJson, evaluate, fail, failures, field, flatten, formulaDefinitions, formulaEvaluators, formulaKinds, formulaKnown, formulaMachine, fromJson, generate, intersectCaps, isAlias, isAllowedOrder, isClosure, isEnvelope, isHostThing, isKey, isKind, isNamespace, isRecord, isRef, isStackOverflow, isTypeRef, jsTruthy, kindDocument, kindNamed, kindOf, layers, looksLikeKind, lookupKind, makeContext, mapRefs, mergeMachines, mergeWorlds, narrow, nearestWalker, nodeAt, ok, partCaps, partsOf, pathMatches, permits, placed, planner, prepare, random, ref, reference, refsOf, resolve, run, sameValue, splitParts, stored, tag, thrown, toJson, typeName, typePath, typed, typesOf, valueOfThing, walk, worldThing };
|
|
5247
5568
|
|
|
5248
5569
|
//# sourceMappingURL=index.js.map
|