@neocompose/cli 0.77.1 → 0.78.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/CHANGELOG.md +12 -0
- package/dist/neo.mjs +1893 -464
- package/dist/test-worker.mjs +692 -163
- package/package.json +1 -1
- package/skills/neocompose-cli/SKILL.md +1 -1
- package/skills/neocompose-cli/references/cli-development.md +1 -1
- package/skills/neocompose-cli/references/declarations-and-construction.md +31 -1
- package/skills/neocompose-cli/references/values-identities-and-references.md +5 -0
package/dist/test-worker.mjs
CHANGED
|
@@ -1490,6 +1490,7 @@ var MemberKind = /* @__PURE__ */ ((MemberKind7) => {
|
|
|
1490
1490
|
MemberKind7[MemberKind7["NSDelegate"] = 25] = "NSDelegate";
|
|
1491
1491
|
MemberKind7[MemberKind7["NSAction"] = 26] = "NSAction";
|
|
1492
1492
|
MemberKind7[MemberKind7["Variant"] = 27] = "Variant";
|
|
1493
|
+
MemberKind7[MemberKind7["Set"] = 28] = "Set";
|
|
1493
1494
|
return MemberKind7;
|
|
1494
1495
|
})(MemberKind || {});
|
|
1495
1496
|
|
|
@@ -1504,13 +1505,13 @@ var TAXONOMY = {
|
|
|
1504
1505
|
[4 /* Float */]: [1 /* Direct */, BINDABLE, "number", null, 4],
|
|
1505
1506
|
[5 /* Dictionary */]: [1 /* Direct */, BINDABLE, "collection", null, 11],
|
|
1506
1507
|
[6 /* List */]: [1 /* Direct */, BINDABLE, "collection", null, 12],
|
|
1507
|
-
[7 /* Class */]: [1 /* Direct */, BINDABLE, "class", null,
|
|
1508
|
-
[8 /* Enum */]: [1 /* Direct */, BINDABLE, "core", null,
|
|
1509
|
-
[9 /* Lookup */]: [1 /* Direct */, STORED, "collection", null,
|
|
1510
|
-
[10 /* NSProperty */]: [1 /* Direct */, 0, "code", null,
|
|
1511
|
-
[11 /* Sprite */]: [1 /* Direct */, BINDABLE, "core", null,
|
|
1512
|
-
[12 /* Audio */]: [1 /* Direct */, BINDABLE, "core", null,
|
|
1513
|
-
[13 /* Function */]: [1 /* Direct */, 8 /* Signature */, "code", null,
|
|
1508
|
+
[7 /* Class */]: [1 /* Direct */, BINDABLE, "class", null, 14],
|
|
1509
|
+
[8 /* Enum */]: [1 /* Direct */, BINDABLE, "core", null, 15],
|
|
1510
|
+
[9 /* Lookup */]: [1 /* Direct */, STORED, "collection", null, 16],
|
|
1511
|
+
[10 /* NSProperty */]: [1 /* Direct */, 0, "code", null, 18],
|
|
1512
|
+
[11 /* Sprite */]: [1 /* Direct */, BINDABLE, "core", null, 24],
|
|
1513
|
+
[12 /* Audio */]: [1 /* Direct */, BINDABLE, "core", null, 25],
|
|
1514
|
+
[13 /* Function */]: [1 /* Direct */, 8 /* Signature */, "code", null, 23],
|
|
1514
1515
|
[14 /* Vector2 */]: [1 /* Direct */, BINDABLE, "vector", 2, 6],
|
|
1515
1516
|
[15 /* Vector2Int */]: [1 /* Direct */, BINDABLE, "vector", 2, 7],
|
|
1516
1517
|
[16 /* Vector3 */]: [1 /* Direct */, BINDABLE, "vector", 3, 8],
|
|
@@ -1520,7 +1521,7 @@ var TAXONOMY = {
|
|
|
1520
1521
|
STORED,
|
|
1521
1522
|
"collection",
|
|
1522
1523
|
null,
|
|
1523
|
-
|
|
1524
|
+
17
|
|
1524
1525
|
],
|
|
1525
1526
|
[19 /* Color */]: [1 /* Direct */, BINDABLE, "core", null, 10],
|
|
1526
1527
|
[20 /* Decimal */]: [1 /* Direct */, BINDABLE, "number", null, 5],
|
|
@@ -1537,7 +1538,7 @@ var TAXONOMY = {
|
|
|
1537
1538
|
8 /* Signature */,
|
|
1538
1539
|
"code",
|
|
1539
1540
|
null,
|
|
1540
|
-
|
|
1541
|
+
19
|
|
1541
1542
|
],
|
|
1542
1543
|
[24 /* FunctionRef */]: [0 /* None */, STORED, null, null, null],
|
|
1543
1544
|
[25 /* NSDelegate */]: [
|
|
@@ -1545,16 +1546,17 @@ var TAXONOMY = {
|
|
|
1545
1546
|
STORED | 8 /* Signature */,
|
|
1546
1547
|
"code",
|
|
1547
1548
|
null,
|
|
1548
|
-
|
|
1549
|
+
20
|
|
1549
1550
|
],
|
|
1550
1551
|
[26 /* NSAction */]: [
|
|
1551
1552
|
1 /* Direct */,
|
|
1552
1553
|
STORED | 8 /* Signature */,
|
|
1553
1554
|
"code",
|
|
1554
1555
|
null,
|
|
1555
|
-
|
|
1556
|
+
21
|
|
1556
1557
|
],
|
|
1557
|
-
[27 /* Variant */]: [1 /* Direct */, STORED, "world", null,
|
|
1558
|
+
[27 /* Variant */]: [1 /* Direct */, STORED, "world", null, 22],
|
|
1559
|
+
[28 /* Set */]: [1 /* Direct */, BINDABLE, "collection", null, 13]
|
|
1558
1560
|
};
|
|
1559
1561
|
var ALL_MEMBER_KINDS = [
|
|
1560
1562
|
0 /* Null */,
|
|
@@ -1584,7 +1586,8 @@ var ALL_MEMBER_KINDS = [
|
|
|
1584
1586
|
24 /* FunctionRef */,
|
|
1585
1587
|
25 /* NSDelegate */,
|
|
1586
1588
|
26 /* NSAction */,
|
|
1587
|
-
27 /* Variant
|
|
1589
|
+
27 /* Variant */,
|
|
1590
|
+
28 /* Set */
|
|
1588
1591
|
];
|
|
1589
1592
|
var DIRECT_MEMBER_KINDS = ALL_MEMBER_KINDS.filter(
|
|
1590
1593
|
(kind) => TAXONOMY[kind][0] === 1 /* Direct */
|
|
@@ -1656,7 +1659,9 @@ var AUTOMATIC_MEMBER_DISTRIBUTION = {
|
|
|
1656
1659
|
/** Listener count grows with content. */
|
|
1657
1660
|
[26 /* NSAction */]: { sparse: "listenerCount" },
|
|
1658
1661
|
/** Fixed class, variant, and optional bound-row ids. */
|
|
1659
|
-
[27 /* Variant */]: 1 /* Packed
|
|
1662
|
+
[27 /* Variant */]: 1 /* Packed */,
|
|
1663
|
+
/** Entry count grows with content. */
|
|
1664
|
+
[28 /* Set */]: { sparse: "entryCount" }
|
|
1660
1665
|
};
|
|
1661
1666
|
function memberKindSupportsDistribution(kind) {
|
|
1662
1667
|
return memberKindSupportsStorage(kind);
|
|
@@ -3012,7 +3017,7 @@ function isNSTypeInfoCollection(value) {
|
|
|
3012
3017
|
}
|
|
3013
3018
|
function isNSTypeInfoCollectionInternal(value, ancestors) {
|
|
3014
3019
|
if (!isNSTypeInfoBase(value)) return false;
|
|
3015
|
-
if (value.type !== 6 /* List */ && value.type !== 5 /* Dictionary */) {
|
|
3020
|
+
if (value.type !== 6 /* List */ && value.type !== 28 /* Set */ && value.type !== 5 /* Dictionary */) {
|
|
3016
3021
|
return false;
|
|
3017
3022
|
}
|
|
3018
3023
|
const v = value;
|
|
@@ -3033,6 +3038,11 @@ function isNSTypeInfoCollectionInternal(value, ancestors) {
|
|
|
3033
3038
|
if (v.listMemberId.length === 0) return false;
|
|
3034
3039
|
if (v.type !== 6 /* List */) return false;
|
|
3035
3040
|
}
|
|
3041
|
+
if (v.setMemberId !== void 0) {
|
|
3042
|
+
if (typeof v.setMemberId !== "string") return false;
|
|
3043
|
+
if (v.setMemberId.length === 0) return false;
|
|
3044
|
+
if (v.type !== 28 /* Set */) return false;
|
|
3045
|
+
}
|
|
3036
3046
|
return true;
|
|
3037
3047
|
}
|
|
3038
3048
|
function isNSTypeInfoLookup(value) {
|
|
@@ -3110,7 +3120,7 @@ function typeInfoContainsUnknown(value, ancestors) {
|
|
|
3110
3120
|
if (ancestors.has(value)) return true;
|
|
3111
3121
|
ancestors.add(value);
|
|
3112
3122
|
try {
|
|
3113
|
-
if (value.type === 6 /* List */ || value.type === 5 /* Dictionary */ || value.type === 9 /* Lookup */) {
|
|
3123
|
+
if (value.type === 6 /* List */ || value.type === 28 /* Set */ || value.type === 5 /* Dictionary */ || value.type === 9 /* Lookup */) {
|
|
3114
3124
|
return typeInfoContainsUnknown(value.entryTypeInfo, ancestors);
|
|
3115
3125
|
}
|
|
3116
3126
|
if (value.type === 25 /* NSDelegate */) {
|
|
@@ -3766,7 +3776,7 @@ function isNSFunctionCollectionQuery(value) {
|
|
|
3766
3776
|
case "TakeWhile":
|
|
3767
3777
|
return isNSCollectionBoolFunction(info);
|
|
3768
3778
|
case "SelectMany":
|
|
3769
|
-
return isNSFunctionWithReturnType(info.function) && (info.function.typeInfo.type === 6 /* List */ || info.function.typeInfo.type === 9 /* Lookup */) && info.function.typeInfo.required;
|
|
3779
|
+
return isNSFunctionWithReturnType(info.function) && (info.function.typeInfo.type === 6 /* List */ || info.function.typeInfo.type === 28 /* Set */ || info.function.typeInfo.type === 9 /* Lookup */) && info.function.typeInfo.required;
|
|
3770
3780
|
case "OrderBy":
|
|
3771
3781
|
case "OrderByDescending":
|
|
3772
3782
|
return isNSFunctionWithReturnType(info.function) && ["int", "float", "decimal", "string", "bool"].includes(info.keyType);
|
|
@@ -3777,6 +3787,8 @@ function isNSFunctionCollectionQuery(value) {
|
|
|
3777
3787
|
return isNSPointer(info.otherPointer);
|
|
3778
3788
|
case "Reverse":
|
|
3779
3789
|
return true;
|
|
3790
|
+
case "ToSet":
|
|
3791
|
+
return info.reference === void 0 || info.reference === true;
|
|
3780
3792
|
default:
|
|
3781
3793
|
return false;
|
|
3782
3794
|
}
|
|
@@ -4127,7 +4139,7 @@ function typeInfosInvariantlyEqual(left, right) {
|
|
|
4127
4139
|
if (left.type === 8 /* Enum */ && right.type === 8 /* Enum */) {
|
|
4128
4140
|
return left.enumId === right.enumId;
|
|
4129
4141
|
}
|
|
4130
|
-
if ((left.type === 6 /* List */ || left.type === 5 /* Dictionary */) && (right.type === 6 /* List */ || right.type === 5 /* Dictionary */)) {
|
|
4142
|
+
if ((left.type === 6 /* List */ || left.type === 28 /* Set */ || left.type === 5 /* Dictionary */) && (right.type === 6 /* List */ || right.type === 28 /* Set */ || right.type === 5 /* Dictionary */)) {
|
|
4131
4143
|
if (left.keyEnumId !== right.keyEnumId) return false;
|
|
4132
4144
|
return typeInfosInvariantlyEqual(left.entryTypeInfo, right.entryTypeInfo);
|
|
4133
4145
|
}
|
|
@@ -4529,10 +4541,22 @@ function isListKind(value) {
|
|
|
4529
4541
|
function isMemberListBase(value) {
|
|
4530
4542
|
const v = asMemberBaseForKind(value, 6 /* List */);
|
|
4531
4543
|
if (v === null) return false;
|
|
4532
|
-
if (typeof v.entryMemberId !== "string") return false;
|
|
4533
4544
|
if (v.listKind !== void 0 && v.listKind !== null && !isListKind(v.listKind)) {
|
|
4534
4545
|
return false;
|
|
4535
4546
|
}
|
|
4547
|
+
return hasValidEntryCollectionFields(v);
|
|
4548
|
+
}
|
|
4549
|
+
function isMemberSetBase(value) {
|
|
4550
|
+
const v = asMemberBaseForKind(value, 28 /* Set */);
|
|
4551
|
+
if (v === null) return false;
|
|
4552
|
+
if (v.listKind !== void 0) return false;
|
|
4553
|
+
return hasValidEntryCollectionFields(v);
|
|
4554
|
+
}
|
|
4555
|
+
function isMemberEntryCollectionBase(value) {
|
|
4556
|
+
return isMemberListBase(value) || isMemberSetBase(value);
|
|
4557
|
+
}
|
|
4558
|
+
function hasValidEntryCollectionFields(v) {
|
|
4559
|
+
if (typeof v.entryMemberId !== "string") return false;
|
|
4536
4560
|
if (v.valueTypeInfo !== void 0 && v.valueTypeInfo !== null && (!isNSTypeInfo(v.valueTypeInfo) || v.valueTypeInfo.type !== 7 /* Class */)) {
|
|
4537
4561
|
return false;
|
|
4538
4562
|
}
|
|
@@ -4557,14 +4581,21 @@ function isMemberListBase(value) {
|
|
|
4557
4581
|
}
|
|
4558
4582
|
function isMemberList(value) {
|
|
4559
4583
|
if (!isMemberListBase(value)) return false;
|
|
4560
|
-
if (!isWithId(value)) return false;
|
|
4561
4584
|
return isWithId(value);
|
|
4562
4585
|
}
|
|
4586
|
+
function isMemberSet(value) {
|
|
4587
|
+
if (!isMemberSetBase(value)) return false;
|
|
4588
|
+
return isWithId(value);
|
|
4589
|
+
}
|
|
4590
|
+
function isMemberEntryCollection(value) {
|
|
4591
|
+
return isMemberList(value) || isMemberSet(value);
|
|
4592
|
+
}
|
|
4563
4593
|
function listKindOf(member) {
|
|
4594
|
+
if (member.kind === 28 /* Set */) return 0 /* Ordered */;
|
|
4564
4595
|
return member.listKind ?? 0 /* Ordered */;
|
|
4565
4596
|
}
|
|
4566
4597
|
function isMemberWithEntries(value) {
|
|
4567
|
-
return
|
|
4598
|
+
return isMemberEntryCollectionBase(value) || isMemberDictionaryBase(value);
|
|
4568
4599
|
}
|
|
4569
4600
|
function isMemberClassBase(value) {
|
|
4570
4601
|
const v = asMemberBaseForKind(value, 7 /* Class */);
|
|
@@ -5091,7 +5122,7 @@ function isMemberBase(value) {
|
|
|
5091
5122
|
if (payload !== void 0 && v?.kind !== 7 /* Class */ && v?.kind !== 21 /* Generic */) {
|
|
5092
5123
|
return false;
|
|
5093
5124
|
}
|
|
5094
|
-
const matchesConcreteType = isMemberNullBase(value) || isMemberBoolBase(value) || isMemberIntBase(value) || isMemberStringBase(value) || isMemberFloatBase(value) || isMemberDictionaryBase(value) || isMemberListBase(value) || isMemberClassBase(value) || isMemberEnumBase(value) || isMemberLookupBase(value) || isMemberDialogueLookupBase(value) || isMemberNSPropertyBase(value) || isMemberNSPropertyContractBase(value) || isMemberSpriteBase(value) || isMemberAudioBase(value) || isMemberFunctionBase(value) || isMemberNSFunctionBase(value) || isMemberNSFunction(value) || isMemberDelegateBase(value) || isMemberActionBase(value) || isMemberFunctionRefBase(value) || isMemberVariantBase(value) || isMemberVector2Base(value) || isMemberVector2IntBase(value) || isMemberVector3Base(value) || isMemberVector3IntBase(value) || isMemberColorBase(value) || isMemberDecimalBase(value) || isMemberGenericBase(value);
|
|
5125
|
+
const matchesConcreteType = isMemberNullBase(value) || isMemberBoolBase(value) || isMemberIntBase(value) || isMemberStringBase(value) || isMemberFloatBase(value) || isMemberDictionaryBase(value) || isMemberListBase(value) || isMemberSetBase(value) || isMemberClassBase(value) || isMemberEnumBase(value) || isMemberLookupBase(value) || isMemberDialogueLookupBase(value) || isMemberNSPropertyBase(value) || isMemberNSPropertyContractBase(value) || isMemberSpriteBase(value) || isMemberAudioBase(value) || isMemberFunctionBase(value) || isMemberNSFunctionBase(value) || isMemberNSFunction(value) || isMemberDelegateBase(value) || isMemberActionBase(value) || isMemberFunctionRefBase(value) || isMemberVariantBase(value) || isMemberVector2Base(value) || isMemberVector2IntBase(value) || isMemberVector3Base(value) || isMemberVector3IntBase(value) || isMemberColorBase(value) || isMemberDecimalBase(value) || isMemberGenericBase(value);
|
|
5095
5126
|
if (!matchesConcreteType) return false;
|
|
5096
5127
|
if (!isValidDocsText(v?.docsText)) return false;
|
|
5097
5128
|
if (typeof v?.name !== "string") return false;
|
|
@@ -5503,7 +5534,7 @@ var ProjectSchemaIndex = class {
|
|
|
5503
5534
|
for (const member of source.members) {
|
|
5504
5535
|
this.membersById.set(member.id, member);
|
|
5505
5536
|
append(this.membersByName, member.name, member);
|
|
5506
|
-
if (
|
|
5537
|
+
if (isMemberEntryCollection(member) || isMemberDictionary(member)) {
|
|
5507
5538
|
append(
|
|
5508
5539
|
this.containerMemberIdsByEntryId,
|
|
5509
5540
|
member.entryMemberId,
|
|
@@ -8991,9 +9022,9 @@ function openBindingTypeInfo(member, env, classes, members) {
|
|
|
8991
9022
|
...Object.keys(typeArguments).length === 0 ? {} : { typeArguments }
|
|
8992
9023
|
};
|
|
8993
9024
|
}
|
|
8994
|
-
if (
|
|
9025
|
+
if (isMemberEntryCollectionBase(resolved)) {
|
|
8995
9026
|
return {
|
|
8996
|
-
type:
|
|
9027
|
+
type: resolved.kind,
|
|
8997
9028
|
required,
|
|
8998
9029
|
entryTypeInfo: nested(resolved.entryMemberId)
|
|
8999
9030
|
};
|
|
@@ -9019,7 +9050,7 @@ function callableBindingMember(memberId, slotName, members) {
|
|
|
9019
9050
|
}
|
|
9020
9051
|
function mapGenericTypeInfo(typeInfo, close) {
|
|
9021
9052
|
if (typeInfo.type === 21 /* Generic */) return close(typeInfo);
|
|
9022
|
-
if (typeInfo.type === 6 /* List */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
9053
|
+
if (typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
9023
9054
|
return {
|
|
9024
9055
|
...typeInfo,
|
|
9025
9056
|
entryTypeInfo: mapGenericTypeInfo(typeInfo.entryTypeInfo, close)
|
|
@@ -9102,6 +9133,14 @@ function typeInfoFromArgumentSignature(signature) {
|
|
|
9102
9133
|
entryTypeInfo: typeInfoFromArgumentSignature(listSignature.entry)
|
|
9103
9134
|
};
|
|
9104
9135
|
}
|
|
9136
|
+
if (signature.type === 28 /* Set */) {
|
|
9137
|
+
const setSignature = signature;
|
|
9138
|
+
return {
|
|
9139
|
+
type: 28 /* Set */,
|
|
9140
|
+
required: setSignature.required,
|
|
9141
|
+
entryTypeInfo: typeInfoFromArgumentSignature(setSignature.entry)
|
|
9142
|
+
};
|
|
9143
|
+
}
|
|
9105
9144
|
if (signature.type === 5 /* Dictionary */) {
|
|
9106
9145
|
const dictionarySignature = signature;
|
|
9107
9146
|
return {
|
|
@@ -9198,6 +9237,13 @@ function typeArgumentSignatureOfMember(member, env, members, seen = /* @__PURE__
|
|
|
9198
9237
|
entry: entrySignature(resolved.entryMemberId, env, members, seen)
|
|
9199
9238
|
};
|
|
9200
9239
|
}
|
|
9240
|
+
if (isMemberSetBase(resolved)) {
|
|
9241
|
+
return {
|
|
9242
|
+
type: 28 /* Set */,
|
|
9243
|
+
required,
|
|
9244
|
+
entry: entrySignature(resolved.entryMemberId, env, members, seen)
|
|
9245
|
+
};
|
|
9246
|
+
}
|
|
9201
9247
|
if (isMemberDictionaryBase(resolved)) {
|
|
9202
9248
|
return {
|
|
9203
9249
|
type: 5 /* Dictionary */,
|
|
@@ -9301,6 +9347,11 @@ function signaturesEqual(a, b) {
|
|
|
9301
9347
|
if (al.listKind !== bl.listKind) return false;
|
|
9302
9348
|
return signaturesEqual(al.entry, bl.entry);
|
|
9303
9349
|
}
|
|
9350
|
+
if (a.type === 28 /* Set */ && b.type === 28 /* Set */) {
|
|
9351
|
+
const as = a;
|
|
9352
|
+
const bs = b;
|
|
9353
|
+
return signaturesEqual(as.entry, bs.entry);
|
|
9354
|
+
}
|
|
9304
9355
|
if (a.type === 5 /* Dictionary */ && b.type === 5 /* Dictionary */) {
|
|
9305
9356
|
const ad = a;
|
|
9306
9357
|
const bd = b;
|
|
@@ -9664,7 +9715,7 @@ function valueSettlesConstruction(member, body, context, path, storedRow = false
|
|
|
9664
9715
|
const value = body.value;
|
|
9665
9716
|
if (value == null) return !isRequiredMember(member);
|
|
9666
9717
|
const isClass = isMemberClassBase(member);
|
|
9667
|
-
const isCollection =
|
|
9718
|
+
const isCollection = isMemberWithEntries(member);
|
|
9668
9719
|
if (!isClass && !isCollection) return true;
|
|
9669
9720
|
if (isClass && member.payload === 1 /* Partial */) return true;
|
|
9670
9721
|
if (typeof value !== "object") return false;
|
|
@@ -9844,6 +9895,40 @@ var UNITY_TEXTURE_2D_OVERRIDE_PATHS = /* @__PURE__ */ new Set([
|
|
|
9844
9895
|
"compressionQuality",
|
|
9845
9896
|
"crunchedCompression",
|
|
9846
9897
|
"platformSettings",
|
|
9898
|
+
"platformSettings.default.maxTextureSize",
|
|
9899
|
+
"platformSettings.default.resizeAlgorithm",
|
|
9900
|
+
"platformSettings.default.format",
|
|
9901
|
+
"platformSettings.default.textureCompression",
|
|
9902
|
+
"platformSettings.default.crunchedCompression",
|
|
9903
|
+
"platformSettings.default.compressionQuality",
|
|
9904
|
+
"platformSettings.standalone.override",
|
|
9905
|
+
"platformSettings.standalone.maxTextureSize",
|
|
9906
|
+
"platformSettings.standalone.resizeAlgorithm",
|
|
9907
|
+
"platformSettings.standalone.format",
|
|
9908
|
+
"platformSettings.standalone.textureCompression",
|
|
9909
|
+
"platformSettings.standalone.crunchedCompression",
|
|
9910
|
+
"platformSettings.standalone.compressionQuality",
|
|
9911
|
+
"platformSettings.web.override",
|
|
9912
|
+
"platformSettings.web.maxTextureSize",
|
|
9913
|
+
"platformSettings.web.resizeAlgorithm",
|
|
9914
|
+
"platformSettings.web.format",
|
|
9915
|
+
"platformSettings.web.textureCompression",
|
|
9916
|
+
"platformSettings.web.crunchedCompression",
|
|
9917
|
+
"platformSettings.web.compressionQuality",
|
|
9918
|
+
"spriteSettings.pivotAlignment",
|
|
9919
|
+
"spriteSettings.pivot.x",
|
|
9920
|
+
"spriteSettings.pivot.y",
|
|
9921
|
+
"spriteSettings.generatePhysicsShape",
|
|
9922
|
+
"normalMapSettings.createFromGrayscale",
|
|
9923
|
+
"normalMapSettings.bumpiness",
|
|
9924
|
+
"normalMapSettings.filtering",
|
|
9925
|
+
"normalMapSettings.flipGreenChannel",
|
|
9926
|
+
"cookieSettings.lightType",
|
|
9927
|
+
"singleChannelSettings.component",
|
|
9928
|
+
"swizzle.r",
|
|
9929
|
+
"swizzle.g",
|
|
9930
|
+
"swizzle.b",
|
|
9931
|
+
"swizzle.a",
|
|
9847
9932
|
"spriteSettings",
|
|
9848
9933
|
"spriteSettings.spriteMode",
|
|
9849
9934
|
"spriteSettings.pixelsPerUnit",
|
|
@@ -10752,7 +10837,7 @@ function storedLeafFieldIssueMessage(issue) {
|
|
|
10752
10837
|
}
|
|
10753
10838
|
function* storedValueChildEntries(args) {
|
|
10754
10839
|
const entryMemberId = args.member.entryMemberId;
|
|
10755
|
-
if (args.member.kind === 6 /* List */ && typeof entryMemberId === "string") {
|
|
10840
|
+
if ((args.member.kind === 6 /* List */ || args.member.kind === 28 /* Set */) && typeof entryMemberId === "string") {
|
|
10756
10841
|
const ids = args.member.listKind === 1 /* Unordered */ && args.unorderedValueIds !== void 0 ? args.unorderedValueIds : Array.isArray(args.body) ? args.body : [];
|
|
10757
10842
|
let pathIndex = 0;
|
|
10758
10843
|
for (const valueId of ids) {
|
|
@@ -11000,7 +11085,7 @@ function isConstantMember(document2, resolved, reads) {
|
|
|
11000
11085
|
if (fixedness === 0 /* Writable */) return false;
|
|
11001
11086
|
const declared = resolved.defaultValue;
|
|
11002
11087
|
if (declared == null) return false;
|
|
11003
|
-
if (fixedness === 1 /* ReadOnly */ && (
|
|
11088
|
+
if (fixedness === 1 /* ReadOnly */ && isMemberWithEntries(resolved))
|
|
11004
11089
|
return false;
|
|
11005
11090
|
return !declarationVaries(
|
|
11006
11091
|
{
|
|
@@ -11081,7 +11166,7 @@ function declarationVaries(walk, member, body, rowId, scope) {
|
|
|
11081
11166
|
}
|
|
11082
11167
|
return owned !== Object.keys(value).length;
|
|
11083
11168
|
}
|
|
11084
|
-
if (
|
|
11169
|
+
if (isMemberEntryCollectionBase(member)) {
|
|
11085
11170
|
if (rowId !== null && listKindOf(member) === 1 /* Unordered */)
|
|
11086
11171
|
walk.reads?.containerIds.add(rowId);
|
|
11087
11172
|
const entryIds = listKindOf(member) !== 1 /* Unordered */ ? value : rowId === null ? [] : document2.unorderedListEntryIds?.(rowId) ?? (walk.membership ??= buildUnorderedListMembershipIndex(
|
|
@@ -11134,7 +11219,7 @@ function typeHoldsWritable(walk, member, fixedness) {
|
|
|
11134
11219
|
}
|
|
11135
11220
|
return false;
|
|
11136
11221
|
}
|
|
11137
|
-
if (
|
|
11222
|
+
if (isMemberWithEntries(member)) {
|
|
11138
11223
|
const entryMember = resolvedInDocument(
|
|
11139
11224
|
walk.document,
|
|
11140
11225
|
findMemberInDocument(walk.document, member.entryMemberId)
|
|
@@ -11481,7 +11566,7 @@ function buildDefaultMemberValueCore(args, resolvedMember) {
|
|
|
11481
11566
|
recordStorageKeyDeclaration(args.storageKeyDeclarations, value2.id, member);
|
|
11482
11567
|
return value2;
|
|
11483
11568
|
}
|
|
11484
|
-
if (
|
|
11569
|
+
if (isMemberEntryCollectionBase(member)) {
|
|
11485
11570
|
const list = cloneDefaultListRecord({
|
|
11486
11571
|
document: args.document,
|
|
11487
11572
|
projectId: args.projectId,
|
|
@@ -11949,7 +12034,7 @@ function cloneDefaultValueForMemberCore(args, sourceValue) {
|
|
|
11949
12034
|
value: record4,
|
|
11950
12035
|
classId: effectiveClassId !== member.classId || sourceValue.constructorArgs != null || anchorsParentClassPartition ? effectiveClassId : void 0
|
|
11951
12036
|
};
|
|
11952
|
-
} else if (
|
|
12037
|
+
} else if (isMemberEntryCollectionBase(member)) {
|
|
11953
12038
|
body = cloneDefaultListRecord({
|
|
11954
12039
|
document: args.document,
|
|
11955
12040
|
projectId: args.projectId,
|
|
@@ -11990,7 +12075,7 @@ function cloneDefaultValueForMemberCore(args, sourceValue) {
|
|
|
11990
12075
|
value.sourceValueId = sourceValue.sourceValueId ?? sourceValue.id;
|
|
11991
12076
|
if (sourceValue.genericBindings != null) {
|
|
11992
12077
|
value.genericBindings = { ...sourceValue.genericBindings };
|
|
11993
|
-
} else if (
|
|
12078
|
+
} else if (isMemberWithEntries(member)) {
|
|
11994
12079
|
stampGenericBindings(value, member, args);
|
|
11995
12080
|
}
|
|
11996
12081
|
args.createdValues.push(value);
|
|
@@ -12366,12 +12451,12 @@ function validateListIndexDefinitions(ctx, listMember) {
|
|
|
12366
12451
|
let list;
|
|
12367
12452
|
try {
|
|
12368
12453
|
const resolved = resolveMember(listMember, ctx.members);
|
|
12369
|
-
if (!
|
|
12454
|
+
if (!isMemberEntryCollectionBase(resolved)) return errors;
|
|
12370
12455
|
list = resolved;
|
|
12371
12456
|
} catch (error) {
|
|
12372
12457
|
errors.push({
|
|
12373
12458
|
memberId: listMember.id,
|
|
12374
|
-
message:
|
|
12459
|
+
message: `${MemberKind[listMember.kind]} member "${listMember.name}" (${listMember.id}) cannot resolve its inheritance chain: ${errorMessage(error)}.`
|
|
12375
12460
|
});
|
|
12376
12461
|
return errors;
|
|
12377
12462
|
}
|
|
@@ -12383,7 +12468,7 @@ function validateListIndexDefinitions(ctx, listMember) {
|
|
|
12383
12468
|
if (entryRecord === void 0) {
|
|
12384
12469
|
errors.push({
|
|
12385
12470
|
memberId: listMember.id,
|
|
12386
|
-
message: `Indexed
|
|
12471
|
+
message: `Indexed ${MemberKind[listMember.kind]} member "${listMember.name}" (${listMember.id}) references missing entry member "${list.entryMemberId}".`
|
|
12387
12472
|
});
|
|
12388
12473
|
return errors;
|
|
12389
12474
|
}
|
|
@@ -12393,14 +12478,14 @@ function validateListIndexDefinitions(ctx, listMember) {
|
|
|
12393
12478
|
} catch (error) {
|
|
12394
12479
|
errors.push({
|
|
12395
12480
|
memberId: listMember.id,
|
|
12396
|
-
message: `Indexed
|
|
12481
|
+
message: `Indexed ${MemberKind[listMember.kind]} member "${listMember.name}" (${listMember.id}) cannot resolve entry member "${list.entryMemberId}": ${errorMessage(error)}.`
|
|
12397
12482
|
});
|
|
12398
12483
|
return errors;
|
|
12399
12484
|
}
|
|
12400
12485
|
if (!isMemberClassBase(entry)) {
|
|
12401
12486
|
errors.push({
|
|
12402
12487
|
memberId: listMember.id,
|
|
12403
|
-
message: `Indexed
|
|
12488
|
+
message: `Indexed ${MemberKind[listMember.kind]} member "${listMember.name}" (${listMember.id}) must have a Class entry member; "${entry.name}" has kind ${MemberKind[entry.kind]}.`
|
|
12404
12489
|
});
|
|
12405
12490
|
return errors;
|
|
12406
12491
|
}
|
|
@@ -12410,7 +12495,7 @@ function validateListIndexDefinitions(ctx, listMember) {
|
|
|
12410
12495
|
if (entryClass === void 0) {
|
|
12411
12496
|
errors.push({
|
|
12412
12497
|
memberId: listMember.id,
|
|
12413
|
-
message: `Indexed
|
|
12498
|
+
message: `Indexed ${MemberKind[listMember.kind]} member "${listMember.name}" (${listMember.id}) references missing entry class "${entry.classId}".`
|
|
12414
12499
|
});
|
|
12415
12500
|
return errors;
|
|
12416
12501
|
}
|
|
@@ -12433,7 +12518,7 @@ function validateListIndexDefinitions(ctx, listMember) {
|
|
|
12433
12518
|
errors.push({
|
|
12434
12519
|
memberId: listMember.id,
|
|
12435
12520
|
schemaKey: definition.schemaKey,
|
|
12436
|
-
message:
|
|
12521
|
+
message: `${MemberKind[listMember.kind]} index "${definition.schemaKey}" on "${listMember.name}" (${listMember.id}) does not resolve on entry class "${runtimeClass.name}" (${runtimeClass.id}).`
|
|
12437
12522
|
});
|
|
12438
12523
|
continue;
|
|
12439
12524
|
}
|
|
@@ -12442,7 +12527,7 @@ function validateListIndexDefinitions(ctx, listMember) {
|
|
|
12442
12527
|
errors.push({
|
|
12443
12528
|
memberId: listMember.id,
|
|
12444
12529
|
schemaKey: definition.schemaKey,
|
|
12445
|
-
message:
|
|
12530
|
+
message: `${MemberKind[listMember.kind]} index "${definition.schemaKey}" on "${listMember.name}" (${listMember.id}) is invalid for entry class "${runtimeClass.name}" (${runtimeClass.id}): ${domain.error}.`
|
|
12446
12531
|
});
|
|
12447
12532
|
continue;
|
|
12448
12533
|
}
|
|
@@ -12454,7 +12539,7 @@ function validateListIndexDefinitions(ctx, listMember) {
|
|
|
12454
12539
|
errors.push({
|
|
12455
12540
|
memberId: listMember.id,
|
|
12456
12541
|
schemaKey: definition.schemaKey,
|
|
12457
|
-
message:
|
|
12542
|
+
message: `${MemberKind[listMember.kind]} index "${definition.schemaKey}" on "${listMember.name}" (${listMember.id}) changes key domain on entry subclass "${runtimeClass.name}" (${runtimeClass.id}); every runtime subclass must resolve the same String or Enum domain.`
|
|
12458
12543
|
});
|
|
12459
12544
|
}
|
|
12460
12545
|
}
|
|
@@ -12465,7 +12550,7 @@ function resolveListIndexDefinitions(ctx, listMember) {
|
|
|
12465
12550
|
const errors = validateListIndexDefinitions(ctx, listMember);
|
|
12466
12551
|
if (errors.length > 0) throw new Error(errors[0].message);
|
|
12467
12552
|
const list = resolveMember(listMember, ctx.members);
|
|
12468
|
-
if (!
|
|
12553
|
+
if (!isMemberEntryCollectionBase(list)) return [];
|
|
12469
12554
|
const entryRecord = ctx.members.find(
|
|
12470
12555
|
(member) => member.id === list.entryMemberId
|
|
12471
12556
|
);
|
|
@@ -12485,7 +12570,7 @@ function resolveListIndexDefinitions(ctx, listMember) {
|
|
|
12485
12570
|
);
|
|
12486
12571
|
if (field === null) {
|
|
12487
12572
|
throw new Error(
|
|
12488
|
-
`Validated
|
|
12573
|
+
`Validated ${MemberKind[list.kind]} index "${definition.schemaKey}" no longer resolves on entry class "${entryClass.name}".`
|
|
12489
12574
|
);
|
|
12490
12575
|
}
|
|
12491
12576
|
const domain = classifyIndexKeyDomain(field.member, ctx.enums);
|
|
@@ -12811,7 +12896,7 @@ var EffectiveStorageResolver = class {
|
|
|
12811
12896
|
}
|
|
12812
12897
|
continue;
|
|
12813
12898
|
}
|
|
12814
|
-
if (member.kind === 6 /* List */ || member.kind === 5 /* Dictionary */) {
|
|
12899
|
+
if (member.kind === 6 /* List */ || member.kind === 28 /* Set */ || member.kind === 5 /* Dictionary */) {
|
|
12815
12900
|
const entryId = this.resolvedEntryMemberId(member.id);
|
|
12816
12901
|
if (entryId !== void 0) addEdge(entryId, member.id);
|
|
12817
12902
|
}
|
|
@@ -12961,7 +13046,7 @@ function compiledConstructionTypeMembers(members, bodies, projectId) {
|
|
|
12961
13046
|
requirement: type.required ? 1 /* Required */ : 0 /* Optional */
|
|
12962
13047
|
};
|
|
12963
13048
|
const fields = (() => {
|
|
12964
|
-
if (type.type === 6 /* List */ || type.type === 5 /* Dictionary */) {
|
|
13049
|
+
if (type.type === 6 /* List */ || type.type === 28 /* Set */ || type.type === 5 /* Dictionary */) {
|
|
12965
13050
|
const entryMemberId = intern(type.entryTypeInfo);
|
|
12966
13051
|
if (entryMemberId === null) return null;
|
|
12967
13052
|
return {
|
|
@@ -13227,6 +13312,9 @@ function createCanonicalMemberResolver(parentOf) {
|
|
|
13227
13312
|
return canonical;
|
|
13228
13313
|
};
|
|
13229
13314
|
}
|
|
13315
|
+
function indexedCollectionMemberId(type) {
|
|
13316
|
+
return type.kind === "list" ? type.listMemberId : type.setMemberId;
|
|
13317
|
+
}
|
|
13230
13318
|
function isNeoScriptConstructionDocumentKind(kind) {
|
|
13231
13319
|
if (kind === "initializer") return true;
|
|
13232
13320
|
if (kind === "initializerExpression") return true;
|
|
@@ -13414,7 +13502,7 @@ function buildNeoScriptConstructorSignature(classId, members, memberDescriptor)
|
|
|
13414
13502
|
}
|
|
13415
13503
|
function buildNeoScriptConstructionSignatures(classId, members, memberDescriptor, immutableOnly) {
|
|
13416
13504
|
const descriptors = /* @__PURE__ */ new Map();
|
|
13417
|
-
const
|
|
13505
|
+
const describe2 = (memberId) => {
|
|
13418
13506
|
let descriptor = descriptors.get(memberId);
|
|
13419
13507
|
if (descriptor === void 0) {
|
|
13420
13508
|
descriptor = memberDescriptor(memberId);
|
|
@@ -13422,7 +13510,7 @@ function buildNeoScriptConstructionSignatures(classId, members, memberDescriptor
|
|
|
13422
13510
|
}
|
|
13423
13511
|
return descriptor;
|
|
13424
13512
|
};
|
|
13425
|
-
const replay = buildNeoScriptConstructorSignature(classId, members,
|
|
13513
|
+
const replay = buildNeoScriptConstructorSignature(classId, members, describe2);
|
|
13426
13514
|
if (immutableOnly) {
|
|
13427
13515
|
return {
|
|
13428
13516
|
storedConstructionReplaySignature: replay,
|
|
@@ -13449,7 +13537,7 @@ function buildNeoScriptConstructionSignatures(classId, members, memberDescriptor
|
|
|
13449
13537
|
classId,
|
|
13450
13538
|
members,
|
|
13451
13539
|
(memberId) => {
|
|
13452
|
-
const descriptor =
|
|
13540
|
+
const descriptor = describe2(memberId);
|
|
13453
13541
|
return descriptor?.immutable === true ? null : descriptor;
|
|
13454
13542
|
}
|
|
13455
13543
|
),
|
|
@@ -14115,9 +14203,9 @@ function visitTypedAggregateRowReferences(value, rawType, visitor) {
|
|
|
14115
14203
|
visitor.visitLookup?.(item.value, type);
|
|
14116
14204
|
else if (type.type === 7 /* Class */ || type.type === 22 /* Interface */) {
|
|
14117
14205
|
if (typeof item.value === "string") visitor.visit(item.value, type);
|
|
14118
|
-
} else if (type.type === 6 /* List */ || type.type === 5 /* Dictionary */) {
|
|
14206
|
+
} else if (type.type === 6 /* List */ || type.type === 28 /* Set */ || type.type === 5 /* Dictionary */) {
|
|
14119
14207
|
if (typeof item.value === "string") visitor.visit(item.value, type);
|
|
14120
|
-
else if (typeof item.value === "object" && item.value !== null && (type.type ===
|
|
14208
|
+
else if (typeof item.value === "object" && item.value !== null && (type.type === 5 /* Dictionary */ ? !Array.isArray(item.value) : Array.isArray(item.value))) {
|
|
14121
14209
|
for (const value2 of Object.values(item.value)) {
|
|
14122
14210
|
visitor.beforeVisit?.();
|
|
14123
14211
|
pending.push({ value: value2, type: type.entryTypeInfo });
|
|
@@ -14127,6 +14215,145 @@ function visitTypedAggregateRowReferences(value, rawType, visitor) {
|
|
|
14127
14215
|
}
|
|
14128
14216
|
}
|
|
14129
14217
|
|
|
14218
|
+
// ../packages/neoscript-language/src/set-elements.ts
|
|
14219
|
+
var SET_ELEMENT_NULLABLE_ERROR = "`Set` elements can't be nullable.";
|
|
14220
|
+
var SET_ELEMENT_COLLECTION_ERROR = "`Set` elements can't be collections.";
|
|
14221
|
+
function setElementKindError(noun) {
|
|
14222
|
+
return `\`Set\` elements can't be ${noun}.`;
|
|
14223
|
+
}
|
|
14224
|
+
|
|
14225
|
+
// ../packages/models/src/members/set-entry-keys.ts
|
|
14226
|
+
var SET_ENTRY_MEMBER_KINDS = /* @__PURE__ */ new Set([
|
|
14227
|
+
1 /* Bool */,
|
|
14228
|
+
2 /* Int */,
|
|
14229
|
+
4 /* Float */,
|
|
14230
|
+
20 /* Decimal */,
|
|
14231
|
+
3 /* String */,
|
|
14232
|
+
14 /* Vector2 */,
|
|
14233
|
+
15 /* Vector2Int */,
|
|
14234
|
+
16 /* Vector3 */,
|
|
14235
|
+
17 /* Vector3Int */,
|
|
14236
|
+
19 /* Color */,
|
|
14237
|
+
11 /* Sprite */,
|
|
14238
|
+
12 /* Audio */,
|
|
14239
|
+
7 /* Class */,
|
|
14240
|
+
21 /* Generic */
|
|
14241
|
+
]);
|
|
14242
|
+
function setEntryKey(entryMember, entry) {
|
|
14243
|
+
const value = entry.value;
|
|
14244
|
+
switch (entryMember.kind) {
|
|
14245
|
+
case 7 /* Class */:
|
|
14246
|
+
return entry.id;
|
|
14247
|
+
case 1 /* Bool */:
|
|
14248
|
+
return String(requireBoolean(value, entryMember));
|
|
14249
|
+
case 2 /* Int */:
|
|
14250
|
+
return String(requireNumber(value, entryMember));
|
|
14251
|
+
case 4 /* Float */:
|
|
14252
|
+
return float32Key(requireNumber(value, entryMember));
|
|
14253
|
+
case 20 /* Decimal */:
|
|
14254
|
+
return decimalKey(requireString(value, entryMember));
|
|
14255
|
+
case 3 /* String */:
|
|
14256
|
+
if (isLocalizedStringMember(entryMember)) {
|
|
14257
|
+
throw new Error(
|
|
14258
|
+
`setEntryKey: "${entryMember.name}" is a localized string; Set<string> elements must be @settings(format: .Plain).`
|
|
14259
|
+
);
|
|
14260
|
+
}
|
|
14261
|
+
return requireString(value, entryMember);
|
|
14262
|
+
case 8 /* Enum */:
|
|
14263
|
+
return requireStringArray(value, entryMember).join(",");
|
|
14264
|
+
case 14 /* Vector2 */:
|
|
14265
|
+
return componentsKey(value, ["x", "y"], float32Key, entryMember);
|
|
14266
|
+
case 15 /* Vector2Int */:
|
|
14267
|
+
return componentsKey(value, ["x", "y"], String, entryMember);
|
|
14268
|
+
case 16 /* Vector3 */:
|
|
14269
|
+
return componentsKey(value, ["x", "y", "z"], float32Key, entryMember);
|
|
14270
|
+
case 17 /* Vector3Int */:
|
|
14271
|
+
return componentsKey(value, ["x", "y", "z"], String, entryMember);
|
|
14272
|
+
case 19 /* Color */:
|
|
14273
|
+
return componentsKey(
|
|
14274
|
+
value,
|
|
14275
|
+
["r", "g", "b", "a"],
|
|
14276
|
+
float32Key,
|
|
14277
|
+
entryMember
|
|
14278
|
+
);
|
|
14279
|
+
case 11 /* Sprite */: {
|
|
14280
|
+
const sprite = requireRecord(value, entryMember);
|
|
14281
|
+
return `${String(sprite.fileId)}:${String(sprite.sliceIndex)}`;
|
|
14282
|
+
}
|
|
14283
|
+
case 12 /* Audio */:
|
|
14284
|
+
return String(requireRecord(value, entryMember).fileId);
|
|
14285
|
+
default:
|
|
14286
|
+
throw new Error(
|
|
14287
|
+
`setEntryKey: "${entryMember.name}" has kind ${MemberKind[entryMember.kind]}, which is not a Set element kind.`
|
|
14288
|
+
);
|
|
14289
|
+
}
|
|
14290
|
+
}
|
|
14291
|
+
var FLOAT32_VIEW = new DataView(new ArrayBuffer(4));
|
|
14292
|
+
function float32Key(value) {
|
|
14293
|
+
FLOAT32_VIEW.setFloat32(0, value === 0 ? 0 : value);
|
|
14294
|
+
return String(FLOAT32_VIEW.getInt32(0));
|
|
14295
|
+
}
|
|
14296
|
+
function decimalKey(value) {
|
|
14297
|
+
let text = value;
|
|
14298
|
+
if (text.includes(".")) text = text.replace(/\.?0+$/, "");
|
|
14299
|
+
return text === "-0" ? "0" : text;
|
|
14300
|
+
}
|
|
14301
|
+
function componentsKey(value, components2, encode, entryMember) {
|
|
14302
|
+
const record4 = requireRecord(value, entryMember);
|
|
14303
|
+
const parts = [];
|
|
14304
|
+
for (const component of components2) {
|
|
14305
|
+
const part = record4[component];
|
|
14306
|
+
if (typeof part !== "number") {
|
|
14307
|
+
throw new Error(
|
|
14308
|
+
`setEntryKey: "${entryMember.name}" entry is missing numeric component "${component}".`
|
|
14309
|
+
);
|
|
14310
|
+
}
|
|
14311
|
+
parts.push(encode(part));
|
|
14312
|
+
}
|
|
14313
|
+
return parts.join(",");
|
|
14314
|
+
}
|
|
14315
|
+
function requireBoolean(value, entryMember) {
|
|
14316
|
+
if (typeof value === "boolean") return value;
|
|
14317
|
+
throw entryTypeError(value, "a boolean", entryMember);
|
|
14318
|
+
}
|
|
14319
|
+
function requireNumber(value, entryMember) {
|
|
14320
|
+
if (typeof value === "number") return value;
|
|
14321
|
+
throw entryTypeError(value, "a number", entryMember);
|
|
14322
|
+
}
|
|
14323
|
+
function requireString(value, entryMember) {
|
|
14324
|
+
if (typeof value === "string") return value;
|
|
14325
|
+
throw entryTypeError(value, "a string", entryMember);
|
|
14326
|
+
}
|
|
14327
|
+
function requireRecord(value, entryMember) {
|
|
14328
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
14329
|
+
throw entryTypeError(value, "an object", entryMember);
|
|
14330
|
+
}
|
|
14331
|
+
return value;
|
|
14332
|
+
}
|
|
14333
|
+
function requireStringArray(value, entryMember) {
|
|
14334
|
+
if (!Array.isArray(value)) {
|
|
14335
|
+
throw entryTypeError(value, "an option id array", entryMember);
|
|
14336
|
+
}
|
|
14337
|
+
for (const optionId of value) {
|
|
14338
|
+
if (typeof optionId !== "string") {
|
|
14339
|
+
throw new Error(
|
|
14340
|
+
`setEntryKey: "${entryMember.name}" entry option ids must be strings; got ${describe(optionId)}.`
|
|
14341
|
+
);
|
|
14342
|
+
}
|
|
14343
|
+
}
|
|
14344
|
+
return value;
|
|
14345
|
+
}
|
|
14346
|
+
function entryTypeError(value, expected, entryMember) {
|
|
14347
|
+
return new Error(
|
|
14348
|
+
`setEntryKey: "${entryMember.name}" entry must be ${expected}; got ${describe(value)}.`
|
|
14349
|
+
);
|
|
14350
|
+
}
|
|
14351
|
+
function describe(value) {
|
|
14352
|
+
if (value === null) return "null";
|
|
14353
|
+
if (Array.isArray(value)) return "an array";
|
|
14354
|
+
return typeof value;
|
|
14355
|
+
}
|
|
14356
|
+
|
|
14130
14357
|
// ../packages/neoscript-runtime/src/neoscript/initializer-dependencies.ts
|
|
14131
14358
|
var PendingInitializerDependency = class extends NSGetterRuntimeError {
|
|
14132
14359
|
constructor(valueId) {
|
|
@@ -14340,7 +14567,7 @@ function resolveOwnerMembersForValues(document2, targetValueIds, additionalRoots
|
|
|
14340
14567
|
}
|
|
14341
14568
|
return;
|
|
14342
14569
|
}
|
|
14343
|
-
if (
|
|
14570
|
+
if (isMemberEntryCollectionBase(member)) {
|
|
14344
14571
|
const entryMemberRecord = membersById.get(member.entryMemberId);
|
|
14345
14572
|
if (entryMemberRecord === void 0) return;
|
|
14346
14573
|
const entryEnv = overlayStamp(ambientEnv, body.genericBindings);
|
|
@@ -17399,9 +17626,8 @@ function exportInitializerCollections(created, writes, ctx) {
|
|
|
17399
17626
|
if (!candidates.has(row.id)) return row;
|
|
17400
17627
|
const member = memberForValueRow(row, ctx);
|
|
17401
17628
|
if (member === null) return row;
|
|
17402
|
-
if (!
|
|
17403
|
-
|
|
17404
|
-
if (isMemberListBase(member) && listKindOf(member) === 1 /* Unordered */) {
|
|
17629
|
+
if (!isMemberWithEntries(member)) return row;
|
|
17630
|
+
if (isMemberEntryCollectionBase(member) && listKindOf(member) === 1 /* Unordered */) {
|
|
17405
17631
|
return { ...row, value: [] };
|
|
17406
17632
|
}
|
|
17407
17633
|
if (!assignedValues.has(row.value)) return row;
|
|
@@ -17528,7 +17754,7 @@ function evaluateNSGetterWithEffects(getter, ctx, argumentValues = [], options =
|
|
|
17528
17754
|
result.value = coerceDecimalOperand(result.value, "return");
|
|
17529
17755
|
}
|
|
17530
17756
|
const initializerResult = options.initializerResult;
|
|
17531
|
-
if (initializerResult !== void 0 && result.value !== null && (
|
|
17757
|
+
if (initializerResult !== void 0 && result.value !== null && isMemberWithEntries(initializerResult.member) && findKnownRowIdByValueReference(result.value, runtimeCtx) === null) {
|
|
17532
17758
|
const createdValues = createdSessionValuesSince(runtimeCtx, creationCheckpoint);
|
|
17533
17759
|
const declarations = /* @__PURE__ */ new Map();
|
|
17534
17760
|
const root = materializeConstructorArgumentValue({
|
|
@@ -17696,6 +17922,7 @@ function getterSubscriptionsFor(ctx) {
|
|
|
17696
17922
|
function withEvaluationRuntime(ctx, writes) {
|
|
17697
17923
|
if (ctx.__runtimeSessionValues !== void 0 && ctx.__executionState !== void 0 && ctx.__valueOverlay !== void 0) {
|
|
17698
17924
|
ctx.__unorderedListProjections ??= createUnorderedListProjectionCache();
|
|
17925
|
+
ctx.__setEntryIndexes ??= /* @__PURE__ */ new WeakMap();
|
|
17699
17926
|
ctx.__runtimeClassOverrides ??= /* @__PURE__ */ new Map();
|
|
17700
17927
|
ctx.__getterSubscriptions ??= getterSubscriptionsFor(ctx);
|
|
17701
17928
|
return ctx;
|
|
@@ -17729,6 +17956,7 @@ function withEvaluationRuntime(ctx, writes) {
|
|
|
17729
17956
|
__sessionStaticBindings: ctx.__sessionStaticBindings ?? staticBindingMap(ctx.sessionStaticBindings),
|
|
17730
17957
|
__valueOverlay: overlay,
|
|
17731
17958
|
__unorderedListProjections: ctx.__unorderedListProjections ?? createUnorderedListProjectionCache(),
|
|
17959
|
+
__setEntryIndexes: ctx.__setEntryIndexes ?? /* @__PURE__ */ new WeakMap(),
|
|
17732
17960
|
__runtimeReferenceRemap: referenceRemap,
|
|
17733
17961
|
__executionState: ctx.__executionState ?? {
|
|
17734
17962
|
writes,
|
|
@@ -17817,7 +18045,7 @@ function ownedConstructorArgumentValues(row, ctx, readRow) {
|
|
|
17817
18045
|
const constructor = evaluatorSchemaIndex(ctx).constructorRecord(constructorId);
|
|
17818
18046
|
if (constructor === void 0 || constructor.classId !== classId) return [];
|
|
17819
18047
|
if (!constructor.argumentTypes.some(
|
|
17820
|
-
(typeInfo) => typeInfo.type === 7 /* Class */ || typeInfo.type === 22 /* Interface */ || typeInfo.type === 6 /* List */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 21 /* Generic */
|
|
18048
|
+
(typeInfo) => typeInfo.type === 7 /* Class */ || typeInfo.type === 22 /* Interface */ || typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 21 /* Generic */
|
|
17821
18049
|
))
|
|
17822
18050
|
return [];
|
|
17823
18051
|
let genericEnv = /* @__PURE__ */ new Map();
|
|
@@ -17990,7 +18218,7 @@ function finalizeConstructorAllocations(ctx, returnValue, ownsInvocationState, r
|
|
|
17990
18218
|
if (groupByRowId.has(argumentId)) scanOwnedRow(argumentId);
|
|
17991
18219
|
const argumentRow = rowForCleanup(argumentId);
|
|
17992
18220
|
if (argumentRow === null) return;
|
|
17993
|
-
if (typeInfo.type === 6 /* List */) {
|
|
18221
|
+
if (typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */) {
|
|
17994
18222
|
if (Array.isArray(argumentRow.value)) {
|
|
17995
18223
|
for (const childId of argumentRow.value) {
|
|
17996
18224
|
if (typeof childId === "string") {
|
|
@@ -18061,7 +18289,7 @@ function finalizeConstructorAllocations(ctx, returnValue, ownsInvocationState, r
|
|
|
18061
18289
|
}
|
|
18062
18290
|
return;
|
|
18063
18291
|
}
|
|
18064
|
-
if (member !== null &&
|
|
18292
|
+
if (member !== null && isMemberEntryCollectionBase(member)) {
|
|
18065
18293
|
const entryMember = evalMemberById(ctx.vm, member.entryMemberId);
|
|
18066
18294
|
if (listKindOf(member) === 1 /* Unordered */) {
|
|
18067
18295
|
ctx.onUnattributableValueRead?.(containerEntriesRead(row.id));
|
|
@@ -18100,7 +18328,7 @@ function finalizeConstructorAllocations(ctx, returnValue, ownsInvocationState, r
|
|
|
18100
18328
|
scannedReturnReferences.add(value);
|
|
18101
18329
|
}
|
|
18102
18330
|
if (typeInfo === void 0) return;
|
|
18103
|
-
if (typeInfo.type === 6 /* List */ && Array.isArray(value)) {
|
|
18331
|
+
if ((typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */) && Array.isArray(value)) {
|
|
18104
18332
|
for (const entry of value) {
|
|
18105
18333
|
scanReturnedValue(entry, typeInfo.entryTypeInfo);
|
|
18106
18334
|
}
|
|
@@ -18882,7 +19110,7 @@ function evalInstructions(instructions, scope, ctx, options) {
|
|
|
18882
19110
|
collectionValueId: member.collectionValueId
|
|
18883
19111
|
};
|
|
18884
19112
|
}
|
|
18885
|
-
const assignedReferenceValueId = targetTypeInfo.type === 7 /* Class */ || targetTypeInfo.type === 6 /* List */ || targetTypeInfo.type === 5 /* Dictionary */ ? findKnownRowIdByValueReference(value, ctx) : null;
|
|
19113
|
+
const assignedReferenceValueId = targetTypeInfo.type === 7 /* Class */ || targetTypeInfo.type === 6 /* List */ || targetTypeInfo.type === 28 /* Set */ || targetTypeInfo.type === 5 /* Dictionary */ ? findKnownRowIdByValueReference(value, ctx) : null;
|
|
18886
19114
|
if (!bindOmittedConstantSlot(destination, member, value, ctx)) {
|
|
18887
19115
|
applyOverlayAssignment(
|
|
18888
19116
|
ins.target.pointer,
|
|
@@ -18893,7 +19121,7 @@ function evalInstructions(instructions, scope, ctx, options) {
|
|
|
18893
19121
|
destination
|
|
18894
19122
|
);
|
|
18895
19123
|
}
|
|
18896
|
-
const unorderedReplacement = assignedReferenceValueId === null && member !== null &&
|
|
19124
|
+
const unorderedReplacement = assignedReferenceValueId === null && member !== null && isMemberEntryCollectionBase(member) && listKindOf(member) === 1 /* Unordered */ && Array.isArray(value) ? unorderedReplacementProjection(
|
|
18897
19125
|
ins.target.pointer,
|
|
18898
19126
|
destination,
|
|
18899
19127
|
scope,
|
|
@@ -18903,7 +19131,7 @@ function evalInstructions(instructions, scope, ctx, options) {
|
|
|
18903
19131
|
kind: "assign",
|
|
18904
19132
|
target: targetTypeInfo === ins.target.typeInfo ? ins.target : { ...ins.target, typeInfo: targetTypeInfo },
|
|
18905
19133
|
value: unorderedReplacement ?? value,
|
|
18906
|
-
...targetTypeInfo.type === 7 /* Class */ || targetTypeInfo.type === 6 /* List */ || targetTypeInfo.type === 5 /* Dictionary */ ? {
|
|
19134
|
+
...targetTypeInfo.type === 7 /* Class */ || targetTypeInfo.type === 6 /* List */ || targetTypeInfo.type === 28 /* Set */ || targetTypeInfo.type === 5 /* Dictionary */ ? {
|
|
18907
19135
|
valueId: value === null || value === void 0 ? void 0 : assignedReferenceValueId ?? void 0
|
|
18908
19136
|
} : {},
|
|
18909
19137
|
...resolvedDestinationFieldsForAssign(
|
|
@@ -19193,7 +19421,7 @@ function resolveNeoScriptChangeListenerSlot(ownerId, memberId, ctx) {
|
|
|
19193
19421
|
return null;
|
|
19194
19422
|
if (resolved.kind === 26 /* NSAction */ || resolved.kind === 25 /* NSDelegate */)
|
|
19195
19423
|
return null;
|
|
19196
|
-
const needsGenericEnv = resolved.kind === 21 /* Generic */ || resolved.kind === 7 /* Class */ || resolved.kind === 6 /* List */ || resolved.kind === 5 /* Dictionary */ || resolved.kind === 9 /* Lookup */ || resolved.kind === 27 /* Variant */;
|
|
19424
|
+
const needsGenericEnv = resolved.kind === 21 /* Generic */ || resolved.kind === 7 /* Class */ || resolved.kind === 6 /* List */ || resolved.kind === 28 /* Set */ || resolved.kind === 5 /* Dictionary */ || resolved.kind === 9 /* Lookup */ || resolved.kind === 27 /* Variant */;
|
|
19197
19425
|
const env = needsGenericEnv ? runtimeGenericEnvForValueRow(owner, ctx, /* @__PURE__ */ new Set()) : /* @__PURE__ */ new Map();
|
|
19198
19426
|
const member = substituteMember(
|
|
19199
19427
|
raw,
|
|
@@ -19565,7 +19793,7 @@ function applyOverlayAssignment(target, targetTypeInfo, value, scope, ctx, desti
|
|
|
19565
19793
|
const receiver = destination === void 0 ? evalPointer(target.keyOf.pointer, scope, ctx) : destination.receiver;
|
|
19566
19794
|
const key = destination === void 0 ? evalPointer(target.keyOf.key, scope, ctx) : destination.key;
|
|
19567
19795
|
assertStoredReplayMutableValue(receiver, ctx, "assignment target", key);
|
|
19568
|
-
const referenceValueId = targetTypeInfo.type === 7 /* Class */ || targetTypeInfo.type === 6 /* List */ || targetTypeInfo.type === 5 /* Dictionary */ ? findKnownRowIdByValueReference(value, ctx) : null;
|
|
19796
|
+
const referenceValueId = targetTypeInfo.type === 7 /* Class */ || targetTypeInfo.type === 6 /* List */ || targetTypeInfo.type === 28 /* Set */ || targetTypeInfo.type === 5 /* Dictionary */ ? findKnownRowIdByValueReference(value, ctx) : null;
|
|
19569
19797
|
if (Array.isArray(receiver)) {
|
|
19570
19798
|
const index = numberArg(key, "List assignment index");
|
|
19571
19799
|
if (referenceValueId !== null) {
|
|
@@ -19670,7 +19898,7 @@ function applyOverlayStaticAssignment(memberId, value, ctx) {
|
|
|
19670
19898
|
}
|
|
19671
19899
|
const currentId = staticBindingTargetId(member, ctx);
|
|
19672
19900
|
const resolved = resolveMember(member, ctx.vm.members);
|
|
19673
|
-
const referenceAssignment = isMemberClassBase(resolved) ||
|
|
19901
|
+
const referenceAssignment = isMemberClassBase(resolved) || isMemberWithEntries(resolved);
|
|
19674
19902
|
const trackedId = findKnownRowIdByValueReference(value, ctx);
|
|
19675
19903
|
if (referenceAssignment && trackedId !== null) {
|
|
19676
19904
|
assertOwnedValueAttachable(
|
|
@@ -19755,8 +19983,7 @@ function bindOmittedConstantSlot(destination, member, value, ctx) {
|
|
|
19755
19983
|
if (construction === void 0) return false;
|
|
19756
19984
|
const key = String(destination.key);
|
|
19757
19985
|
if (Object.prototype.hasOwnProperty.call(receiver, key)) return false;
|
|
19758
|
-
if (isMemberClassBase(member) ||
|
|
19759
|
-
return false;
|
|
19986
|
+
if (isMemberClassBase(member) || isMemberWithEntries(member)) return false;
|
|
19760
19987
|
const resolved = resolveMember(member, ctx.vm.members);
|
|
19761
19988
|
const decision = constantMemberDecision(
|
|
19762
19989
|
constructorDefaultValueDocument(ctx, member),
|
|
@@ -19864,7 +20091,7 @@ function resolvedDestinationFieldsForAssign(target, scope, ctx, destination) {
|
|
|
19864
20091
|
receiver: container,
|
|
19865
20092
|
key
|
|
19866
20093
|
});
|
|
19867
|
-
const assignsUnorderedList = targetMember !== null &&
|
|
20094
|
+
const assignsUnorderedList = targetMember !== null && isMemberEntryCollectionBase(targetMember) && listKindOf(targetMember) === 1 /* Unordered */;
|
|
19868
20095
|
return {
|
|
19869
20096
|
resolvedDestination: {
|
|
19870
20097
|
containerValueId,
|
|
@@ -20011,7 +20238,13 @@ function evalCollectionMutationInstruction(ins, scope, ctx, options) {
|
|
|
20011
20238
|
);
|
|
20012
20239
|
}
|
|
20013
20240
|
const args = ins.args.map((arg) => evalPointer(arg, scope, ctx));
|
|
20014
|
-
const
|
|
20241
|
+
const setEntryMember = mutatesLocalVariable ? null : storedSetEntryMember(targetValue, ctx);
|
|
20242
|
+
const isLookupSet = setEntryMember === null && ins.target.typeInfo.type === 9 /* Lookup */;
|
|
20243
|
+
const setMatch = setEntryMember !== null && Array.isArray(targetValue) && (ins.mutation === "Add" /* Add */ || ins.mutation === "Remove" /* Remove */) ? findStoredSetEntry(targetValue, args[0], setEntryMember, ctx) : null;
|
|
20244
|
+
if (ins.mutation === "Add" /* Add */ && setMatch !== null) return;
|
|
20245
|
+
if (ins.mutation === "Remove" /* Remove */ && setEntryMember !== null && setMatch === null) {
|
|
20246
|
+
return;
|
|
20247
|
+
}
|
|
20015
20248
|
if (ins.mutation === "Add" /* Add */ || ins.mutation === "Insert" /* Insert */) {
|
|
20016
20249
|
consumeBudget(
|
|
20017
20250
|
ctx,
|
|
@@ -20039,6 +20272,7 @@ function evalCollectionMutationInstruction(ins, scope, ctx, options) {
|
|
|
20039
20272
|
removedIndex2,
|
|
20040
20273
|
ctx
|
|
20041
20274
|
);
|
|
20275
|
+
if (Array.isArray(targetValue)) ctx.__setEntryIndexes?.delete(targetValue);
|
|
20042
20276
|
invalidateEvaluatorIndexes(ctx, targetValue);
|
|
20043
20277
|
scope.setLocal(variablePointer.variableId, targetValue);
|
|
20044
20278
|
return;
|
|
@@ -20046,7 +20280,15 @@ function evalCollectionMutationInstruction(ins, scope, ctx, options) {
|
|
|
20046
20280
|
validateCollectionMutation(targetValue, ins.mutation, args);
|
|
20047
20281
|
const overlayArgs = [...args];
|
|
20048
20282
|
if ((ins.mutation === "Add" /* Add */ || ins.mutation === "Remove" /* Remove */) && Array.isArray(targetValue)) {
|
|
20049
|
-
|
|
20283
|
+
if (setMatch !== null) overlayArgs[0] = setMatch.entry;
|
|
20284
|
+
else if (isLookupSet)
|
|
20285
|
+
overlayArgs[0] = lookupSetSelectionValue(
|
|
20286
|
+
args[0],
|
|
20287
|
+
ins.target.typeInfo,
|
|
20288
|
+
ctx
|
|
20289
|
+
);
|
|
20290
|
+
else
|
|
20291
|
+
overlayArgs[0] = findKnownRowIdByValueReference(args[0], ctx) ?? args[0];
|
|
20050
20292
|
} else if (ins.mutation === "Insert" /* Insert */) {
|
|
20051
20293
|
overlayArgs[1] = findKnownRowIdByValueReference(args[1], ctx) ?? args[1];
|
|
20052
20294
|
} else if (ins.mutation === "Add" /* Add */ && !Array.isArray(targetValue)) {
|
|
@@ -20107,6 +20349,15 @@ function evalCollectionMutationInstruction(ins, scope, ctx, options) {
|
|
|
20107
20349
|
ctx
|
|
20108
20350
|
);
|
|
20109
20351
|
}
|
|
20352
|
+
if (Array.isArray(targetValue)) {
|
|
20353
|
+
syncStoredSetEntries(
|
|
20354
|
+
targetValue,
|
|
20355
|
+
ins.mutation,
|
|
20356
|
+
setMatch,
|
|
20357
|
+
setEntryMember,
|
|
20358
|
+
ctx
|
|
20359
|
+
);
|
|
20360
|
+
}
|
|
20110
20361
|
invalidateEvaluatorIndexes(ctx, targetValue);
|
|
20111
20362
|
switch (ins.mutation) {
|
|
20112
20363
|
case "Insert" /* Insert */:
|
|
@@ -20148,7 +20399,7 @@ function evalCollectionMutationInstruction(ins, scope, ctx, options) {
|
|
|
20148
20399
|
target: ins.target,
|
|
20149
20400
|
value: isLookupSet ? overlayArgs[0] : args[0],
|
|
20150
20401
|
...!isLookupSet ? {
|
|
20151
|
-
valueId: findKnownRowIdByValueReference(args[0], ctx) ?? void 0
|
|
20402
|
+
valueId: setMatch?.valueId ?? findKnownRowIdByValueReference(args[0], ctx) ?? void 0
|
|
20152
20403
|
} : {},
|
|
20153
20404
|
...resolvedDestinationFieldsForContainer(targetValue, ctx)
|
|
20154
20405
|
});
|
|
@@ -20178,6 +20429,78 @@ function evalCollectionMutationInstruction(ins, scope, ctx, options) {
|
|
|
20178
20429
|
return;
|
|
20179
20430
|
}
|
|
20180
20431
|
}
|
|
20432
|
+
function storedSetEntryMember(collection, ctx) {
|
|
20433
|
+
const containerId = findKnownRowIdByValueReference(collection, ctx);
|
|
20434
|
+
if (containerId === null) return null;
|
|
20435
|
+
const container = evalValueById(
|
|
20436
|
+
ctx,
|
|
20437
|
+
containerId,
|
|
20438
|
+
ctx.__runtimeSessionValues,
|
|
20439
|
+
ctx.__valueOverlay
|
|
20440
|
+
);
|
|
20441
|
+
if (container === null) return null;
|
|
20442
|
+
const member = memberForValueRow(container, ctx);
|
|
20443
|
+
if (member === null || member.kind !== 28 /* Set */) return null;
|
|
20444
|
+
const resolved = resolveMember(member, ctx.vm.members);
|
|
20445
|
+
if (!isMemberSetBase(resolved)) {
|
|
20446
|
+
throw new NSGetterRuntimeError(
|
|
20447
|
+
`Set member '${member.name}' is not a valid Set record.`
|
|
20448
|
+
);
|
|
20449
|
+
}
|
|
20450
|
+
const entry = evalMemberById(ctx.vm, resolved.entryMemberId);
|
|
20451
|
+
if (entry === null) {
|
|
20452
|
+
throw new NSGetterRuntimeError(
|
|
20453
|
+
`Set member '${member.name}' references missing entry member '${resolved.entryMemberId}'.`
|
|
20454
|
+
);
|
|
20455
|
+
}
|
|
20456
|
+
return substituteMember(
|
|
20457
|
+
entry,
|
|
20458
|
+
runtimeGenericEnvForValueRow(container, ctx),
|
|
20459
|
+
ctx.vm.members
|
|
20460
|
+
);
|
|
20461
|
+
}
|
|
20462
|
+
function storedSetEntryMatch(raw, entryMember, ctx) {
|
|
20463
|
+
const byIdentity = entryMember.kind === 7 /* Class */;
|
|
20464
|
+
const row = byIdentity || typeof raw !== "string" ? null : evalValueById(ctx, raw, ctx.__runtimeSessionValues, ctx.__valueOverlay);
|
|
20465
|
+
const valueId = byIdentity && typeof raw === "string" ? raw : row?.id ?? null;
|
|
20466
|
+
const entry = row === null ? { id: "", value: raw } : { id: row.id, value: row.value };
|
|
20467
|
+
const key = byIdentity ? valueId ?? referenceIdOf(raw, ctx) : setEntryKey(entryMember, entry);
|
|
20468
|
+
return key === null ? null : { key, entry: raw, valueId };
|
|
20469
|
+
}
|
|
20470
|
+
function storedSetEntries(set, entryMember, ctx) {
|
|
20471
|
+
const indexes3 = ctx.__setEntryIndexes ??= /* @__PURE__ */ new WeakMap();
|
|
20472
|
+
const existing = indexes3.get(set);
|
|
20473
|
+
if (existing !== void 0) return existing;
|
|
20474
|
+
consumeBudget(ctx, "collectionVisits", set.length, "collection visit");
|
|
20475
|
+
const entries = /* @__PURE__ */ new Map();
|
|
20476
|
+
for (const raw of set) {
|
|
20477
|
+
const match = storedSetEntryMatch(raw, entryMember, ctx);
|
|
20478
|
+
if (match !== null && !entries.has(match.key)) {
|
|
20479
|
+
entries.set(match.key, match);
|
|
20480
|
+
}
|
|
20481
|
+
}
|
|
20482
|
+
indexes3.set(set, entries);
|
|
20483
|
+
return entries;
|
|
20484
|
+
}
|
|
20485
|
+
function syncStoredSetEntries(set, mutation, removed, entryMember, ctx) {
|
|
20486
|
+
const entries = ctx.__setEntryIndexes?.get(set);
|
|
20487
|
+
if (entries === void 0) return;
|
|
20488
|
+
if (entryMember !== null && mutation === "Add" /* Add */) {
|
|
20489
|
+
const added = storedSetEntryMatch(set[set.length - 1], entryMember, ctx);
|
|
20490
|
+
if (added !== null) entries.set(added.key, added);
|
|
20491
|
+
return;
|
|
20492
|
+
}
|
|
20493
|
+
if (removed !== null && mutation === "Remove" /* Remove */) {
|
|
20494
|
+
entries.delete(removed.key);
|
|
20495
|
+
return;
|
|
20496
|
+
}
|
|
20497
|
+
ctx.__setEntryIndexes?.delete(set);
|
|
20498
|
+
}
|
|
20499
|
+
function findStoredSetEntry(set, value, entryMember, ctx) {
|
|
20500
|
+
const key = entryMember.kind === 7 /* Class */ ? referenceIdOf(value, ctx) : setEntryKey(entryMember, { id: "", value });
|
|
20501
|
+
if (key === null) return null;
|
|
20502
|
+
return storedSetEntries(set, entryMember, ctx).get(key) ?? null;
|
|
20503
|
+
}
|
|
20181
20504
|
function applyLocalCollectionMutation(targetValue, mutation, args, ctx, unique = false, resolveJoinedRemovalEntries = false, reference = false) {
|
|
20182
20505
|
validateCollectionMutation(targetValue, mutation, args);
|
|
20183
20506
|
switch (mutation) {
|
|
@@ -21085,17 +21408,17 @@ function invokeDelegateValue(value, args, ctx, callSiteId, ownerReceiver, result
|
|
|
21085
21408
|
state.delegateStack.pop();
|
|
21086
21409
|
}
|
|
21087
21410
|
}
|
|
21088
|
-
function actionListenersOf(value,
|
|
21411
|
+
function actionListenersOf(value, describe2) {
|
|
21089
21412
|
if (value === null || value === void 0) return [];
|
|
21090
21413
|
if (!isNSActionValue(value)) {
|
|
21091
21414
|
throw new NSGetterRuntimeError(
|
|
21092
|
-
`NeoAction ${
|
|
21415
|
+
`NeoAction ${describe2()} holds a value that is not a valid listener set \u2014 every entry must be a distinct member target.`
|
|
21093
21416
|
);
|
|
21094
21417
|
}
|
|
21095
21418
|
return value.listeners;
|
|
21096
21419
|
}
|
|
21097
21420
|
function storedActionListeners(member, receiver, ctx) {
|
|
21098
|
-
const
|
|
21421
|
+
const describe2 = () => `target '${member.name}'`;
|
|
21099
21422
|
if (receiver !== null) {
|
|
21100
21423
|
const schemaKey = cachedSchemaKeyForMember(member.id, ctx);
|
|
21101
21424
|
if (schemaKey === null) {
|
|
@@ -21115,11 +21438,11 @@ function storedActionListeners(member, receiver, ctx) {
|
|
|
21115
21438
|
member,
|
|
21116
21439
|
ctx
|
|
21117
21440
|
),
|
|
21118
|
-
|
|
21441
|
+
describe2
|
|
21119
21442
|
);
|
|
21120
21443
|
}
|
|
21121
21444
|
if (isStaticMember(member) === true) {
|
|
21122
|
-
return actionListenersOf(evalStaticMember(member.id, ctx),
|
|
21445
|
+
return actionListenersOf(evalStaticMember(member.id, ctx), describe2);
|
|
21123
21446
|
}
|
|
21124
21447
|
if (member.defaultValue === void 0 || member.defaultValue === null) {
|
|
21125
21448
|
return [];
|
|
@@ -21129,7 +21452,7 @@ function storedActionListeners(member, receiver, ctx) {
|
|
|
21129
21452
|
`NeoAction target '${member.name}' has an unevaluated initializer instead of a declaration default listener set.`
|
|
21130
21453
|
);
|
|
21131
21454
|
}
|
|
21132
|
-
return actionListenersOf(member.defaultValue.value,
|
|
21455
|
+
return actionListenersOf(member.defaultValue.value, describe2);
|
|
21133
21456
|
}
|
|
21134
21457
|
function listenerReceiverOnOwner(memberId, ownerReceiver, ctx) {
|
|
21135
21458
|
const schemaKey = cachedSchemaKeyForMember(memberId, ctx);
|
|
@@ -21337,7 +21660,7 @@ function typeInfoContainsGeneric(typeInfo, visited = /* @__PURE__ */ new Set())
|
|
|
21337
21660
|
const nextVisited = new Set(visited);
|
|
21338
21661
|
nextVisited.add(typeInfo);
|
|
21339
21662
|
if (typeInfo.type === 21 /* Generic */) return true;
|
|
21340
|
-
if (typeInfo.type === 6 /* List */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
21663
|
+
if (typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
21341
21664
|
return typeInfoContainsGeneric(typeInfo.entryTypeInfo, nextVisited);
|
|
21342
21665
|
}
|
|
21343
21666
|
if (typeInfo.type !== 7 /* Class */) return false;
|
|
@@ -21408,7 +21731,7 @@ function genericParametersConcretelyBound(typeInfo, env) {
|
|
|
21408
21731
|
if (typeInfo.type === 21 /* Generic */) {
|
|
21409
21732
|
return env.get(typeInfo.genericParamId)?.kind === "member";
|
|
21410
21733
|
}
|
|
21411
|
-
if (typeInfo.type === 6 /* List */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
21734
|
+
if (typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
21412
21735
|
return genericParametersConcretelyBound(typeInfo.entryTypeInfo, env);
|
|
21413
21736
|
}
|
|
21414
21737
|
if (typeInfo.type === 25 /* NSDelegate */) {
|
|
@@ -21439,7 +21762,7 @@ function substituteRuntimeTypeInfo(typeInfo, env, ctx) {
|
|
|
21439
21762
|
const boundType = runtimeTypeInfoForMember(member, env, ctx, /* @__PURE__ */ new Set());
|
|
21440
21763
|
return { ...boundType, required: boundType.required && typeInfo.required };
|
|
21441
21764
|
}
|
|
21442
|
-
if (typeInfo.type === 6 /* List */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
21765
|
+
if (typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
21443
21766
|
return {
|
|
21444
21767
|
...typeInfo,
|
|
21445
21768
|
entryTypeInfo: substituteRuntimeTypeInfo(
|
|
@@ -21539,7 +21862,7 @@ function runtimeTypeInfoForMember(rawMember, env, ctx, seen) {
|
|
|
21539
21862
|
enumId: member.enumId
|
|
21540
21863
|
};
|
|
21541
21864
|
}
|
|
21542
|
-
if (isMemberList(member) || isMemberDictionary(member)) {
|
|
21865
|
+
if (isMemberList(member) || isMemberSet(member) || isMemberDictionary(member)) {
|
|
21543
21866
|
const entryMember = evalMemberById(ctx.vm, member.entryMemberId);
|
|
21544
21867
|
if (entryMember === null) {
|
|
21545
21868
|
throw new NSGetterRuntimeError(
|
|
@@ -21579,7 +21902,7 @@ function runtimeTypeInfoForMember(rawMember, env, ctx, seen) {
|
|
|
21579
21902
|
ctx,
|
|
21580
21903
|
new Set(seen)
|
|
21581
21904
|
);
|
|
21582
|
-
if (collectionTypeInfo.type !== 6 /* List */ && collectionTypeInfo.type !== 5 /* Dictionary */) {
|
|
21905
|
+
if (collectionTypeInfo.type !== 6 /* List */ && collectionTypeInfo.type !== 28 /* Set */ && collectionTypeInfo.type !== 5 /* Dictionary */) {
|
|
21583
21906
|
throw new NSGetterRuntimeError(
|
|
21584
21907
|
`Lookup binding '${member.id}' does not target a collection.`
|
|
21585
21908
|
);
|
|
@@ -21664,7 +21987,7 @@ function formatDebugValue(value, type, ctx) {
|
|
|
21664
21987
|
);
|
|
21665
21988
|
if (type.type === 9 /* Lookup */ && type.entryTypeInfo.type === 8 /* Enum */)
|
|
21666
21989
|
type = type.entryTypeInfo;
|
|
21667
|
-
if (value !== null && value !== void 0 && (type.type === 7 /* Class */ || type.type === 6 /* List */ || type.type === 5 /* Dictionary */ || type.type === 9 /* Lookup */)) {
|
|
21990
|
+
if (value !== null && value !== void 0 && (type.type === 7 /* Class */ || type.type === 6 /* List */ || type.type === 28 /* Set */ || type.type === 5 /* Dictionary */ || type.type === 9 /* Lookup */)) {
|
|
21668
21991
|
return formatNeoScriptDebugValue(
|
|
21669
21992
|
formatForInterp(value, type, ctx),
|
|
21670
21993
|
3 /* String */
|
|
@@ -21706,13 +22029,14 @@ function formatForInterp(value, sourceType, ctx) {
|
|
|
21706
22029
|
const rowId = findRowIdByValueReference(value, ctx);
|
|
21707
22030
|
return `(Class<${typeName}>, Value<${rowId}>)`;
|
|
21708
22031
|
}
|
|
21709
|
-
case 6 /* List */:
|
|
22032
|
+
case 6 /* List */:
|
|
22033
|
+
case 28 /* Set */: {
|
|
21710
22034
|
const entryName = describeRuntimeType(
|
|
21711
22035
|
sourceType.entryTypeInfo,
|
|
21712
22036
|
ctx
|
|
21713
22037
|
);
|
|
21714
22038
|
const rowId = findRowIdByValueReference(value, ctx);
|
|
21715
|
-
return `(
|
|
22039
|
+
return `(${MemberKind[sourceType.type]}<${entryName}>, Value<${rowId}>)`;
|
|
21716
22040
|
}
|
|
21717
22041
|
case 5 /* Dictionary */: {
|
|
21718
22042
|
const entryName = describeRuntimeType(
|
|
@@ -21774,6 +22098,8 @@ function describeRuntimeType(t, ctx) {
|
|
|
21774
22098
|
}
|
|
21775
22099
|
case 6 /* List */:
|
|
21776
22100
|
return `List<${describeRuntimeType(t.entryTypeInfo, ctx)}>`;
|
|
22101
|
+
case 28 /* Set */:
|
|
22102
|
+
return `Set<${describeRuntimeType(t.entryTypeInfo, ctx)}>`;
|
|
21777
22103
|
case 5 /* Dictionary */:
|
|
21778
22104
|
return `Dictionary<${describeRuntimeType(t.entryTypeInfo, ctx)}>`;
|
|
21779
22105
|
case 9 /* Lookup */:
|
|
@@ -21873,6 +22199,7 @@ function runtimeTypeCheck(value, checkType, ctx, seenCollections = /* @__PURE__
|
|
|
21873
22199
|
case 18 /* DialogueLookup */:
|
|
21874
22200
|
return Array.isArray(value) && value.length === 1 && typeof value[0] === "string";
|
|
21875
22201
|
case 6 /* List */:
|
|
22202
|
+
case 28 /* Set */:
|
|
21876
22203
|
case 9 /* Lookup */: {
|
|
21877
22204
|
if (!Array.isArray(value)) return false;
|
|
21878
22205
|
if (seenCollections.has(value)) return false;
|
|
@@ -22190,7 +22517,7 @@ function readDeclarationDefault(member, ctx) {
|
|
|
22190
22517
|
if (member?.defaultValue === void 0 || member.defaultValue === null) {
|
|
22191
22518
|
return { matched: false };
|
|
22192
22519
|
}
|
|
22193
|
-
if (isInitValueContent(member.defaultValue) || isMemberClassBase(member) ||
|
|
22520
|
+
if (isInitValueContent(member.defaultValue) || isMemberClassBase(member) || isMemberWithEntries(member)) {
|
|
22194
22521
|
const session = ctx.__runtimeSessionValues;
|
|
22195
22522
|
let shared;
|
|
22196
22523
|
if (session !== void 0) {
|
|
@@ -22319,7 +22646,7 @@ function resolveValueIfId(at2, ctx) {
|
|
|
22319
22646
|
);
|
|
22320
22647
|
if (!row) return at2;
|
|
22321
22648
|
const member = memberForValueRow(row, ctx);
|
|
22322
|
-
if (member !== null &&
|
|
22649
|
+
if (member !== null && isMemberEntryCollectionBase(member) && listKindOf(member) === 1 /* Unordered */ && Array.isArray(row.value)) {
|
|
22323
22650
|
return evaluatorUnorderedListEntryIds(row.id, ctx);
|
|
22324
22651
|
}
|
|
22325
22652
|
const value = member === null ? resolveLocalizedRowValue(row, ctx) : resolveLocalizedRowValueForMember(row, member, ctx);
|
|
@@ -22336,7 +22663,7 @@ function resolveValueIfIdForMember(at2, member, ctx) {
|
|
|
22336
22663
|
ctx.__valueOverlay
|
|
22337
22664
|
);
|
|
22338
22665
|
if (!row) return at2;
|
|
22339
|
-
if (
|
|
22666
|
+
if (isMemberEntryCollectionBase(member) && listKindOf(member) === 1 /* Unordered */ && Array.isArray(row.value)) {
|
|
22340
22667
|
return evaluatorUnorderedListEntryIds(row.id, ctx);
|
|
22341
22668
|
}
|
|
22342
22669
|
const value = resolveLocalizedRowValueForMember(row, member, ctx);
|
|
@@ -22420,7 +22747,7 @@ function invalidateUnorderedListProjection(containerValueId, ctx) {
|
|
|
22420
22747
|
function updateUnorderedListProjectionAfterAssignment(row, value, ctx) {
|
|
22421
22748
|
invalidateUnorderedListProjection(row.id, ctx);
|
|
22422
22749
|
const member = memberForValueRow(row, ctx);
|
|
22423
|
-
if (member === null || !
|
|
22750
|
+
if (member === null || !isMemberEntryCollectionBase(member) || listKindOf(member) !== 1 /* Unordered */ || !Array.isArray(value)) {
|
|
22424
22751
|
return;
|
|
22425
22752
|
}
|
|
22426
22753
|
const referenceIndexes = ctx.__unorderedListProjections?.referenceEntryIndexesByArray.get(value);
|
|
@@ -22547,10 +22874,7 @@ function resolveMemberForValueRow(row, ctx, visited) {
|
|
|
22547
22874
|
ctx,
|
|
22548
22875
|
new Set(visited)
|
|
22549
22876
|
);
|
|
22550
|
-
if (parentMember !== null &&
|
|
22551
|
-
return evalMemberById(ctx.vm, parentMember.entryMemberId);
|
|
22552
|
-
}
|
|
22553
|
-
if (parentMember !== null && isMemberDictionary(parentMember)) {
|
|
22877
|
+
if (parentMember !== null && isMemberWithEntries(parentMember)) {
|
|
22554
22878
|
return evalMemberById(ctx.vm, parentMember.entryMemberId);
|
|
22555
22879
|
}
|
|
22556
22880
|
const classId = parent.classId ?? (parentMember !== null && isMemberClass(parentMember) ? parentMember.classId : void 0);
|
|
@@ -23339,16 +23663,19 @@ function evalDeclaredListIndex(info, scope, ctx) {
|
|
|
23339
23663
|
const collection = evalPointer(info.collectionPointer, scope, ctx);
|
|
23340
23664
|
if (!Array.isArray(collection)) {
|
|
23341
23665
|
throw new NSGetterRuntimeError(
|
|
23342
|
-
`List index '${info.schemaKey}' requires a present List value.`
|
|
23666
|
+
`List index '${info.schemaKey}' requires a present List or Set value.`
|
|
23343
23667
|
);
|
|
23344
23668
|
}
|
|
23345
23669
|
const rawMember = evalMemberById(ctx.vm, info.listMemberId);
|
|
23346
|
-
if (!rawMember || !
|
|
23670
|
+
if (!rawMember || !isMemberEntryCollectionBase(rawMember)) {
|
|
23347
23671
|
throw new NSGetterRuntimeError(
|
|
23348
|
-
`List index contract references missing List member '${info.listMemberId}'.`
|
|
23672
|
+
`List index contract references missing List or Set member '${info.listMemberId}'.`
|
|
23349
23673
|
);
|
|
23350
23674
|
}
|
|
23351
|
-
const member = resolveMember(
|
|
23675
|
+
const member = resolveMember(
|
|
23676
|
+
rawMember,
|
|
23677
|
+
ctx.vm.members
|
|
23678
|
+
);
|
|
23352
23679
|
const definition = member.indexes?.find(
|
|
23353
23680
|
(candidate) => candidate.schemaKey === info.schemaKey
|
|
23354
23681
|
);
|
|
@@ -23763,8 +24090,20 @@ function evalCollectionQuery(info, scope, ctx) {
|
|
|
23763
24090
|
}
|
|
23764
24091
|
let visited = 0;
|
|
23765
24092
|
let skipping = true;
|
|
24093
|
+
const seenSetKeys = /* @__PURE__ */ new Set();
|
|
23766
24094
|
iterateCollection(collection, ctx, (entry, key, valueId) => {
|
|
23767
24095
|
switch (info.op) {
|
|
24096
|
+
case "ToSet": {
|
|
24097
|
+
const setKey = toSetEntryKey(
|
|
24098
|
+
entry,
|
|
24099
|
+
valueId,
|
|
24100
|
+
info.reference === true,
|
|
24101
|
+
ctx
|
|
24102
|
+
);
|
|
24103
|
+
if (seenSetKeys.has(setKey)) return 0 /* Continue */;
|
|
24104
|
+
seenSetKeys.add(setKey);
|
|
24105
|
+
return append2(entry, key, valueId);
|
|
24106
|
+
}
|
|
23768
24107
|
case "SelectMany": {
|
|
23769
24108
|
const inner = invoke(entry, key, valueId);
|
|
23770
24109
|
isListCollection(inner);
|
|
@@ -23814,6 +24153,10 @@ function evalCollectionQuery(info, scope, ctx) {
|
|
|
23814
24153
|
}
|
|
23815
24154
|
return finish();
|
|
23816
24155
|
}
|
|
24156
|
+
function toSetEntryKey(entry, valueId, reference, ctx) {
|
|
24157
|
+
if (reference) return valueId ?? referenceIdOf(entry, ctx) ?? entry;
|
|
24158
|
+
return typeof entry === "object" && entry !== null ? canonicalJsonStringify(entry) : entry;
|
|
24159
|
+
}
|
|
23817
24160
|
function compareCollectionKeys(left, right, keyType) {
|
|
23818
24161
|
if (left === null) return right === null ? 0 : -1;
|
|
23819
24162
|
if (right === null) return 1;
|
|
@@ -23944,6 +24287,15 @@ function evalFunction(fn, scope, ctx) {
|
|
|
23944
24287
|
}
|
|
23945
24288
|
return c.includes(target);
|
|
23946
24289
|
}
|
|
24290
|
+
const setEntryMember = storedSetEntryMember(c, ctx);
|
|
24291
|
+
if (setEntryMember !== null) {
|
|
24292
|
+
return findStoredSetEntry(
|
|
24293
|
+
listArg(c, "Set Contains receiver"),
|
|
24294
|
+
target,
|
|
24295
|
+
setEntryMember,
|
|
24296
|
+
ctx
|
|
24297
|
+
) !== null;
|
|
24298
|
+
}
|
|
23947
24299
|
if (fn.info.reference === true) {
|
|
23948
24300
|
return referenceIndexOf(c, target, ctx) !== null;
|
|
23949
24301
|
}
|
|
@@ -24497,7 +24849,7 @@ function constructionGenericSlotsForMember(rawMember, ctx, instanceEnv, visitedM
|
|
|
24497
24849
|
const classArguments2 = member.classArguments ?? {};
|
|
24498
24850
|
return Object.keys(classArguments2).length === 0 ? [] : [{ classId: member.classId, classArguments: classArguments2 }];
|
|
24499
24851
|
}
|
|
24500
|
-
if (!
|
|
24852
|
+
if (!isMemberWithEntries(member)) return [];
|
|
24501
24853
|
const entryMember = evalMemberById(ctx.vm, member.entryMemberId);
|
|
24502
24854
|
if (entryMember === null) return [];
|
|
24503
24855
|
return constructionGenericSlotsForMember(
|
|
@@ -24667,7 +25019,7 @@ function applyConstructorFields(args) {
|
|
|
24667
25019
|
}
|
|
24668
25020
|
const existingId = rootRecord[schemaKey];
|
|
24669
25021
|
const existing = typeof existingId === "string" ? createdById.get(existingId) : void 0;
|
|
24670
|
-
if (existing !== void 0 && isLiteralValueContent(existing) && !isMemberClassBase(member) && !
|
|
25022
|
+
if (existing !== void 0 && isLiteralValueContent(existing) && !isMemberClassBase(member) && !isMemberWithEntries(member)) {
|
|
24671
25023
|
overwriteConstructedLiteral(existing, value, ctx);
|
|
24672
25024
|
continue;
|
|
24673
25025
|
}
|
|
@@ -24700,7 +25052,7 @@ function applyExplicitNullConstructorField(args) {
|
|
|
24700
25052
|
}
|
|
24701
25053
|
const existingId = args.rootRecord[schemaKey];
|
|
24702
25054
|
const existing = typeof existingId === "string" ? args.createdById.get(existingId) : void 0;
|
|
24703
|
-
if (existing !== void 0 && isLiteralValueContent(existing) && !isMemberClassBase(member) && !
|
|
25055
|
+
if (existing !== void 0 && isLiteralValueContent(existing) && !isMemberClassBase(member) && !isMemberWithEntries(member)) {
|
|
24704
25056
|
overwriteConstructedLiteral(existing, null, args.ctx);
|
|
24705
25057
|
return;
|
|
24706
25058
|
}
|
|
@@ -25880,7 +26232,7 @@ function encodeRequiredConstructorArgument(args) {
|
|
|
25880
26232
|
}
|
|
25881
26233
|
return adoptTracked(aggregateId2, "root");
|
|
25882
26234
|
}
|
|
25883
|
-
if (args.typeInfo.type !== 6 /* List */ && args.typeInfo.type !== 5 /* Dictionary */) {
|
|
26235
|
+
if (args.typeInfo.type !== 6 /* List */ && args.typeInfo.type !== 28 /* Set */ && args.typeInfo.type !== 5 /* Dictionary */) {
|
|
25884
26236
|
return cloneConstructorLiteralValue(args.value);
|
|
25885
26237
|
}
|
|
25886
26238
|
if (args.value === null || args.value === void 0) return null;
|
|
@@ -25894,7 +26246,7 @@ function encodeRequiredConstructorArgument(args) {
|
|
|
25894
26246
|
if (genericBindings !== void 0) row2.genericBindings = genericBindings;
|
|
25895
26247
|
return row2;
|
|
25896
26248
|
};
|
|
25897
|
-
const entryMember = settled !== void 0 && (
|
|
26249
|
+
const entryMember = settled !== void 0 && isMemberWithEntries(settled) ? evalMemberById(args.ctx.vm, settled.entryMemberId) ?? void 0 : void 0;
|
|
25898
26250
|
const registerRow = (value, containerId) => {
|
|
25899
26251
|
args.ctx.beforeValueAllocation?.();
|
|
25900
26252
|
const row2 = buildNewValue(args.ctx.vm.project.id, { value });
|
|
@@ -25921,7 +26273,7 @@ function encodeRequiredConstructorArgument(args) {
|
|
|
25921
26273
|
}
|
|
25922
26274
|
return adoptTracked(id, suffix);
|
|
25923
26275
|
}
|
|
25924
|
-
if (entryType.type === 6 /* List */ || entryType.type === 5 /* Dictionary */) {
|
|
26276
|
+
if (entryType.type === 6 /* List */ || entryType.type === 28 /* Set */ || entryType.type === 5 /* Dictionary */) {
|
|
25925
26277
|
const nested = encodeRequiredConstructorArgument({
|
|
25926
26278
|
...args,
|
|
25927
26279
|
value,
|
|
@@ -25938,10 +26290,10 @@ function encodeRequiredConstructorArgument(args) {
|
|
|
25938
26290
|
}
|
|
25939
26291
|
return registerRow(cloneConstructorLiteralValue(value)).id;
|
|
25940
26292
|
};
|
|
25941
|
-
if (collectionType.type === 6 /* List */) {
|
|
26293
|
+
if (collectionType.type === 6 /* List */ || collectionType.type === 28 /* Set */) {
|
|
25942
26294
|
if (!Array.isArray(args.value)) {
|
|
25943
26295
|
throw new NSGetterRuntimeError(
|
|
25944
|
-
`Constructor argument '${args.parameterId}' must be a
|
|
26296
|
+
`Constructor argument '${args.parameterId}' must be a ${MemberKind[collectionType.type]}.`
|
|
25945
26297
|
);
|
|
25946
26298
|
}
|
|
25947
26299
|
const row2 = registerCollectionRow([]);
|
|
@@ -26789,7 +27141,7 @@ function constructDeclaredClassValueWithinFrame(descriptor, record4, info, scope
|
|
|
26789
27141
|
createdValues,
|
|
26790
27142
|
storageKeyDeclarations,
|
|
26791
27143
|
// Only collection rows carry a stamp from the settled member.
|
|
26792
|
-
member: resolvedArgumentType.type === 6 /* List */ || resolvedArgumentType.type === 5 /* Dictionary */ ? settledConstructorParameterMember(
|
|
27144
|
+
member: resolvedArgumentType.type === 6 /* List */ || resolvedArgumentType.type === 28 /* Set */ || resolvedArgumentType.type === 5 /* Dictionary */ ? settledConstructorParameterMember(
|
|
26793
27145
|
classId,
|
|
26794
27146
|
argumentType.name,
|
|
26795
27147
|
record4.id,
|
|
@@ -27028,7 +27380,7 @@ function currentOwnedValueAttachments(valueId, ctx) {
|
|
|
27028
27380
|
}
|
|
27029
27381
|
continue;
|
|
27030
27382
|
}
|
|
27031
|
-
if (member !== null &&
|
|
27383
|
+
if (member !== null && isMemberEntryCollectionBase(member) && Array.isArray(parent.value)) {
|
|
27032
27384
|
for (const [index, childId] of parent.value.entries()) {
|
|
27033
27385
|
if (childId !== valueId) continue;
|
|
27034
27386
|
add({
|
|
@@ -27146,7 +27498,7 @@ function cloneConstructorArgumentGraph(args) {
|
|
|
27146
27498
|
...isLiteralValueContent(source) ? clonedConstructorProvenance(source) : {}
|
|
27147
27499
|
});
|
|
27148
27500
|
if (clonedContainerId !== void 0) clone.containerId = clonedContainerId;
|
|
27149
|
-
if (
|
|
27501
|
+
if (isMemberWithEntries(member)) {
|
|
27150
27502
|
const stamp = computeGenericBindingsStamp(
|
|
27151
27503
|
member,
|
|
27152
27504
|
genericEnv,
|
|
@@ -27250,7 +27602,7 @@ function cloneConstructorArgumentGraph(args) {
|
|
|
27250
27602
|
}
|
|
27251
27603
|
return clone;
|
|
27252
27604
|
}
|
|
27253
|
-
if (
|
|
27605
|
+
if (isMemberEntryCollectionBase(member)) {
|
|
27254
27606
|
if (source.value === null) {
|
|
27255
27607
|
clone.value = null;
|
|
27256
27608
|
return clone;
|
|
@@ -27326,7 +27678,7 @@ function cloneConstructorLiteralValue(value) {
|
|
|
27326
27678
|
}
|
|
27327
27679
|
function materializeConstructorArgumentValue(args) {
|
|
27328
27680
|
const trackedValueId = findKnownRowIdByValueReference(args.value, args.ctx);
|
|
27329
|
-
if (args.value === null && !isRequiredMember(args.member) && (
|
|
27681
|
+
if (args.value === null && !isRequiredMember(args.member) && isMemberWithEntries(args.member)) {
|
|
27330
27682
|
return registerConstructorArgumentRow(args, null);
|
|
27331
27683
|
}
|
|
27332
27684
|
if (isMemberClassBase(args.member)) {
|
|
@@ -27384,7 +27736,7 @@ function materializeConstructorArgumentValue(args) {
|
|
|
27384
27736
|
`Constructor argument for Class field '${args.member.name}' has no backing value row.`
|
|
27385
27737
|
);
|
|
27386
27738
|
}
|
|
27387
|
-
if (
|
|
27739
|
+
if (isMemberEntryCollectionBase(args.member)) {
|
|
27388
27740
|
if (!Array.isArray(args.value)) {
|
|
27389
27741
|
throw new NSGetterRuntimeError(
|
|
27390
27742
|
`Constructor argument for List field '${args.member.name}' must be a list.`
|
|
@@ -27424,7 +27776,7 @@ function materializeConstructorArgumentValue(args) {
|
|
|
27424
27776
|
const entryValue = constructorCollectionEntryValue(
|
|
27425
27777
|
rawEntry,
|
|
27426
27778
|
args.ctx,
|
|
27427
|
-
isMemberClassBase(resolvedEntry) ||
|
|
27779
|
+
isMemberClassBase(resolvedEntry) || isMemberWithEntries(resolvedEntry) || (referenceIndexes?.has(index) ?? args.collectionEntriesAreReferences ?? trackedValueId !== null)
|
|
27428
27780
|
);
|
|
27429
27781
|
const child = materializeConstructorArgumentValue({
|
|
27430
27782
|
...args,
|
|
@@ -27472,7 +27824,7 @@ function materializeConstructorArgumentValue(args) {
|
|
|
27472
27824
|
const entry = constructorCollectionEntryValue(
|
|
27473
27825
|
rawEntry,
|
|
27474
27826
|
args.ctx,
|
|
27475
|
-
isMemberClassBase(resolvedEntry) ||
|
|
27827
|
+
isMemberClassBase(resolvedEntry) || isMemberWithEntries(resolvedEntry) || (args.collectionEntriesAreReferences ?? trackedValueId !== null)
|
|
27476
27828
|
);
|
|
27477
27829
|
record4[key] = materializeConstructorArgumentValue({
|
|
27478
27830
|
...args,
|
|
@@ -27507,7 +27859,7 @@ function registerConstructorArgumentRow(args, value) {
|
|
|
27507
27859
|
return row;
|
|
27508
27860
|
}
|
|
27509
27861
|
function rowGenericBindings(args) {
|
|
27510
|
-
if (!
|
|
27862
|
+
if (!isMemberWithEntries(args.member)) {
|
|
27511
27863
|
return void 0;
|
|
27512
27864
|
}
|
|
27513
27865
|
return computeGenericBindingsStamp(
|
|
@@ -27686,7 +28038,7 @@ function cloneClassValueGraph(receiver, expectedClassId, ctx) {
|
|
|
27686
28038
|
argumentValues,
|
|
27687
28039
|
sourceRow.id,
|
|
27688
28040
|
compileMemberId,
|
|
27689
|
-
|
|
28041
|
+
isMemberWithEntries(sourceMember) ? runtimeGenericEnvForValueRow(sourceRow, ctx, /* @__PURE__ */ new Set()) : void 0
|
|
27690
28042
|
);
|
|
27691
28043
|
if (evaluated.existingValueRow !== void 0) {
|
|
27692
28044
|
const adoptedClone = cloneRow2(
|
|
@@ -27803,9 +28155,9 @@ function cloneClassValueGraph(receiver, expectedClassId, ctx) {
|
|
|
27803
28155
|
);
|
|
27804
28156
|
clonedRecord[key] = clonedChild.id;
|
|
27805
28157
|
}
|
|
27806
|
-
} else if (Array.isArray(sourceRow.value) && (
|
|
27807
|
-
const entryMember =
|
|
27808
|
-
const entryTypeInfo = sourceTypeInfo?.type === 6 /* List */ ? sourceTypeInfo.entryTypeInfo : void 0;
|
|
28158
|
+
} else if (Array.isArray(sourceRow.value) && (isMemberEntryCollectionBase(sourceMember) || sourceTypeInfo?.type === 6 /* List */ || sourceTypeInfo?.type === 28 /* Set */)) {
|
|
28159
|
+
const entryMember = isMemberEntryCollectionBase(sourceMember) ? evalMemberById(ctx.vm, sourceMember.entryMemberId) : null;
|
|
28160
|
+
const entryTypeInfo = sourceTypeInfo?.type === 6 /* List */ || sourceTypeInfo?.type === 28 /* Set */ ? sourceTypeInfo.entryTypeInfo : void 0;
|
|
27809
28161
|
if (entryMember !== null || entryTypeInfo !== void 0) {
|
|
27810
28162
|
clone.value = sourceRow.value.map((childId) => {
|
|
27811
28163
|
if (typeof childId !== "string") return childId;
|
|
@@ -28287,7 +28639,7 @@ function createStoredValuePlacementTraversal(args, trackReferences = false) {
|
|
|
28287
28639
|
}
|
|
28288
28640
|
continue;
|
|
28289
28641
|
}
|
|
28290
|
-
if (!
|
|
28642
|
+
if (!isMemberWithEntries(member)) {
|
|
28291
28643
|
continue;
|
|
28292
28644
|
}
|
|
28293
28645
|
const entryMember = membersById.get(member.entryMemberId);
|
|
@@ -28418,7 +28770,7 @@ function lookupEntryTypeInfo(member, collectionTypeInfo) {
|
|
|
28418
28770
|
if (member.collectionMemberId === void 0) return member.declaredTypeInfo;
|
|
28419
28771
|
const collection = collectionTypeInfo(member.collectionMemberId);
|
|
28420
28772
|
if (collection === null) return null;
|
|
28421
|
-
if (collection.type !== 6 /* List */ && collection.type !== 5 /* Dictionary */) {
|
|
28773
|
+
if (collection.type !== 6 /* List */ && collection.type !== 28 /* Set */ && collection.type !== 5 /* Dictionary */) {
|
|
28422
28774
|
return null;
|
|
28423
28775
|
}
|
|
28424
28776
|
return member.declaredTypeInfo ?? collection.entryTypeInfo;
|
|
@@ -28511,10 +28863,10 @@ function resolveMemberDeclaredTypeInfoInternal(member, members, seen, ownerClass
|
|
|
28511
28863
|
argumentTypes: unnamedArgumentTypes(resolved.argumentTypes)
|
|
28512
28864
|
};
|
|
28513
28865
|
}
|
|
28514
|
-
|
|
28515
|
-
|
|
28516
|
-
|
|
28517
|
-
);
|
|
28866
|
+
const collectionKind = resolved.kind;
|
|
28867
|
+
if (collectionKind === 6 /* List */ || collectionKind === 28 /* Set */ || collectionKind === 5 /* Dictionary */ && isMemberDictionaryBase(resolved)) {
|
|
28868
|
+
const entryMemberId = getField(resolved, "entryMemberId");
|
|
28869
|
+
const entry = members.find((candidate) => candidate.id === entryMemberId);
|
|
28518
28870
|
if (entry === void 0) return null;
|
|
28519
28871
|
const entryTypeInfo = resolveMemberDeclaredTypeInfoInternal(
|
|
28520
28872
|
entry,
|
|
@@ -28525,7 +28877,7 @@ function resolveMemberDeclaredTypeInfoInternal(member, members, seen, ownerClass
|
|
|
28525
28877
|
);
|
|
28526
28878
|
if (entryTypeInfo === null) return null;
|
|
28527
28879
|
return {
|
|
28528
|
-
type:
|
|
28880
|
+
type: collectionKind,
|
|
28529
28881
|
required: isRequiredMember(resolved),
|
|
28530
28882
|
entryTypeInfo,
|
|
28531
28883
|
...isMemberDictionaryBase(resolved) && resolved.keyEnumId ? { keyEnumId: resolved.keyEnumId } : {}
|
|
@@ -28757,7 +29109,7 @@ var MaterializedValueGraphContext = class {
|
|
|
28757
29109
|
const rewriteId = (value2) => replacements.get(value2) ?? value2;
|
|
28758
29110
|
let value = row.value;
|
|
28759
29111
|
if (owner !== void 0 || aggregateType !== void 0) {
|
|
28760
|
-
if ((owner !== void 0 ?
|
|
29112
|
+
if ((owner !== void 0 ? isMemberEntryCollectionBase(owner) : aggregateType === 6 /* List */ || aggregateType === 28 /* Set */) && Array.isArray(value)) {
|
|
28761
29113
|
value = value.map(
|
|
28762
29114
|
(entry) => typeof entry === "string" ? rewriteId(entry) : entry
|
|
28763
29115
|
);
|
|
@@ -28816,7 +29168,7 @@ var MaterializedValueGraphContext = class {
|
|
|
28816
29168
|
if (member === void 0) return null;
|
|
28817
29169
|
return this.memberTypeInfo(member, env);
|
|
28818
29170
|
}
|
|
28819
|
-
if (rawTypeInfo.type === 6 /* List */ || rawTypeInfo.type === 5 /* Dictionary */) {
|
|
29171
|
+
if (rawTypeInfo.type === 6 /* List */ || rawTypeInfo.type === 28 /* Set */ || rawTypeInfo.type === 5 /* Dictionary */) {
|
|
28820
29172
|
const entryTypeInfo = this.resolveTypeInfo(
|
|
28821
29173
|
rawTypeInfo.entryTypeInfo,
|
|
28822
29174
|
env
|
|
@@ -28886,7 +29238,7 @@ function collectSoftOwnedConstructorArgumentValueIds(index, ownerValueId, preser
|
|
|
28886
29238
|
collectNestedConstructorArguments(valueId);
|
|
28887
29239
|
if (typeInfo.type === 7 /* Class */ || typeInfo.type === 22 /* Interface */) {
|
|
28888
29240
|
collectClassChildren(row, typeInfo);
|
|
28889
|
-
} else if (typeInfo.type === 6 /* List */) {
|
|
29241
|
+
} else if (typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */) {
|
|
28890
29242
|
const unorderedChildren = childrenByContainerId.get(row.id) ?? [];
|
|
28891
29243
|
if (unorderedChildren.length > 0) {
|
|
28892
29244
|
for (const child of unorderedChildren) {
|
|
@@ -28971,7 +29323,7 @@ function tryResolveTypeInfo(document2, rawTypeInfo, env) {
|
|
|
28971
29323
|
if (member === void 0) return null;
|
|
28972
29324
|
return tryMemberTypeInfo(document2, member, env);
|
|
28973
29325
|
}
|
|
28974
|
-
if (rawTypeInfo.type === 6 /* List */ || rawTypeInfo.type === 5 /* Dictionary */) {
|
|
29326
|
+
if (rawTypeInfo.type === 6 /* List */ || rawTypeInfo.type === 28 /* Set */ || rawTypeInfo.type === 5 /* Dictionary */) {
|
|
28975
29327
|
const entryTypeInfo = tryResolveTypeInfo(
|
|
28976
29328
|
document2,
|
|
28977
29329
|
rawTypeInfo.entryTypeInfo,
|
|
@@ -28993,7 +29345,7 @@ function tryMemberTypeInfo(document2, rawMember, env) {
|
|
|
28993
29345
|
}
|
|
28994
29346
|
}
|
|
28995
29347
|
function isAggregateTypeInfo(typeInfo) {
|
|
28996
|
-
return typeInfo.type === 7 /* Class */ || typeInfo.type === 22 /* Interface */ || typeInfo.type === 6 /* List */ || typeInfo.type === 5 /* Dictionary */;
|
|
29348
|
+
return typeInfo.type === 7 /* Class */ || typeInfo.type === 22 /* Interface */ || typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */ || typeInfo.type === 5 /* Dictionary */;
|
|
28997
29349
|
}
|
|
28998
29350
|
function isStringRecord3(value) {
|
|
28999
29351
|
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
@@ -31841,7 +32193,7 @@ function resolveVirtualInstanceGraph(args) {
|
|
|
31841
32193
|
schemaKey: settled2.schemaKey
|
|
31842
32194
|
})
|
|
31843
32195
|
)?.member;
|
|
31844
|
-
if (destination === void 0 || !(isMemberClassBase(destination) ||
|
|
32196
|
+
if (destination === void 0 || !(isMemberClassBase(destination) || isMemberWithEntries(destination)))
|
|
31845
32197
|
continue;
|
|
31846
32198
|
result.set(settled2.schemaKey, edge.targetValueId);
|
|
31847
32199
|
}
|
|
@@ -31891,7 +32243,7 @@ function resolveVirtualInstanceGraph(args) {
|
|
|
31891
32243
|
};
|
|
31892
32244
|
if (indexed.parentSegment?.kind === "list" && parentId !== null) {
|
|
31893
32245
|
const parent = indexed.parentPathKey === null ? void 0 : expansion.nodesByPath.get(indexed.parentPathKey);
|
|
31894
|
-
if (parent !== void 0 &&
|
|
32246
|
+
if (parent !== void 0 && isMemberEntryCollectionBase(parent.member) && listKindOf(parent.member) === 1 /* Unordered */)
|
|
31895
32247
|
effective.containerId = parentId;
|
|
31896
32248
|
}
|
|
31897
32249
|
if (isMemberClassBase(indexed.member) && effective.value !== null) {
|
|
@@ -31922,7 +32274,7 @@ function resolveVirtualInstanceGraph(args) {
|
|
|
31922
32274
|
if (effectiveRecord[key] === void 0) effectiveRecord[key] = childId;
|
|
31923
32275
|
}
|
|
31924
32276
|
effective.value = effectiveRecord;
|
|
31925
|
-
} else if (
|
|
32277
|
+
} else if (isMemberEntryCollectionBase(indexed.member)) {
|
|
31926
32278
|
const effectiveListValue = materialized === null ? indexed.expandedRow.value : materialized.value;
|
|
31927
32279
|
if (effectiveListValue === null) {
|
|
31928
32280
|
effective.value = null;
|
|
@@ -32671,7 +33023,7 @@ function indexExpansion(args) {
|
|
|
32671
33023
|
}
|
|
32672
33024
|
return;
|
|
32673
33025
|
}
|
|
32674
|
-
if (
|
|
33026
|
+
if (isMemberEntryCollectionBase(member)) {
|
|
32675
33027
|
if (listKindOf(member) === 1 /* Unordered */) {
|
|
32676
33028
|
const entryMember3 = membersById.get(member.entryMemberId);
|
|
32677
33029
|
if (entryMember3 === void 0) return;
|
|
@@ -32788,7 +33140,7 @@ function rewriteExpandedRow(node, expansion) {
|
|
|
32788
33140
|
rewrite(childId)
|
|
32789
33141
|
])
|
|
32790
33142
|
);
|
|
32791
|
-
} else if (
|
|
33143
|
+
} else if (isMemberEntryCollectionBase(node.member) && Array.isArray(row.value)) {
|
|
32792
33144
|
row.value = row.value.map(
|
|
32793
33145
|
(childId) => typeof childId === "string" ? rewrite(childId) : childId
|
|
32794
33146
|
);
|
|
@@ -32808,7 +33160,7 @@ function remapMemberDelegateReceiver(value, remap) {
|
|
|
32808
33160
|
}
|
|
32809
33161
|
function normalizeLeafPayload(row, member, remapReceiver = (id) => id) {
|
|
32810
33162
|
const literal3 = literalRow(row);
|
|
32811
|
-
if (
|
|
33163
|
+
if (isMemberWithEntries(member)) {
|
|
32812
33164
|
return {
|
|
32813
33165
|
value: literal3.value,
|
|
32814
33166
|
classId: literal3.classId ?? null,
|
|
@@ -32841,7 +33193,7 @@ function compareContextualCreationProvenance(left, right, context) {
|
|
|
32841
33193
|
member.classArguments,
|
|
32842
33194
|
context.document.classes
|
|
32843
33195
|
) : /* @__PURE__ */ new Map();
|
|
32844
|
-
if (
|
|
33196
|
+
if (isMemberWithEntries(member)) {
|
|
32845
33197
|
for (const paramId of referencedGenericParams(
|
|
32846
33198
|
member,
|
|
32847
33199
|
context.document.members
|
|
@@ -33033,7 +33385,7 @@ function storedConstructorReplayInitializer(args) {
|
|
|
33033
33385
|
};
|
|
33034
33386
|
}
|
|
33035
33387
|
function storedArgumentPointer(value, typeInfo) {
|
|
33036
|
-
if ((typeInfo.type === 7 /* Class */ || typeInfo.type === 22 /* Interface */ || typeInfo.type === 6 /* List */ || typeInfo.type === 5 /* Dictionary */) && typeof value === "string") {
|
|
33388
|
+
if ((typeInfo.type === 7 /* Class */ || typeInfo.type === 22 /* Interface */ || typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */ || typeInfo.type === 5 /* Dictionary */) && typeof value === "string") {
|
|
33037
33389
|
return { type: "reference" /* reference */, valueId: value };
|
|
33038
33390
|
}
|
|
33039
33391
|
return {
|
|
@@ -35426,7 +35778,8 @@ var COLLECTION_QUERY_METHODS = {
|
|
|
35426
35778
|
SkipWhile: "predicate",
|
|
35427
35779
|
TakeWhile: "predicate",
|
|
35428
35780
|
Reverse: "none",
|
|
35429
|
-
Concat: "collection"
|
|
35781
|
+
Concat: "collection",
|
|
35782
|
+
ToSet: "none"
|
|
35430
35783
|
};
|
|
35431
35784
|
var COLLECTION_FUNCTION_ARGUMENTS = {
|
|
35432
35785
|
Where: "predicate",
|
|
@@ -35445,6 +35798,19 @@ function collectionFunctionContract(name) {
|
|
|
35445
35798
|
return COLLECTION_FUNCTION_ALIASES[name];
|
|
35446
35799
|
return isCollectionFunctionName(name) ? name : null;
|
|
35447
35800
|
}
|
|
35801
|
+
var SET_PRESERVING_COLLECTION_QUERIES = /* @__PURE__ */ new Set([
|
|
35802
|
+
"Where",
|
|
35803
|
+
"Skip",
|
|
35804
|
+
"Take",
|
|
35805
|
+
"SkipWhile",
|
|
35806
|
+
"TakeWhile",
|
|
35807
|
+
"OrderBy",
|
|
35808
|
+
"OrderByDescending",
|
|
35809
|
+
"Reverse"
|
|
35810
|
+
]);
|
|
35811
|
+
function isSetPreservingCollectionQuery(name) {
|
|
35812
|
+
return SET_PRESERVING_COLLECTION_QUERIES.has(name);
|
|
35813
|
+
}
|
|
35448
35814
|
function isCollectionQueryName(name) {
|
|
35449
35815
|
return Object.hasOwn(COLLECTION_QUERY_METHODS, name);
|
|
35450
35816
|
}
|
|
@@ -39727,7 +40093,7 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
39727
40093
|
indexCollectionPointer: receiver.pointer
|
|
39728
40094
|
};
|
|
39729
40095
|
}
|
|
39730
|
-
if (receiver.type.kind === "list" && name === "Index" && this.indexesFor(receiver.type).length > 0) {
|
|
40096
|
+
if ((receiver.type.kind === "list" || receiver.type.kind === "set") && name === "Index" && this.indexesFor(receiver.type).length > 0) {
|
|
39731
40097
|
return {
|
|
39732
40098
|
pointer: receiver.pointer,
|
|
39733
40099
|
type: { kind: "primitive", name: "unknown" },
|
|
@@ -39908,10 +40274,11 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
39908
40274
|
declaring
|
|
39909
40275
|
);
|
|
39910
40276
|
}
|
|
39911
|
-
/** The indexes declared on a schema-backed List, keyed by its member. */
|
|
40277
|
+
/** The indexes declared on a schema-backed List or Set, keyed by its member. */
|
|
39912
40278
|
indexesFor(type) {
|
|
39913
|
-
|
|
39914
|
-
|
|
40279
|
+
const memberId = indexedCollectionMemberId(type);
|
|
40280
|
+
if (memberId === void 0) return [];
|
|
40281
|
+
return this.project.indexesByListMemberId.get(memberId) ?? [];
|
|
39915
40282
|
}
|
|
39916
40283
|
/**
|
|
39917
40284
|
* P42 §2.3. `Images.<Name>` / `AudioClips.<Name>`.
|
|
@@ -42469,6 +42836,33 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
42469
42836
|
case "Reverse":
|
|
42470
42837
|
info = { ...base, op: name };
|
|
42471
42838
|
break;
|
|
42839
|
+
case "ToSet": {
|
|
42840
|
+
if (collection.kind === "dictionary")
|
|
42841
|
+
throw new CompileError("ToSet requires a List or Set receiver.", pos);
|
|
42842
|
+
const elementError = setElementTypeError(
|
|
42843
|
+
collection.valueType,
|
|
42844
|
+
this.project
|
|
42845
|
+
);
|
|
42846
|
+
if (elementError !== null) throw new CompileError(elementError, pos);
|
|
42847
|
+
info = {
|
|
42848
|
+
...base,
|
|
42849
|
+
op: name,
|
|
42850
|
+
...hasReferenceEquality(collection.valueType, this.project) ? { reference: true } : {}
|
|
42851
|
+
};
|
|
42852
|
+
resultType = {
|
|
42853
|
+
kind: "set",
|
|
42854
|
+
elementType: collection.valueType,
|
|
42855
|
+
readOnly: true
|
|
42856
|
+
};
|
|
42857
|
+
break;
|
|
42858
|
+
}
|
|
42859
|
+
}
|
|
42860
|
+
if (collection.kind === "set" && isSetPreservingCollectionQuery(name)) {
|
|
42861
|
+
resultType = {
|
|
42862
|
+
kind: "set",
|
|
42863
|
+
elementType: collection.valueType,
|
|
42864
|
+
readOnly: true
|
|
42865
|
+
};
|
|
42472
42866
|
}
|
|
42473
42867
|
return {
|
|
42474
42868
|
...intrinsic(
|
|
@@ -42476,7 +42870,7 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
42476
42870
|
{
|
|
42477
42871
|
...info,
|
|
42478
42872
|
...toWireType(
|
|
42479
|
-
resultType.kind === "list" ? resultType.elementType : resultType,
|
|
42873
|
+
resultType.kind === "list" || resultType.kind === "set" ? resultType.elementType : resultType,
|
|
42480
42874
|
this.project
|
|
42481
42875
|
).type === 8 /* Enum */ ? { enumEntries: true } : {}
|
|
42482
42876
|
},
|
|
@@ -44809,10 +45203,16 @@ function toWireType(type, project) {
|
|
|
44809
45203
|
...type.readOnly ? { readOnly: true } : {}
|
|
44810
45204
|
};
|
|
44811
45205
|
case "set": {
|
|
45206
|
+
const entryTypeInfo = toWireType(type.elementType, project);
|
|
45207
|
+
if (type.setMemberId === void 0) {
|
|
45208
|
+
return { type: 9 /* Lookup */, required, entryTypeInfo };
|
|
45209
|
+
}
|
|
44812
45210
|
return {
|
|
44813
|
-
type:
|
|
45211
|
+
type: 28 /* Set */,
|
|
44814
45212
|
required,
|
|
44815
|
-
entryTypeInfo
|
|
45213
|
+
entryTypeInfo,
|
|
45214
|
+
setMemberId: type.setMemberId,
|
|
45215
|
+
...type.readOnly ? { readOnly: true } : {}
|
|
44816
45216
|
};
|
|
44817
45217
|
}
|
|
44818
45218
|
case "dictionary": {
|
|
@@ -44895,6 +45295,15 @@ function fromWireType(type) {
|
|
|
44895
45295
|
nullable: nullable2
|
|
44896
45296
|
};
|
|
44897
45297
|
}
|
|
45298
|
+
if (type.type === 28 /* Set */) {
|
|
45299
|
+
return {
|
|
45300
|
+
kind: "set",
|
|
45301
|
+
elementType: fromWireType(type.entryTypeInfo),
|
|
45302
|
+
nullable: nullable2,
|
|
45303
|
+
...type.setMemberId ? { setMemberId: type.setMemberId } : {},
|
|
45304
|
+
...type.readOnly ? { readOnly: true } : {}
|
|
45305
|
+
};
|
|
45306
|
+
}
|
|
44898
45307
|
if (type.type === 25 /* Delegate */) {
|
|
44899
45308
|
return {
|
|
44900
45309
|
kind: "delegate",
|
|
@@ -44992,6 +45401,23 @@ function valueKindPrimitive(kind) {
|
|
|
44992
45401
|
return "Color";
|
|
44993
45402
|
}
|
|
44994
45403
|
}
|
|
45404
|
+
function setElementTypeError(type, project) {
|
|
45405
|
+
if (type.nullable === true) return SET_ELEMENT_NULLABLE_ERROR;
|
|
45406
|
+
switch (type.kind) {
|
|
45407
|
+
case "list":
|
|
45408
|
+
case "set":
|
|
45409
|
+
case "dictionary":
|
|
45410
|
+
return SET_ELEMENT_COLLECTION_ERROR;
|
|
45411
|
+
case "delegate":
|
|
45412
|
+
return setElementKindError("delegates");
|
|
45413
|
+
case "action":
|
|
45414
|
+
return setElementKindError("actions");
|
|
45415
|
+
case "named":
|
|
45416
|
+
return project.typeById.get(type.typeId)?.kind === "interface" ? setElementKindError("interfaces") : null;
|
|
45417
|
+
default:
|
|
45418
|
+
return null;
|
|
45419
|
+
}
|
|
45420
|
+
}
|
|
44995
45421
|
function hasReferenceEquality(type, project) {
|
|
44996
45422
|
const lookup = neoScriptMemberLookupType(type);
|
|
44997
45423
|
switch (lookup.kind) {
|
|
@@ -46731,7 +47157,7 @@ function orderMergedMembers(type, members, environment) {
|
|
|
46731
47157
|
return ordered;
|
|
46732
47158
|
}
|
|
46733
47159
|
function listIndexes(member, environment, field) {
|
|
46734
|
-
if (member.kind !== "list") return [];
|
|
47160
|
+
if (member.kind !== "list" && member.kind !== "set") return [];
|
|
46735
47161
|
const id = string(member.id, `${field}.id`);
|
|
46736
47162
|
const entryId = string(member.entryMemberId, `${field}.entryMemberId`);
|
|
46737
47163
|
const entry = environment.members.get(entryId);
|
|
@@ -46810,7 +47236,7 @@ function memberType(member, environment, visiting, field) {
|
|
|
46810
47236
|
};
|
|
46811
47237
|
return member.multiselect === true ? { kind: "set", elementType: enumType2, nullable: nullable2 } : { ...enumType2, nullable: nullable2 };
|
|
46812
47238
|
}
|
|
46813
|
-
if (kind === "list" || kind === "dictionary") {
|
|
47239
|
+
if (kind === "list" || kind === "set" || kind === "dictionary") {
|
|
46814
47240
|
const entry = environment.members.get(
|
|
46815
47241
|
string(member.entryMemberId, `${field}.entryMemberId`)
|
|
46816
47242
|
);
|
|
@@ -46824,6 +47250,9 @@ function memberType(member, environment, visiting, field) {
|
|
|
46824
47250
|
readOnly: false
|
|
46825
47251
|
};
|
|
46826
47252
|
}
|
|
47253
|
+
if (kind === "set") {
|
|
47254
|
+
return { kind: "set", elementType: entryType, nullable: nullable2, setMemberId: id };
|
|
47255
|
+
}
|
|
46827
47256
|
const key = optionalRecord(member.key);
|
|
46828
47257
|
return {
|
|
46829
47258
|
kind: "dictionary",
|
|
@@ -46968,6 +47397,18 @@ function manifestType(value, environment, field) {
|
|
|
46968
47397
|
readOnly: boolean(type.readOnly, `${field}.readOnly`)
|
|
46969
47398
|
};
|
|
46970
47399
|
}
|
|
47400
|
+
if (kind === "set") {
|
|
47401
|
+
return {
|
|
47402
|
+
kind: "set",
|
|
47403
|
+
elementType: manifestType(
|
|
47404
|
+
type.entryType,
|
|
47405
|
+
environment,
|
|
47406
|
+
`${field}.entryType`
|
|
47407
|
+
),
|
|
47408
|
+
nullable: nullable2,
|
|
47409
|
+
setMemberId: string(type.setMemberId, `${field}.setMemberId`)
|
|
47410
|
+
};
|
|
47411
|
+
}
|
|
46971
47412
|
if (kind === "dictionary") {
|
|
46972
47413
|
const keyEnumId = nullableString(type.keyEnumId, `${field}.keyEnumId`);
|
|
46973
47414
|
return {
|
|
@@ -47481,7 +47922,7 @@ function interfacePropertyIsSettable(member) {
|
|
|
47481
47922
|
function containsForbiddenMemberTypeInfo(typeInfo) {
|
|
47482
47923
|
if (typeInfo.type === NS_TYPE_UNKNOWN) return true;
|
|
47483
47924
|
if (typeInfo.type === 21 /* Generic */) return true;
|
|
47484
|
-
if (typeInfo.type === 6 /* List */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
47925
|
+
if (typeInfo.type === 6 /* List */ || typeInfo.type === 28 /* Set */ || typeInfo.type === 5 /* Dictionary */ || typeInfo.type === 9 /* Lookup */) {
|
|
47485
47926
|
return containsForbiddenMemberTypeInfo(typeInfo.entryTypeInfo);
|
|
47486
47927
|
}
|
|
47487
47928
|
if (typeInfo.type === 7 /* Class */ && typeInfo.typeArguments) {
|
|
@@ -47866,8 +48307,7 @@ function storedDialogueGroupSources(groups, memberById, classById) {
|
|
|
47866
48307
|
}
|
|
47867
48308
|
function lookupEntry(collectionMemberId, memberById, classById) {
|
|
47868
48309
|
const collection = memberById(collectionMemberId);
|
|
47869
|
-
if (!
|
|
47870
|
-
return void 0;
|
|
48310
|
+
if (!isMemberWithEntries(collection)) return void 0;
|
|
47871
48311
|
const entry = memberById(collection.entryMemberId);
|
|
47872
48312
|
if (!isMemberClassBase(entry)) return void 0;
|
|
47873
48313
|
const entryClass = classById(entry.classId);
|
|
@@ -48691,7 +49131,7 @@ function createListIndexes(context) {
|
|
|
48691
49131
|
} catch {
|
|
48692
49132
|
continue;
|
|
48693
49133
|
}
|
|
48694
|
-
if (!
|
|
49134
|
+
if (!isMemberEntryCollectionBase(resolved)) continue;
|
|
48695
49135
|
const definitions = resolveListIndexDefinitions(
|
|
48696
49136
|
{
|
|
48697
49137
|
members: context.vm.members,
|
|
@@ -48701,7 +49141,7 @@ function createListIndexes(context) {
|
|
|
48701
49141
|
record4
|
|
48702
49142
|
);
|
|
48703
49143
|
const listType = memberRuntimeType(record4, context);
|
|
48704
|
-
if (listType.kind !== "list") continue;
|
|
49144
|
+
if (listType.kind !== "list" && listType.kind !== "set") continue;
|
|
48705
49145
|
for (const definition of definitions) {
|
|
48706
49146
|
result.push({
|
|
48707
49147
|
id: `${record4.id}:index:${definition.schemaKey}`,
|
|
@@ -48797,6 +49237,22 @@ function memberRuntimeType(record4, context, seen = /* @__PURE__ */ new Set(), g
|
|
|
48797
49237
|
nullable: !required
|
|
48798
49238
|
};
|
|
48799
49239
|
}
|
|
49240
|
+
case 28 /* Set */: {
|
|
49241
|
+
if (!isMemberSetBase(member)) return UNKNOWN_TYPE;
|
|
49242
|
+
const entry = analyzerMemberById(context, member.entryMemberId);
|
|
49243
|
+
const projectedEntry = entry ? substituteForGenericEnvironment(entry, genericEnvironment, context) : null;
|
|
49244
|
+
return {
|
|
49245
|
+
kind: "set",
|
|
49246
|
+
elementType: projectedEntry ? memberRuntimeType(
|
|
49247
|
+
projectedEntry,
|
|
49248
|
+
context,
|
|
49249
|
+
nextSeen,
|
|
49250
|
+
genericEnvironment
|
|
49251
|
+
) : UNKNOWN_TYPE,
|
|
49252
|
+
setMemberId: record4.id,
|
|
49253
|
+
nullable: !required
|
|
49254
|
+
};
|
|
49255
|
+
}
|
|
48800
49256
|
case 5 /* Dictionary */: {
|
|
48801
49257
|
if (!isMemberDictionaryBase(member)) return UNKNOWN_TYPE;
|
|
48802
49258
|
const entry = analyzerMemberById(context, member.entryMemberId);
|
|
@@ -49041,6 +49497,18 @@ function toLanguageType(type, context, genericEnvironment) {
|
|
|
49041
49497
|
...type.listMemberId ? { listMemberId: type.listMemberId } : {},
|
|
49042
49498
|
...type.readOnly ? { readOnly: true } : {}
|
|
49043
49499
|
};
|
|
49500
|
+
case 28 /* Set */:
|
|
49501
|
+
return {
|
|
49502
|
+
kind: "set",
|
|
49503
|
+
elementType: toLanguageType(
|
|
49504
|
+
type.entryTypeInfo,
|
|
49505
|
+
context,
|
|
49506
|
+
genericEnvironment
|
|
49507
|
+
),
|
|
49508
|
+
nullable: !required,
|
|
49509
|
+
...type.setMemberId ? { setMemberId: type.setMemberId } : {},
|
|
49510
|
+
...type.readOnly ? { readOnly: true } : {}
|
|
49511
|
+
};
|
|
49044
49512
|
case 5 /* Dictionary */:
|
|
49045
49513
|
return {
|
|
49046
49514
|
kind: "dictionary",
|
|
@@ -54187,6 +54655,10 @@ function schemaTypeOptionsAtDepth(depth) {
|
|
|
54187
54655
|
listMemberId: nullableId,
|
|
54188
54656
|
readOnly: boolean2()
|
|
54189
54657
|
}),
|
|
54658
|
+
nullableTypeSchema("set", {
|
|
54659
|
+
entryType: schemaTypeAtDepth(depth + 1),
|
|
54660
|
+
setMemberId: nonEmptyString
|
|
54661
|
+
}),
|
|
54190
54662
|
nullableTypeSchema("dictionary", {
|
|
54191
54663
|
entryType: schemaTypeAtDepth(depth + 1),
|
|
54192
54664
|
keyEnumId: nullableId,
|
|
@@ -54455,6 +54927,12 @@ var schemaMemberSchema = variant("kind", [
|
|
|
54455
54927
|
indexes: array(schemaListIndexSchema),
|
|
54456
54928
|
columns: array(schemaListColumnSchema)
|
|
54457
54929
|
}),
|
|
54930
|
+
/** P108 §2: insertion-ordered owned entries, no two equal. */
|
|
54931
|
+
memberSchema("set", {
|
|
54932
|
+
entryMemberId: nonEmptyString,
|
|
54933
|
+
indexes: array(schemaListIndexSchema),
|
|
54934
|
+
columns: array(schemaListColumnSchema)
|
|
54935
|
+
}),
|
|
54458
54936
|
memberSchema("class", {
|
|
54459
54937
|
classId: nonEmptyString,
|
|
54460
54938
|
partial: optional(boolean2()),
|
|
@@ -54531,6 +55009,9 @@ var schemaMemberSchema = variant("kind", [
|
|
|
54531
55009
|
partial: optional(boolean2())
|
|
54532
55010
|
})
|
|
54533
55011
|
]);
|
|
55012
|
+
function isSchemaEntryCollectionMember(member) {
|
|
55013
|
+
return member.kind === "list" || member.kind === "set";
|
|
55014
|
+
}
|
|
54534
55015
|
|
|
54535
55016
|
// node_modules/valibot/dist/index.mjs
|
|
54536
55017
|
var store$42;
|
|
@@ -54598,7 +55079,8 @@ var MEMBER_KIND = {
|
|
|
54598
55079
|
FunctionRef: 24,
|
|
54599
55080
|
NSDelegate: 25,
|
|
54600
55081
|
NSAction: 26,
|
|
54601
|
-
Variant: 27
|
|
55082
|
+
Variant: 27,
|
|
55083
|
+
Set: 28
|
|
54602
55084
|
};
|
|
54603
55085
|
var MEMBER_MODIFIERS = ["virtual", "sealed", "abstract", "static"];
|
|
54604
55086
|
var MEMBER_ACCESS = ["public", "protected", "private"];
|
|
@@ -54658,6 +55140,7 @@ var MEMBER_KIND_BY_KIND = /* @__PURE__ */ new Map([
|
|
|
54658
55140
|
["float", MEMBER_KIND.Float],
|
|
54659
55141
|
["dictionary", MEMBER_KIND.Dictionary],
|
|
54660
55142
|
["list", MEMBER_KIND.List],
|
|
55143
|
+
["set", MEMBER_KIND.Set],
|
|
54661
55144
|
["class", MEMBER_KIND.Class],
|
|
54662
55145
|
["enum", MEMBER_KIND.Enum],
|
|
54663
55146
|
["lookup", MEMBER_KIND.Lookup],
|
|
@@ -54844,6 +55327,19 @@ function memberFromDocument(record4, members, owners, classNames, context) {
|
|
|
54844
55327
|
columns: listColumnsFromDocument(field("columnSettings", []), record4)
|
|
54845
55328
|
};
|
|
54846
55329
|
}
|
|
55330
|
+
if (kind === MEMBER_KIND.Set) {
|
|
55331
|
+
return {
|
|
55332
|
+
...common,
|
|
55333
|
+
kind: "set",
|
|
55334
|
+
entryMemberId: requiredStringValue(
|
|
55335
|
+
field("entryMemberId", void 0),
|
|
55336
|
+
record4,
|
|
55337
|
+
"entryMemberId"
|
|
55338
|
+
),
|
|
55339
|
+
indexes: listIndexesFromDocument(field("indexes", []), record4),
|
|
55340
|
+
columns: listColumnsFromDocument(field("columnSettings", []), record4)
|
|
55341
|
+
};
|
|
55342
|
+
}
|
|
54847
55343
|
if (kind === MEMBER_KIND.Class) {
|
|
54848
55344
|
return {
|
|
54849
55345
|
...common,
|
|
@@ -55097,10 +55593,13 @@ var INHERITED_MEMBER_ORDINAL_FIELDS = /* @__PURE__ */ new Set([
|
|
|
55097
55593
|
"dispatch",
|
|
55098
55594
|
"bodyMode"
|
|
55099
55595
|
]);
|
|
55596
|
+
function schemaMemberKindOrdinal(kind) {
|
|
55597
|
+
const ordinal = MEMBER_KIND_BY_KIND.get(kind);
|
|
55598
|
+
if (ordinal === void 0) throw new Error(`No document kind for ${kind}.`);
|
|
55599
|
+
return ordinal;
|
|
55600
|
+
}
|
|
55100
55601
|
function memberToDocumentFields(member, baseData) {
|
|
55101
|
-
const kind =
|
|
55102
|
-
if (kind === void 0)
|
|
55103
|
-
throw new Error(`No document kind for ${member.kind}.`);
|
|
55602
|
+
const kind = schemaMemberKindOrdinal(member.kind);
|
|
55104
55603
|
const isOverride = member.overrideOf !== null;
|
|
55105
55604
|
const fields = {
|
|
55106
55605
|
id: member.id,
|
|
@@ -55158,9 +55657,9 @@ function memberToDocumentFields(member, baseData) {
|
|
|
55158
55657
|
}
|
|
55159
55658
|
if (member.key.kind === "enum") fields.keyEnumId = member.key.enumId;
|
|
55160
55659
|
}
|
|
55161
|
-
if (member
|
|
55660
|
+
if (isSchemaEntryCollectionMember(member)) {
|
|
55162
55661
|
fields.entryMemberId = member.entryMemberId;
|
|
55163
|
-
if (member.listKind === "unordered" || isOverride) {
|
|
55662
|
+
if (member.kind === "list" && (member.listKind === "unordered" || isOverride)) {
|
|
55164
55663
|
fields.listKind = member.listKind === "unordered" ? 1 : 0;
|
|
55165
55664
|
}
|
|
55166
55665
|
if (!isOverride) {
|
|
@@ -55472,6 +55971,22 @@ function documentTypeToManifest(value, record4, path) {
|
|
|
55472
55971
|
readOnly: typeInfo.readOnly === true
|
|
55473
55972
|
};
|
|
55474
55973
|
}
|
|
55974
|
+
if (kind === MEMBER_KIND.Set) {
|
|
55975
|
+
return {
|
|
55976
|
+
kind: "set",
|
|
55977
|
+
nullable: nullable2,
|
|
55978
|
+
entryType: documentTypeToManifest(
|
|
55979
|
+
typeInfo.entryTypeInfo,
|
|
55980
|
+
record4,
|
|
55981
|
+
`${path}.entryTypeInfo`
|
|
55982
|
+
),
|
|
55983
|
+
setMemberId: requiredStringValue(
|
|
55984
|
+
typeInfo.setMemberId,
|
|
55985
|
+
record4,
|
|
55986
|
+
`${path}.setMemberId`
|
|
55987
|
+
)
|
|
55988
|
+
};
|
|
55989
|
+
}
|
|
55475
55990
|
if (kind === MEMBER_KIND.Lookup) {
|
|
55476
55991
|
const collectionValueId = optionalStringOrNull(typeInfo.collectionValueId);
|
|
55477
55992
|
const collectionMemberId = optionalStringOrNull(
|
|
@@ -55595,6 +56110,14 @@ function manifestTypeToDocument(type) {
|
|
|
55595
56110
|
readOnly: type.readOnly || void 0
|
|
55596
56111
|
});
|
|
55597
56112
|
}
|
|
56113
|
+
if (type.kind === "set") {
|
|
56114
|
+
return {
|
|
56115
|
+
type: MEMBER_KIND.Set,
|
|
56116
|
+
required,
|
|
56117
|
+
entryTypeInfo: manifestTypeToDocument(type.entryType),
|
|
56118
|
+
setMemberId: type.setMemberId
|
|
56119
|
+
};
|
|
56120
|
+
}
|
|
55598
56121
|
if (type.kind === "dictionary") {
|
|
55599
56122
|
return omitUndefined({
|
|
55600
56123
|
type: MEMBER_KIND.Dictionary,
|
|
@@ -57189,7 +57712,7 @@ var INITIALIZER_KEY_PLACEHOLDER = new RegExp(
|
|
|
57189
57712
|
|
|
57190
57713
|
// ../packages/manifest/schema-contract/registry.mjs
|
|
57191
57714
|
var PROJECT_SCHEMA_CONTRACT = Object.freeze({
|
|
57192
|
-
cliVersion: "0.
|
|
57715
|
+
cliVersion: "0.78.0",
|
|
57193
57716
|
projectFileUploadBatchSize: 32,
|
|
57194
57717
|
documentRecords: {
|
|
57195
57718
|
member: {
|
|
@@ -59019,9 +59542,15 @@ var WORLD_OBJECT_CONTRACT_WORLD_KINDS = /* @__PURE__ */ new Set([
|
|
|
59019
59542
|
NeoWorldSystemClassKind.SortingGroup,
|
|
59020
59543
|
NeoWorldSystemClassKind.SpriteObject
|
|
59021
59544
|
]);
|
|
59545
|
+
var SCRIPT_COLLECTION_READERS = {
|
|
59546
|
+
[6 /* List */]: "ReadScriptList",
|
|
59547
|
+
[28 /* Set */]: "ReadScriptSet",
|
|
59548
|
+
[9 /* Lookup */]: "ReadScriptSet",
|
|
59549
|
+
[5 /* Dictionary */]: "ReadScriptDictionary"
|
|
59550
|
+
};
|
|
59022
59551
|
|
|
59023
59552
|
// ../src/models/exports/unity-codegen-revision.ts
|
|
59024
|
-
var UNITY_CODEGEN_REVISION = "
|
|
59553
|
+
var UNITY_CODEGEN_REVISION = "8e940ebfec562d0be7fe7b82014f66293ea075c2ca394c3a3eaac419eaddfeb8";
|
|
59025
59554
|
|
|
59026
59555
|
// src/export-cache.ts
|
|
59027
59556
|
var CACHE_BUILD = JSON.stringify([
|