@prisma/orm-framework 8.0.0-rc.15-dev.2 → 8.0.0-rc.15-dev.3
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/dist/{authoring-CcT010vl.d.mts → authoring-DZ6xCFkL.d.mts} +2 -2
- package/dist/{authoring-CcT010vl.d.mts.map → authoring-DZ6xCFkL.d.mts.map} +1 -1
- package/dist/authoring-DcJL9g8s.mjs +352 -0
- package/dist/authoring-DcJL9g8s.mjs.map +1 -0
- package/dist/{binder-Dz5zT7tr-Dc_RkyB2.d.mts → binder-CfxKD8hm-CtG0Bs3W.d.mts} +30 -13
- package/dist/binder-CfxKD8hm-CtG0Bs3W.d.mts.map +1 -0
- package/dist/codec-U-xbQys_.mjs.map +1 -1
- package/dist/{components-CK8GHz8l.d.mts → components-DFGmVWZ7.d.mts} +2 -2
- package/dist/{components-CK8GHz8l.d.mts.map → components-DFGmVWZ7.d.mts.map} +1 -1
- package/dist/components.d.mts +8 -8
- package/dist/components.mjs +7 -6
- package/dist/components__authoring.d.mts +3 -3
- package/dist/components__authoring.mjs +3 -3
- package/dist/components__codec.mjs +2 -1
- package/dist/components__components.d.mts +2 -2
- package/dist/components__control.d.mts +3 -3
- package/dist/components__control.mjs +2 -2
- package/dist/components__execution.d.mts +1 -1
- package/dist/{config-types-D-P60plU.d.mts → config-types-CHO5rbVo.d.mts} +10 -8
- package/dist/config-types-CHO5rbVo.d.mts.map +1 -0
- package/dist/config.d.mts +1 -1
- package/dist/config__config-types.d.mts +1 -1
- package/dist/contract-authoring.d.mts +1 -1
- package/dist/contract-authoring.mjs +1 -1
- package/dist/{control-BIv_-3QB.mjs → control-DZJQzwlC.mjs} +8 -4
- package/dist/control-DZJQzwlC.mjs.map +1 -0
- package/dist/{control-C1x8zzHb.d.mts → control-_4dB7KvO.d.mts} +7 -7
- package/dist/{control-C1x8zzHb.d.mts.map → control-_4dB7KvO.d.mts.map} +1 -1
- package/dist/{resolve-codec-vOfdHcIJ-IeNjz3Tm.mjs → data-type-4xQlxYB5-DD158cOq.mjs} +3 -70
- package/dist/data-type-4xQlxYB5-DD158cOq.mjs.map +1 -0
- package/dist/{declarations-DDT0hm5r-BZoOKiu1.mjs → declarations-5xLxC310-R3-Z4vcK.mjs} +6 -6
- package/dist/{declarations-DDT0hm5r-BZoOKiu1.mjs.map → declarations-5xLxC310-R3-Z4vcK.mjs.map} +1 -1
- package/dist/errors.d.mts +1 -1
- package/dist/errors__execution.d.mts +1 -1
- package/dist/{execution-gjfB1CvH.d.mts → execution-CYxp6gvp.d.mts} +2 -2
- package/dist/{execution-gjfB1CvH.d.mts.map → execution-CYxp6gvp.d.mts.map} +1 -1
- package/dist/{execution-o-z5gzZh.d.mts → execution-Utsq8aY6.d.mts} +2 -2
- package/dist/{execution-o-z5gzZh.d.mts.map → execution-Utsq8aY6.d.mts.map} +1 -1
- package/dist/{framework-components-DDr6lZoZ-EpXYrZj7.d.mts → framework-components-BY_7sg-B-ChOD-ovL.d.mts} +3 -3
- package/dist/{framework-components-DDr6lZoZ-EpXYrZj7.d.mts.map → framework-components-BY_7sg-B-ChOD-ovL.d.mts.map} +1 -1
- package/dist/{mutation-default-types-D_M8NC3U-BQNexfRU.d.mts → mutation-default-types-CMx8Y9zx-yQN8l2GU.d.mts} +4 -10
- package/dist/mutation-default-types-CMx8Y9zx-yQN8l2GU.d.mts.map +1 -0
- package/dist/{parse-ymgXJUnk-CwVCe8ZD.mjs → parse-Cjjj1-m4-Coaz3UzQ.mjs} +3 -3
- package/dist/{parse-ymgXJUnk-CwVCe8ZD.mjs.map → parse-Cjjj1-m4-Coaz3UzQ.mjs.map} +1 -1
- package/dist/{parse-eSQ_clQv-YWR_NQoq.d.mts → parse-GXhoypXR-CeQ_TuEg.d.mts} +7 -7
- package/dist/{parse-eSQ_clQv-YWR_NQoq.d.mts.map → parse-GXhoypXR-CeQ_TuEg.d.mts.map} +1 -1
- package/dist/psl-parser.d.mts +36 -7
- package/dist/psl-parser.d.mts.map +1 -1
- package/dist/psl-parser.mjs +161 -18
- package/dist/psl-parser.mjs.map +1 -1
- package/dist/psl-parser__format.d.mts +1 -1
- package/dist/psl-parser__format.mjs +2 -2
- package/dist/psl-parser__format.mjs.map +1 -1
- package/dist/psl-parser__interpret.d.mts +4 -4
- package/dist/psl-parser__interpret.mjs +1 -1
- package/dist/psl-parser__syntax.d.mts +1 -1
- package/dist/psl-parser__syntax.mjs +2 -2
- package/dist/psl-parser__syntax.mjs.map +1 -1
- package/dist/psl-printer.d.mts +1 -1
- package/dist/psl-printer.mjs +1 -1
- package/dist/resolve-codec-qqMjZrmn-Cok8elAo.mjs +74 -0
- package/dist/resolve-codec-qqMjZrmn-Cok8elAo.mjs.map +1 -0
- package/dist/{temporal-presets-DIo9uYtS-Odk6WBk8.mjs → temporal-presets-DUCEijgt-CODhqGVy.mjs} +20 -11
- package/dist/{temporal-presets-DIo9uYtS-Odk6WBk8.mjs.map → temporal-presets-DUCEijgt-CODhqGVy.mjs.map} +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/written-value-BB9UYfrg-OiFCVcz2.d.mts +278 -0
- package/dist/written-value-BB9UYfrg-OiFCVcz2.d.mts.map +1 -0
- package/package.json +15 -15
- package/dist/authoring-iMWszF7p.mjs +0 -157
- package/dist/authoring-iMWszF7p.mjs.map +0 -1
- package/dist/binder-Dz5zT7tr-Dc_RkyB2.d.mts.map +0 -1
- package/dist/config-types-D-P60plU.d.mts.map +0 -1
- package/dist/control-BIv_-3QB.mjs.map +0 -1
- package/dist/mutation-default-types-D_M8NC3U-BQNexfRU.d.mts.map +0 -1
- package/dist/resolve-codec-vOfdHcIJ-IeNjz3Tm.mjs.map +0 -1
- package/dist/temporal-presets-CLsu00ZK-CAx-cLAM.d.mts +0 -160
- package/dist/temporal-presets-CLsu00ZK-CAx-cLAM.d.mts.map +0 -1
package/dist/psl-parser.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
2
|
import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
3
3
|
import { a as or, i as okVoid, n as notOk, r as ok, t as and } from "./result-8OXF26MN.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { r as createDataTypeLookup } from "./data-type-4xQlxYB5-DD158cOq.mjs";
|
|
5
|
+
import { S as isAuthoringPslBlockDescriptor, f as describeTaggedLiteralFailure, x as isAuthoringModelAttributeDescriptor } from "./temporal-presets-DUCEijgt-CODhqGVy.mjs";
|
|
6
|
+
import { _ as tagForm, a as describeExpected, g as readWrittenValue, i as describeAdmittedForms, n as admittedTags, o as describeRefusal, r as castTypedValue, t as admittedForms, u as exactRewrite } from "./authoring-DcJL9g8s.mjs";
|
|
5
7
|
import { a as flatPslModels, c as namespacePslExtensionBlocks } from "./psl-ast-CyvE6CR-.mjs";
|
|
6
8
|
import { n as isPslIdentifier } from "./tokenizer-BMz7z2KR-J0yZ4im3.mjs";
|
|
7
|
-
import { C as TaggedLiteralExprAst, S as StringLiteralExprAst, T as TypesBlockAst, _ as NumberLiteralExprAst, a as CompositeTypeDeclarationAst, b as PathExprAst, d as IdentifierAst, g as NamespaceDeclarationAst, i as BooleanLiteralExprAst, l as FunctionCallAst, m as ModelDeclarationAst, t as ArrayLiteralAst, u as GenericBlockDeclarationAst, y as ObjectLiteralExprAst } from "./declarations-
|
|
9
|
+
import { C as TaggedLiteralExprAst, S as StringLiteralExprAst, T as TypesBlockAst, _ as NumberLiteralExprAst, a as CompositeTypeDeclarationAst, b as PathExprAst, d as IdentifierAst, g as NamespaceDeclarationAst, i as BooleanLiteralExprAst, l as FunctionCallAst, m as ModelDeclarationAst, t as ArrayLiteralAst, u as GenericBlockDeclarationAst, y as ObjectLiteralExprAst } from "./declarations-5xLxC310-R3-Z4vcK.mjs";
|
|
8
10
|
import { a as mapPslDiagnostics, c as readResolvedAttributes, i as keywordPslSpan, l as readResolvedConstructorCall, n as diagnosticFromSpan, o as nodePslSpan, r as diagnosticSource, s as readResolvedAttribute, t as createPslDiagnosticCollector } from "./resolve-C8PUf8zv-QAvnPhCt.mjs";
|
|
9
|
-
//#region ../../../1-framework/2-authoring/psl-parser/dist/symbol-table-
|
|
11
|
+
//#region ../../../1-framework/2-authoring/psl-parser/dist/symbol-table-BtWXPbMr.mjs
|
|
10
12
|
function* modelAttributeDescriptors(namespace) {
|
|
11
13
|
for (const value of Object.values(namespace)) {
|
|
12
14
|
if (isAuthoringModelAttributeDescriptor(value)) {
|
|
@@ -37,6 +39,72 @@ function resolveDescribeUnresolvedType(pslDiagnostics) {
|
|
|
37
39
|
if (pslDiagnostics?.describeUnresolvedType === void 0) return;
|
|
38
40
|
return blindCast(pslDiagnostics.describeUnresolvedType);
|
|
39
41
|
}
|
|
42
|
+
const AN_EXPRESSION = {
|
|
43
|
+
ok: false,
|
|
44
|
+
reason: "not-a-literal",
|
|
45
|
+
found: "an expression"
|
|
46
|
+
};
|
|
47
|
+
function written(value) {
|
|
48
|
+
return {
|
|
49
|
+
ok: true,
|
|
50
|
+
written: value
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** Reads a PSL literal expression as a `WrittenScalar`, for a position that takes a value of a data type. ADR 254. */
|
|
54
|
+
function readWrittenScalar(expression) {
|
|
55
|
+
const syntax = expression.syntax;
|
|
56
|
+
const string = StringLiteralExprAst.cast(syntax)?.value();
|
|
57
|
+
if (string !== void 0) return written({
|
|
58
|
+
kind: "string",
|
|
59
|
+
text: string
|
|
60
|
+
});
|
|
61
|
+
const number = NumberLiteralExprAst.cast(syntax);
|
|
62
|
+
if (number !== void 0) {
|
|
63
|
+
const text = number.token()?.text;
|
|
64
|
+
return text === void 0 ? AN_EXPRESSION : written({
|
|
65
|
+
kind: "number",
|
|
66
|
+
text
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const boolean = BooleanLiteralExprAst.cast(syntax)?.value();
|
|
70
|
+
if (boolean !== void 0) return written({
|
|
71
|
+
kind: "boolean",
|
|
72
|
+
value: boolean
|
|
73
|
+
});
|
|
74
|
+
const tagged = TaggedLiteralExprAst.cast(syntax);
|
|
75
|
+
if (tagged !== void 0) {
|
|
76
|
+
const canonicalization = tagged.canonicalization();
|
|
77
|
+
return canonicalization.ok ? written({
|
|
78
|
+
kind: "tag",
|
|
79
|
+
tag: tagged.tagName(),
|
|
80
|
+
text: canonicalization.text
|
|
81
|
+
}) : {
|
|
82
|
+
ok: false,
|
|
83
|
+
reason: canonicalization.reason
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (IdentifierAst.cast(syntax) !== void 0) return {
|
|
87
|
+
ok: false,
|
|
88
|
+
reason: "not-a-literal",
|
|
89
|
+
found: "an identifier"
|
|
90
|
+
};
|
|
91
|
+
if (FunctionCallAst.cast(syntax) !== void 0) return {
|
|
92
|
+
ok: false,
|
|
93
|
+
reason: "not-a-literal",
|
|
94
|
+
found: "a function call"
|
|
95
|
+
};
|
|
96
|
+
if (ArrayLiteralAst.cast(syntax) !== void 0) return {
|
|
97
|
+
ok: false,
|
|
98
|
+
reason: "not-a-literal",
|
|
99
|
+
found: "a list"
|
|
100
|
+
};
|
|
101
|
+
if (ObjectLiteralExprAst.cast(syntax) !== void 0) return {
|
|
102
|
+
ok: false,
|
|
103
|
+
reason: "not-a-literal",
|
|
104
|
+
found: "an object"
|
|
105
|
+
};
|
|
106
|
+
return AN_EXPRESSION;
|
|
107
|
+
}
|
|
40
108
|
function writtenEntityReference(node) {
|
|
41
109
|
const name = IdentifierAst.cast(node)?.name();
|
|
42
110
|
if (name !== void 0) return {
|
|
@@ -371,16 +439,14 @@ function createBinder(input) {
|
|
|
371
439
|
contributedTypes: mergeContributedTypes(contributions.field, contributions.type),
|
|
372
440
|
attributeSpecs: assembleAttributeSpecs(contributions),
|
|
373
441
|
pslBlockDescriptors: contributions.pslBlockDescriptors,
|
|
374
|
-
controlMutationDefaults: {
|
|
375
|
-
|
|
376
|
-
dataTypeEntries: contributions.dataTypes
|
|
377
|
-
},
|
|
442
|
+
controlMutationDefaults: { defaultFunctionRegistry: context.controlMutationDefaults.defaultFunctionRegistry },
|
|
443
|
+
dataTypes: context.dataTypes,
|
|
378
444
|
...describeUnsupportedAttributeFactory !== void 0 ? { describeUnsupportedAttribute: describeUnsupportedAttributeFactory(sources) } : {},
|
|
379
445
|
...describeUnresolvedTypeFactory !== void 0 ? { describeUnresolvedType: describeUnresolvedTypeFactory(contributions) } : {}
|
|
380
446
|
});
|
|
381
447
|
}
|
|
382
448
|
function bind(options) {
|
|
383
|
-
const { sources, symbolTable, contributedTypes, attributeSpecs, controlMutationDefaults, describeUnsupportedAttribute, describeUnresolvedType } = options;
|
|
449
|
+
const { sources, symbolTable, contributedTypes, attributeSpecs, controlMutationDefaults, dataTypes, describeUnsupportedAttribute, describeUnresolvedType } = options;
|
|
384
450
|
const pslBlockDescriptors = options.pslBlockDescriptors ?? {};
|
|
385
451
|
const contributed = contributedScope(contributedTypeScope(contributedTypes));
|
|
386
452
|
const document = documentScope(symbolTable.topLevel, contributed);
|
|
@@ -478,7 +544,8 @@ function bind(options) {
|
|
|
478
544
|
const specContext = entity.kind === "model" ? {
|
|
479
545
|
symbols: symbolTable,
|
|
480
546
|
model: entity,
|
|
481
|
-
controlMutationDefaults
|
|
547
|
+
controlMutationDefaults,
|
|
548
|
+
dataTypes
|
|
482
549
|
} : void 0;
|
|
483
550
|
bindAttributes(entity, entity.attributes, attributeSpecs.model, (factory) => specContext === void 0 ? void 0 : factory(specContext), {
|
|
484
551
|
...context,
|
|
@@ -778,6 +845,14 @@ function tryBindExpression(rule, expression, ctx, modelContext) {
|
|
|
778
845
|
references,
|
|
779
846
|
diagnostics
|
|
780
847
|
};
|
|
848
|
+
case "dataTypeValue": {
|
|
849
|
+
const literal = readWrittenScalar(expression);
|
|
850
|
+
return {
|
|
851
|
+
matched: literal.ok || literal.reason !== "not-a-literal",
|
|
852
|
+
references,
|
|
853
|
+
diagnostics
|
|
854
|
+
};
|
|
855
|
+
}
|
|
781
856
|
case "rejecting": return {
|
|
782
857
|
matched: false,
|
|
783
858
|
references,
|
|
@@ -1257,6 +1332,55 @@ function bool() {
|
|
|
1257
1332
|
}
|
|
1258
1333
|
};
|
|
1259
1334
|
}
|
|
1335
|
+
const TAGGED_LITERAL_FAILURE_CODES = {
|
|
1336
|
+
nul: "PSL_TAGGED_LITERAL_NUL",
|
|
1337
|
+
"too-large": "PSL_TAGGED_LITERAL_TOO_LARGE"
|
|
1338
|
+
};
|
|
1339
|
+
/** An argument typed by a data type: any literal, admitted by the ADR 254 cast rule. Used as a parameter of an attribute or a `funcCall`. ADR 231, ADR 254. */
|
|
1340
|
+
function dataTypeValue(dataType, support) {
|
|
1341
|
+
const tags = admittedTags(support, dataType);
|
|
1342
|
+
const [firstTag] = tags;
|
|
1343
|
+
const forms = admittedForms(support, [dataType]);
|
|
1344
|
+
return {
|
|
1345
|
+
kind: "dataTypeValue",
|
|
1346
|
+
label: firstTag === void 0 ? describeAdmittedForms(support, dataType) : tagForm(firstTag).phrase,
|
|
1347
|
+
dataType,
|
|
1348
|
+
tags,
|
|
1349
|
+
documentation: support.entries[dataType]?.documentation ?? "",
|
|
1350
|
+
parse: (arg, ctx) => parseDataTypeValue(arg, ctx, dataType, support, forms)
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
function parseDataTypeValue(arg, ctx, dataType, support, forms) {
|
|
1354
|
+
if (!support.lookup.has(dataType)) throw new InternalError(`An argument receives data type "${dataType}", which this stack does not register.`);
|
|
1355
|
+
if (forms.length === 0) throw new InternalError(`An argument receives data type "${dataType}", which nothing in this stack writes.`);
|
|
1356
|
+
const refuse = ({ code, message }) => notOk([leafDiagnostic(ctx, arg, message, code)]);
|
|
1357
|
+
const literal = readWrittenScalar(arg);
|
|
1358
|
+
if (!literal.ok) return literal.reason === "not-a-literal" ? refuse({
|
|
1359
|
+
code: "PSL_INVALID_ATTRIBUTE_SYNTAX",
|
|
1360
|
+
message: `${describeExpected(forms)}; got ${literal.found}`
|
|
1361
|
+
}) : refuse({
|
|
1362
|
+
code: TAGGED_LITERAL_FAILURE_CODES[literal.reason],
|
|
1363
|
+
message: describeTaggedLiteralFailure(literal.reason)
|
|
1364
|
+
});
|
|
1365
|
+
const read = readWrittenValue(support, literal.written);
|
|
1366
|
+
if (!read.ok) return refuse(describeRefusal(read.failure, support, {
|
|
1367
|
+
forms,
|
|
1368
|
+
rewrite: void 0
|
|
1369
|
+
}));
|
|
1370
|
+
const cast = castTypedValue(support, dataType, read.value);
|
|
1371
|
+
if (!cast.ok) {
|
|
1372
|
+
const rewrite = exactRewrite(support, dataType, literal.written);
|
|
1373
|
+
return refuse(describeRefusal(cast.failure, support, {
|
|
1374
|
+
forms,
|
|
1375
|
+
rewrite
|
|
1376
|
+
}));
|
|
1377
|
+
}
|
|
1378
|
+
return ok({
|
|
1379
|
+
type: dataType,
|
|
1380
|
+
value: cast.value.value,
|
|
1381
|
+
span: nodePslSpan(arg.syntax, ctx.sources)
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1260
1384
|
function entityRef(expected) {
|
|
1261
1385
|
const label = `${expected.kind === "block" ? expected.keyword : expected.kind} reference`;
|
|
1262
1386
|
return {
|
|
@@ -1392,6 +1516,7 @@ function funcCall(name, sig) {
|
|
|
1392
1516
|
label: `${name}()`,
|
|
1393
1517
|
name,
|
|
1394
1518
|
signature: sig,
|
|
1519
|
+
claims: (arg) => plainCallee(arg)?.name === name,
|
|
1395
1520
|
parse: (arg, ctx) => {
|
|
1396
1521
|
const guard = matchCallee(arg, name, ctx);
|
|
1397
1522
|
if (!guard.ok) return guard;
|
|
@@ -1410,15 +1535,22 @@ function funcCall(name, sig) {
|
|
|
1410
1535
|
}
|
|
1411
1536
|
};
|
|
1412
1537
|
}
|
|
1413
|
-
function
|
|
1538
|
+
function plainCallee(arg) {
|
|
1414
1539
|
const call = FunctionCallAst.cast(arg.syntax);
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
if (qname
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1540
|
+
const qname = call?.name();
|
|
1541
|
+
if (call === void 0 || qname === void 0) return void 0;
|
|
1542
|
+
if (qname.dot() !== void 0 || qname.colon() !== void 0) return void 0;
|
|
1543
|
+
const name = qname.identifier()?.token()?.text;
|
|
1544
|
+
return name === void 0 ? void 0 : {
|
|
1545
|
+
call,
|
|
1546
|
+
name
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
function matchCallee(arg, name, ctx) {
|
|
1550
|
+
const callee = plainCallee(arg);
|
|
1551
|
+
if (callee === void 0) return notOk([leafDiagnostic(ctx, arg, "Expected a function call")]);
|
|
1552
|
+
if (callee.name !== name) return notOk([leafDiagnostic(ctx, arg, `Expected ${name}()`)]);
|
|
1553
|
+
return ok(callee.call);
|
|
1422
1554
|
}
|
|
1423
1555
|
function identifier(name, options) {
|
|
1424
1556
|
const label = name ?? "identifier";
|
|
@@ -1516,6 +1648,9 @@ function list(of, opts) {
|
|
|
1516
1648
|
}
|
|
1517
1649
|
};
|
|
1518
1650
|
}
|
|
1651
|
+
/**
|
|
1652
|
+
* The first alternative that accepts the argument. When exactly one alternative claims the argument's shape, its result, success or failure, so its diagnostics about the argument are kept.
|
|
1653
|
+
*/
|
|
1519
1654
|
function oneOf(...alts) {
|
|
1520
1655
|
const label = alts.map((alt) => alt.label).join(" | ");
|
|
1521
1656
|
return {
|
|
@@ -1524,6 +1659,9 @@ function oneOf(...alts) {
|
|
|
1524
1659
|
alternatives: alts,
|
|
1525
1660
|
parse: (arg, ctx) => {
|
|
1526
1661
|
const [head, ...tail] = blindCast(alts);
|
|
1662
|
+
const claiming = [head, ...tail].filter((alt) => alt.claims?.(arg) === true);
|
|
1663
|
+
const [only] = claiming;
|
|
1664
|
+
if (only !== void 0 && claiming.length === 1) return only.parse(arg, ctx);
|
|
1527
1665
|
let rejection = head.parse(arg, ctx);
|
|
1528
1666
|
if (rejection.ok) return rejection;
|
|
1529
1667
|
for (const alt of tail) {
|
|
@@ -1730,6 +1868,11 @@ function optional(type, ...rest) {
|
|
|
1730
1868
|
defaultValue: rest[0]
|
|
1731
1869
|
};
|
|
1732
1870
|
}
|
|
1871
|
+
/** The data types of a stack that registers none. */
|
|
1872
|
+
const EMPTY_DATA_TYPES = {
|
|
1873
|
+
entries: {},
|
|
1874
|
+
lookup: createDataTypeLookup([])
|
|
1875
|
+
};
|
|
1733
1876
|
function structBlock(config) {
|
|
1734
1877
|
return {
|
|
1735
1878
|
mode: "struct",
|
|
@@ -1975,6 +2118,6 @@ function renameLegacyDirective(text) {
|
|
|
1975
2118
|
return text.replace(DIRECTIVE, (whole, lead, name, trail) => name === LEGACY_NAME ? `${lead}prisma-8${trail}` : whole);
|
|
1976
2119
|
}
|
|
1977
2120
|
//#endregion
|
|
1978
|
-
export { NAME_THE_PSL_SOURCE_LOSES, PSL_UNRESOLVED_REFERENCE, assembleAttributeSpecs, blockAttribute, blockSpecFactoryOf, bool, buildSymbolTable, contributedTypeOf, createBinder, createPslDiagnosticCollector, diagnosticFromSpan, diagnosticSource, entityRef, entityReference, fieldAttribute, fieldRef, findBlockDescriptor, flatPslModels, funcCall, getPositionalArgument, identifier, int, interpretArgs, interpretAttribute, interpretExtensionBlock, interpretExtensionBlockAttributes, interpretExtensionBlocks, isNamespaceLike, isPrismaNextSchema, isPslIdentifier, json, jsonValue, keywordPslSpan, leafDiagnostic, list, mapBlock, mapPslDiagnostics, matchesSelector, memberEntries, modelAttribute, namespacePslExtensionBlocks, nodePslSpan, num, numLiteral, oneOf, optional, parseQuotedStringLiteral, readResolvedAttribute, readResolvedAttributes, readResolvedConstructorCall, record, referencedFieldRef, renameLegacyDirective, str, structBlock, taggedLiteral, typeReferenceNode };
|
|
2121
|
+
export { EMPTY_DATA_TYPES, NAME_THE_PSL_SOURCE_LOSES, PSL_UNRESOLVED_REFERENCE, assembleAttributeSpecs, blockAttribute, blockSpecFactoryOf, bool, buildSymbolTable, contributedTypeOf, createBinder, createPslDiagnosticCollector, dataTypeValue, diagnosticFromSpan, diagnosticSource, entityRef, entityReference, fieldAttribute, fieldRef, findBlockDescriptor, flatPslModels, funcCall, getPositionalArgument, identifier, int, interpretArgs, interpretAttribute, interpretExtensionBlock, interpretExtensionBlockAttributes, interpretExtensionBlocks, isNamespaceLike, isPrismaNextSchema, isPslIdentifier, json, jsonValue, keywordPslSpan, leafDiagnostic, list, mapBlock, mapPslDiagnostics, matchesSelector, memberEntries, modelAttribute, namespacePslExtensionBlocks, nodePslSpan, num, numLiteral, oneOf, optional, parseQuotedStringLiteral, readResolvedAttribute, readResolvedAttributes, readResolvedConstructorCall, readWrittenScalar, record, referencedFieldRef, renameLegacyDirective, str, structBlock, taggedLiteral, typeReferenceNode };
|
|
1979
2122
|
|
|
1980
2123
|
//# sourceMappingURL=psl-parser.mjs.map
|