@prisma-next/psl-parser 0.12.0 → 0.13.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as parsePslDocument } from "./parser-Bjdnhl7C.mjs";
1
+ import { t as parsePslDocument } from "./parser-Dfi3Wfdq.mjs";
2
2
  import { ParsePslDocumentInput, ParsePslDocumentResult, PslAttribute, PslAttribute as PslAttribute$1, PslAttributeArgument, PslAttributeNamedArgument, PslAttributePositionalArgument, PslAttributeTarget, PslCompositeType, PslDefaultFunctionValue, PslDefaultLiteralValue, PslDefaultValue, PslDiagnostic, PslDiagnosticCode, PslDocumentAst, PslEnum, PslEnumValue, PslField, PslFieldAttribute, PslModel, PslModelAttribute, PslNamedTypeDeclaration, PslNamespace, PslPosition, PslSpan, PslTypeConstructorCall, PslTypesBlock } from "@prisma-next/framework-components/psl-ast";
3
3
 
4
4
  //#region src/attribute-helpers.d.ts
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as parsePslDocument } from "./parser-R7ldFfcr.mjs";
1
+ import { t as parsePslDocument } from "./parser-Cw_zV0M5.mjs";
2
2
  //#region src/attribute-helpers.ts
3
3
  function getPositionalArgument(attribute, index = 0) {
4
4
  return attribute.args.filter((arg) => arg.kind === "positional")[index]?.value;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/attribute-helpers.ts"],"sourcesContent":["import type { PslAttribute } from '@prisma-next/framework-components/psl-ast';\n\nexport function getPositionalArgument(attribute: PslAttribute, index = 0): string | undefined {\n const entries = attribute.args.filter((arg) => arg.kind === 'positional');\n return entries[index]?.value;\n}\n\nexport function parseQuotedStringLiteral(value: string): string | undefined {\n const trimmed = value.trim();\n const match = trimmed.match(/^(['\"])(.*)\\1$/);\n if (!match) return undefined;\n return match[2] ?? '';\n}\n"],"mappings":";;AAEA,SAAgB,sBAAsB,WAAyB,QAAQ,GAAuB;CAE5F,OADgB,UAAU,KAAK,QAAQ,QAAQ,IAAI,SAAS,YAC/C,EAAE,QAAQ;AACzB;AAEA,SAAgB,yBAAyB,OAAmC;CAE1E,MAAM,QADU,MAAM,KACF,EAAE,MAAM,gBAAgB;CAC5C,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,OAAO,MAAM,MAAM;AACrB"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/attribute-helpers.ts"],"sourcesContent":["import type { PslAttribute } from '@prisma-next/framework-components/psl-ast';\n\nexport function getPositionalArgument(attribute: PslAttribute, index = 0): string | undefined {\n const entries = attribute.args.filter((arg) => arg.kind === 'positional');\n return entries[index]?.value;\n}\n\nexport function parseQuotedStringLiteral(value: string): string | undefined {\n const trimmed = value.trim();\n const match = trimmed.match(/^(['\"])(.*)\\1$/);\n if (!match) return undefined;\n return match[2] ?? '';\n}\n"],"mappings":";;AAEA,SAAgB,sBAAsB,WAAyB,QAAQ,GAAuB;CAE5F,OADgB,UAAU,KAAK,QAAQ,QAAQ,IAAI,SAAS,YAC/C,CAAC,CAAC,MAAM,EAAE;AACzB;AAEA,SAAgB,yBAAyB,OAAmC;CAE1E,MAAM,QADU,MAAM,KACF,CAAC,CAAC,MAAM,gBAAgB;CAC5C,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,OAAO,MAAM,MAAM;AACrB"}
@@ -1,4 +1,6 @@
1
- import { UNSPECIFIED_PSL_NAMESPACE_ID } from "@prisma-next/framework-components/psl-ast";
1
+ import { isAuthoringPslBlockDescriptor } from "@prisma-next/framework-components/authoring";
2
+ import { emptyCodecLookup } from "@prisma-next/framework-components/codec";
3
+ import { UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries, namespacePslExtensionBlocks, validateExtensionBlock } from "@prisma-next/framework-components/psl-ast";
2
4
  import { ifDefined } from "@prisma-next/utils/defined";
3
5
  //#region src/parser.ts
4
6
  const SCALAR_TYPES = new Set([
@@ -34,6 +36,7 @@ function parsePslDocument(input) {
34
36
  models: [],
35
37
  enums: [],
36
38
  compositeTypes: [],
39
+ extensionBlocks: [],
37
40
  span: spanIfNew
38
41
  };
39
42
  namespacesByName.set(name, acc);
@@ -42,6 +45,7 @@ function parsePslDocument(input) {
42
45
  return acc;
43
46
  };
44
47
  let typesBlock;
48
+ const pslBlockNamespace = input.pslBlockDescriptors ?? {};
45
49
  const parseBody = (startLine, endLineExclusive, currentNamespaceName, isInsideNamespace) => {
46
50
  let lineIndex = startLine;
47
51
  while (lineIndex < endLineExclusive) {
@@ -111,6 +115,22 @@ function parsePslDocument(input) {
111
115
  lineIndex = bounds.endLine + 1;
112
116
  continue;
113
117
  }
118
+ const extensionBlockMatch = line.match(/^([A-Za-z_]\w*)\s+([A-Za-z_]\w*)\s*\{$/);
119
+ if (extensionBlockMatch) {
120
+ const keyword = extensionBlockMatch[1] ?? "";
121
+ const blockName = extensionBlockMatch[2] ?? "";
122
+ const descriptor = lookupExtensionBlockDescriptor(pslBlockNamespace, keyword);
123
+ if (descriptor) {
124
+ const bounds = findBlockBounds(context, lineIndex);
125
+ if (blockName.length > 0) {
126
+ const acc = getOrCreateNamespace(currentNamespaceName, createTrimmedLineSpan(context, lineIndex));
127
+ const node = parseExtensionBlock(context, descriptor, blockName, lineIndex, bounds);
128
+ acc.extensionBlocks.push(node);
129
+ }
130
+ lineIndex = bounds.endLine + 1;
131
+ continue;
132
+ }
133
+ }
114
134
  if (line.includes("{")) {
115
135
  pushDiagnostic(context, {
116
136
  code: "PSL_UNSUPPORTED_TOP_LEVEL_BLOCK",
@@ -174,7 +194,7 @@ function parsePslDocument(input) {
174
194
  for (const name of namespaceOrder) {
175
195
  const acc = namespacesByName.get(name);
176
196
  if (!acc) continue;
177
- if (name === UNSPECIFIED_PSL_NAMESPACE_ID && acc.models.length === 0 && acc.enums.length === 0 && acc.compositeTypes.length === 0) continue;
197
+ if (name === UNSPECIFIED_PSL_NAMESPACE_ID && acc.models.length === 0 && acc.enums.length === 0 && acc.compositeTypes.length === 0 && acc.extensionBlocks.length === 0) continue;
178
198
  const normalizedModels = acc.models.map((model) => ({
179
199
  ...model,
180
200
  fields: model.fields.map((field) => {
@@ -186,14 +206,26 @@ function parsePslDocument(input) {
186
206
  };
187
207
  })
188
208
  }));
189
- namespaces.push({
209
+ namespaces.push(makePslNamespace({
190
210
  kind: "namespace",
191
211
  name,
192
- models: normalizedModels,
193
- enums: acc.enums,
194
- compositeTypes: acc.compositeTypes,
212
+ entries: makePslNamespaceEntries(normalizedModels, acc.enums, acc.compositeTypes, acc.extensionBlocks),
195
213
  span: acc.span ?? documentSpan
196
- });
214
+ }));
215
+ }
216
+ if (Object.keys(pslBlockNamespace).length > 0) {
217
+ const codecLookup = input.codecLookup ?? emptyCodecLookup;
218
+ const descriptorByDiscriminator = /* @__PURE__ */ new Map();
219
+ for (const value of Object.values(pslBlockNamespace)) if (isAuthoringPslBlockDescriptor(value)) descriptorByDiscriminator.set(value.discriminator, value);
220
+ for (const ns of namespaces) for (const block of namespacePslExtensionBlocks(ns)) {
221
+ const descriptor = descriptorByDiscriminator.get(block.kind);
222
+ if (descriptor === void 0) continue;
223
+ const blockDiagnostics = validateExtensionBlock(block, descriptor, input.sourceId, codecLookup, {
224
+ ownerNamespace: ns,
225
+ allNamespaces: namespaces
226
+ });
227
+ diagnostics.push(...blockDiagnostics);
228
+ }
197
229
  }
198
230
  return {
199
231
  ast: {
@@ -499,9 +531,34 @@ function parseField(context, line, lineIndex) {
499
531
  if (typeConstructor === "malformed") return;
500
532
  let typeName;
501
533
  let typeNamespaceId;
534
+ let typeContractSpaceId;
502
535
  if (typeConstructor) typeName = typeConstructor.path.join(".");
503
536
  else {
504
- if ((baseTypeSource.match(/\./g) ?? []).length > 1) {
537
+ const colonCount = (baseTypeSource.match(/:/g) ?? []).length;
538
+ if (colonCount > 1) {
539
+ pushDiagnostic(context, {
540
+ code: "PSL_INVALID_MODEL_MEMBER",
541
+ message: `Invalid model member declaration "${line}"`,
542
+ span: createTrimmedLineSpan(context, lineIndex)
543
+ });
544
+ return;
545
+ }
546
+ let typeRefSource;
547
+ if (colonCount === 1) {
548
+ const colonIndex = baseTypeSource.indexOf(":");
549
+ const spaceCandidate = baseTypeSource.slice(0, colonIndex);
550
+ typeRefSource = baseTypeSource.slice(colonIndex + 1);
551
+ if (!/^[A-Za-z_]\w*$/.test(spaceCandidate)) {
552
+ pushDiagnostic(context, {
553
+ code: "PSL_INVALID_MODEL_MEMBER",
554
+ message: `Invalid model member declaration "${line}"`,
555
+ span: createTrimmedLineSpan(context, lineIndex)
556
+ });
557
+ return;
558
+ }
559
+ typeContractSpaceId = spaceCandidate;
560
+ } else typeRefSource = baseTypeSource;
561
+ if ((typeRefSource.match(/\./g) ?? []).length > 1) {
505
562
  pushDiagnostic(context, {
506
563
  code: "PSL_INVALID_QUALIFIED_TYPE",
507
564
  message: `Nested dot-qualified type "${baseTypeSource}" is not supported; use exactly one qualifier segment (e.g. "ns.TypeName")`,
@@ -509,7 +566,7 @@ function parseField(context, line, lineIndex) {
509
566
  });
510
567
  return;
511
568
  }
512
- const singleMatch = baseTypeSource.match(/^([A-Za-z_]\w*)(?:\.([A-Za-z_]\w*))?$/);
569
+ const singleMatch = typeRefSource.match(/^([A-Za-z_]\w*)(?:\.([A-Za-z_]\w*))?$/);
513
570
  if (!singleMatch) {
514
571
  pushDiagnostic(context, {
515
572
  code: "PSL_INVALID_MODEL_MEMBER",
@@ -532,6 +589,7 @@ function parseField(context, line, lineIndex) {
532
589
  name: fieldName,
533
590
  typeName,
534
591
  ...ifDefined("typeNamespaceId", typeNamespaceId),
592
+ ...ifDefined("typeContractSpaceId", typeContractSpaceId),
535
593
  ...ifDefined("typeConstructor", typeConstructor),
536
594
  optional,
537
595
  list,
@@ -552,6 +610,7 @@ function parseField(context, line, lineIndex) {
552
610
  name: fieldName,
553
611
  typeName,
554
612
  ...ifDefined("typeNamespaceId", typeNamespaceId),
613
+ ...ifDefined("typeContractSpaceId", typeContractSpaceId),
555
614
  ...ifDefined("typeConstructor", typeConstructor),
556
615
  optional,
557
616
  list,
@@ -1004,7 +1063,114 @@ function pushDiagnostic(context, diagnostic) {
1004
1063
  sourceId: context.sourceId
1005
1064
  });
1006
1065
  }
1066
+ function lookupExtensionBlockDescriptor(namespace, keyword) {
1067
+ if (!Object.hasOwn(namespace, keyword)) return;
1068
+ const value = namespace[keyword];
1069
+ return isAuthoringPslBlockDescriptor(value) ? value : void 0;
1070
+ }
1071
+ /**
1072
+ * Reads an extension block body generically, driven by the descriptor's
1073
+ * `parameters` map. Each `key = <rhs>` line in the body is matched against
1074
+ * a declared parameter and the RHS is captured per the parameter's kind:
1075
+ *
1076
+ * - `ref` → the bareword identifier token (`PslExtensionBlockParamRef`)
1077
+ * - `value` → the raw RHS text verbatim (`PslExtensionBlockParamScalarValue`)
1078
+ * - `option` → the chosen bareword token (`PslExtensionBlockParamOption`)
1079
+ * - `list` → bracketed `[a, b, …]` list, each element captured per `of`
1080
+ * (`PslExtensionBlockParamList`)
1081
+ *
1082
+ * No validation runs here (unknown key, missing required, codec acceptance,
1083
+ * option-in-set, ref resolution). A body line that is not `key = value`
1084
+ * shaped emits a `PSL_INVALID_EXTENSION_BLOCK_MEMBER` parse diagnostic.
1085
+ */
1086
+ function parseExtensionBlock(context, descriptor, blockName, keywordLineIndex, bounds) {
1087
+ const parameters = {};
1088
+ for (let lineIndex = bounds.startLine + 1; lineIndex < bounds.endLine; lineIndex += 1) {
1089
+ const line = stripInlineComment(context.lines[lineIndex] ?? "").trim();
1090
+ if (line.length === 0) continue;
1091
+ const assignMatch = line.match(/^([A-Za-z_]\w*)\s*=\s*(.+)$/);
1092
+ if (!assignMatch) {
1093
+ pushDiagnostic(context, {
1094
+ code: "PSL_INVALID_EXTENSION_BLOCK_MEMBER",
1095
+ message: `Invalid extension block body line "${line}"; expected "key = value"`,
1096
+ span: createTrimmedLineSpan(context, lineIndex)
1097
+ });
1098
+ continue;
1099
+ }
1100
+ const key = assignMatch[1] ?? "";
1101
+ const rhsRaw = (assignMatch[2] ?? "").trim();
1102
+ const paramDescriptor = descriptor.parameters[key];
1103
+ if (paramDescriptor === void 0) {
1104
+ parameters[key] = {
1105
+ kind: "value",
1106
+ raw: rhsRaw,
1107
+ span: createTrimmedLineSpan(context, lineIndex)
1108
+ };
1109
+ continue;
1110
+ }
1111
+ const captured = captureParamRhs(context, lineIndex, rhsRaw, paramDescriptor);
1112
+ if (captured !== void 0) parameters[key] = captured;
1113
+ }
1114
+ return {
1115
+ kind: descriptor.discriminator,
1116
+ name: blockName,
1117
+ parameters,
1118
+ span: createLineRangeSpan(context, keywordLineIndex, bounds.endLine)
1119
+ };
1120
+ }
1121
+ /**
1122
+ * Captures a single parameter RHS string according to the declared parameter
1123
+ * kind. Returns `undefined` and pushes a diagnostic only if the syntax is
1124
+ * genuinely malformed (e.g. a `list` with no opening bracket). Value
1125
+ * acceptance (codec, option-in-set, ref resolution) is handled by the validator.
1126
+ */
1127
+ function captureParamRhs(context, lineIndex, rhs, param) {
1128
+ const span = createTrimmedLineSpan(context, lineIndex);
1129
+ switch (param.kind) {
1130
+ case "ref": return {
1131
+ kind: "ref",
1132
+ identifier: rhs,
1133
+ span
1134
+ };
1135
+ case "value": return {
1136
+ kind: "value",
1137
+ raw: rhs,
1138
+ span
1139
+ };
1140
+ case "option": return {
1141
+ kind: "option",
1142
+ token: rhs,
1143
+ span
1144
+ };
1145
+ case "list": {
1146
+ if (!rhs.startsWith("[") || !rhs.endsWith("]")) {
1147
+ pushDiagnostic(context, {
1148
+ code: "PSL_INVALID_EXTENSION_BLOCK_MEMBER",
1149
+ message: `Expected a bracketed list "[…]" for list parameter, got "${rhs}"`,
1150
+ span
1151
+ });
1152
+ return;
1153
+ }
1154
+ const inner = rhs.slice(1, -1).trim();
1155
+ const items = [];
1156
+ if (inner.length > 0) {
1157
+ const segments = splitTopLevelSegments(inner, ",");
1158
+ for (const segment of segments) {
1159
+ const itemRhs = segment.value.trim();
1160
+ if (itemRhs.length === 0) continue;
1161
+ const item = captureParamRhs(context, lineIndex, itemRhs, param.of);
1162
+ if (item !== void 0) items.push(item);
1163
+ }
1164
+ }
1165
+ return {
1166
+ kind: "list",
1167
+ items,
1168
+ span
1169
+ };
1170
+ }
1171
+ }
1172
+ }
1007
1173
  //#endregion
1008
1174
  export { parsePslDocument as t };
1009
1175
 
1010
- //# sourceMappingURL=parser-R7ldFfcr.mjs.map
1176
+ //# sourceMappingURL=parser-Cw_zV0M5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser-Cw_zV0M5.mjs","names":[],"sources":["../src/parser.ts"],"sourcesContent":["import type {\n AuthoringPslBlockDescriptor,\n AuthoringPslBlockDescriptorNamespace,\n} from '@prisma-next/framework-components/authoring';\nimport { isAuthoringPslBlockDescriptor } from '@prisma-next/framework-components/authoring';\nimport { emptyCodecLookup } from '@prisma-next/framework-components/codec';\nimport type {\n ParsePslDocumentInput,\n ParsePslDocumentResult,\n PslAttribute,\n PslAttributeArgument,\n PslAttributeTarget,\n PslCompositeType,\n PslDiagnostic,\n PslDiagnosticCode,\n PslDocumentAst,\n PslEnum,\n PslEnumValue,\n PslExtensionBlock,\n PslExtensionBlockParamValue,\n PslField,\n PslFieldAttribute,\n PslModel,\n PslModelAttribute,\n PslNamedTypeDeclaration,\n PslNamespace,\n PslPosition,\n PslSpan,\n PslTypeConstructorCall,\n PslTypesBlock,\n} from '@prisma-next/framework-components/psl-ast';\nimport {\n makePslNamespace,\n makePslNamespaceEntries,\n namespacePslExtensionBlocks,\n UNSPECIFIED_PSL_NAMESPACE_ID,\n validateExtensionBlock,\n} from '@prisma-next/framework-components/psl-ast';\nimport { ifDefined } from '@prisma-next/utils/defined';\n\nconst SCALAR_TYPES = new Set([\n 'String',\n 'Boolean',\n 'Int',\n 'BigInt',\n 'Float',\n 'Decimal',\n 'DateTime',\n 'Json',\n 'Bytes',\n]);\n\ninterface BlockBounds {\n readonly startLine: number;\n readonly endLine: number;\n readonly closed: boolean;\n}\n\ninterface ParserContext {\n readonly schema: string;\n readonly sourceId: string;\n readonly lines: readonly string[];\n readonly lineOffsets: readonly number[];\n readonly diagnostics: PslDiagnostic[];\n}\n\nexport function parsePslDocument(input: ParsePslDocumentInput): ParsePslDocumentResult {\n const normalizedSchema = input.schema.replaceAll('\\r\\n', '\\n');\n const lines = normalizedSchema.split('\\n');\n const lineOffsets = computeLineOffsets(normalizedSchema);\n const diagnostics: PslDiagnostic[] = [];\n const context: ParserContext = {\n schema: normalizedSchema,\n sourceId: input.sourceId,\n lines,\n lineOffsets,\n diagnostics,\n };\n\n interface NamespaceAccumulator {\n name: string;\n models: PslModel[];\n enums: PslEnum[];\n compositeTypes: PslCompositeType[];\n extensionBlocks: PslExtensionBlock[];\n span: PslSpan | undefined;\n }\n\n const namespaceOrder: string[] = [];\n const namespacesByName = new Map<string, NamespaceAccumulator>();\n const getOrCreateNamespace = (\n name: string,\n spanIfNew: PslSpan | undefined,\n ): NamespaceAccumulator => {\n let acc = namespacesByName.get(name);\n if (!acc) {\n acc = {\n name,\n models: [],\n enums: [],\n compositeTypes: [],\n extensionBlocks: [],\n span: spanIfNew,\n };\n namespacesByName.set(name, acc);\n namespaceOrder.push(name);\n }\n return acc;\n };\n\n let typesBlock: PslTypesBlock | undefined;\n const pslBlockNamespace: AuthoringPslBlockDescriptorNamespace = input.pslBlockDescriptors ?? {};\n\n // Walk a contiguous range of lines, routing top-level declarations into the\n // active namespace bucket. Called once for the whole document and once per\n // `namespace { … }` block body; nested `namespace { … }` or `types { … }`\n // blocks inside a namespace body are rejected with a diagnostic.\n const parseBody = (\n startLine: number,\n endLineExclusive: number,\n currentNamespaceName: string,\n isInsideNamespace: boolean,\n ): void => {\n let lineIndex = startLine;\n while (lineIndex < endLineExclusive) {\n const rawLine = context.lines[lineIndex] ?? '';\n const line = stripInlineComment(rawLine).trim();\n if (line.length === 0) {\n lineIndex += 1;\n continue;\n }\n\n const modelMatch = line.match(/^model\\s+([A-Za-z_]\\w*)\\s*\\{$/);\n if (modelMatch) {\n const bounds = findBlockBounds(context, lineIndex);\n const name = modelMatch[1] ?? '';\n if (name.length > 0) {\n const acc = getOrCreateNamespace(\n currentNamespaceName,\n createTrimmedLineSpan(context, lineIndex),\n );\n acc.models.push(parseModelBlock(context, name, bounds));\n }\n lineIndex = bounds.endLine + 1;\n continue;\n }\n\n const enumMatch = line.match(/^enum\\s+([A-Za-z_]\\w*)\\s*\\{$/);\n if (enumMatch) {\n const bounds = findBlockBounds(context, lineIndex);\n const name = enumMatch[1] ?? '';\n if (name.length > 0) {\n const acc = getOrCreateNamespace(\n currentNamespaceName,\n createTrimmedLineSpan(context, lineIndex),\n );\n acc.enums.push(parseEnumBlock(context, name, bounds));\n }\n lineIndex = bounds.endLine + 1;\n continue;\n }\n\n const compositeTypeMatch = line.match(/^type\\s+([A-Za-z_]\\w*)\\s*\\{$/);\n if (compositeTypeMatch) {\n const bounds = findBlockBounds(context, lineIndex);\n const name = compositeTypeMatch[1] ?? '';\n if (name.length > 0) {\n const acc = getOrCreateNamespace(\n currentNamespaceName,\n createTrimmedLineSpan(context, lineIndex),\n );\n acc.compositeTypes.push(parseCompositeTypeBlock(context, name, bounds));\n }\n lineIndex = bounds.endLine + 1;\n continue;\n }\n\n const namespaceMatch = line.match(/^namespace\\s+([A-Za-z_]\\w*)\\s*\\{$/);\n if (namespaceMatch) {\n const bounds = findBlockBounds(context, lineIndex);\n const name = namespaceMatch[1] ?? '';\n if (isInsideNamespace) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_NAMESPACE_BLOCK',\n message: `Recursive \"namespace ${name}\" block is not allowed; namespace blocks may not nest`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n } else if (name === UNSPECIFIED_PSL_NAMESPACE_ID) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_NAMESPACE_BLOCK',\n message: `Namespace name \"${UNSPECIFIED_PSL_NAMESPACE_ID}\" is reserved for the parser-synthesised bucket for top-level declarations`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n } else if (name.length > 0) {\n getOrCreateNamespace(name, createTrimmedLineSpan(context, lineIndex));\n parseBody(bounds.startLine + 1, bounds.endLine, name, true);\n }\n lineIndex = bounds.endLine + 1;\n continue;\n }\n\n if (/^types\\s*\\{$/.test(line)) {\n const bounds = findBlockBounds(context, lineIndex);\n if (isInsideNamespace) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_NAMESPACE_BLOCK',\n message:\n '`types` blocks must be declared at the document top level, not inside a namespace block',\n span: createTrimmedLineSpan(context, lineIndex),\n });\n } else if (typesBlock !== undefined) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_TYPES_MEMBER',\n message: 'Only one top-level `types` block is allowed per document',\n span: createTrimmedLineSpan(context, lineIndex),\n });\n } else {\n typesBlock = parseTypesBlock(context, bounds);\n }\n lineIndex = bounds.endLine + 1;\n continue;\n }\n\n const extensionBlockMatch = line.match(/^([A-Za-z_]\\w*)\\s+([A-Za-z_]\\w*)\\s*\\{$/);\n if (extensionBlockMatch) {\n const keyword = extensionBlockMatch[1] ?? '';\n const blockName = extensionBlockMatch[2] ?? '';\n const descriptor = lookupExtensionBlockDescriptor(pslBlockNamespace, keyword);\n if (descriptor) {\n const bounds = findBlockBounds(context, lineIndex);\n if (blockName.length > 0) {\n const acc = getOrCreateNamespace(\n currentNamespaceName,\n createTrimmedLineSpan(context, lineIndex),\n );\n const node = parseExtensionBlock(context, descriptor, blockName, lineIndex, bounds);\n acc.extensionBlocks.push(node);\n }\n lineIndex = bounds.endLine + 1;\n continue;\n }\n }\n\n if (line.includes('{')) {\n const blockName = line.split(/\\s+/)[0] ?? 'block';\n pushDiagnostic(context, {\n code: 'PSL_UNSUPPORTED_TOP_LEVEL_BLOCK',\n message: `Unsupported top-level block \"${blockName}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n const bounds = findBlockBounds(context, lineIndex);\n lineIndex = bounds.endLine + 1;\n continue;\n }\n\n pushDiagnostic(context, {\n code: 'PSL_UNSUPPORTED_TOP_LEVEL_BLOCK',\n message: `Unsupported top-level declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n lineIndex += 1;\n }\n };\n\n parseBody(0, lines.length, UNSPECIFIED_PSL_NAMESPACE_ID, false);\n\n // Named-type validation: types are document-scoped (one block, outside any\n // namespace), so collision checks compare named-type names against every\n // model/enum/composite-type in every namespace.\n const allModels: PslModel[] = [];\n const allEnums: PslEnum[] = [];\n const allCompositeTypes: PslCompositeType[] = [];\n for (const name of namespaceOrder) {\n const acc = namespacesByName.get(name);\n if (!acc) continue;\n allModels.push(...acc.models);\n allEnums.push(...acc.enums);\n allCompositeTypes.push(...acc.compositeTypes);\n }\n\n const namedTypeNames = new Set(\n (typesBlock?.declarations ?? []).map((declaration) => declaration.name),\n );\n const modelNames = new Set(allModels.map((model) => model.name));\n const enumNames = new Set(allEnums.map((enumBlock) => enumBlock.name));\n const compositeTypeNames = new Set(allCompositeTypes.map((ct) => ct.name));\n for (const declaration of typesBlock?.declarations ?? []) {\n if (SCALAR_TYPES.has(declaration.name)) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_TYPES_MEMBER',\n message: `Named type \"${declaration.name}\" conflicts with scalar type \"${declaration.name}\"`,\n span: declaration.span,\n });\n continue;\n }\n if (modelNames.has(declaration.name)) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_TYPES_MEMBER',\n message: `Named type \"${declaration.name}\" conflicts with model name \"${declaration.name}\"`,\n span: declaration.span,\n });\n continue;\n }\n if (enumNames.has(declaration.name)) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_TYPES_MEMBER',\n message: `Named type \"${declaration.name}\" conflicts with enum name \"${declaration.name}\"`,\n span: declaration.span,\n });\n }\n }\n\n const documentSpan: PslSpan = {\n start: createPosition(context, 0, 0),\n end: createPosition(\n context,\n Math.max(lines.length - 1, 0),\n (lines[Math.max(lines.length - 1, 0)] ?? '').length,\n ),\n };\n\n const namespaces: PslNamespace[] = [];\n for (const name of namespaceOrder) {\n const acc = namespacesByName.get(name);\n if (!acc) continue;\n // Drop the synthesised __unspecified__ entry when it ended up empty (e.g.\n // every declaration in the document lived inside an explicit\n // `namespace { … }` block). Keeping a phantom bucket would force every\n // downstream consumer to special-case \"namespace with no members\".\n if (\n name === UNSPECIFIED_PSL_NAMESPACE_ID &&\n acc.models.length === 0 &&\n acc.enums.length === 0 &&\n acc.compositeTypes.length === 0 &&\n acc.extensionBlocks.length === 0\n ) {\n continue;\n }\n const normalizedModels = acc.models.map((model) => ({\n ...model,\n fields: model.fields.map((field) => {\n if (!namedTypeNames.has(field.typeName)) {\n return field;\n }\n const hasRelationAttribute = field.attributes.some(\n (attribute) => attribute.name === 'relation',\n );\n if (\n hasRelationAttribute ||\n modelNames.has(field.typeName) ||\n enumNames.has(field.typeName) ||\n compositeTypeNames.has(field.typeName) ||\n SCALAR_TYPES.has(field.typeName)\n ) {\n return field;\n }\n return {\n ...field,\n typeRef: field.typeName,\n };\n }),\n }));\n namespaces.push(\n makePslNamespace({\n kind: 'namespace',\n name,\n entries: makePslNamespaceEntries(\n normalizedModels,\n acc.enums,\n acc.compositeTypes,\n acc.extensionBlocks,\n ),\n span: acc.span ?? documentSpan,\n }),\n );\n }\n\n // Validate extension blocks with the generic validator after the full\n // AST is assembled. The validator needs all namespaces for ref resolution.\n // It runs whenever pslBlockDescriptors are registered — codecLookup falls\n // back to emptyCodecLookup when not provided, which rejects value-kind\n // parameters with unknown codecs. Callers with value parameters should\n // always supply a codecLookup.\n if (Object.keys(pslBlockNamespace).length > 0) {\n const codecLookup = input.codecLookup ?? emptyCodecLookup;\n // Build a discriminator → descriptor reverse map from the descriptor\n // namespace. The parser keyed by keyword; the validator resolves by\n // node.kind (= discriminator) so we need the reverse direction.\n const descriptorByDiscriminator = new Map<string, AuthoringPslBlockDescriptor>();\n for (const value of Object.values(pslBlockNamespace)) {\n if (isAuthoringPslBlockDescriptor(value)) {\n descriptorByDiscriminator.set(value.discriminator, value);\n }\n }\n for (const ns of namespaces) {\n // Collect extension blocks from entries using the canonical helper, then\n // filter to only those whose discriminator is registered in the namespace.\n for (const block of namespacePslExtensionBlocks(ns)) {\n const descriptor = descriptorByDiscriminator.get(block.kind);\n if (descriptor === undefined) {\n continue;\n }\n const blockDiagnostics = validateExtensionBlock(\n block,\n descriptor,\n input.sourceId,\n codecLookup,\n {\n ownerNamespace: ns,\n allNamespaces: namespaces,\n },\n );\n diagnostics.push(...blockDiagnostics);\n }\n }\n }\n\n const ast: PslDocumentAst = {\n kind: 'document',\n sourceId: input.sourceId,\n namespaces,\n ...ifDefined('types', typesBlock),\n span: documentSpan,\n };\n\n return {\n ast,\n diagnostics,\n ok: diagnostics.length === 0,\n };\n}\n\nfunction parseModelBlock(context: ParserContext, name: string, bounds: BlockBounds): PslModel {\n const fields: PslField[] = [];\n const attributes: PslModelAttribute[] = [];\n\n for (let lineIndex = bounds.startLine + 1; lineIndex < bounds.endLine; lineIndex += 1) {\n const raw = context.lines[lineIndex] ?? '';\n const line = stripInlineComment(raw).trim();\n if (line.length === 0) {\n continue;\n }\n\n if (line.startsWith('@@')) {\n const attribute = parseModelAttribute(context, line, lineIndex);\n if (attribute) {\n attributes.push(attribute);\n }\n continue;\n }\n\n const field = parseField(context, line, lineIndex);\n if (field) {\n fields.push(field);\n }\n }\n\n return {\n kind: 'model',\n name,\n fields,\n attributes,\n span: createLineRangeSpan(context, bounds.startLine, bounds.endLine),\n };\n}\n\nfunction parseCompositeTypeBlock(\n context: ParserContext,\n name: string,\n bounds: BlockBounds,\n): PslCompositeType {\n const fields: PslField[] = [];\n const attributes: PslAttribute[] = [];\n\n for (let lineIndex = bounds.startLine + 1; lineIndex < bounds.endLine; lineIndex += 1) {\n const raw = context.lines[lineIndex] ?? '';\n const line = stripInlineComment(raw).trim();\n if (line.length === 0) {\n continue;\n }\n\n if (line.startsWith('@@')) {\n const attribute = parseModelAttribute(context, line, lineIndex);\n if (attribute) {\n attributes.push(attribute);\n }\n continue;\n }\n\n const field = parseField(context, line, lineIndex);\n if (field) {\n fields.push(field);\n }\n }\n\n return {\n kind: 'compositeType',\n name,\n fields,\n attributes,\n span: createLineRangeSpan(context, bounds.startLine, bounds.endLine),\n };\n}\n\nfunction parseEnumBlock(context: ParserContext, name: string, bounds: BlockBounds): PslEnum {\n const values: PslEnumValue[] = [];\n const attributes: PslAttribute[] = [];\n\n for (let lineIndex = bounds.startLine + 1; lineIndex < bounds.endLine; lineIndex += 1) {\n const raw = context.lines[lineIndex] ?? '';\n const line = stripInlineComment(raw).trim();\n if (line.length === 0) {\n continue;\n }\n\n if (line.startsWith('@@')) {\n const attribute = parseEnumAttribute(context, line, lineIndex);\n if (attribute) {\n attributes.push(attribute);\n }\n continue;\n }\n\n // An enum member line is the bare member identifier, optionally followed\n // by a `@map(\"storage-label\")` attribute. The map attribute lets the\n // printer round-trip enum values whose original storage label is not a\n // valid PSL identifier (e.g. PostgreSQL enum labels with hyphens).\n const valueMatch = line.match(/^([A-Za-z_]\\w*)(?:\\s+@map\\(\\s*\"((?:[^\"\\\\]|\\\\.)*)\"\\s*\\))?$/);\n if (!valueMatch) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ENUM_MEMBER',\n message: `Invalid enum value declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n continue;\n }\n\n const mapName = valueMatch[2] !== undefined ? unescapePslString(valueMatch[2]) : undefined;\n\n values.push({\n kind: 'enumValue',\n name: valueMatch[1] ?? '',\n ...(mapName !== undefined ? { mapName } : {}),\n span: createTrimmedLineSpan(context, lineIndex),\n });\n }\n\n return {\n kind: 'enum',\n name,\n values,\n attributes,\n span: createLineRangeSpan(context, bounds.startLine, bounds.endLine),\n };\n}\n\n/**\n * Decode PSL escape sequences (`\\\\`, `\\\"`, `\\'`, `\\n`, `\\r`) inside a\n * quoted-literal body. The argument is the body of the literal with the\n * surrounding quotes already stripped by the caller. Mirrors the inverse\n * helper in `@prisma-next/psl-printer`'s `escapePslString` so a string\n * round-trips parser → printer → parser unchanged.\n */\nfunction unescapePslString(value: string): string {\n let result = '';\n for (let i = 0; i < value.length; i++) {\n const ch = value.charCodeAt(i);\n if (ch !== 0x5c /* '\\\\' */ || i + 1 >= value.length) {\n result += value[i];\n continue;\n }\n const next = value[i + 1];\n if (next === '\\\\' || next === '\"' || next === \"'\") {\n result += next;\n } else if (next === 'n') {\n result += '\\n';\n } else if (next === 'r') {\n result += '\\r';\n } else {\n result += '\\\\';\n result += next;\n }\n i++;\n }\n return result;\n}\n\nfunction parseTypesBlock(context: ParserContext, bounds: BlockBounds): PslTypesBlock {\n const declarations: PslNamedTypeDeclaration[] = [];\n\n for (let lineIndex = bounds.startLine + 1; lineIndex < bounds.endLine; lineIndex += 1) {\n const raw = context.lines[lineIndex] ?? '';\n const lineWithoutComment = stripInlineComment(raw);\n const line = lineWithoutComment.trim();\n if (line.length === 0) {\n continue;\n }\n\n const declarationMatch = line.match(/^([A-Za-z_]\\w*)\\s*=\\s*(.+)$/);\n if (!declarationMatch) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_TYPES_MEMBER',\n message: `Invalid types declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n continue;\n }\n\n const declarationName = declarationMatch[1] ?? '';\n const trimmedStartColumn = firstNonWhitespaceColumn(raw);\n const declarationValue = (declarationMatch[2] ?? '').trim();\n const valueOffset = line.indexOf(declarationValue);\n const declarationValueColumn = trimmedStartColumn + Math.max(valueOffset, 0);\n\n const typeAndAttributeSplit = splitTypeAndAttributes(declarationValue);\n const typeSource = typeAndAttributeSplit.typeSource.trim();\n const attributeSource = typeAndAttributeSplit.attributeSource.trimStart();\n const leadingAttributeWhitespace =\n typeAndAttributeSplit.attributeSource.length - attributeSource.length;\n\n const typeConstructor = parseTypeConstructorCall(context, {\n declarationValue: typeSource,\n lineIndex,\n startColumn: declarationValueColumn,\n invalidCode: 'PSL_INVALID_TYPES_MEMBER',\n invalidMessage: (value) => `Invalid types declaration \"${value}\"`,\n });\n if (typeConstructor === 'malformed') {\n continue;\n }\n\n const attributeParse = extractAttributeTokensWithSpans(\n context,\n lineIndex,\n attributeSource,\n declarationValueColumn + typeAndAttributeSplit.attributeOffset + leadingAttributeWhitespace,\n );\n if (!attributeParse.ok) {\n continue;\n }\n const attributes = attributeParse.tokens\n .map((token) =>\n parseAttributeToken(context, {\n token: token.text,\n target: 'namedType',\n lineIndex,\n span: token.span,\n }),\n )\n .filter((attribute): attribute is PslAttribute => Boolean(attribute));\n\n if (typeConstructor) {\n declarations.push({\n kind: 'namedType',\n name: declarationName,\n typeConstructor,\n attributes,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n continue;\n }\n\n const baseTypeMatch = typeSource.match(/^([A-Za-z_]\\w*)$/);\n if (!baseTypeMatch) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_TYPES_MEMBER',\n message: `Invalid types declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n continue;\n }\n\n const baseType = baseTypeMatch[1] ?? '';\n\n declarations.push({\n kind: 'namedType',\n name: declarationName,\n baseType,\n attributes,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n }\n\n return {\n kind: 'types',\n declarations,\n span: createLineRangeSpan(context, bounds.startLine, bounds.endLine),\n };\n}\n\nfunction parseTypeConstructorCall(\n context: ParserContext,\n input: {\n readonly declarationValue: string;\n readonly lineIndex: number;\n readonly startColumn: number;\n readonly invalidCode: PslDiagnosticCode;\n readonly invalidMessage: (value: string) => string;\n },\n): PslTypeConstructorCall | 'malformed' | undefined {\n const value = input.declarationValue.trim();\n const constructorMatch = value.match(\n /^([A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)*)\\s*\\(/,\n );\n if (!constructorMatch) {\n return undefined;\n }\n\n // constructorMatch already required `(`; openParen is guaranteed ≥ 0.\n const openParen = value.indexOf('(');\n const closeParen = value.lastIndexOf(')');\n\n if (closeParen !== value.length - 1) {\n pushDiagnostic(context, {\n code: input.invalidCode,\n message: input.invalidMessage(value),\n span: createInlineSpan(\n context,\n input.lineIndex,\n input.startColumn,\n input.startColumn + value.length,\n ),\n });\n return 'malformed';\n }\n\n const constructorPath = constructorMatch[1] ?? '';\n\n const argsRaw = value.slice(openParen + 1, closeParen);\n const args = parseArgumentList(context, {\n argsRaw,\n argsOffset: input.startColumn + openParen + 1,\n lineIndex: input.lineIndex,\n token: value,\n span: createInlineSpan(\n context,\n input.lineIndex,\n input.startColumn,\n input.startColumn + value.length,\n ),\n invalidCode: input.invalidCode,\n invalidEmptyArgumentMessage: `Invalid empty argument in type constructor \"${value}\"`,\n invalidNamedArgumentMessage: (part) =>\n `Invalid named argument syntax \"${part}\" in type constructor \"${value}\"`,\n });\n if (!args) {\n return 'malformed';\n }\n\n return {\n kind: 'typeConstructor',\n path: constructorPath.split('.'),\n args,\n span: createInlineSpan(\n context,\n input.lineIndex,\n input.startColumn,\n input.startColumn + value.length,\n ),\n };\n}\n\nfunction parseModelAttribute(\n context: ParserContext,\n line: string,\n lineIndex: number,\n): PslModelAttribute | undefined {\n const rawLine = context.lines[lineIndex] ?? '';\n const tokenParse = extractAttributeTokensWithSpans(\n context,\n lineIndex,\n line,\n firstNonWhitespaceColumn(rawLine),\n );\n if (!tokenParse.ok || tokenParse.tokens.length !== 1) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Invalid model attribute syntax \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n return undefined;\n }\n const token = tokenParse.tokens[0];\n if (!token) {\n return undefined;\n }\n return parseAttributeToken(context, {\n token: token.text,\n target: 'model',\n lineIndex,\n span: token.span,\n });\n}\n\nfunction parseEnumAttribute(\n context: ParserContext,\n line: string,\n lineIndex: number,\n): PslAttribute | undefined {\n const rawLine = context.lines[lineIndex] ?? '';\n const tokenParse = extractAttributeTokensWithSpans(\n context,\n lineIndex,\n line,\n firstNonWhitespaceColumn(rawLine),\n );\n if (!tokenParse.ok || tokenParse.tokens.length !== 1) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ENUM_MEMBER',\n message: `Invalid enum value declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n return undefined;\n }\n const token = tokenParse.tokens[0];\n if (!token) {\n return undefined;\n }\n const parsed = parseAttributeToken(context, {\n token: token.text,\n target: 'enum',\n lineIndex,\n span: token.span,\n });\n if (!parsed) {\n return undefined;\n }\n if (parsed.name !== 'map') {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ENUM_MEMBER',\n message: `Invalid enum value declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n return undefined;\n }\n return parsed;\n}\n\nfunction parseField(context: ParserContext, line: string, lineIndex: number): PslField | undefined {\n const fieldMatch = line.match(/^([A-Za-z_]\\w*)(\\s+)(.+)$/);\n if (!fieldMatch) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_MODEL_MEMBER',\n message: `Invalid model member declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n return undefined;\n }\n\n const fieldName = fieldMatch[1] ?? '';\n const separator = fieldMatch[2] ?? '';\n const remainder = fieldMatch[3] ?? '';\n const typeAndAttributeSplit = splitTypeAndAttributes(remainder);\n const rawTypeSource = typeAndAttributeSplit.typeSource.trim();\n const attributePart = typeAndAttributeSplit.attributeSource;\n const optional = rawTypeSource.endsWith('?');\n const typeSourceWithoutOptional = optional ? rawTypeSource.slice(0, -1).trimEnd() : rawTypeSource;\n const list = typeSourceWithoutOptional.endsWith('[]');\n const baseTypeSource = list\n ? typeSourceWithoutOptional.slice(0, -2).trimEnd()\n : typeSourceWithoutOptional;\n const rawLine = context.lines[lineIndex] ?? '';\n const trimmedStartColumn = firstNonWhitespaceColumn(rawLine);\n const typeStartColumn = trimmedStartColumn + fieldName.length + separator.length;\n\n const typeConstructor = parseTypeConstructorCall(context, {\n declarationValue: baseTypeSource,\n lineIndex,\n startColumn: typeStartColumn,\n invalidCode: 'PSL_INVALID_MODEL_MEMBER',\n invalidMessage: (value) => `Invalid field type constructor \"${value}\"`,\n });\n if (typeConstructor === 'malformed') {\n return undefined;\n }\n\n let typeName: string;\n let typeNamespaceId: string | undefined;\n let typeContractSpaceId: string | undefined;\n\n if (typeConstructor) {\n typeName = typeConstructor.path.join('.');\n } else {\n // Detect the colon-prefix cross-contract-space form: `<space>:<rest>` where\n // `<rest>` is the existing dot-qualified or bare form (`<ns>.<Name>` or `<Name>`).\n // Multiple colons (e.g. `a:b:c`) are invalid.\n const colonCount = (baseTypeSource.match(/:/g) ?? []).length;\n if (colonCount > 1) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_MODEL_MEMBER',\n message: `Invalid model member declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n return undefined;\n }\n\n let typeRefSource: string;\n if (colonCount === 1) {\n // Colon-prefix form: `<space>:<rest>`\n const colonIndex = baseTypeSource.indexOf(':');\n const spaceCandidate = baseTypeSource.slice(0, colonIndex);\n typeRefSource = baseTypeSource.slice(colonIndex + 1);\n // Validate space identifier\n if (!/^[A-Za-z_]\\w*$/.test(spaceCandidate)) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_MODEL_MEMBER',\n message: `Invalid model member declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n return undefined;\n }\n typeContractSpaceId = spaceCandidate;\n } else {\n typeRefSource = baseTypeSource;\n }\n\n const dotCount = (typeRefSource.match(/\\./g) ?? []).length;\n if (dotCount > 1) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_QUALIFIED_TYPE',\n message: `Nested dot-qualified type \"${baseTypeSource}\" is not supported; use exactly one qualifier segment (e.g. \"ns.TypeName\")`,\n span: createInlineSpan(\n context,\n lineIndex,\n typeStartColumn,\n typeStartColumn + baseTypeSource.length,\n ),\n });\n return undefined;\n }\n const singleMatch = typeRefSource.match(/^([A-Za-z_]\\w*)(?:\\.([A-Za-z_]\\w*))?$/);\n if (!singleMatch) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_MODEL_MEMBER',\n message: `Invalid model member declaration \"${line}\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n return undefined;\n }\n if (singleMatch[2] !== undefined) {\n typeNamespaceId = singleMatch[1];\n typeName = singleMatch[2];\n } else {\n typeName = singleMatch[1] ?? '';\n }\n }\n\n const attributes: PslFieldAttribute[] = [];\n const attributeSource = attributePart.trimStart();\n const leadingAttributeWhitespace = attributePart.length - attributeSource.length;\n const tokenParse = extractAttributeTokensWithSpans(\n context,\n lineIndex,\n attributeSource,\n trimmedStartColumn +\n fieldName.length +\n separator.length +\n typeAndAttributeSplit.attributeOffset +\n leadingAttributeWhitespace,\n );\n if (!tokenParse.ok) {\n return {\n kind: 'field',\n name: fieldName,\n typeName,\n ...ifDefined('typeNamespaceId', typeNamespaceId),\n ...ifDefined('typeContractSpaceId', typeContractSpaceId),\n ...ifDefined('typeConstructor', typeConstructor),\n optional,\n list,\n attributes,\n span: createTrimmedLineSpan(context, lineIndex),\n };\n }\n\n for (const token of tokenParse.tokens) {\n const parsed = parseAttributeToken(context, {\n token: token.text,\n target: 'field',\n lineIndex,\n span: token.span,\n });\n if (parsed) {\n attributes.push(parsed);\n }\n }\n\n return {\n kind: 'field',\n name: fieldName,\n typeName,\n ...ifDefined('typeNamespaceId', typeNamespaceId),\n ...ifDefined('typeContractSpaceId', typeContractSpaceId),\n ...ifDefined('typeConstructor', typeConstructor),\n optional,\n list,\n attributes,\n span: createTrimmedLineSpan(context, lineIndex),\n };\n}\n\nfunction isQuoteEscaped(value: string, quoteIndex: number): boolean {\n let backslashCount = 0;\n\n for (let index = quoteIndex - 1; index >= 0 && value[index] === '\\\\'; index -= 1) {\n backslashCount += 1;\n }\n\n return backslashCount % 2 === 1;\n}\n\nfunction splitTypeAndAttributes(value: string): {\n readonly typeSource: string;\n readonly attributeSource: string;\n readonly attributeOffset: number;\n} {\n let depthParen = 0;\n let depthBracket = 0;\n let depthBrace = 0;\n let quote: '\"' | \"'\" | null = null;\n\n for (let index = 0; index < value.length; index += 1) {\n const character = value[index] ?? '';\n if (quote) {\n if (character === quote && !isQuoteEscaped(value, index)) {\n quote = null;\n }\n continue;\n }\n\n if (character === '\"' || character === \"'\") {\n quote = character;\n continue;\n }\n if (character === '(') {\n depthParen += 1;\n continue;\n }\n if (character === ')') {\n depthParen = Math.max(0, depthParen - 1);\n continue;\n }\n if (character === '[') {\n depthBracket += 1;\n continue;\n }\n if (character === ']') {\n depthBracket = Math.max(0, depthBracket - 1);\n continue;\n }\n if (character === '{') {\n depthBrace += 1;\n continue;\n }\n if (character === '}') {\n depthBrace = Math.max(0, depthBrace - 1);\n continue;\n }\n\n if (character === '@' && depthParen === 0 && depthBracket === 0 && depthBrace === 0) {\n return {\n typeSource: value.slice(0, index).trimEnd(),\n attributeSource: value.slice(index),\n attributeOffset: index,\n };\n }\n }\n\n return {\n typeSource: value.trimEnd(),\n attributeSource: '',\n attributeOffset: value.length,\n };\n}\n\nfunction parseAttributeToken(\n context: ParserContext,\n input: {\n readonly token: string;\n readonly target: PslAttributeTarget;\n readonly lineIndex: number;\n readonly span: PslSpan;\n },\n): PslAttribute | undefined {\n const expectsBlockPrefix = input.target === 'model' || input.target === 'enum';\n const targetLabel = input.target === 'enum' ? 'Enum' : 'Model';\n if (expectsBlockPrefix && !input.token.startsWith('@@')) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `${targetLabel} attribute \"${input.token}\" must use @@ prefix`,\n span: input.span,\n });\n return undefined;\n }\n if (!expectsBlockPrefix && !input.token.startsWith('@')) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Attribute \"${input.token}\" must use @ prefix`,\n span: input.span,\n });\n return undefined;\n }\n if (!expectsBlockPrefix && input.token.startsWith('@@')) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Attribute \"${input.token}\" is not valid in ${input.target} context`,\n span: input.span,\n });\n return undefined;\n }\n\n const rawBody = expectsBlockPrefix ? input.token.slice(2) : input.token.slice(1);\n const openParen = rawBody.indexOf('(');\n const closeParen = rawBody.lastIndexOf(')');\n const hasArgs = openParen >= 0 || closeParen >= 0;\n if ((openParen >= 0 && closeParen === -1) || (openParen === -1 && closeParen >= 0)) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Invalid attribute syntax \"${input.token}\"`,\n span: input.span,\n });\n return undefined;\n }\n\n const name = (openParen >= 0 ? rawBody.slice(0, openParen) : rawBody).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_-]*(\\.[A-Za-z_][A-Za-z0-9_-]*)*$/.test(name)) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Invalid attribute name \"${name || input.token}\"`,\n span: input.span,\n });\n return undefined;\n }\n\n let args: readonly PslAttributeArgument[] = [];\n if (hasArgs && openParen >= 0 && closeParen >= openParen) {\n if (closeParen !== rawBody.length - 1) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Invalid trailing syntax in attribute \"${input.token}\"`,\n span: input.span,\n });\n return undefined;\n }\n const argsRaw = rawBody.slice(openParen + 1, closeParen);\n const parsedArgs = parseArgumentList(context, {\n argsRaw,\n argsOffset: input.span.start.column - 1 + (expectsBlockPrefix ? 2 : 1) + openParen + 1,\n lineIndex: input.lineIndex,\n token: input.token,\n span: input.span,\n invalidCode: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n invalidEmptyArgumentMessage: `Invalid empty argument in attribute \"${input.token}\"`,\n invalidNamedArgumentMessage: (part) => `Invalid named argument syntax \"${part}\"`,\n });\n if (!parsedArgs) {\n return undefined;\n }\n args = parsedArgs;\n }\n\n return {\n kind: 'attribute',\n target: input.target,\n name,\n args,\n span: input.span,\n };\n}\n\nfunction parseArgumentList(\n context: ParserContext,\n input: {\n readonly argsRaw: string;\n readonly argsOffset: number;\n readonly lineIndex: number;\n readonly token: string;\n readonly span: PslSpan;\n readonly invalidCode: PslDiagnosticCode;\n readonly invalidEmptyArgumentMessage: string;\n readonly invalidNamedArgumentMessage: (part: string) => string;\n },\n): readonly PslAttributeArgument[] | undefined {\n const trimmed = input.argsRaw.trim();\n if (trimmed.length === 0) {\n return [];\n }\n\n const parts = splitTopLevelSegments(input.argsRaw, ',');\n const args: PslAttributeArgument[] = [];\n\n for (const part of parts) {\n const original = part.value;\n const trimmedPart = original.trim();\n if (trimmedPart.length === 0) {\n pushDiagnostic(context, {\n code: input.invalidCode,\n message: input.invalidEmptyArgumentMessage,\n span: input.span,\n });\n return undefined;\n }\n\n const leadingWhitespace = original.length - original.trimStart().length;\n const partStart = input.argsOffset + part.start + leadingWhitespace;\n const partEnd = partStart + trimmedPart.length;\n const partSpan = createInlineSpan(context, input.lineIndex, partStart, partEnd);\n\n const namedSplit = splitTopLevelSegments(trimmedPart, ':');\n if (namedSplit.length > 1) {\n const first = namedSplit[0];\n if (!first) {\n pushDiagnostic(context, {\n code: input.invalidCode,\n message: input.invalidNamedArgumentMessage(trimmedPart),\n span: partSpan,\n });\n return undefined;\n }\n const name = first.value.trim();\n const rawValue = trimmedPart.slice(first.end + 1).trim();\n if (!name || rawValue.length === 0) {\n pushDiagnostic(context, {\n code: input.invalidCode,\n message: input.invalidNamedArgumentMessage(trimmedPart),\n span: partSpan,\n });\n return undefined;\n }\n args.push({\n kind: 'named',\n name,\n value: normalizeAttributeArgumentValue(rawValue),\n span: partSpan,\n });\n continue;\n }\n\n args.push({\n kind: 'positional',\n value: normalizeAttributeArgumentValue(trimmedPart),\n span: partSpan,\n });\n }\n\n return args;\n}\n\nfunction normalizeAttributeArgumentValue(value: string): string {\n return value.trim();\n}\n\nfunction findBlockBounds(context: ParserContext, startLine: number): BlockBounds {\n let depth = 0;\n\n for (let lineIndex = startLine; lineIndex < context.lines.length; lineIndex += 1) {\n const line = stripInlineComment(context.lines[lineIndex] ?? '');\n let quote: '\"' | \"'\" | null = null;\n for (let index = 0; index < line.length; index += 1) {\n const character = line[index] ?? '';\n if (quote) {\n if (character === quote && !isQuoteEscaped(line, index)) {\n quote = null;\n }\n continue;\n }\n\n if (character === '\"' || character === \"'\") {\n quote = character;\n continue;\n }\n\n if (character === '{') {\n depth += 1;\n }\n if (character === '}') {\n depth -= 1;\n if (depth === 0) {\n return { startLine, endLine: lineIndex, closed: true };\n }\n }\n }\n }\n\n pushDiagnostic(context, {\n code: 'PSL_UNTERMINATED_BLOCK',\n message: 'Unterminated block declaration',\n span: createTrimmedLineSpan(context, startLine),\n });\n return {\n startLine,\n endLine: context.lines.length - 1,\n closed: false,\n };\n}\n\ninterface TopLevelSegment {\n readonly value: string;\n readonly start: number;\n readonly end: number;\n}\n\nfunction splitTopLevelSegments(value: string, separator: ',' | ':'): TopLevelSegment[] {\n const parts: TopLevelSegment[] = [];\n let depthParen = 0;\n let depthBracket = 0;\n let depthBrace = 0;\n let quote: '\"' | \"'\" | null = null;\n let start = 0;\n\n for (let index = 0; index < value.length; index += 1) {\n const character = value[index] ?? '';\n if (quote) {\n if (character === quote && !isQuoteEscaped(value, index)) {\n quote = null;\n }\n continue;\n }\n\n if (character === '\"' || character === \"'\") {\n quote = character;\n continue;\n }\n\n if (character === '(') {\n depthParen += 1;\n continue;\n }\n if (character === ')') {\n depthParen = Math.max(0, depthParen - 1);\n continue;\n }\n if (character === '[') {\n depthBracket += 1;\n continue;\n }\n if (character === ']') {\n depthBracket = Math.max(0, depthBracket - 1);\n continue;\n }\n if (character === '{') {\n depthBrace += 1;\n continue;\n }\n if (character === '}') {\n depthBrace = Math.max(0, depthBrace - 1);\n continue;\n }\n\n if (character === separator && depthParen === 0 && depthBracket === 0 && depthBrace === 0) {\n parts.push({\n value: value.slice(start, index),\n start,\n end: index,\n });\n start = index + 1;\n }\n }\n\n parts.push({\n value: value.slice(start),\n start,\n end: value.length,\n });\n return parts;\n}\n\nfunction extractAttributeTokensWithSpans(\n context: ParserContext,\n lineIndex: number,\n value: string,\n startColumn: number,\n): { readonly ok: boolean; readonly tokens: readonly { text: string; span: PslSpan }[] } {\n const tokens: { text: string; span: PslSpan }[] = [];\n let index = 0;\n while (index < value.length) {\n while (index < value.length && /\\s/.test(value[index] ?? '')) {\n index += 1;\n }\n if (index >= value.length) {\n break;\n }\n\n if (value[index] !== '@') {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Invalid attribute syntax \"${value.trim()}\"`,\n span: createInlineSpan(context, lineIndex, startColumn + index, startColumn + value.length),\n });\n return { ok: false, tokens };\n }\n\n const start = index;\n index += 1;\n if (value[index] === '@') {\n index += 1;\n }\n\n const nameStart = index;\n while (index < value.length && /[A-Za-z0-9_.-]/.test(value[index] ?? '')) {\n index += 1;\n }\n\n if (index === nameStart) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Invalid attribute syntax \"${value.slice(start).trim()}\"`,\n span: createInlineSpan(context, lineIndex, startColumn + start, startColumn + value.length),\n });\n return { ok: false, tokens };\n }\n\n if (value[index] === '(') {\n let depth = 0;\n let quote: '\"' | \"'\" | null = null;\n while (index < value.length) {\n const char = value[index] ?? '';\n if (quote) {\n if (char === quote && !isQuoteEscaped(value, index)) {\n quote = null;\n }\n index += 1;\n continue;\n }\n\n if (char === '\"' || char === \"'\") {\n quote = char;\n index += 1;\n continue;\n }\n\n if (char === '(') {\n depth += 1;\n } else if (char === ')') {\n depth -= 1;\n if (depth === 0) {\n index += 1;\n break;\n }\n }\n index += 1;\n }\n if (depth !== 0) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Unterminated attribute argument list in \"${value.slice(start).trim()}\"`,\n span: createInlineSpan(\n context,\n lineIndex,\n startColumn + start,\n startColumn + value.length,\n ),\n });\n return { ok: false, tokens };\n }\n }\n\n const tokenText = value.slice(start, index).trim();\n tokens.push({\n text: tokenText,\n span: createInlineSpan(context, lineIndex, startColumn + start, startColumn + index),\n });\n\n while (index < value.length && /\\s/.test(value[index] ?? '')) {\n index += 1;\n }\n\n if (index < value.length && value[index] !== '@') {\n break;\n }\n }\n\n if (index < value.length && value[index] !== '@') {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_ATTRIBUTE_SYNTAX',\n message: `Invalid attribute syntax \"${value.trim()}\"`,\n span: createInlineSpan(context, lineIndex, startColumn + index, startColumn + value.length),\n });\n return { ok: false, tokens };\n }\n\n return { ok: true, tokens };\n}\n\nfunction stripInlineComment(line: string): string {\n let quote: '\"' | \"'\" | null = null;\n for (let index = 0; index < line.length - 1; index += 1) {\n const current = line[index] ?? '';\n const next = line[index + 1] ?? '';\n\n if (quote) {\n if (current === quote && !isQuoteEscaped(line, index)) {\n quote = null;\n }\n continue;\n }\n\n if (current === '\"' || current === \"'\") {\n quote = current;\n continue;\n }\n\n if (current === '/' && next === '/') {\n return line.slice(0, index);\n }\n }\n\n return line;\n}\n\nfunction computeLineOffsets(schema: string): number[] {\n const offsets = [0];\n for (let index = 0; index < schema.length; index += 1) {\n if (schema[index] === '\\n') {\n offsets.push(index + 1);\n }\n }\n return offsets;\n}\n\nfunction firstNonWhitespaceColumn(line: string): number {\n const first = line.search(/\\S/);\n return first === -1 ? 0 : first;\n}\n\nfunction createInlineSpan(\n context: ParserContext,\n lineIndex: number,\n startColumn: number,\n endColumn: number,\n): PslSpan {\n return {\n start: createPosition(context, lineIndex, startColumn),\n end: createPosition(context, lineIndex, endColumn),\n };\n}\n\nfunction createTrimmedLineSpan(context: ParserContext, lineIndex: number): PslSpan {\n const line = context.lines[lineIndex] ?? '';\n const startColumn = firstNonWhitespaceColumn(line);\n return {\n start: createPosition(context, lineIndex, startColumn),\n end: createPosition(context, lineIndex, line.length),\n };\n}\n\nfunction createLineRangeSpan(context: ParserContext, startLine: number, endLine: number): PslSpan {\n const startLineText = context.lines[startLine] ?? '';\n const endLineText = context.lines[endLine] ?? '';\n const startColumn = firstNonWhitespaceColumn(startLineText);\n return {\n start: createPosition(context, startLine, startColumn),\n end: createPosition(context, endLine, endLineText.length),\n };\n}\n\nfunction createPosition(\n context: ParserContext,\n lineIndex: number,\n columnIndex: number,\n): PslPosition {\n const clampedLineIndex = Math.max(0, Math.min(lineIndex, context.lineOffsets.length - 1));\n const lineText = context.lines[clampedLineIndex] ?? '';\n const clampedColumnIndex = Math.max(0, Math.min(columnIndex, lineText.length));\n return {\n offset: (context.lineOffsets[clampedLineIndex] ?? 0) + clampedColumnIndex,\n line: clampedLineIndex + 1,\n column: clampedColumnIndex + 1,\n };\n}\n\nfunction pushDiagnostic(\n context: ParserContext,\n diagnostic: Omit<PslDiagnostic, 'sourceId'> & { readonly code: PslDiagnosticCode },\n): void {\n context.diagnostics.push({\n ...diagnostic,\n sourceId: context.sourceId,\n });\n}\n\nfunction lookupExtensionBlockDescriptor(\n namespace: AuthoringPslBlockDescriptorNamespace,\n keyword: string,\n): AuthoringPslBlockDescriptor | undefined {\n if (!Object.hasOwn(namespace, keyword)) {\n return undefined;\n }\n const value = namespace[keyword];\n return isAuthoringPslBlockDescriptor(value) ? value : undefined;\n}\n\n/**\n * Reads an extension block body generically, driven by the descriptor's\n * `parameters` map. Each `key = <rhs>` line in the body is matched against\n * a declared parameter and the RHS is captured per the parameter's kind:\n *\n * - `ref` → the bareword identifier token (`PslExtensionBlockParamRef`)\n * - `value` → the raw RHS text verbatim (`PslExtensionBlockParamScalarValue`)\n * - `option` → the chosen bareword token (`PslExtensionBlockParamOption`)\n * - `list` → bracketed `[a, b, …]` list, each element captured per `of`\n * (`PslExtensionBlockParamList`)\n *\n * No validation runs here (unknown key, missing required, codec acceptance,\n * option-in-set, ref resolution). A body line that is not `key = value`\n * shaped emits a `PSL_INVALID_EXTENSION_BLOCK_MEMBER` parse diagnostic.\n */\nfunction parseExtensionBlock(\n context: ParserContext,\n descriptor: AuthoringPslBlockDescriptor,\n blockName: string,\n keywordLineIndex: number,\n bounds: BlockBounds,\n): PslExtensionBlock {\n const parameters: Record<string, PslExtensionBlockParamValue> = {};\n\n for (let lineIndex = bounds.startLine + 1; lineIndex < bounds.endLine; lineIndex += 1) {\n const raw = context.lines[lineIndex] ?? '';\n const line = stripInlineComment(raw).trim();\n if (line.length === 0) {\n continue;\n }\n\n const assignMatch = line.match(/^([A-Za-z_]\\w*)\\s*=\\s*(.+)$/);\n if (!assignMatch) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_EXTENSION_BLOCK_MEMBER',\n message: `Invalid extension block body line \"${line}\"; expected \"key = value\"`,\n span: createTrimmedLineSpan(context, lineIndex),\n });\n continue;\n }\n\n const key = assignMatch[1] ?? '';\n const rhsRaw = (assignMatch[2] ?? '').trim();\n const paramDescriptor = descriptor.parameters[key];\n\n if (paramDescriptor === undefined) {\n // Unknown parameter — captured as a raw value; the generic validator reports this.\n parameters[key] = {\n kind: 'value',\n raw: rhsRaw,\n span: createTrimmedLineSpan(context, lineIndex),\n };\n continue;\n }\n\n const captured = captureParamRhs(context, lineIndex, rhsRaw, paramDescriptor);\n if (captured !== undefined) {\n parameters[key] = captured;\n }\n }\n\n return {\n kind: descriptor.discriminator,\n name: blockName,\n parameters,\n span: createLineRangeSpan(context, keywordLineIndex, bounds.endLine),\n };\n}\n\n/**\n * Captures a single parameter RHS string according to the declared parameter\n * kind. Returns `undefined` and pushes a diagnostic only if the syntax is\n * genuinely malformed (e.g. a `list` with no opening bracket). Value\n * acceptance (codec, option-in-set, ref resolution) is handled by the validator.\n */\nfunction captureParamRhs(\n context: ParserContext,\n lineIndex: number,\n rhs: string,\n param: AuthoringPslBlockDescriptor['parameters'][string],\n): PslExtensionBlockParamValue | undefined {\n const span = createTrimmedLineSpan(context, lineIndex);\n\n switch (param.kind) {\n case 'ref': {\n return { kind: 'ref', identifier: rhs, span };\n }\n case 'value': {\n return { kind: 'value', raw: rhs, span };\n }\n case 'option': {\n return { kind: 'option', token: rhs, span };\n }\n case 'list': {\n if (!rhs.startsWith('[') || !rhs.endsWith(']')) {\n pushDiagnostic(context, {\n code: 'PSL_INVALID_EXTENSION_BLOCK_MEMBER',\n message: `Expected a bracketed list \"[…]\" for list parameter, got \"${rhs}\"`,\n span,\n });\n return undefined;\n }\n const inner = rhs.slice(1, -1).trim();\n const items: PslExtensionBlockParamValue[] = [];\n if (inner.length > 0) {\n const segments = splitTopLevelSegments(inner, ',');\n for (const segment of segments) {\n const itemRhs = segment.value.trim();\n if (itemRhs.length === 0) {\n continue;\n }\n const item = captureParamRhs(context, lineIndex, itemRhs, param.of);\n if (item !== undefined) {\n items.push(item);\n }\n }\n }\n return { kind: 'list', items, span };\n }\n }\n}\n"],"mappings":";;;;;AAwCA,MAAM,eAAe,IAAI,IAAI;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAgBD,SAAgB,iBAAiB,OAAsD;CACrF,MAAM,mBAAmB,MAAM,OAAO,WAAW,QAAQ,IAAI;CAC7D,MAAM,QAAQ,iBAAiB,MAAM,IAAI;CACzC,MAAM,cAAc,mBAAmB,gBAAgB;CACvD,MAAM,cAA+B,CAAC;CACtC,MAAM,UAAyB;EAC7B,QAAQ;EACR,UAAU,MAAM;EAChB;EACA;EACA;CACF;CAWA,MAAM,iBAA2B,CAAC;CAClC,MAAM,mCAAmB,IAAI,IAAkC;CAC/D,MAAM,wBACJ,MACA,cACyB;EACzB,IAAI,MAAM,iBAAiB,IAAI,IAAI;EACnC,IAAI,CAAC,KAAK;GACR,MAAM;IACJ;IACA,QAAQ,CAAC;IACT,OAAO,CAAC;IACR,gBAAgB,CAAC;IACjB,iBAAiB,CAAC;IAClB,MAAM;GACR;GACA,iBAAiB,IAAI,MAAM,GAAG;GAC9B,eAAe,KAAK,IAAI;EAC1B;EACA,OAAO;CACT;CAEA,IAAI;CACJ,MAAM,oBAA0D,MAAM,uBAAuB,CAAC;CAM9F,MAAM,aACJ,WACA,kBACA,sBACA,sBACS;EAC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,sBAAsB,OAAO,GAAG;IACjD,KAAK,MAAM,WAAW,UAAU;KAC9B,MAAM,UAAU,QAAQ,MAAM,KAAK;KACnC,IAAI,QAAQ,WAAW,GACrB;KAEF,MAAM,OAAO,gBAAgB,SAAS,WAAW,SAAS,MAAM,EAAE;KAClE,IAAI,SAAS,KAAA,GACX,MAAM,KAAK,IAAI;IAEnB;GACF;GACA,OAAO;IAAE,MAAM;IAAQ;IAAO;GAAK;EACrC;CACF;AACF"}
@@ -4,4 +4,4 @@ import { ParsePslDocumentInput, ParsePslDocumentResult } from "@prisma-next/fram
4
4
  declare function parsePslDocument(input: ParsePslDocumentInput): ParsePslDocumentResult;
5
5
  //#endregion
6
6
  export { parsePslDocument as t };
7
- //# sourceMappingURL=parser-Bjdnhl7C.d.mts.map
7
+ //# sourceMappingURL=parser-Dfi3Wfdq.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser-Dfi3Wfdq.d.mts","names":[],"sources":["../src/parser.ts"],"mappings":";;;iBAkEgB,gBAAA,CAAiB,KAAA,EAAO,qBAAA,GAAwB,sBAAsB"}
package/dist/parser.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as parsePslDocument } from "./parser-Bjdnhl7C.mjs";
1
+ import { t as parsePslDocument } from "./parser-Dfi3Wfdq.mjs";
2
2
  export { parsePslDocument };
package/dist/parser.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as parsePslDocument } from "./parser-R7ldFfcr.mjs";
1
+ import { t as parsePslDocument } from "./parser-Cw_zV0M5.mjs";
2
2
  export { parsePslDocument };