@prisma/orm-framework 8.0.0-rc.14-dev.2 → 8.0.0-rc.14-dev.4
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/{config-types-DmSch3ta.d.mts → config-types-DtyK6o50.d.mts} +10 -2
- package/dist/config-types-DtyK6o50.d.mts.map +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/config__config-types.d.mts +2 -2
- package/dist/{parse-DAVL8A2m-CdprLvJq.mjs → parse-81Q8fvfm-iWuq9WLS.mjs} +17 -17
- package/dist/parse-81Q8fvfm-iWuq9WLS.mjs.map +1 -0
- package/dist/{parse-XbG2XDRs-BJvdVA-3.d.mts → parse-BLbPHv4U-Y4lID7XQ.d.mts} +4 -4
- package/dist/{parse-XbG2XDRs-BJvdVA-3.d.mts.map → parse-BLbPHv4U-Y4lID7XQ.d.mts.map} +1 -1
- package/dist/psl-parser.d.mts +2 -2
- package/dist/psl-parser__format.d.mts +2 -1
- package/dist/psl-parser__format.d.mts.map +1 -1
- package/dist/psl-parser__format.mjs +3 -3
- package/dist/psl-parser__format.mjs.map +1 -1
- package/dist/psl-parser__interpret.d.mts +3 -3
- package/dist/psl-parser__syntax.d.mts +1 -1
- package/dist/psl-parser__syntax.mjs +1 -1
- package/dist/psl-parser__syntax.mjs.map +1 -1
- package/dist/{symbol-table-uBpYeTjB-CYN4_SgJ.d.mts → symbol-table-cNWLdZRx-Cj1Gb8HJ.d.mts} +3 -3
- package/dist/{symbol-table-uBpYeTjB-CYN4_SgJ.d.mts.map → symbol-table-cNWLdZRx-Cj1Gb8HJ.d.mts.map} +1 -1
- package/package.json +15 -15
- package/dist/config-types-DmSch3ta.d.mts.map +0 -1
- package/dist/parse-DAVL8A2m-CdprLvJq.mjs.map +0 -1
|
@@ -73,8 +73,16 @@ interface ContractSourceProviderBase {
|
|
|
73
73
|
readonly inputs?: readonly string[];
|
|
74
74
|
readonly load: (context: ContractSourceContext) => Promise<Result<Contract, ContractSourceDiagnostics>>;
|
|
75
75
|
}
|
|
76
|
+
/** The PSL grammar versions the parser knows. `prisma-7` reads the lines of a `view` block as model fields; Prisma 6 schemas use the same grammar. */
|
|
77
|
+
type PslGrammar = 'prisma-7' | 'prisma-8';
|
|
78
|
+
/** What a PSL source tells the parser about its files. Every tool that parses the source's files passes these to the parser. */
|
|
79
|
+
interface PslParserOptions {
|
|
80
|
+
/** The grammar the files are written in. Defaults to `prisma-8`. */
|
|
81
|
+
readonly grammar?: PslGrammar;
|
|
82
|
+
}
|
|
76
83
|
interface PslContractSourceProvider extends ContractSourceProviderBase {
|
|
77
84
|
readonly format: 'psl';
|
|
85
|
+
readonly parserOptions?: PslParserOptions;
|
|
78
86
|
}
|
|
79
87
|
interface TypeScriptContractSourceProvider extends ContractSourceProviderBase {
|
|
80
88
|
readonly format: 'typescript';
|
|
@@ -188,5 +196,5 @@ declare function defineConfig<TFamilyId extends string = string, TTargetId exten
|
|
|
188
196
|
*/
|
|
189
197
|
declare function defaultContractOutputPath(contractPath: string): string;
|
|
190
198
|
//#endregion
|
|
191
|
-
export {
|
|
192
|
-
//# sourceMappingURL=config-types-
|
|
199
|
+
export { defaultContractOutputPath as _, ContractSourceDiagnosticSpan as a, ContractSourceProvider as c, FormatterConfig as d, PrismaNextConfig as f, TypeScriptContractSourceProvider as g, PslParserOptions as h, ContractSourceDiagnosticPosition as i, ContractSourceProviderBase as l, PslGrammar as m, ContractSourceContext as n, ContractSourceDiagnostics as o, PslContractSourceProvider as p, ContractSourceDiagnostic as r, ContractSourceFormat as s, ContractConfig as t, DEFAULT_CONTRACT_SOURCE_DIR as u, defineConfig as v, normalizeContractConfig as y };
|
|
200
|
+
//# sourceMappingURL=config-types-DtyK6o50.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-types-DtyK6o50.d.mts","names":[],"sources":["../../../../1-framework/1-core/config/dist/config-types.d.mts"],"mappings":";;;;;;;;;;UAMU;WACC;WACA;WACA;;UAED;WACC,OAAO;WACP,KAAK;;UAEN;WACC;WACA;WACA;WACA,OAAO;;WAEP;;;;;;WAMA,OAAO,SAAS;;UAEjB;WACC;WACA,sBAAsB;WACtB,OAAO;;UAER;WACC;;WAEA,4BAA4B,oBAAoB;WAChD,wBAAwB;WACxB,aAAa;;WAEb,gBAAgB;WAChB,yBAAyB;;;;;;;WAOzB;WACA,cAAc;;;;WAId,iBAAiB,YAAY;;;;;;;KAOnC;UACK;;;;;;WAMC;WACA,OAAO,SAAS,0BAA0B,QAAQ,OAAO,UAAU;;;KAGzE;;UAEK;;WAEC,UAAU;;UAEX,kCAAkC;WACjC;WACA,gBAAgB;;UAEjB,yCAAyC;WACxC;;KAEN,yBAAyB,4BAA4B;;;;;;UAMhD;;;;;WAKC,QAAQ;;;;;;;WAOR;;UAED;WACC;WACA;;;;;;;cAOG;iBACG,wBAAwB,UAAU,iBAAiB;WACzD;;;;;;;;;;UAUD,iBAAiB,mCAAmC,mCAAmC;WACtF,QAAQ,wBAAwB;WAChC,QAAQ,wBAAwB,WAAW;WAC3C,SAAS,yBAAyB,WAAW;WAC7C,sBAAsB,2BAA2B,WAAW;;;;;;;WAO5D,SAAS,wBAAwB,WAAW,WAAW,sBAAsB,WAAW,YAAY;;;;;WAKpG;;;;;;aAME,aAAa;;;;;;WAMf,WAAW;;;;WAIX;;aAEE;;WAEF,YAAY;;;;;;;WAOZ;;;;;;;;;;;;;;;iBAeM,aAAa,mCAAmC,mCAAmC,QAAQ,iBAAiB,WAAW,aAAa,iBAAiB,WAAW;;;;;;;;iBAQhK,0BAA0B"}
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { type ContractConfig, type ContractSourceContext, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceFormat, type ContractSourceProvider, type ContractSourceProviderBase, DEFAULT_CONTRACT_SOURCE_DIR, type FormatterConfig, type PrismaNextConfig, type PslContractSourceProvider, type TypeScriptContractSourceProvider, defaultContractOutputPath, defineConfig, normalizeContractConfig };
|
|
1
|
+
import { _ as defaultContractOutputPath, a as ContractSourceDiagnosticSpan, c as ContractSourceProvider, d as FormatterConfig, f as PrismaNextConfig, g as TypeScriptContractSourceProvider, h as PslParserOptions, i as ContractSourceDiagnosticPosition, l as ContractSourceProviderBase, m as PslGrammar, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PslContractSourceProvider, r as ContractSourceDiagnostic, s as ContractSourceFormat, t as ContractConfig, u as DEFAULT_CONTRACT_SOURCE_DIR, v as defineConfig, y as normalizeContractConfig } from "./config-types-DtyK6o50.mjs";
|
|
2
|
+
export { type ContractConfig, type ContractSourceContext, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceFormat, type ContractSourceProvider, type ContractSourceProviderBase, DEFAULT_CONTRACT_SOURCE_DIR, type FormatterConfig, type PrismaNextConfig, type PslContractSourceProvider, type PslGrammar, type PslParserOptions, type TypeScriptContractSourceProvider, defaultContractOutputPath, defineConfig, normalizeContractConfig };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { type ContractConfig, type ContractSourceContext, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceFormat, type ContractSourceProvider, type ContractSourceProviderBase, DEFAULT_CONTRACT_SOURCE_DIR, type FormatterConfig, type PrismaNextConfig, type PslContractSourceProvider, type TypeScriptContractSourceProvider, defaultContractOutputPath, defineConfig, normalizeContractConfig };
|
|
1
|
+
import { _ as defaultContractOutputPath, a as ContractSourceDiagnosticSpan, c as ContractSourceProvider, d as FormatterConfig, f as PrismaNextConfig, g as TypeScriptContractSourceProvider, h as PslParserOptions, i as ContractSourceDiagnosticPosition, l as ContractSourceProviderBase, m as PslGrammar, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PslContractSourceProvider, r as ContractSourceDiagnostic, s as ContractSourceFormat, t as ContractConfig, u as DEFAULT_CONTRACT_SOURCE_DIR, v as defineConfig, y as normalizeContractConfig } from "./config-types-DtyK6o50.mjs";
|
|
2
|
+
export { type ContractConfig, type ContractSourceContext, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceFormat, type ContractSourceProvider, type ContractSourceProviderBase, DEFAULT_CONTRACT_SOURCE_DIR, type FormatterConfig, type PrismaNextConfig, type PslContractSourceProvider, type PslGrammar, type PslParserOptions, type TypeScriptContractSourceProvider, defaultContractOutputPath, defineConfig, normalizeContractConfig };
|
|
@@ -3,7 +3,7 @@ import { r as UNSPECIFIED_PSL_NAMESPACE_ID } from "./psl-ast-CyvE6CR-.mjs";
|
|
|
3
3
|
import { r as isTerminatedStringLiteral, t as Tokenizer } from "./tokenizer-BMz7z2KR-J0yZ4im3.mjs";
|
|
4
4
|
import { a as createSyntaxTree } from "./ast-helpers-2XRnkQEO-BxG5qx3Q.mjs";
|
|
5
5
|
import { o as DocumentAst } from "./declarations-CcEBlusF-DXJwQ_ze.mjs";
|
|
6
|
-
//#region ../../../1-framework/2-authoring/psl-parser/dist/parse-
|
|
6
|
+
//#region ../../../1-framework/2-authoring/psl-parser/dist/parse-81Q8fvfm.mjs
|
|
7
7
|
const CARRIAGE_RETURN = 13;
|
|
8
8
|
const LINE_FEED = 10;
|
|
9
9
|
var SourceFile = class {
|
|
@@ -520,9 +520,9 @@ function parseTypeAnnotation(cursor) {
|
|
|
520
520
|
* Parses a full PSL document. Never throws — malformed input yields diagnostics
|
|
521
521
|
* and a recovered tree, not an exception.
|
|
522
522
|
*/
|
|
523
|
-
function parse(source, filename) {
|
|
523
|
+
function parse(source, filename, options = {}) {
|
|
524
524
|
const cursor = new Cursor(filename, source);
|
|
525
|
-
const root = createSyntaxTree(parseDocument(cursor));
|
|
525
|
+
const root = createSyntaxTree(parseDocument(cursor, options));
|
|
526
526
|
const document = DocumentAst.cast(root) ?? new DocumentAst(root);
|
|
527
527
|
const sources = new PslSources([[document.syntax, cursor.sourceFile]]);
|
|
528
528
|
return {
|
|
@@ -531,9 +531,9 @@ function parse(source, filename) {
|
|
|
531
531
|
sources
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
function parseDocument(cursor) {
|
|
534
|
+
function parseDocument(cursor, options) {
|
|
535
535
|
cursor.startNode("Document");
|
|
536
|
-
while (cursor.peekKind() !== "Eof") parseDeclaration(cursor, false);
|
|
536
|
+
while (cursor.peekKind() !== "Eof") parseDeclaration(cursor, false, options);
|
|
537
537
|
cursor.flushTrivia();
|
|
538
538
|
return cursor.finishNode();
|
|
539
539
|
}
|
|
@@ -552,12 +552,12 @@ function keywordIs(cursor, keyword) {
|
|
|
552
552
|
* Recovery runs via the `if (!node)` tail rather than as a `??` arm, because it
|
|
553
553
|
* appends raw tokens to the open parent instead of returning a child node.
|
|
554
554
|
*/
|
|
555
|
-
function parseDeclaration(cursor, insideNamespace) {
|
|
555
|
+
function parseDeclaration(cursor, insideNamespace, options) {
|
|
556
556
|
const name = cursor.peekKind(1) === "Ident" ? cursor.peekToken(1).text : "";
|
|
557
557
|
if (insideNamespace && keywordIs(cursor, "namespace")) cursor.diagnostic("PSL_INVALID_NAMESPACE_BLOCK", `Recursive "namespace ${name}" block is not allowed; namespace blocks may not nest`, cursor.mark());
|
|
558
558
|
else if (insideNamespace && keywordIs(cursor, "types")) cursor.diagnostic("PSL_INVALID_NAMESPACE_BLOCK", "`types` blocks must be declared at the document top level, not inside a namespace block", cursor.mark());
|
|
559
559
|
else if (keywordIs(cursor, "namespace") && name === "__unspecified__") cursor.diagnostic("PSL_INVALID_NAMESPACE_BLOCK", `Namespace name "${UNSPECIFIED_PSL_NAMESPACE_ID}" is reserved for the parser-synthesised bucket for top-level declarations`, cursor.mark(1));
|
|
560
|
-
if (!(parseModel(cursor) ?? parseNamespace(cursor) ?? parseCompositeType(cursor) ?? parseTypesBlock(cursor) ?? parseGenericBlock(cursor))) parseUnsupportedTopLevel(cursor);
|
|
560
|
+
if (!(parseModel(cursor) ?? parseNamespace(cursor, options) ?? parseCompositeType(cursor) ?? parseTypesBlock(cursor) ?? parseGenericBlock(cursor, options))) parseUnsupportedTopLevel(cursor);
|
|
561
561
|
}
|
|
562
562
|
/**
|
|
563
563
|
* Reports only the first missing piece — a missing name suppresses the
|
|
@@ -586,7 +586,7 @@ function parseModel(cursor) {
|
|
|
586
586
|
* open, so a bare identifier with no brace (e.g. `oops`) is read as an unfinished
|
|
587
587
|
* custom declaration rather than unsupported content.
|
|
588
588
|
*/
|
|
589
|
-
function parseGenericBlock(cursor) {
|
|
589
|
+
function parseGenericBlock(cursor, options) {
|
|
590
590
|
if (cursor.peekKind() !== "Ident") return void 0;
|
|
591
591
|
const keyword = cursor.peekToken().text;
|
|
592
592
|
if (RESERVED_BLOCK_KEYWORDS.has(keyword)) return void 0;
|
|
@@ -594,16 +594,16 @@ function parseGenericBlock(cursor) {
|
|
|
594
594
|
cursor.startNode("GenericBlockDeclaration");
|
|
595
595
|
cursor.bump();
|
|
596
596
|
if (hasName) parseIdentifier(cursor);
|
|
597
|
-
if (cursor.peekKind() === "LBrace") parseBlockBody(cursor, genericBlockMemberParser(keyword));
|
|
597
|
+
if (cursor.peekKind() === "LBrace") parseBlockBody(cursor, genericBlockMemberParser(keyword, options));
|
|
598
598
|
else {
|
|
599
599
|
cursor.diagnostic("PSL_INVALID_DECLARATION", `Expected "{" to open the "${keyword}" block`, cursor.markAfterLastToken());
|
|
600
600
|
cursor.recoverToSyncPoint();
|
|
601
601
|
}
|
|
602
602
|
return cursor.finishNode();
|
|
603
603
|
}
|
|
604
|
-
function parseNamespace(cursor) {
|
|
604
|
+
function parseNamespace(cursor, options) {
|
|
605
605
|
if (!keywordIs(cursor, "namespace")) return void 0;
|
|
606
|
-
return parseBlock(cursor, "Namespace", true, (inner) => parseDeclaration(inner, true));
|
|
606
|
+
return parseBlock(cursor, "Namespace", true, (inner) => parseDeclaration(inner, true, options));
|
|
607
607
|
}
|
|
608
608
|
function parseCompositeType(cursor) {
|
|
609
609
|
if (!keywordIs(cursor, "type")) return void 0;
|
|
@@ -648,12 +648,12 @@ function parseNamedTypeMember(cursor) {
|
|
|
648
648
|
if (!parseNamedType(cursor)) invalidMember(cursor, "PSL_INVALID_TYPES_MEMBER", `Invalid types declaration "${cursor.peekToken().text}"`);
|
|
649
649
|
}
|
|
650
650
|
/**
|
|
651
|
-
* A `
|
|
652
|
-
*
|
|
653
|
-
* interpreter decides whether it accepts the block and its members.
|
|
651
|
+
* A generic block reads `key = value` entries and bare keys; in an `enum` block those may carry `@`
|
|
652
|
+
* attributes (`USER @map("user")`). In the `prisma-7` grammar, a `view` body is read like a model
|
|
653
|
+
* body. Each interpreter decides whether it accepts the block and its members.
|
|
654
654
|
*/
|
|
655
|
-
function genericBlockMemberParser(keyword) {
|
|
656
|
-
if (keyword === "view") return parseModelMember;
|
|
655
|
+
function genericBlockMemberParser(keyword, options) {
|
|
656
|
+
if (keyword === "view" && options.grammar === "prisma-7") return parseModelMember;
|
|
657
657
|
if (keyword === "enum") return parseEnumMember;
|
|
658
658
|
return parseKeyValueMember;
|
|
659
659
|
}
|
|
@@ -716,4 +716,4 @@ function parseKeyValue(cursor, options = { memberAttributes: false }) {
|
|
|
716
716
|
//#endregion
|
|
717
717
|
export { greenToken as a, greenNode as i, PslSources as n, parse as o, SourceFile as r, GreenNodeBuilder as t };
|
|
718
718
|
|
|
719
|
-
//# sourceMappingURL=parse-
|
|
719
|
+
//# sourceMappingURL=parse-81Q8fvfm-iWuq9WLS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-81Q8fvfm-iWuq9WLS.mjs","names":["#filename","#text","#lineStarts","#lineIndexAt","#lineStartAt","#lineEndAt","#sourcesByRoot","#stack","#tokenizer","#sourceFile","#diagnostics","#offset","#depth","#builder","#advance"],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/parse-81Q8fvfm.mjs"],"sourcesContent":["import { r as isTerminatedStringLiteral, t as Tokenizer } from \"./tokenizer-BMz7z2KR.mjs\";\nimport { l as createSyntaxTree } from \"./ast-helpers-2XRnkQEO.mjs\";\nimport { n as DocumentAst } from \"./declarations-CcEBlusF.mjs\";\nimport { UNSPECIFIED_PSL_NAMESPACE_ID } from \"@internal/framework-components/psl-ast\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/source-file.ts\nconst CARRIAGE_RETURN = 13;\nconst LINE_FEED = 10;\nvar SourceFile = class {\n\t#filename;\n\t#text;\n\t#lineStarts;\n\tconstructor(filename, text) {\n\t\tthis.#filename = filename;\n\t\tthis.#text = text;\n\t\tconst lineStarts = [0];\n\t\tfor (let offset = 0; offset < text.length; offset++) if (text.charCodeAt(offset) === LINE_FEED) lineStarts.push(offset + 1);\n\t\tthis.#lineStarts = lineStarts;\n\t}\n\tget filename() {\n\t\treturn this.#filename;\n\t}\n\tget text() {\n\t\treturn this.#text;\n\t}\n\tget length() {\n\t\treturn this.#text.length;\n\t}\n\tget lineCount() {\n\t\treturn this.#lineStarts.length;\n\t}\n\tlineStartOffsets() {\n\t\treturn this.#lineStarts;\n\t}\n\tlineStartOffset(line) {\n\t\tif (line <= 0) return 0;\n\t\treturn this.#lineStarts[line] ?? this.#text.length;\n\t}\n\tlineEndOffset(line) {\n\t\tif (line < 0) return 0;\n\t\tconst nextLineStart = this.#lineStarts[line + 1];\n\t\tif (nextLineStart === void 0) return this.#text.length;\n\t\tconst lineFeedOffset = nextLineStart - 1;\n\t\tconst carriageReturnOffset = lineFeedOffset - 1;\n\t\treturn this.#text.charCodeAt(carriageReturnOffset) === CARRIAGE_RETURN ? carriageReturnOffset : lineFeedOffset;\n\t}\n\tpositionAt(offset) {\n\t\tconst clamped = clamp(offset, 0, this.#text.length);\n\t\tconst line = this.#lineIndexAt(clamped);\n\t\treturn {\n\t\t\tline,\n\t\t\tcharacter: clamped - this.#lineStartAt(line)\n\t\t};\n\t}\n\toffsetAt(position) {\n\t\tconst line = clamp(position.line, 0, this.#lineStarts.length - 1);\n\t\tconst lineStart = this.#lineStartAt(line);\n\t\tconst lineEnd = this.#lineEndAt(line);\n\t\treturn clamp(lineStart + position.character, lineStart, lineEnd);\n\t}\n\toffsetToPslPosition(offset) {\n\t\tconst position = this.positionAt(offset);\n\t\treturn {\n\t\t\toffset,\n\t\t\tline: position.line + 1,\n\t\t\tcolumn: position.character + 1\n\t\t};\n\t}\n\trangeToPslSpan(range) {\n\t\treturn {\n\t\t\tstart: this.offsetToPslPosition(this.offsetAt(range.start)),\n\t\t\tend: this.offsetToPslPosition(this.offsetAt(range.end))\n\t\t};\n\t}\n\tpslSpanToRange(span) {\n\t\treturn {\n\t\t\tstart: this.positionAt(span.start.offset),\n\t\t\tend: this.positionAt(span.end.offset)\n\t\t};\n\t}\n\t#lineStartAt(line) {\n\t\treturn this.#lineStarts[line] ?? 0;\n\t}\n\t#lineEndAt(line) {\n\t\treturn line + 1 < this.#lineStarts.length ? this.#lineStartAt(line + 1) - 1 : this.#text.length;\n\t}\n\t#lineIndexAt(offset) {\n\t\tconst lineStarts = this.#lineStarts;\n\t\tlet low = 0;\n\t\tlet high = lineStarts.length - 1;\n\t\twhile (low < high) {\n\t\t\tconst mid = low + high + 1 >>> 1;\n\t\t\tif ((lineStarts[mid] ?? 0) <= offset) low = mid;\n\t\t\telse high = mid - 1;\n\t\t}\n\t\treturn low;\n\t}\n};\nvar PslSources = class PslSources {\n\t#sourcesByRoot = /* @__PURE__ */ new Map();\n\tconstructor(entries) {\n\t\tfor (const [root, sourceFile] of entries) this.#sourcesByRoot.set(root, sourceFile);\n\t}\n\t/**\n\t* A new registry uniting this one with `others` — e.g. the per-document\n\t* `PslSources` registries `parse()` returns for each member of a\n\t* multi-file schema, united into the one registry `buildSymbolTable` and\n\t* the interpreters expect.\n\t*/\n\tmerge(...others) {\n\t\treturn new PslSources([...this.#sourcesByRoot, ...others.flatMap((other) => [...other.#sourcesByRoot])]);\n\t}\n\tsourceFileNamed(filename) {\n\t\tlet match;\n\t\tfor (const sourceFile of this.#sourcesByRoot.values()) {\n\t\t\tif (sourceFile.filename !== filename) continue;\n\t\t\tif (match !== void 0 && match.text !== sourceFile.text) throw new InternalError(`Ambiguous PSL diagnostic filename \"${filename}\": registered sources have different text`);\n\t\t\tmatch = sourceFile;\n\t\t}\n\t\tif (match === void 0) throw new InternalError(`No SourceFile registered for PSL diagnostic filename \"${filename}\"`);\n\t\treturn match;\n\t}\n\tsourceFileFor(node) {\n\t\tconst root = node.root();\n\t\tconst sourceFile = this.#sourcesByRoot.get(root);\n\t\tif (sourceFile === void 0) throw new InternalError(\"No SourceFile registered for PSL syntax root\");\n\t\treturn sourceFile;\n\t}\n};\nfunction clamp(value, min, max) {\n\tif (value < min) return min;\n\tif (value > max) return max;\n\treturn value;\n}\n//#endregion\n//#region src/syntax/green.ts\nfunction greenToken(kind, text) {\n\treturn {\n\t\ttype: \"token\",\n\t\tkind,\n\t\ttext\n\t};\n}\nfunction greenNode(kind, children) {\n\tlet textLength = 0;\n\tfor (const child of children) textLength += child.type === \"token\" ? child.text.length : child.textLength;\n\treturn {\n\t\ttype: \"node\",\n\t\tkind,\n\t\tchildren,\n\t\ttextLength\n\t};\n}\n//#endregion\n//#region src/syntax/green-builder.ts\nvar GreenNodeBuilder = class {\n\t#stack = [];\n\tstartNode(kind) {\n\t\tthis.#stack.push({\n\t\t\tkind,\n\t\t\tchildren: []\n\t\t});\n\t}\n\ttoken(kind, text) {\n\t\tconst current = this.#stack.at(-1);\n\t\tif (!current) throw new InternalError(\"GreenNodeBuilder: token() called with no open node\");\n\t\tcurrent.children.push(greenToken(kind, text));\n\t}\n\tfinishNode() {\n\t\tconst completed = this.#stack.pop();\n\t\tif (!completed) throw new InternalError(\"GreenNodeBuilder: finishNode() called with no open node\");\n\t\tconst node = greenNode(completed.kind, completed.children);\n\t\tconst parent = this.#stack.at(-1);\n\t\tif (parent) parent.children.push(node);\n\t\treturn node;\n\t}\n};\n//#endregion\n//#region src/parse.ts\nconst TRIVIA_KINDS = /* @__PURE__ */ new Set([\n\t\"Whitespace\",\n\t\"Newline\",\n\t\"Comment\"\n]);\n/**\n* The fault-tolerant parser substrate the parse functions below drive. Trivia is flushed\n* into the enclosing open node, so every child node spans exactly its first\n* through last significant token.\n*/\nvar Cursor = class {\n\t#tokenizer;\n\t#sourceFile;\n\t#builder = new GreenNodeBuilder();\n\t#diagnostics = [];\n\t#offset = 0;\n\t#depth = 0;\n\tconstructor(filename, source) {\n\t\tthis.#tokenizer = new Tokenizer(source);\n\t\tthis.#sourceFile = new SourceFile(filename, source);\n\t}\n\tget diagnostics() {\n\t\treturn this.#diagnostics;\n\t}\n\tget sourceFile() {\n\t\treturn this.#sourceFile;\n\t}\n\tpeekKind(ahead = 0) {\n\t\treturn this.peekToken(ahead).kind;\n\t}\n\tpeekToken(ahead = 0) {\n\t\tlet rawIndex = 0;\n\t\tlet remaining = ahead;\n\t\tfor (;;) {\n\t\t\tconst token = this.#tokenizer.peek(rawIndex);\n\t\t\tif (token.kind === \"Eof\") return token;\n\t\t\tif (TRIVIA_KINDS.has(token.kind)) {\n\t\t\t\trawIndex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (remaining === 0) return token;\n\t\t\tremaining--;\n\t\t\trawIndex++;\n\t\t}\n\t}\n\t/** Span of the significant token `lookahead` positions ahead (`mark(0)` = the next). */\n\tmark(lookahead = 0) {\n\t\tlet rawIndex = 0;\n\t\tlet offset = this.#offset;\n\t\tlet remaining = lookahead;\n\t\tfor (;;) {\n\t\t\tconst token = this.#tokenizer.peek(rawIndex);\n\t\t\tif (token.kind === \"Eof\") return {\n\t\t\t\toffset,\n\t\t\t\tlength: token.text.length\n\t\t\t};\n\t\t\tif (!TRIVIA_KINDS.has(token.kind) && remaining === 0) return {\n\t\t\t\toffset,\n\t\t\t\tlength: token.text.length\n\t\t\t};\n\t\t\tif (!TRIVIA_KINDS.has(token.kind)) remaining--;\n\t\t\toffset += token.text.length;\n\t\t\trawIndex++;\n\t\t}\n\t}\n\t/**\n\t* Zero-width mark just past the last consumed significant token — anchors an\n\t* \"expected here\" diagnostic, e.g. the `{` missing after a declaration's name.\n\t*/\n\tmarkAfterLastToken() {\n\t\treturn {\n\t\t\toffset: this.#offset,\n\t\t\tlength: 0\n\t\t};\n\t}\n\tstartNode(kind) {\n\t\tif (this.#depth > 0) this.flushTrivia();\n\t\tthis.#builder.startNode(kind);\n\t\tthis.#depth++;\n\t}\n\tfinishNode() {\n\t\tthis.#depth--;\n\t\treturn this.#builder.finishNode();\n\t}\n\tbump() {\n\t\tthis.flushTrivia();\n\t\tconst token = this.#tokenizer.peek();\n\t\tif (token.kind === \"Eof\") return token;\n\t\tthis.#builder.token(token.kind, token.text);\n\t\tthis.#advance();\n\t\treturn token;\n\t}\n\trecoverToSyncPoint() {\n\t\tfor (;;) {\n\t\t\tconst token = this.#tokenizer.peek();\n\t\t\tif (token.kind === \"Eof\" || token.kind === \"Newline\" || token.kind === \"RBrace\") return;\n\t\t\tthis.#builder.token(token.kind, token.text);\n\t\t\tthis.#advance();\n\t\t}\n\t}\n\tflushTrivia() {\n\t\tfor (;;) {\n\t\t\tconst token = this.#tokenizer.peek();\n\t\t\tif (!TRIVIA_KINDS.has(token.kind)) return;\n\t\t\tthis.#builder.token(token.kind, token.text);\n\t\t\tthis.#advance();\n\t\t}\n\t}\n\tdiagnostic(code, message, mark) {\n\t\tconst start = mark.offset;\n\t\tconst end = start + mark.length;\n\t\tthis.#diagnostics.push({\n\t\t\tfilename: this.#sourceFile.filename,\n\t\t\tcode,\n\t\t\tmessage,\n\t\t\trange: {\n\t\t\t\tstart: this.#sourceFile.positionAt(start),\n\t\t\t\tend: this.#sourceFile.positionAt(end)\n\t\t\t}\n\t\t});\n\t}\n\t#advance() {\n\t\tthis.#offset += this.#tokenizer.next().text.length;\n\t}\n};\nfunction parseIdentifier(cursor) {\n\tcursor.startNode(\"Identifier\");\n\tcursor.bump();\n\tcursor.finishNode();\n}\n/**\n* Returns `undefined` when the next significant token does not start a\n* recognised expression, leaving recovery to the caller.\n*/\nfunction parseExpression(cursor) {\n\treturn parseStringLiteralExpr(cursor) ?? parseNumberLiteralExpr(cursor) ?? parseArrayLiteral(cursor) ?? parseObjectLiteralExpr(cursor) ?? parseTaggedLiteral(cursor) ?? parseFunctionCall(cursor) ?? parseBooleanLiteralExpr(cursor) ?? parseIdentifierExpr(cursor);\n}\n/** A string literal outside a tagged literal, where a backtick string is refused. */\nfunction parseStringLiteralExpr(cursor) {\n\tif (cursor.peekKind() !== \"StringLiteral\") return void 0;\n\tif (cursor.peekToken().text.startsWith(\"`\")) cursor.diagnostic(\"PSL_BACKTICK_STRING_REQUIRES_TAG\", \"A backtick string must follow a tag, as in tag`...`.\", cursor.mark());\n\treturn parseStringLiteral(cursor);\n}\nfunction parseStringLiteral(cursor) {\n\tconst stringMark = cursor.mark();\n\tconst text = cursor.peekToken().text;\n\tcursor.startNode(\"StringLiteralExpr\");\n\tcursor.bump();\n\tif (!isTerminatedStringLiteral(text)) cursor.diagnostic(\"PSL_UNTERMINATED_STRING\", \"Unterminated string literal\", stringMark);\n\treturn cursor.finishNode();\n}\nfunction parseNumberLiteralExpr(cursor) {\n\tif (cursor.peekKind() !== \"NumberLiteral\") return void 0;\n\tcursor.startNode(\"NumberLiteralExpr\");\n\tcursor.bump();\n\treturn cursor.finishNode();\n}\n/**\n* Parses a namespace-qualified name `[space ':']? Ident ('.' Ident)*`. The\n* caller guarantees a leading `Ident`.\n*\n* Parsing the whole chain up front lets a position decide\n* constructor-vs-reference by peeking exactly one token for `(`, with no scan of\n* the dotted chain's length.\n*/\nfunction parseQualifiedName(cursor) {\n\tcursor.startNode(\"QualifiedName\");\n\tparseIdentifier(cursor);\n\tparseQualifiedSegments(cursor, \"Colon\");\n\tparseQualifiedSegments(cursor, \"Dot\");\n\tcursor.finishNode();\n}\n/**\n* A well-formed name carries at most one colon space and one dot namespace, so\n* each separator past the first of its kind reports `PSL_INVALID_QUALIFIED_NAME`.\n* The separator is consumed regardless, keeping the lossless round-trip intact.\n*/\nfunction parseQualifiedSegments(cursor, separator) {\n\tlet seen = 0;\n\twhile (cursor.peekKind() === separator) {\n\t\tseen++;\n\t\tconst separatorMark = cursor.mark();\n\t\tcursor.bump();\n\t\tif (seen > 1) cursor.diagnostic(\"PSL_INVALID_QUALIFIED_NAME\", \"Qualified name has too many segments\", separatorMark);\n\t\tif (cursor.peekKind() === \"Ident\") parseIdentifier(cursor);\n\t\telse cursor.diagnostic(\"PSL_INVALID_QUALIFIED_NAME\", \"Qualified name is missing a name after the separator\", cursor.mark());\n\t}\n}\n/**\n* Whether the next tokens open a tagged literal: a bare `Ident` or a\n* namespace-qualified `Ident.Ident`, then a string. Trivia may sit anywhere\n* between them. Bounded like {@link isCallAhead}.\n*/\nfunction isTaggedLiteralAhead(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return false;\n\tif (cursor.peekKind(1) === \"StringLiteral\") return true;\n\treturn cursor.peekKind(1) === \"Dot\" && cursor.peekKind(2) === \"Ident\" && cursor.peekKind(3) === \"StringLiteral\";\n}\n/** Parses `` tag`body` ``, `tag\"body\"`, or `tag'body'`: a qualified name, then a string literal. */\nfunction parseTaggedLiteral(cursor) {\n\tif (!isTaggedLiteralAhead(cursor)) return void 0;\n\tcursor.startNode(\"TaggedLiteral\");\n\tparseQualifiedName(cursor);\n\tparseStringLiteral(cursor);\n\treturn cursor.finishNode();\n}\nfunction parseBooleanLiteralExpr(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tconst text = cursor.peekToken().text;\n\tif (text !== \"true\" && text !== \"false\") return void 0;\n\tcursor.startNode(\"BooleanLiteralExpr\");\n\tcursor.bump();\n\treturn cursor.finishNode();\n}\nfunction parseIdentifierExpr(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tcursor.startNode(\"Identifier\");\n\tcursor.bump();\n\treturn cursor.finishNode();\n}\nfunction parseArrayLiteral(cursor) {\n\tif (cursor.peekKind() !== \"LBracket\") return void 0;\n\tcursor.startNode(\"ArrayLiteral\");\n\tcursor.bump();\n\twhile (cursor.peekKind() !== \"RBracket\" && cursor.peekKind() !== \"Eof\") {\n\t\tif (!parseExpression(cursor)) break;\n\t\tif (cursor.peekKind() === \"Comma\") cursor.bump();\n\t\telse break;\n\t}\n\tif (cursor.peekKind() === \"RBracket\") cursor.bump();\n\treturn cursor.finishNode();\n}\nfunction parseObjectLiteralExpr(cursor) {\n\tif (cursor.peekKind() !== \"LBrace\") return void 0;\n\tconst braceMark = cursor.mark();\n\tcursor.startNode(\"ObjectLiteralExpr\");\n\tcursor.bump();\n\twhile (cursor.peekKind() !== \"RBrace\" && cursor.peekKind() !== \"Eof\") {\n\t\tparseObjectField(cursor);\n\t\tif (cursor.peekKind() === \"Comma\") cursor.bump();\n\t\telse if (cursor.peekKind() === \"Ident\") cursor.diagnostic(\"PSL_INVALID_OBJECT_LITERAL\", \"Expected \\\",\\\" between object-literal fields\", cursor.markAfterLastToken());\n\t\telse break;\n\t}\n\tif (cursor.peekKind() === \"RBrace\") cursor.bump();\n\telse cursor.diagnostic(\"PSL_INVALID_OBJECT_LITERAL\", \"Unterminated object literal\", braceMark);\n\treturn cursor.finishNode();\n}\nfunction parseObjectField(cursor) {\n\tcursor.startNode(\"ObjectField\");\n\tconst keyMark = cursor.mark();\n\tconst keyText = cursor.peekToken().text;\n\tif (cursor.peekKind() === \"Ident\") parseIdentifier(cursor);\n\telse if (cursor.peekKind() === \"StringLiteral\") parseStringLiteralExpr(cursor);\n\tif (cursor.peekKind() === \"Colon\") {\n\t\tcursor.bump();\n\t\tif (!parseExpression(cursor)) cursor.diagnostic(\"PSL_INVALID_OBJECT_LITERAL\", \"Expected a value after \\\":\\\"\", cursor.mark());\n\t} else {\n\t\tcursor.diagnostic(\"PSL_INVALID_OBJECT_LITERAL\", `Expected \":\" after \"${keyText}\"`, keyMark);\n\t\tif (!(cursor.peekKind() === \"Ident\" && cursor.peekKind(1) === \"Colon\")) parseExpression(cursor);\n\t}\n\treturn cursor.finishNode();\n}\n/**\n* Whether the next tokens open a call: a bare `Ident(` or a namespace-qualified\n* `Ident.Ident(`. The lookahead is deliberately bounded so a bare dotted\n* reference like `a.b` is not mistaken for a call, rather than scanning an\n* unbounded dotted chain ahead to find the paren.\n*/\nfunction isCallAhead(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return false;\n\tif (cursor.peekKind(1) === \"LParen\") return true;\n\treturn cursor.peekKind(1) === \"Dot\" && cursor.peekKind(2) === \"Ident\" && cursor.peekKind(3) === \"LParen\";\n}\n/**\n* Parses a function/constructor call — bare `autoincrement()` or qualified\n* `temporal.updatedAt()`. Returns `undefined` unless {@link isCallAhead}\n* confirms a trailing `(`, so the `parseExpression` chain falls through to the\n* boolean and bare-identifier forms.\n*/\nfunction parseFunctionCall(cursor) {\n\tif (!isCallAhead(cursor)) return void 0;\n\tcursor.startNode(\"FunctionCall\");\n\tparseQualifiedName(cursor);\n\tif (cursor.peekKind() === \"LParen\") parseParenArgs(cursor);\n\treturn cursor.finishNode();\n}\n/** Parses a parenthesised, comma-separated `AttributeArg` list into the currently open node. */\nfunction parseParenArgs(cursor) {\n\tcursor.bump();\n\twhile (cursor.peekKind() !== \"RParen\" && cursor.peekKind() !== \"Eof\") {\n\t\tparseAttributeArg(cursor);\n\t\tif (cursor.peekKind() === \"Comma\") cursor.bump();\n\t\telse break;\n\t}\n\tif (cursor.peekKind() === \"RParen\") cursor.bump();\n}\nfunction parseAttributeArg(cursor) {\n\tconst kind = cursor.peekKind();\n\tif (kind !== \"Ident\" && kind !== \"StringLiteral\" && kind !== \"NumberLiteral\" && kind !== \"LBracket\" && kind !== \"LBrace\") return;\n\tcursor.startNode(\"AttributeArg\");\n\tif (cursor.peekKind() === \"Ident\" && cursor.peekKind(1) === \"Colon\") {\n\t\tparseIdentifier(cursor);\n\t\tcursor.bump();\n\t}\n\tparseArgValue(cursor);\n\tcursor.finishNode();\n}\nfunction parseArgValue(cursor) {\n\tparseExpression(cursor);\n}\nfunction parseAttributeArgList(cursor) {\n\tcursor.startNode(\"AttributeArgList\");\n\tparseParenArgs(cursor);\n\treturn cursor.finishNode();\n}\nfunction parseAttribute(cursor) {\n\tconst isBlockAttribute = cursor.peekKind() === \"DoubleAt\";\n\tconst attributeMark = cursor.mark();\n\tcursor.startNode(isBlockAttribute ? \"ModelAttribute\" : \"FieldAttribute\");\n\tcursor.bump();\n\tif (cursor.peekKind() === \"Ident\") parseQualifiedName(cursor);\n\telse cursor.diagnostic(\"PSL_INVALID_ATTRIBUTE_SYNTAX\", \"Attribute name expected\", attributeMark);\n\tif (cursor.peekKind() === \"LParen\") parseAttributeArgList(cursor);\n\treturn cursor.finishNode();\n}\n/**\n* A type annotation: `QualifiedName (argList)? ([])? (?)?`, e.g.\n* `pgvector.Vector(1536)[]?`. When the field has no type, no node is emitted —\n* a missing type is the absence of a `TypeAnnotation`, not a zero-width one.\n*/\nfunction parseTypeAnnotation(cursor) {\n\tconst kind = cursor.peekKind();\n\tif (kind !== \"Ident\" && kind !== \"LBracket\" && kind !== \"Question\") return;\n\tcursor.startNode(\"TypeAnnotation\");\n\tif (cursor.peekKind() === \"Ident\") {\n\t\tparseQualifiedName(cursor);\n\t\tif (cursor.peekKind() === \"LParen\") parseAttributeArgList(cursor);\n\t}\n\tif (cursor.peekKind() === \"LBracket\") {\n\t\tcursor.bump();\n\t\tif (cursor.peekKind() === \"RBracket\") cursor.bump();\n\t}\n\tif (cursor.peekKind() === \"Question\") cursor.bump();\n\tcursor.finishNode();\n}\n/**\n* Parses a full PSL document. Never throws — malformed input yields diagnostics\n* and a recovered tree, not an exception.\n*/\nfunction parse(source, filename, options = {}) {\n\tconst cursor = new Cursor(filename, source);\n\tconst root = createSyntaxTree(parseDocument(cursor, options));\n\tconst document = DocumentAst.cast(root) ?? new DocumentAst(root);\n\tconst sources = new PslSources([[document.syntax, cursor.sourceFile]]);\n\treturn {\n\t\tdocument,\n\t\tdiagnostics: cursor.diagnostics,\n\t\tsources\n\t};\n}\nfunction parseDocument(cursor, options) {\n\tcursor.startNode(\"Document\");\n\twhile (cursor.peekKind() !== \"Eof\") parseDeclaration(cursor, false, options);\n\tcursor.flushTrivia();\n\treturn cursor.finishNode();\n}\nconst RESERVED_BLOCK_KEYWORDS = /* @__PURE__ */ new Set([\n\t\"model\",\n\t\"namespace\",\n\t\"type\",\n\t\"types\"\n]);\nfunction keywordIs(cursor, keyword) {\n\treturn cursor.peekKind() === \"Ident\" && cursor.peekToken().text === keyword;\n}\n/**\n* Each alternative is a no-op on non-match, consuming nothing, so the\n* forward-only cursor is never left half-consumed by a rejected alternative.\n* Recovery runs via the `if (!node)` tail rather than as a `??` arm, because it\n* appends raw tokens to the open parent instead of returning a child node.\n*/\nfunction parseDeclaration(cursor, insideNamespace, options) {\n\tconst name = cursor.peekKind(1) === \"Ident\" ? cursor.peekToken(1).text : \"\";\n\tif (insideNamespace && keywordIs(cursor, \"namespace\")) cursor.diagnostic(\"PSL_INVALID_NAMESPACE_BLOCK\", `Recursive \"namespace ${name}\" block is not allowed; namespace blocks may not nest`, cursor.mark());\n\telse if (insideNamespace && keywordIs(cursor, \"types\")) cursor.diagnostic(\"PSL_INVALID_NAMESPACE_BLOCK\", \"`types` blocks must be declared at the document top level, not inside a namespace block\", cursor.mark());\n\telse if (keywordIs(cursor, \"namespace\") && name === UNSPECIFIED_PSL_NAMESPACE_ID) cursor.diagnostic(\"PSL_INVALID_NAMESPACE_BLOCK\", `Namespace name \"${UNSPECIFIED_PSL_NAMESPACE_ID}\" is reserved for the parser-synthesised bucket for top-level declarations`, cursor.mark(1));\n\tif (!(parseModel(cursor) ?? parseNamespace(cursor, options) ?? parseCompositeType(cursor) ?? parseTypesBlock(cursor) ?? parseGenericBlock(cursor, options))) parseUnsupportedTopLevel(cursor);\n}\n/**\n* Reports only the first missing piece — a missing name suppresses the\n* missing-brace diagnostic. `nameRequired` is false only for the `types` block.\n*/\nfunction parseBlock(cursor, kind, nameRequired, parseMember) {\n\tconst keyword = cursor.peekToken().text;\n\tconst keywordMark = cursor.mark();\n\tcursor.startNode(kind);\n\tcursor.bump();\n\tconst hasName = nameRequired && cursor.peekKind() === \"Ident\";\n\tif (hasName) parseIdentifier(cursor);\n\tif (nameRequired && !hasName) cursor.diagnostic(\"PSL_INVALID_DECLARATION\", `Expected a name after \"${keyword}\"`, keywordMark);\n\telse if (cursor.peekKind() !== \"LBrace\") cursor.diagnostic(\"PSL_INVALID_DECLARATION\", `Expected \"{\" to open the \"${keyword}\" block`, cursor.markAfterLastToken());\n\tif (cursor.peekKind() === \"LBrace\") parseBlockBody(cursor, parseMember);\n\telse cursor.recoverToSyncPoint();\n\treturn cursor.finishNode();\n}\nfunction parseModel(cursor) {\n\tif (!keywordIs(cursor, \"model\")) return void 0;\n\treturn parseBlock(cursor, \"ModelDeclaration\", true, parseModelMember);\n}\n/**\n* Excluding the reserved keywords keeps a malformed reserved block (e.g. `model\n* {` with no name) routed to its dedicated parser. The generic keyword set is\n* open, so a bare identifier with no brace (e.g. `oops`) is read as an unfinished\n* custom declaration rather than unsupported content.\n*/\nfunction parseGenericBlock(cursor, options) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tconst keyword = cursor.peekToken().text;\n\tif (RESERVED_BLOCK_KEYWORDS.has(keyword)) return void 0;\n\tconst hasName = cursor.peekKind(1) === \"Ident\" && cursor.peekKind(2) === \"LBrace\";\n\tcursor.startNode(\"GenericBlockDeclaration\");\n\tcursor.bump();\n\tif (hasName) parseIdentifier(cursor);\n\tif (cursor.peekKind() === \"LBrace\") parseBlockBody(cursor, genericBlockMemberParser(keyword, options));\n\telse {\n\t\tcursor.diagnostic(\"PSL_INVALID_DECLARATION\", `Expected \"{\" to open the \"${keyword}\" block`, cursor.markAfterLastToken());\n\t\tcursor.recoverToSyncPoint();\n\t}\n\treturn cursor.finishNode();\n}\nfunction parseNamespace(cursor, options) {\n\tif (!keywordIs(cursor, \"namespace\")) return void 0;\n\treturn parseBlock(cursor, \"Namespace\", true, (inner) => parseDeclaration(inner, true, options));\n}\nfunction parseCompositeType(cursor) {\n\tif (!keywordIs(cursor, \"type\")) return void 0;\n\treturn parseBlock(cursor, \"CompositeTypeDeclaration\", true, parseModelMember);\n}\n/** `types` (plural) is the no-name types block; the singular `type` is the composite type above. */\nfunction parseTypesBlock(cursor) {\n\tif (!keywordIs(cursor, \"types\")) return void 0;\n\treturn parseBlock(cursor, \"TypesBlock\", false, parseNamedTypeMember);\n}\n/** Every `parseMember` consumes at least one significant token, so the loop always terminates. */\nfunction parseBlockBody(cursor, parseMember) {\n\tconst braceMark = cursor.mark();\n\tcursor.bump();\n\tfor (;;) {\n\t\tconst kind = cursor.peekKind();\n\t\tif (kind === \"RBrace\" || kind === \"Eof\") break;\n\t\tparseMember(cursor);\n\t}\n\tif (cursor.peekKind() === \"RBrace\") cursor.bump();\n\telse cursor.diagnostic(\"PSL_UNTERMINATED_BLOCK\", \"Unterminated block declaration\", braceMark);\n}\nfunction parseUnsupportedTopLevel(cursor) {\n\tconst offending = cursor.peekToken().text;\n\tconst message = cursor.peekKind(1) === \"LBrace\" ? `Unsupported top-level block \"${offending}\"` : `Unsupported top-level declaration \"${offending}\"`;\n\tcursor.diagnostic(\"PSL_UNSUPPORTED_TOP_LEVEL_BLOCK\", message, cursor.mark());\n\tcursor.bump();\n\tcursor.recoverToSyncPoint();\n}\n/**\n* Matches a leading `@@` block attribute, a no-op otherwise. Single-`@`\n* attributes belong to fields and are parsed inside `parseField`.\n*/\nfunction parseBlockAttribute(cursor) {\n\tif (cursor.peekKind() !== \"DoubleAt\") return void 0;\n\treturn parseAttribute(cursor);\n}\nfunction parseModelMember(cursor) {\n\tif (!(parseBlockAttribute(cursor) ?? parseField(cursor))) invalidMember(cursor, \"PSL_INVALID_MODEL_MEMBER\", `Invalid model member declaration \"${cursor.peekToken().text}\"`);\n}\nfunction parseNamedTypeMember(cursor) {\n\tif (!parseNamedType(cursor)) invalidMember(cursor, \"PSL_INVALID_TYPES_MEMBER\", `Invalid types declaration \"${cursor.peekToken().text}\"`);\n}\n/**\n* A generic block reads `key = value` entries and bare keys; in an `enum` block those may carry `@`\n* attributes (`USER @map(\"user\")`). In the `prisma-7` grammar, a `view` body is read like a model\n* body. Each interpreter decides whether it accepts the block and its members.\n*/\nfunction genericBlockMemberParser(keyword, options) {\n\tif (keyword === \"view\" && options.grammar === \"prisma-7\") return parseModelMember;\n\tif (keyword === \"enum\") return parseEnumMember;\n\treturn parseKeyValueMember;\n}\n/**\n* A generic-block member is either a `@@`-block attribute or a `key = value`\n* entry. The block-attribute alternative is purely syntactic — it does not judge\n* whether the attribute is valid for the block's kind.\n*/\nfunction parseKeyValueMember(cursor) {\n\tif (!(parseBlockAttribute(cursor) ?? parseKeyValue(cursor))) invalidMember(cursor, \"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", \"Invalid block entry\");\n}\nfunction parseEnumMember(cursor) {\n\tif (!(parseBlockAttribute(cursor) ?? parseKeyValue(cursor, { memberAttributes: true }))) invalidMember(cursor, \"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", \"Invalid block entry\");\n}\nfunction invalidMember(cursor, code, message) {\n\tcursor.diagnostic(code, message, cursor.mark());\n\tcursor.bump();\n\tcursor.recoverToSyncPoint();\n}\nfunction parseField(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tcursor.startNode(\"FieldDeclaration\");\n\tconst nameMark = cursor.mark();\n\tconst nameText = cursor.peekToken().text;\n\tparseIdentifier(cursor);\n\tif (cursor.peekKind() !== \"Ident\") cursor.diagnostic(\"PSL_INVALID_MODEL_MEMBER\", `Expected a type after field \"${nameText}\"`, nameMark);\n\tparseTypeAnnotation(cursor);\n\twhile (cursor.peekKind() === \"At\") parseAttribute(cursor);\n\treturn cursor.finishNode();\n}\nfunction parseNamedType(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tcursor.startNode(\"NamedTypeDeclaration\");\n\tconst nameMark = cursor.mark();\n\tconst nameText = cursor.peekToken().text;\n\tparseIdentifier(cursor);\n\tif (cursor.peekKind() === \"Equals\") cursor.bump();\n\telse cursor.diagnostic(\"PSL_INVALID_TYPES_MEMBER\", `Expected \"=\" after \"${nameText}\"`, nameMark);\n\tparseTypeAnnotation(cursor);\n\twhile (cursor.peekKind() === \"At\") parseAttribute(cursor);\n\treturn cursor.finishNode();\n}\n/**\n* A generic-block entry is either `key = value` or a bare `key` (committing a\n* `KeyValuePair` carrying only the key). With `memberAttributes` (enum blocks) any number of `@`\n* attributes may follow, as in `USER @map(\"user\")`. A `key =` with no following expression is\n* flagged.\n*/\nfunction parseKeyValue(cursor, options = { memberAttributes: false }) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tcursor.startNode(\"KeyValuePair\");\n\tparseIdentifier(cursor);\n\tif (cursor.peekKind() === \"Equals\") {\n\t\tcursor.bump();\n\t\tif (!parseExpression(cursor)) cursor.diagnostic(\"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", \"Expected a value after \\\"=\\\"\", cursor.mark());\n\t}\n\twhile (options.memberAttributes && cursor.peekKind() === \"At\") parseAttribute(cursor);\n\treturn cursor.finishNode();\n}\n//#endregion\nexport { PslSources as a, greenToken as i, GreenNodeBuilder as n, SourceFile as o, greenNode as r, parse as t };\n\n//# sourceMappingURL=parse-81Q8fvfm.mjs.map"],"mappings":";;;;;;AAMA,MAAM,kBAAkB;AACxB,MAAM,YAAY;AAClB,IAAI,aAAa,MAAM;CACtB;CACA;CACA;CACA,YAAY,UAAU,MAAM;EAC3B,KAAKA,YAAY;EACjB,KAAKC,QAAQ;EACb,MAAM,aAAa,CAAC,CAAC;EACrB,KAAK,IAAI,SAAS,GAAG,SAAS,KAAK,QAAQ,UAAU,IAAI,KAAK,WAAW,MAAM,MAAM,WAAW,WAAW,KAAK,SAAS,CAAC;EAC1H,KAAKC,cAAc;CAC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,OAAO,OAAO,SAAS,MAAM,MAAM,eAAe,MAAM;CACxD,OAAO,OAAO,WAAW;AAC1B;AACA,SAAS,eAAe,QAAQ;CAC/B,IAAI,OAAO,SAAS,MAAM,SAAS,OAAO,KAAK;CAC/C,OAAO,UAAU,sBAAsB;CACvC,MAAM,WAAW,OAAO,KAAK;CAC7B,MAAM,WAAW,OAAO,UAAU,CAAC,CAAC;CACpC,gBAAgB,MAAM;CACtB,IAAI,OAAO,SAAS,MAAM,UAAU,OAAO,KAAK;MAC3C,OAAO,WAAW,4BAA4B,uBAAuB,SAAS,IAAI,QAAQ;CAC/F,oBAAoB,MAAM;CAC1B,OAAO,OAAO,SAAS,MAAM,MAAM,eAAe,MAAM;CACxD,OAAO,OAAO,WAAW;AAC1B;;;;;;;AAOA,SAAS,cAAc,QAAQ,UAAU,EAAE,kBAAkB,MAAM,GAAG;CACrE,IAAI,OAAO,SAAS,MAAM,SAAS,OAAO,KAAK;CAC/C,OAAO,UAAU,cAAc;CAC/B,gBAAgB,MAAM;CACtB,IAAI,OAAO,SAAS,MAAM,UAAU;EACnC,OAAO,KAAK;EACZ,IAAI,CAAC,gBAAgB,MAAM,GAAG,OAAO,WAAW,sCAAsC,gCAAgC,OAAO,KAAK,CAAC;CACpI;CACA,OAAO,QAAQ,oBAAoB,OAAO,SAAS,MAAM,MAAM,eAAe,MAAM;CACpF,OAAO,OAAO,WAAW;AAC1B"}
|
|
@@ -2,9 +2,9 @@ import { U as PslSpan } from "./framework-authoring-Lssvcd3X-DsgKz6mc.mjs";
|
|
|
2
2
|
import { o as TaggedLiteralCanonicalization } from "./temporal-presets-yQzaI_83-DfMU1Lm2.mjs";
|
|
3
3
|
import "./control-Bcsnrolt.mjs";
|
|
4
4
|
import "./psl-ast-BOzFRzI0.mjs";
|
|
5
|
-
import { r as ContractSourceDiagnostic } from "./config-types-
|
|
5
|
+
import { h as PslParserOptions, r as ContractSourceDiagnostic } from "./config-types-DtyK6o50.mjs";
|
|
6
6
|
import { n as TokenKind, t as Token } from "./tokenizer-DW30uwhx-BHsWTwYk.mjs";
|
|
7
|
-
//#region ../../../1-framework/2-authoring/psl-parser/dist/parse-
|
|
7
|
+
//#region ../../../1-framework/2-authoring/psl-parser/dist/parse-BLbPHv4U.d.mts
|
|
8
8
|
//#region src/syntax/syntax-kind.d.ts
|
|
9
9
|
type SyntaxKind = 'Document' | 'ModelDeclaration' | 'CompositeTypeDeclaration' | 'Namespace' | 'TypesBlock' | 'GenericBlockDeclaration' | 'FieldDeclaration' | 'NamedTypeDeclaration' | 'KeyValuePair' | 'FieldAttribute' | 'ModelAttribute' | 'AttributeArgList' | 'AttributeArg' | 'TypeAnnotation' | 'Identifier' | 'QualifiedName' | 'FunctionCall' | 'ArrayLiteral' | 'StringLiteralExpr' | 'TaggedLiteral' | 'NumberLiteralExpr' | 'BooleanLiteralExpr' | 'ObjectLiteralExpr' | 'ObjectField';
|
|
10
10
|
//#endregion
|
|
@@ -488,7 +488,7 @@ interface ParseResult {
|
|
|
488
488
|
* Parses a full PSL document. Never throws — malformed input yields diagnostics
|
|
489
489
|
* and a recovered tree, not an exception.
|
|
490
490
|
*/
|
|
491
|
-
declare function parse(source: string, filename: string): ParseResult;
|
|
491
|
+
declare function parse(source: string, filename: string, options?: PslParserOptions): ParseResult;
|
|
492
492
|
//#endregion
|
|
493
493
|
export { createPslDiagnosticCollector as $, ObjectFieldAst as A, SourceFile as B, KeyValuePairAst as C, NamespaceDeclarationAst as D, NamedTypeDeclarationAst as E, PslDiagnostic as F, SyntaxNode as G, StringLiteralQuote as H, PslDiagnosticCollector as I, TokenAtOffset as J, SyntaxToken as K, PslSources as L, ParseDiagnostic as M, ParseResult as N, NamespaceMemberAst as O, Position as P, castExpression as Q, QualifiedNameAst as R, IdentifierAst as S, ModelDeclarationAst as T, SyntaxElement as U, StringLiteralExprAst as V, SyntaxKind as W, TypesBlockAst as X, TypeAnnotationAst as Y, any as Z, GenericBlockDeclarationAst as _, AttributeAst as a, findFirstChild as at, GreenNode as b, BracedBlock as c, mapPslDiagnostics as ct, DiagnosticSource as d, createSyntaxTree as et, DocumentAst as f, FunctionCallAst as g, FieldDeclarationAst as h, AttributeArgListAst as i, findChildToken as it, ObjectLiteralExprAst as j, NumberLiteralExprAst as k, CompositeTypeDeclarationAst as l, parse as lt, FieldAttributeAst as m, AstNode as n, diagnosticSource as nt, BlockMemberAst as o, greenNode as ot, ExpressionAst as p, TaggedLiteralExprAst as q, AttributeArgAst as r, filterChildren as rt, BooleanLiteralExprAst as s, greenToken as st, ArrayLiteralAst as t, diagnosticFromSpan as tt, DeclarationAst as u, printSyntax as ut, GenericBlockMemberAst as v, ModelAttributeAst as w, GreenToken as x, GreenElement as y, Range as z };
|
|
494
|
-
//# sourceMappingURL=parse-
|
|
494
|
+
//# sourceMappingURL=parse-BLbPHv4U-Y4lID7XQ.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-
|
|
1
|
+
{"version":3,"file":"parse-BLbPHv4U-Y4lID7XQ.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/parse-BLbPHv4U.d.mts"],"mappings":";;;;;;;;KAKK;;;UAGK;WACC;WACA,MAAM;WACN;;UAED;WACC;WACA,MAAM;WACN,UAAU,cAAc;WACxB;;KAEN,eAAe,YAAY;iBACf,WAAW,MAAM,WAAW,eAAe;iBAC3C,UAAU,MAAM,YAAY,UAAU,cAAc,gBAAgB;;;;;;;;;;cAUvE,uBAAuB;WAC1B,OAAO;WACP,MAAM;WACN;WACA;WACA,QAAQ;;WAER;EACT,YAAY,OAAO,YAAY,gBAAgB,QAAQ,YAAY;MAC/D;MACA;;EAEJ,SAAS;EACT,UAAU;;MAEN,sBAAsB;;MAEtB,sBAAsB;;MAEtB,aAAa;;MAEb,aAAa;;KAEd,gBAAgB,aAAa;cACpB;;UAEJ;SACD,QAAQ;SACR,OAAO,OAAO,cAAc;SAC5B,QAAQ,MAAM,aAAa,OAAO,cAAc;MACnD;MACA;E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,sBAAsB;WACtB,SAAS;;;;;;iBAMH,MAAM,gBAAgB,kBAAkB,UAAU,mBAAmB"}
|
package/dist/psl-parser.d.mts
CHANGED
|
@@ -8,8 +8,8 @@ import { r as Result } from "./result-BYCOANWy.mjs";
|
|
|
8
8
|
import { n as AssembledAuthoringContributions } from "./control-Bcsnrolt.mjs";
|
|
9
9
|
import "./psl-ast-BOzFRzI0.mjs";
|
|
10
10
|
import { i as isPslIdentifier } from "./tokenizer-DW30uwhx-BHsWTwYk.mjs";
|
|
11
|
-
import { $ as createPslDiagnosticCollector, F as PslDiagnostic, G as SyntaxNode, I as PslDiagnosticCollector, L as PslSources, M as ParseDiagnostic, ct as mapPslDiagnostics, d as DiagnosticSource, m as FieldAttributeAst, n as AstNode, nt as diagnosticSource, p as ExpressionAst, r as AttributeArgAst, tt as diagnosticFromSpan, w as ModelAttributeAst } from "./parse-
|
|
12
|
-
import { _ as nodePslSpan, a as ModelSymbol, b as readResolvedConstructorCall, c as ResolvedAttribute, d as ResolvedTypeConstructorCall, f as SymbolTable, g as keywordPslSpan, h as buildSymbolTable, i as FieldSymbol, l as ResolvedAttributeArg, m as TopLevelScope, n as BuildSymbolTableOptions, o as NamedTypeSymbol, p as SymbolTableResult, r as CompositeTypeSymbol, s as NamespaceSymbol, t as BlockSymbol, u as ResolvedNamedTypeBinding, v as readResolvedAttribute, y as readResolvedAttributes } from "./symbol-table-
|
|
11
|
+
import { $ as createPslDiagnosticCollector, F as PslDiagnostic, G as SyntaxNode, I as PslDiagnosticCollector, L as PslSources, M as ParseDiagnostic, ct as mapPslDiagnostics, d as DiagnosticSource, m as FieldAttributeAst, n as AstNode, nt as diagnosticSource, p as ExpressionAst, r as AttributeArgAst, tt as diagnosticFromSpan, w as ModelAttributeAst } from "./parse-BLbPHv4U-Y4lID7XQ.mjs";
|
|
12
|
+
import { _ as nodePslSpan, a as ModelSymbol, b as readResolvedConstructorCall, c as ResolvedAttribute, d as ResolvedTypeConstructorCall, f as SymbolTable, g as keywordPslSpan, h as buildSymbolTable, i as FieldSymbol, l as ResolvedAttributeArg, m as TopLevelScope, n as BuildSymbolTableOptions, o as NamedTypeSymbol, p as SymbolTableResult, r as CompositeTypeSymbol, s as NamespaceSymbol, t as BlockSymbol, u as ResolvedNamedTypeBinding, v as readResolvedAttribute, y as readResolvedAttributes } from "./symbol-table-cNWLdZRx-Cj1Gb8HJ.mjs";
|
|
13
13
|
import { n as UnionToIntersection, t as Simplify } from "./types-DGxlljKG.mjs";
|
|
14
14
|
//#region ../../../1-framework/2-authoring/psl-parser/dist/index.d.mts
|
|
15
15
|
//#region src/attribute-helpers.d.ts
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { h as PslParserOptions } from "./config-types-DtyK6o50.mjs";
|
|
1
2
|
//#region ../../../1-framework/2-authoring/psl-parser/dist/format.d.mts
|
|
2
3
|
//#region src/format/options.d.ts
|
|
3
4
|
interface FormatOptions {
|
|
@@ -6,7 +7,7 @@ interface FormatOptions {
|
|
|
6
7
|
}
|
|
7
8
|
//#endregion
|
|
8
9
|
//#region src/format/format.d.ts
|
|
9
|
-
declare function format(source: string, options?: FormatOptions): string;
|
|
10
|
+
declare function format(source: string, options?: FormatOptions, parserOptions?: PslParserOptions): string;
|
|
10
11
|
//#endregion
|
|
11
12
|
export { type FormatOptions, format };
|
|
12
13
|
//# sourceMappingURL=psl-parser__format.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psl-parser__format.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/format.d.mts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"psl-parser__format.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/format.d.mts"],"mappings":";;;UAEU;WACC;WACA;;;;iBAIM,OAAO,gBAAgB,UAAU,eAAe,gBAAgB"}
|
|
@@ -2,7 +2,7 @@ import { o as structuredError } from "./structured-error-BXbihKQ-.mjs";
|
|
|
2
2
|
import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
3
3
|
import { t as SyntaxNode } from "./ast-helpers-2XRnkQEO-BxG5qx3Q.mjs";
|
|
4
4
|
import { a as CompositeTypeDeclarationAst, c as FieldDeclarationAst, f as KeyValuePairAst, g as NamespaceDeclarationAst, h as NamedTypeDeclarationAst, m as ModelDeclarationAst, p as ModelAttributeAst, u as GenericBlockDeclarationAst, w as TypesBlockAst } from "./declarations-CcEBlusF-DXJwQ_ze.mjs";
|
|
5
|
-
import { o as parse } from "./parse-
|
|
5
|
+
import { o as parse } from "./parse-81Q8fvfm-iWuq9WLS.mjs";
|
|
6
6
|
//#region ../../../1-framework/2-authoring/psl-parser/dist/format.mjs
|
|
7
7
|
function emitDocument(document, indentUnit, newline) {
|
|
8
8
|
const writer = new LineWriter(indentUnit, newline);
|
|
@@ -468,9 +468,9 @@ function resolveFormatOptions(options) {
|
|
|
468
468
|
newline: newline === "CRLF" ? "\r\n" : "\n"
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
|
-
function format(source, options) {
|
|
471
|
+
function format(source, options, parserOptions = {}) {
|
|
472
472
|
const resolved = resolveFormatOptions(options);
|
|
473
|
-
const { document, diagnostics } = parse(source, "<format-input>.psl");
|
|
473
|
+
const { document, diagnostics } = parse(source, "<format-input>.psl", parserOptions);
|
|
474
474
|
if (diagnostics.length > 0) throw pslError("PSL.PARSE_FAILED", `Cannot format PSL with parse errors: ${diagnostics[0]?.message ?? "unknown parse error"}${diagnostics.length > 1 ? ` (and ${diagnostics.length - 1} more)` : ""}`, { meta: { diagnostics } });
|
|
475
475
|
return emitDocument(document, resolved.indentUnit, resolved.newline);
|
|
476
476
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psl-parser__format.mjs","names":["#indentUnit","#newline","#depth","#lastWasBlank","#lineOpen","#prevKind","#out","#line","#hasContent"],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/format.mjs"],"sourcesContent":["import { o as SyntaxNode } from \"./ast-helpers-2XRnkQEO.mjs\";\nimport { a as KeyValuePairAst, c as NamespaceDeclarationAst, i as GenericBlockDeclarationAst, l as TypesBlockAst, o as ModelDeclarationAst, p as ModelAttributeAst, r as FieldDeclarationAst, s as NamedTypeDeclarationAst, t as CompositeTypeDeclarationAst } from \"./declarations-CcEBlusF.mjs\";\nimport { t as parse } from \"./parse-DAVL8A2m.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/format/emit.ts\nfunction emitDocument(document, indentUnit, newline) {\n\tconst writer = new LineWriter(indentUnit, newline);\n\temitTopLevel(writer, document);\n\treturn writer.finish();\n}\nvar LineWriter = class {\n\t#indentUnit;\n\t#newline;\n\t#out = [];\n\t#depth = 0;\n\t#line = \"\";\n\t#lineOpen = false;\n\t#prevKind;\n\t#lastWasBlank = false;\n\t#hasContent = false;\n\tconstructor(indentUnit, newline) {\n\t\tthis.#indentUnit = indentUnit;\n\t\tthis.#newline = newline;\n\t}\n\tindent() {\n\t\tthis.#depth += 1;\n\t}\n\tunindent() {\n\t\tthis.#depth = Math.max(0, this.#depth - 1);\n\t}\n\tlastIsBlank() {\n\t\treturn this.#lastWasBlank;\n\t}\n\tlineOpen() {\n\t\treturn this.#lineOpen;\n\t}\n\tprevKind() {\n\t\treturn this.#prevKind;\n\t}\n\tnewline() {\n\t\tif (!this.#lineOpen) return;\n\t\tthis.#out.push(`${this.#indentUnit.repeat(this.#depth)}${this.#line}`);\n\t\tthis.#line = \"\";\n\t\tthis.#lineOpen = false;\n\t\tthis.#prevKind = void 0;\n\t\tthis.#lastWasBlank = false;\n\t\tthis.#hasContent = true;\n\t}\n\tblank() {\n\t\tthis.newline();\n\t\tif (!this.#hasContent || this.#lastWasBlank) return;\n\t\tthis.#out.push(\"\");\n\t\tthis.#lastWasBlank = true;\n\t}\n\twrite(token, space, padTo) {\n\t\tif (this.#lineOpen && padTo !== void 0) this.#line = this.#line.padEnd(padTo);\n\t\telse if (this.#lineOpen && space) this.#line += \" \";\n\t\tthis.#line += token.text;\n\t\tthis.#lineOpen = true;\n\t\tthis.#prevKind = token.kind;\n\t}\n\twriteRaw(text) {\n\t\tthis.#line += text;\n\t\tthis.#lineOpen = true;\n\t}\n\tcomment(text) {\n\t\tif (this.#lineOpen) this.#line += ` ${text}`;\n\t\telse this.#line = text;\n\t\tthis.#lineOpen = true;\n\t\tthis.newline();\n\t}\n\tfinish() {\n\t\tthis.newline();\n\t\tconst body = this.#out.join(this.#newline);\n\t\treturn body.length > 0 ? `${body}${this.#newline}` : \"\";\n\t}\n};\nfunction spaceBetween(prev, cur, inQualifiedName) {\n\tif (prev === void 0) return false;\n\tif (inQualifiedName) return false;\n\tif (prev === \"Ident\" && cur === \"StringLiteral\") return false;\n\tswitch (cur) {\n\t\tcase \"LBracket\": return prev === \"Colon\" || prev === \"Comma\" || prev === \"Equals\";\n\t\tcase \"LParen\":\n\t\tcase \"RParen\":\n\t\tcase \"RBracket\":\n\t\tcase \"Comma\":\n\t\tcase \"Question\":\n\t\tcase \"Dot\":\n\t\tcase \"Colon\": return false;\n\t\tcase \"RBrace\": return prev !== \"LBrace\";\n\t\tdefault: break;\n\t}\n\tswitch (prev) {\n\t\tcase \"LParen\":\n\t\tcase \"LBracket\":\n\t\tcase \"Dot\":\n\t\tcase \"At\":\n\t\tcase \"DoubleAt\": return false;\n\t\tdefault: return true;\n\t}\n}\nfunction streamNode(writer, node, padTo) {\n\tlet continuation = 0;\n\tlet first = true;\n\tlet prevQualified = false;\n\tconst walk = (parent, qualified) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child, qualified || child.kind === \"QualifiedName\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\t\tif (child.kind === \"Comment\") {\n\t\t\t\twriter.comment(child.text);\n\t\t\t\twriter.indent();\n\t\t\t\tcontinuation += 1;\n\t\t\t\tprevQualified = false;\n\t\t\t\tfirst = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst pad = first ? padTo : void 0;\n\t\t\tconst space = spaceBetween(writer.prevKind(), child.kind, qualified && prevQualified);\n\t\t\twriter.write(child, space, writer.lineOpen() ? pad : void 0);\n\t\t\tprevQualified = qualified;\n\t\t\tfirst = false;\n\t\t}\n\t};\n\twalk(node, false);\n\treturn continuation;\n}\nfunction closeContinuation(writer, count) {\n\tfor (let i = 0; i < count; i++) writer.unindent();\n}\nfunction emitField(writer, field, alignmentColumns) {\n\treturn streamRow(writer, field.syntax, alignmentColumns);\n}\nfunction emitNamedType(writer, decl) {\n\treturn streamRow(writer, decl.syntax, void 0);\n}\nfunction streamRow(writer, row, alignmentColumns) {\n\tlet continuation = 0;\n\tlet sawAttribute = false;\n\tfor (const child of row.children()) {\n\t\tif (child instanceof SyntaxNode) {\n\t\t\tlet padTo;\n\t\t\tif (child.kind === \"TypeAnnotation\" && continuation === 0) padTo = alignmentColumns?.typeColumn;\n\t\t\telse if (child.kind === \"FieldAttribute\") {\n\t\t\t\tif (continuation > 0) writer.newline();\n\t\t\t\telse if (!sawAttribute) padTo = alignmentColumns?.attributeColumn;\n\t\t\t\tsawAttribute = true;\n\t\t\t}\n\t\t\tcontinuation += streamNode(writer, child, padTo);\n\t\t\tcontinue;\n\t\t}\n\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\tif (child.kind === \"Comment\") {\n\t\t\twriter.comment(child.text);\n\t\t\twriter.indent();\n\t\t\tcontinuation += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst space = spaceBetween(writer.prevKind(), child.kind, false);\n\t\twriter.write(child, space);\n\t}\n\treturn continuation;\n}\nfunction emitBlockAttribute(writer, attribute) {\n\treturn streamNode(writer, attribute.syntax);\n}\nfunction emitKeyValue(writer, pair) {\n\treturn streamNode(writer, pair.syntax);\n}\nfunction leafMember(writer, category, print) {\n\treturn {\n\t\tcategory,\n\t\temit(trailing) {\n\t\t\tconst continuation = print();\n\t\t\tif (trailing !== void 0) writer.comment(trailing);\n\t\t\telse writer.newline();\n\t\t\treturn continuation;\n\t\t}\n\t};\n}\nfunction emitModel(writer, model, trailing) {\n\tconst alignmentColumns = alignmentMap(model.syntax);\n\temitBlockBody(writer, model.syntax, trailing, (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignmentColumns));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t});\n}\nfunction emitCompositeType(writer, composite, trailing) {\n\tconst alignmentColumns = alignmentMap(composite.syntax);\n\temitBlockBody(writer, composite.syntax, trailing, (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignmentColumns));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t});\n}\nfunction emitGenericBlock(writer, block, trailing) {\n\tconst alignment = alignmentMap(block.syntax);\n\temitBlockBody(writer, block.syntax, trailing, (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignment));\n\t\tconst entry = KeyValuePairAst.cast(node);\n\t\tif (entry) return leafMember(writer, \"regular\", () => emitKeyValue(writer, entry));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t});\n}\nfunction emitNamespace(writer, namespace, trailing) {\n\temitBlockBody(writer, namespace.syntax, trailing, (node) => {\n\t\tconst declaration = castBlockDeclaration(node);\n\t\tif (declaration) return nestedBlockMember(writer, declaration);\n\t});\n}\nfunction emitTypesBlock(writer, block, trailing) {\n\temitBlockBody(writer, block.syntax, trailing, (node) => {\n\t\tconst named = NamedTypeDeclarationAst.cast(node);\n\t\tif (named) return leafMember(writer, \"regular\", () => emitNamedType(writer, named));\n\t});\n}\nfunction emitTopLevel(writer, document) {\n\twalkRegion(writer, Array.from(document.syntax.children()), void 0, (node) => {\n\t\tconst declaration = castTopLevelDeclaration(node);\n\t\tif (declaration) return nestedBlockMember(writer, declaration);\n\t});\n}\nfunction nestedBlockMember(writer, block) {\n\treturn {\n\t\tcategory: \"nestedBlock\",\n\t\temit(trailing) {\n\t\t\tblock(writer, trailing);\n\t\t\treturn 0;\n\t\t}\n\t};\n}\nfunction castBlockDeclaration(node) {\n\tconst model = ModelDeclarationAst.cast(node);\n\tif (model) return (writer, trailing) => emitModel(writer, model, trailing);\n\tconst composite = CompositeTypeDeclarationAst.cast(node);\n\tif (composite) return (writer, trailing) => emitCompositeType(writer, composite, trailing);\n\tconst generic = GenericBlockDeclarationAst.cast(node);\n\tif (generic) return (writer, trailing) => emitGenericBlock(writer, generic, trailing);\n}\nfunction castTopLevelDeclaration(node) {\n\tconst block = castBlockDeclaration(node);\n\tif (block) return block;\n\tconst namespace = NamespaceDeclarationAst.cast(node);\n\tif (namespace) return (writer, trailing) => emitNamespace(writer, namespace, trailing);\n\tconst types = TypesBlockAst.cast(node);\n\tif (types) return (writer, trailing) => emitTypesBlock(writer, types, trailing);\n}\nfunction emitBlockBody(writer, node, closingTrailing, classify) {\n\tconst children = Array.from(node.children());\n\tconst openIndex = children.findIndex((el) => !(el instanceof SyntaxNode) && el.kind === \"LBrace\");\n\tconst headerComments = streamHeader(writer, node);\n\tconst openingComment = sameLineCommentAfter(children, openIndex);\n\tif (openingComment !== void 0) headerComments.push(openingComment);\n\tconst [firstComment, ...otherComments] = headerComments;\n\tif (firstComment !== void 0) writer.comment(firstComment);\n\telse writer.newline();\n\twriter.indent();\n\tfor (const comment of otherComments) writer.comment(comment);\n\twalkRegion(writer, children, \"RBrace\", classify);\n\twriter.unindent();\n\twriter.writeRaw(\"}\");\n\tif (closingTrailing !== void 0) writer.comment(closingTrailing);\n\telse writer.newline();\n}\n/** Writes the block header through `{` and returns the source comments found before the `{`. */\nfunction streamHeader(writer, node) {\n\tconst comments = [];\n\tlet done = false;\n\tconst walk = (parent) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (done) return;\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Comment\") {\n\t\t\t\tcomments.push(child.text);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\t\tconst space = spaceBetween(writer.prevKind(), child.kind, false);\n\t\t\twriter.write(child, space);\n\t\t\tif (child.kind === \"LBrace\") {\n\t\t\t\tdone = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\twalk(node);\n\treturn comments;\n}\nfunction walkRegion(writer, elements, closeKind, classify) {\n\tlet sawOpenBrace = closeKind === void 0;\n\tlet sawContent = false;\n\tlet lastWasRegular = false;\n\tlet ledByComment = false;\n\tlet newlines = 0;\n\tfor (let i = 0; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) {\n\t\t\tif (!sawOpenBrace) continue;\n\t\t\tconst member = classify(element);\n\t\t\tif (member === void 0) throw new InternalError(`Formatter has no rule for a ${element.kind} node at offset ${element.offset}; formatting would drop its text`);\n\t\t\tif (!ledByComment) {\n\t\t\t\tif (newlines >= 2 && sawContent && !writer.lastIsBlank()) writer.blank();\n\t\t\t\telse if (separationBlankWanted(writer, member.category, sawContent, lastWasRegular)) writer.blank();\n\t\t\t}\n\t\t\tconst trailing = sameLineTrailingComment(elements, i);\n\t\t\tcloseContinuation(writer, member.emit(trailing.text));\n\t\t\tif (trailing.index !== void 0) i = trailing.index;\n\t\t\tsawContent = true;\n\t\t\tlastWasRegular = member.category !== \"blockAttribute\";\n\t\t\tledByComment = false;\n\t\t\tnewlines = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (element.kind === \"LBrace\" && closeKind === \"RBrace\" && !sawOpenBrace) {\n\t\t\tsawOpenBrace = true;\n\t\t\tnewlines = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (!sawOpenBrace) continue;\n\t\tif (closeKind === \"RBrace\" && element.kind === \"RBrace\") break;\n\t\tif (element.kind === \"Whitespace\") continue;\n\t\tif (element.kind === \"Newline\") {\n\t\t\tnewlines += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (element.kind === \"Comment\") {\n\t\t\tif (closeKind === \"RBrace\" && newlines === 0 && !sawContent) continue;\n\t\t\tif (newlines >= 2 && sawContent && !writer.lastIsBlank()) writer.blank();\n\t\t\telse if (!ledByComment) {\n\t\t\t\tconst led = leadingMemberAfter(elements, i, classify);\n\t\t\t\tif (led && separationBlankWanted(writer, led, sawContent, lastWasRegular)) writer.blank();\n\t\t\t}\n\t\t\twriter.writeRaw(element.text);\n\t\t\twriter.newline();\n\t\t\tsawContent = true;\n\t\t\tledByComment = true;\n\t\t\tnewlines = 0;\n\t\t}\n\t}\n}\nfunction separationBlankWanted(writer, category, sawContent, lastWasRegular) {\n\tif (!sawContent || writer.lastIsBlank()) return false;\n\tif (category === \"nestedBlock\") return true;\n\treturn category === \"blockAttribute\" && lastWasRegular;\n}\nfunction leadingMemberAfter(elements, commentIndex, classify) {\n\tfor (let i = commentIndex + 1; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) return classify(element)?.category;\n\t\tif (element.kind === \"RBrace\") return void 0;\n\t}\n}\nfunction sameLineTrailingComment(elements, memberIndex) {\n\tfor (let i = memberIndex + 1; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) break;\n\t\tif (element.kind === \"Whitespace\") continue;\n\t\tif (element.kind === \"Comment\") return {\n\t\t\ttext: element.text,\n\t\t\tindex: i\n\t\t};\n\t\tbreak;\n\t}\n\treturn {\n\t\ttext: void 0,\n\t\tindex: void 0\n\t};\n}\nfunction sameLineCommentAfter(children, openIndex) {\n\tfor (let i = openIndex + 1; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tif (child === void 0) continue;\n\t\tif (child instanceof SyntaxNode) return void 0;\n\t\tif (child.kind === \"Whitespace\") continue;\n\t\tif (child.kind === \"Comment\") return child.text;\n\t\treturn;\n\t}\n}\nfunction alignmentMap(block) {\n\tconst fields = [];\n\tfor (const element of block.children()) {\n\t\tif (!(element instanceof SyntaxNode)) continue;\n\t\tif (FieldDeclarationAst.cast(element) === void 0) continue;\n\t\tif (hasInteriorComment(element)) continue;\n\t\tfields.push(element);\n\t}\n\tif (fields.length === 0) return void 0;\n\treturn alignmentColumns(fields);\n}\nfunction alignmentColumns(rows) {\n\tlet nameWidth = 0;\n\tfor (const row of rows) {\n\t\tconst field = FieldDeclarationAst.cast(row);\n\t\tif (!field) continue;\n\t\tnameWidth = Math.max(nameWidth, renderTokens(field.name()?.syntax).length);\n\t}\n\tconst typeColumn = nameWidth + 1;\n\tlet cellEnd = 0;\n\tfor (const row of rows) {\n\t\tconst field = FieldDeclarationAst.cast(row);\n\t\tif (!field) continue;\n\t\tconst name = renderTokens(field.name()?.syntax);\n\t\tconst type = renderTokens(field.typeAnnotation()?.syntax);\n\t\tcellEnd = Math.max(cellEnd, type.length > 0 ? typeColumn + type.length : name.length);\n\t}\n\treturn {\n\t\ttypeColumn,\n\t\tattributeColumn: cellEnd + 1\n\t};\n}\nfunction hasInteriorComment(node) {\n\tfor (const token of node.tokens()) if (token.kind === \"Comment\") return true;\n\treturn false;\n}\nfunction renderTokens(node) {\n\tif (!node) return \"\";\n\tlet out = \"\";\n\tlet prev;\n\tlet prevQualified = false;\n\tconst walk = (parent, qualified) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child, qualified || child.kind === \"QualifiedName\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\" || child.kind === \"Comment\") continue;\n\t\t\tif (spaceBetween(prev, child.kind, qualified && prevQualified)) out += \" \";\n\t\t\tout += child.text;\n\t\t\tprev = child.kind;\n\t\t\tprevQualified = qualified;\n\t\t}\n\t};\n\twalk(node, false);\n\treturn out;\n}\n//#endregion\n//#region src/format/error.ts\nfunction pslError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/format/options.ts\nfunction resolveFormatOptions(options) {\n\tconst indent = options?.indent ?? 2;\n\tif (indent !== \"tab\" && (typeof indent !== \"number\" || !Number.isInteger(indent) || indent < 1)) throw pslError(\"PSL.FORMAT_OPTION_INVALID\", `Invalid format options: indent must be a positive integer or 'tab', got ${String(indent)}`, { meta: {\n\t\toption: \"indent\",\n\t\treceived: String(indent)\n\t} });\n\tconst newline = options?.newline ?? \"LF\";\n\tif (newline !== \"LF\" && newline !== \"CRLF\") throw pslError(\"PSL.FORMAT_OPTION_INVALID\", `Invalid format options: newline must be 'LF' or 'CRLF', got ${String(newline)}`, { meta: {\n\t\toption: \"newline\",\n\t\treceived: String(newline)\n\t} });\n\treturn {\n\t\tindentUnit: indent === \"tab\" ? \"\t\" : \" \".repeat(indent),\n\t\tnewline: newline === \"CRLF\" ? \"\\r\\n\" : \"\\n\"\n\t};\n}\n//#endregion\n//#region src/format/format.ts\nfunction format(source, options) {\n\tconst resolved = resolveFormatOptions(options);\n\tconst { document, diagnostics } = parse(source, \"<format-input>.psl\");\n\tif (diagnostics.length > 0) throw pslError(\"PSL.PARSE_FAILED\", `Cannot format PSL with parse errors: ${diagnostics[0]?.message ?? \"unknown parse error\"}${diagnostics.length > 1 ? ` (and ${diagnostics.length - 1} more)` : \"\"}`, { meta: { diagnostics } });\n\treturn emitDocument(document, resolved.indentUnit, resolved.newline);\n}\n//#endregion\nexport { format };\n\n//# source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C,MAAM,WAAW,qBAAqB,OAAO;CAC7C,MAAM,EAAE,UAAU,gBAAgB,MAAM,QAAQ,oBAAoB;CACpE,IAAI,YAAY,SAAS,GAAG,MAAM,SAAS,oBAAoB,wCAAwC,YAAY,EAAE,EAAE,WAAW,wBAAwB,YAAY,SAAS,IAAI,SAAS,YAAY,SAAS,EAAE,UAAU,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;CAC5P,OAAO,aAAa,UAAU,SAAS,YAAY,SAAS,OAAO;AACpE"}
|
|
1
|
+
{"version":3,"file":"psl-parser__format.mjs","names":["#indentUnit","#newline","#depth","#lastWasBlank","#lineOpen","#prevKind","#out","#line","#hasContent"],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/format.mjs"],"sourcesContent":["import { o as SyntaxNode } from \"./ast-helpers-2XRnkQEO.mjs\";\nimport { a as KeyValuePairAst, c as NamespaceDeclarationAst, i as GenericBlockDeclarationAst, l as TypesBlockAst, o as ModelDeclarationAst, p as ModelAttributeAst, r as FieldDeclarationAst, s as NamedTypeDeclarationAst, t as CompositeTypeDeclarationAst } from \"./declarations-CcEBlusF.mjs\";\nimport { t as parse } from \"./parse-81Q8fvfm.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/format/emit.ts\nfunction emitDocument(document, indentUnit, newline) {\n\tconst writer = new LineWriter(indentUnit, newline);\n\temitTopLevel(writer, document);\n\treturn writer.finish();\n}\nvar LineWriter = class {\n\t#indentUnit;\n\t#newline;\n\t#out = [];\n\t#depth = 0;\n\t#line = \"\";\n\t#lineOpen = false;\n\t#prevKind;\n\t#lastWasBlank = false;\n\t#hasContent = false;\n\tconstructor(indentUnit, newline) {\n\t\tthis.#indentUnit = indentUnit;\n\t\tthis.#newline = newline;\n\t}\n\tindent() {\n\t\tthis.#depth += 1;\n\t}\n\tunindent() {\n\t\tthis.#depth = Math.max(0, this.#depth - 1);\n\t}\n\tlastIsBlank() {\n\t\treturn this.#lastWasBlank;\n\t}\n\tlineOpen() {\n\t\treturn this.#lineOpen;\n\t}\n\tprevKind() {\n\t\treturn this.#prevKind;\n\t}\n\tnewline() {\n\t\tif (!this.#lineOpen) return;\n\t\tthis.#out.push(`${this.#indentUnit.repeat(this.#depth)}${this.#line}`);\n\t\tthis.#line = \"\";\n\t\tthis.#lineOpen = false;\n\t\tthis.#prevKind = void 0;\n\t\tthis.#lastWasBlank = false;\n\t\tthis.#hasContent = true;\n\t}\n\tblank() {\n\t\tthis.newline();\n\t\tif (!this.#hasContent || this.#lastWasBlank) return;\n\t\tthis.#out.push(\"\");\n\t\tthis.#lastWasBlank = true;\n\t}\n\twrite(token, space, padTo) {\n\t\tif (this.#lineOpen && padTo !== void 0) this.#line = this.#line.padEnd(padTo);\n\t\telse if (this.#lineOpen && space) this.#line += \" \";\n\t\tthis.#line += token.text;\n\t\tthis.#lineOpen = true;\n\t\tthis.#prevKind = token.kind;\n\t}\n\twriteRaw(text) {\n\t\tthis.#line += text;\n\t\tthis.#lineOpen = true;\n\t}\n\tcomment(text) {\n\t\tif (this.#lineOpen) this.#line += ` ${text}`;\n\t\telse this.#line = text;\n\t\tthis.#lineOpen = true;\n\t\tthis.newline();\n\t}\n\tfinish() {\n\t\tthis.newline();\n\t\tconst body = this.#out.join(this.#newline);\n\t\treturn body.length > 0 ? `${body}${this.#newline}` : \"\";\n\t}\n};\nfunction spaceBetween(prev, cur, inQualifiedName) {\n\tif (prev === void 0) return false;\n\tif (inQualifiedName) return false;\n\tif (prev === \"Ident\" && cur === \"StringLiteral\") return false;\n\tswitch (cur) {\n\t\tcase \"LBracket\": return prev === \"Colon\" || prev === \"Comma\" || prev === \"Equals\";\n\t\tcase \"LParen\":\n\t\tcase \"RParen\":\n\t\tcase \"RBracket\":\n\t\tcase \"Comma\":\n\t\tcase \"Question\":\n\t\tcase \"Dot\":\n\t\tcase \"Colon\": return false;\n\t\tcase \"RBrace\": return prev !== \"LBrace\";\n\t\tdefault: break;\n\t}\n\tswitch (prev) {\n\t\tcase \"LParen\":\n\t\tcase \"LBracket\":\n\t\tcase \"Dot\":\n\t\tcase \"At\":\n\t\tcase \"DoubleAt\": return false;\n\t\tdefault: return true;\n\t}\n}\nfunction streamNode(writer, node, padTo) {\n\tlet continuation = 0;\n\tlet first = true;\n\tlet prevQualified = false;\n\tconst walk = (parent, qualified) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child, qualified || child.kind === \"QualifiedName\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\t\tif (child.kind === \"Comment\") {\n\t\t\t\twriter.comment(child.text);\n\t\t\t\twriter.indent();\n\t\t\t\tcontinuation += 1;\n\t\t\t\tprevQualified = false;\n\t\t\t\tfirst = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst pad = first ? padTo : void 0;\n\t\t\tconst space = spaceBetween(writer.prevKind(), child.kind, qualified && prevQualified);\n\t\t\twriter.write(child, space, writer.lineOpen() ? pad : void 0);\n\t\t\tprevQualified = qualified;\n\t\t\tfirst = false;\n\t\t}\n\t};\n\twalk(node, false);\n\treturn continuation;\n}\nfunction closeContinuation(writer, count) {\n\tfor (let i = 0; i < count; i++) writer.unindent();\n}\nfunction emitField(writer, field, alignmentColumns) {\n\treturn streamRow(writer, field.syntax, alignmentColumns);\n}\nfunction emitNamedType(writer, decl) {\n\treturn streamRow(writer, decl.syntax, void 0);\n}\nfunction streamRow(writer, row, alignmentColumns) {\n\tlet continuation = 0;\n\tlet sawAttribute = false;\n\tfor (const child of row.children()) {\n\t\tif (child instanceof SyntaxNode) {\n\t\t\tlet padTo;\n\t\t\tif (child.kind === \"TypeAnnotation\" && continuation === 0) padTo = alignmentColumns?.typeColumn;\n\t\t\telse if (child.kind === \"FieldAttribute\") {\n\t\t\t\tif (continuation > 0) writer.newline();\n\t\t\t\telse if (!sawAttribute) padTo = alignmentColumns?.attributeColumn;\n\t\t\t\tsawAttribute = true;\n\t\t\t}\n\t\t\tcontinuation += streamNode(writer, child, padTo);\n\t\t\tcontinue;\n\t\t}\n\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\tif (child.kind === \"Comment\") {\n\t\t\twriter.comment(child.text);\n\t\t\twriter.indent();\n\t\t\tcontinuation += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst space = spaceBetween(writer.prevKind(), child.kind, false);\n\t\twriter.write(child, space);\n\t}\n\treturn continuation;\n}\nfunction emitBlockAttribute(writer, attribute) {\n\treturn streamNode(writer, attribute.syntax);\n}\nfunction emitKeyValue(writer, pair) {\n\treturn streamNode(writer, pair.syntax);\n}\nfunction leafMember(writer, category, print) {\n\treturn {\n\t\tcategory,\n\t\temit(trailing) {\n\t\t\tconst continuation = print();\n\t\t\tif (trailing !== void 0) writer.comment(trailing);\n\t\t\telse writer.newline();\n\t\t\treturn continuation;\n\t\t}\n\t};\n}\nfunction emitModel(writer, model, trailing) {\n\tconst alignmentColumns = alignmentMap(model.syntax);\n\temitBlockBody(writer, model.syntax, trailing, (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignmentColumns));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t});\n}\nfunction emitCompositeType(writer, composite, trailing) {\n\tconst alignmentColumns = alignmentMap(composite.syntax);\n\temitBlockBody(writer, composite.syntax, trailing, (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignmentColumns));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t});\n}\nfunction emitGenericBlock(writer, block, trailing) {\n\tconst alignment = alignmentMap(block.syntax);\n\temitBlockBody(writer, block.syntax, trailing, (node) => {\n\t\tconst field = FieldDeclarationAst.cast(node);\n\t\tif (field) return leafMember(writer, \"regular\", () => emitField(writer, field, alignment));\n\t\tconst entry = KeyValuePairAst.cast(node);\n\t\tif (entry) return leafMember(writer, \"regular\", () => emitKeyValue(writer, entry));\n\t\tconst attribute = ModelAttributeAst.cast(node);\n\t\tif (attribute) return leafMember(writer, \"blockAttribute\", () => emitBlockAttribute(writer, attribute));\n\t});\n}\nfunction emitNamespace(writer, namespace, trailing) {\n\temitBlockBody(writer, namespace.syntax, trailing, (node) => {\n\t\tconst declaration = castBlockDeclaration(node);\n\t\tif (declaration) return nestedBlockMember(writer, declaration);\n\t});\n}\nfunction emitTypesBlock(writer, block, trailing) {\n\temitBlockBody(writer, block.syntax, trailing, (node) => {\n\t\tconst named = NamedTypeDeclarationAst.cast(node);\n\t\tif (named) return leafMember(writer, \"regular\", () => emitNamedType(writer, named));\n\t});\n}\nfunction emitTopLevel(writer, document) {\n\twalkRegion(writer, Array.from(document.syntax.children()), void 0, (node) => {\n\t\tconst declaration = castTopLevelDeclaration(node);\n\t\tif (declaration) return nestedBlockMember(writer, declaration);\n\t});\n}\nfunction nestedBlockMember(writer, block) {\n\treturn {\n\t\tcategory: \"nestedBlock\",\n\t\temit(trailing) {\n\t\t\tblock(writer, trailing);\n\t\t\treturn 0;\n\t\t}\n\t};\n}\nfunction castBlockDeclaration(node) {\n\tconst model = ModelDeclarationAst.cast(node);\n\tif (model) return (writer, trailing) => emitModel(writer, model, trailing);\n\tconst composite = CompositeTypeDeclarationAst.cast(node);\n\tif (composite) return (writer, trailing) => emitCompositeType(writer, composite, trailing);\n\tconst generic = GenericBlockDeclarationAst.cast(node);\n\tif (generic) return (writer, trailing) => emitGenericBlock(writer, generic, trailing);\n}\nfunction castTopLevelDeclaration(node) {\n\tconst block = castBlockDeclaration(node);\n\tif (block) return block;\n\tconst namespace = NamespaceDeclarationAst.cast(node);\n\tif (namespace) return (writer, trailing) => emitNamespace(writer, namespace, trailing);\n\tconst types = TypesBlockAst.cast(node);\n\tif (types) return (writer, trailing) => emitTypesBlock(writer, types, trailing);\n}\nfunction emitBlockBody(writer, node, closingTrailing, classify) {\n\tconst children = Array.from(node.children());\n\tconst openIndex = children.findIndex((el) => !(el instanceof SyntaxNode) && el.kind === \"LBrace\");\n\tconst headerComments = streamHeader(writer, node);\n\tconst openingComment = sameLineCommentAfter(children, openIndex);\n\tif (openingComment !== void 0) headerComments.push(openingComment);\n\tconst [firstComment, ...otherComments] = headerComments;\n\tif (firstComment !== void 0) writer.comment(firstComment);\n\telse writer.newline();\n\twriter.indent();\n\tfor (const comment of otherComments) writer.comment(comment);\n\twalkRegion(writer, children, \"RBrace\", classify);\n\twriter.unindent();\n\twriter.writeRaw(\"}\");\n\tif (closingTrailing !== void 0) writer.comment(closingTrailing);\n\telse writer.newline();\n}\n/** Writes the block header through `{` and returns the source comments found before the `{`. */\nfunction streamHeader(writer, node) {\n\tconst comments = [];\n\tlet done = false;\n\tconst walk = (parent) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (done) return;\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Comment\") {\n\t\t\t\tcomments.push(child.text);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\") continue;\n\t\t\tconst space = spaceBetween(writer.prevKind(), child.kind, false);\n\t\t\twriter.write(child, space);\n\t\t\tif (child.kind === \"LBrace\") {\n\t\t\t\tdone = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\twalk(node);\n\treturn comments;\n}\nfunction walkRegion(writer, elements, closeKind, classify) {\n\tlet sawOpenBrace = closeKind === void 0;\n\tlet sawContent = false;\n\tlet lastWasRegular = false;\n\tlet ledByComment = false;\n\tlet newlines = 0;\n\tfor (let i = 0; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) {\n\t\t\tif (!sawOpenBrace) continue;\n\t\t\tconst member = classify(element);\n\t\t\tif (member === void 0) throw new InternalError(`Formatter has no rule for a ${element.kind} node at offset ${element.offset}; formatting would drop its text`);\n\t\t\tif (!ledByComment) {\n\t\t\t\tif (newlines >= 2 && sawContent && !writer.lastIsBlank()) writer.blank();\n\t\t\t\telse if (separationBlankWanted(writer, member.category, sawContent, lastWasRegular)) writer.blank();\n\t\t\t}\n\t\t\tconst trailing = sameLineTrailingComment(elements, i);\n\t\t\tcloseContinuation(writer, member.emit(trailing.text));\n\t\t\tif (trailing.index !== void 0) i = trailing.index;\n\t\t\tsawContent = true;\n\t\t\tlastWasRegular = member.category !== \"blockAttribute\";\n\t\t\tledByComment = false;\n\t\t\tnewlines = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (element.kind === \"LBrace\" && closeKind === \"RBrace\" && !sawOpenBrace) {\n\t\t\tsawOpenBrace = true;\n\t\t\tnewlines = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (!sawOpenBrace) continue;\n\t\tif (closeKind === \"RBrace\" && element.kind === \"RBrace\") break;\n\t\tif (element.kind === \"Whitespace\") continue;\n\t\tif (element.kind === \"Newline\") {\n\t\t\tnewlines += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (element.kind === \"Comment\") {\n\t\t\tif (closeKind === \"RBrace\" && newlines === 0 && !sawContent) continue;\n\t\t\tif (newlines >= 2 && sawContent && !writer.lastIsBlank()) writer.blank();\n\t\t\telse if (!ledByComment) {\n\t\t\t\tconst led = leadingMemberAfter(elements, i, classify);\n\t\t\t\tif (led && separationBlankWanted(writer, led, sawContent, lastWasRegular)) writer.blank();\n\t\t\t}\n\t\t\twriter.writeRaw(element.text);\n\t\t\twriter.newline();\n\t\t\tsawContent = true;\n\t\t\tledByComment = true;\n\t\t\tnewlines = 0;\n\t\t}\n\t}\n}\nfunction separationBlankWanted(writer, category, sawContent, lastWasRegular) {\n\tif (!sawContent || writer.lastIsBlank()) return false;\n\tif (category === \"nestedBlock\") return true;\n\treturn category === \"blockAttribute\" && lastWasRegular;\n}\nfunction leadingMemberAfter(elements, commentIndex, classify) {\n\tfor (let i = commentIndex + 1; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) return classify(element)?.category;\n\t\tif (element.kind === \"RBrace\") return void 0;\n\t}\n}\nfunction sameLineTrailingComment(elements, memberIndex) {\n\tfor (let i = memberIndex + 1; i < elements.length; i++) {\n\t\tconst element = elements[i];\n\t\tif (element === void 0) continue;\n\t\tif (element instanceof SyntaxNode) break;\n\t\tif (element.kind === \"Whitespace\") continue;\n\t\tif (element.kind === \"Comment\") return {\n\t\t\ttext: element.text,\n\t\t\tindex: i\n\t\t};\n\t\tbreak;\n\t}\n\treturn {\n\t\ttext: void 0,\n\t\tindex: void 0\n\t};\n}\nfunction sameLineCommentAfter(children, openIndex) {\n\tfor (let i = openIndex + 1; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tif (child === void 0) continue;\n\t\tif (child instanceof SyntaxNode) return void 0;\n\t\tif (child.kind === \"Whitespace\") continue;\n\t\tif (child.kind === \"Comment\") return child.text;\n\t\treturn;\n\t}\n}\nfunction alignmentMap(block) {\n\tconst fields = [];\n\tfor (const element of block.children()) {\n\t\tif (!(element instanceof SyntaxNode)) continue;\n\t\tif (FieldDeclarationAst.cast(element) === void 0) continue;\n\t\tif (hasInteriorComment(element)) continue;\n\t\tfields.push(element);\n\t}\n\tif (fields.length === 0) return void 0;\n\treturn alignmentColumns(fields);\n}\nfunction alignmentColumns(rows) {\n\tlet nameWidth = 0;\n\tfor (const row of rows) {\n\t\tconst field = FieldDeclarationAst.cast(row);\n\t\tif (!field) continue;\n\t\tnameWidth = Math.max(nameWidth, renderTokens(field.name()?.syntax).length);\n\t}\n\tconst typeColumn = nameWidth + 1;\n\tlet cellEnd = 0;\n\tfor (const row of rows) {\n\t\tconst field = FieldDeclarationAst.cast(row);\n\t\tif (!field) continue;\n\t\tconst name = renderTokens(field.name()?.syntax);\n\t\tconst type = renderTokens(field.typeAnnotation()?.syntax);\n\t\tcellEnd = Math.max(cellEnd, type.length > 0 ? typeColumn + type.length : name.length);\n\t}\n\treturn {\n\t\ttypeColumn,\n\t\tattributeColumn: cellEnd + 1\n\t};\n}\nfunction hasInteriorComment(node) {\n\tfor (const token of node.tokens()) if (token.kind === \"Comment\") return true;\n\treturn false;\n}\nfunction renderTokens(node) {\n\tif (!node) return \"\";\n\tlet out = \"\";\n\tlet prev;\n\tlet prevQualified = false;\n\tconst walk = (parent, qualified) => {\n\t\tfor (const child of parent.children()) {\n\t\t\tif (child instanceof SyntaxNode) {\n\t\t\t\twalk(child, qualified || child.kind === \"QualifiedName\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (child.kind === \"Whitespace\" || child.kind === \"Newline\" || child.kind === \"Comment\") continue;\n\t\t\tif (spaceBetween(prev, child.kind, qualified && prevQualified)) out += \" \";\n\t\t\tout += child.text;\n\t\t\tprev = child.kind;\n\t\t\tprevQualified = qualified;\n\t\t}\n\t};\n\twalk(node, false);\n\treturn out;\n}\n//#endregion\n//#region src/format/error.ts\nfunction pslError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/format/options.ts\nfunction resolveFormatOptions(options) {\n\tconst indent = options?.indent ?? 2;\n\tif (indent !== \"tab\" && (typeof indent !== \"number\" || !Number.isInteger(indent) || indent < 1)) throw pslError(\"PSL.FORMAT_OPTION_INVALID\", `Invalid format options: indent must be a positive integer or 'tab', got ${String(indent)}`, { meta: {\n\t\toption: \"indent\",\n\t\treceived: String(indent)\n\t} });\n\tconst newline = options?.newline ?? \"LF\";\n\tif (newline !== \"LF\" && newline !== \"CRLF\") throw pslError(\"PSL.FORMAT_OPTION_INVALID\", `Invalid format options: newline must be 'LF' or 'CRLF', got ${String(newline)}`, { meta: {\n\t\toption: \"newline\",\n\t\treceived: String(newline)\n\t} });\n\treturn {\n\t\tindentUnit: indent === \"tab\" ? \"\t\" : \" \".repeat(indent),\n\t\tnewline: newline === \"CRLF\" ? \"\\r\\n\" : \"\\n\"\n\t};\n}\n//#endregion\n//#region src/format/format.ts\nfunction format(source, options, parserOptions = {}) {\n\tconst resolved = resolveFormatOptions(options);\n\tconst { document, diagnostics } = parse(source, \"<format-input>.psl\", parserOptions);\n\tif (diagnostics.length > 0) throw pslError(\"PSL.PARSE_FAILED\", `Cannot format PSL with parse errors: ${diagnostics[0]?.message ?? \"unknown parse error\"}${diagnostics.length > 1 ? ` (and ${diagnostics.length - 1} more)` : \"\"}`, { meta: { diagnostics } });\n\treturn emitDocument(document, resolved.indentUnit, resolved.newline);\n}\n//#endregion\nexport { format };\n\n//# sourceMappingURL=format.mjs.map"],"mappings":";;;;;;AAMA,SAAS,aAAa,UAAU,YAAY,SAAS;CACpD,MAAM,SAAS,IAAI,WAAW,YAAY,OAAO;CACjD,aAAa,QAAQ,QAAQ;CAC7B,OAAO,OAAO,OAAO;AACtB;AACA,IAAI,aAAa,MAAM;CACtB;CACA;CACA,OAAO,CAAC;CACR,SAAS;CACT,QAAQ;CACR,YAAY;CACZ;CACA,gBAAgB;CAChB,cAAc;CACd,YAAY,YAAY,SAAS;EAChC,KAAKA,cAAc;EACnB,KAAKC,WAAW;CACjB;CACA,SAAS;EACR,KAAKC,UAAU;CAChB;CACA,WAAW;EACV,KAAKA,SAAS,KAAK,IAAI,GAAG,KAAKA,SAAS,CAAC;CAC1C;CACA,cAAc;EACb,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKC;CACb;CACA,UAAU;EACT,IAAI,CAAC,KAAKD,WAAW;EACrB,KAAKE,KAAK,KAAK,GAAG,KAAKN,YAAY,OAAO,KAAKE,MAAM,IAAI,KAAKK,OAAO;EACrE,KAAKA,QAAQ;EACb,KAAKH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AAU;CAClC,IAAI,WAAW,UAAU,OAAO,WAAW,YAAY,CAAC,OAAO,UAAU,MAAM,KAAK,SAAS,IAAI,MAAM,SAAS,6BAA6B,2EAA2E,OAAO,MAAM,KAAK,EAAE,MAAM;EACjP,QAAQ;EACR,UAAU,OAAO,MAAM;CACxB,EAAE,CAAC;CACH,MAAM,UAAU,SAAS,WAAW;CACpC,IAAI,YAAY,QAAQ,YAAY,QAAQ,MAAM,SAAS,6BAA6B,+DAA+D,OAAO,OAAO,KAAK,EAAE,MAAM;EACjL,QAAQ;EACR,UAAU,OAAO,OAAO;CACzB,EAAE,CAAC;CACH,OAAO;EACN,YAAY,WAAW,QAAQ,MAAM,IAAI,OAAO,MAAM;EACtD,SAAS,YAAY,SAAS,SAAS;CACxC;AACD;AAGA,SAAS,OAAO,QAAQ,SAAS,gBAAgB,CAAC,GAAG;CACpD,MAAM,WAAW,qBAAqB,OAAO;CAC7C,MAAM,EAAE,UAAU,gBAAgB,MAAM,QAAQ,sBAAsB,aAAa;CACnF,IAAI,YAAY,SAAS,GAAG,MAAM,SAAS,oBAAoB,wCAAwC,YAAY,EAAE,EAAE,WAAW,wBAAwB,YAAY,SAAS,IAAI,SAAS,YAAY,SAAS,EAAE,UAAU,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;CAC5P,OAAO,aAAa,UAAU,SAAS,YAAY,SAAS,OAAO;AACpE"}
|
|
@@ -3,9 +3,9 @@ import { C as AuthoringPslBlockDescriptorNamespace, Q as instantiateAuthoringFie
|
|
|
3
3
|
import "./authoring-BYbSOseC.mjs";
|
|
4
4
|
import { r as Result } from "./result-BYCOANWy.mjs";
|
|
5
5
|
import "./psl-ast-BOzFRzI0.mjs";
|
|
6
|
-
import { c as ContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PslContractSourceProvider, r as ContractSourceDiagnostic } from "./config-types-
|
|
7
|
-
import { F as PslDiagnostic, I as PslDiagnosticCollector, L as PslSources, d as DiagnosticSource, f as DocumentAst } from "./parse-
|
|
8
|
-
import { d as ResolvedTypeConstructorCall, f as SymbolTable, i as FieldSymbol, l as ResolvedAttributeArg, t as BlockSymbol } from "./symbol-table-
|
|
6
|
+
import { c as ContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PslContractSourceProvider, r as ContractSourceDiagnostic } from "./config-types-DtyK6o50.mjs";
|
|
7
|
+
import { F as PslDiagnostic, I as PslDiagnosticCollector, L as PslSources, d as DiagnosticSource, f as DocumentAst } from "./parse-BLbPHv4U-Y4lID7XQ.mjs";
|
|
8
|
+
import { d as ResolvedTypeConstructorCall, f as SymbolTable, i as FieldSymbol, l as ResolvedAttributeArg, t as BlockSymbol } from "./symbol-table-cNWLdZRx-Cj1Gb8HJ.mjs";
|
|
9
9
|
//#region ../../../1-framework/2-authoring/psl-parser/dist/interpret.d.mts
|
|
10
10
|
//#region src/authoring-arguments.d.ts
|
|
11
11
|
declare function mapPslHelperArgs(input: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as TokenKind } from "./tokenizer-DW30uwhx-BHsWTwYk.mjs";
|
|
2
|
-
import { A as ObjectFieldAst, B as SourceFile, C as KeyValuePairAst, D as NamespaceDeclarationAst, E as NamedTypeDeclarationAst, G as SyntaxNode, H as StringLiteralQuote, J as TokenAtOffset, K as SyntaxToken, L as PslSources, M as ParseDiagnostic, N as ParseResult, O as NamespaceMemberAst, P as Position, Q as castExpression, R as QualifiedNameAst, S as IdentifierAst, T as ModelDeclarationAst, U as SyntaxElement, V as StringLiteralExprAst, W as SyntaxKind, X as TypesBlockAst, Y as TypeAnnotationAst, Z as any, _ as GenericBlockDeclarationAst, a as AttributeAst, at as findFirstChild, b as GreenNode, c as BracedBlock, et as createSyntaxTree, f as DocumentAst, g as FunctionCallAst, h as FieldDeclarationAst, i as AttributeArgListAst, it as findChildToken, j as ObjectLiteralExprAst, k as NumberLiteralExprAst, l as CompositeTypeDeclarationAst, lt as parse, m as FieldAttributeAst, n as AstNode, o as BlockMemberAst, ot as greenNode, p as ExpressionAst, q as TaggedLiteralExprAst, r as AttributeArgAst, rt as filterChildren, s as BooleanLiteralExprAst, st as greenToken, t as ArrayLiteralAst, u as DeclarationAst, ut as printSyntax, v as GenericBlockMemberAst, w as ModelAttributeAst, x as GreenToken, y as GreenElement, z as Range } from "./parse-
|
|
2
|
+
import { A as ObjectFieldAst, B as SourceFile, C as KeyValuePairAst, D as NamespaceDeclarationAst, E as NamedTypeDeclarationAst, G as SyntaxNode, H as StringLiteralQuote, J as TokenAtOffset, K as SyntaxToken, L as PslSources, M as ParseDiagnostic, N as ParseResult, O as NamespaceMemberAst, P as Position, Q as castExpression, R as QualifiedNameAst, S as IdentifierAst, T as ModelDeclarationAst, U as SyntaxElement, V as StringLiteralExprAst, W as SyntaxKind, X as TypesBlockAst, Y as TypeAnnotationAst, Z as any, _ as GenericBlockDeclarationAst, a as AttributeAst, at as findFirstChild, b as GreenNode, c as BracedBlock, et as createSyntaxTree, f as DocumentAst, g as FunctionCallAst, h as FieldDeclarationAst, i as AttributeArgListAst, it as findChildToken, j as ObjectLiteralExprAst, k as NumberLiteralExprAst, l as CompositeTypeDeclarationAst, lt as parse, m as FieldAttributeAst, n as AstNode, o as BlockMemberAst, ot as greenNode, p as ExpressionAst, q as TaggedLiteralExprAst, r as AttributeArgAst, rt as filterChildren, s as BooleanLiteralExprAst, st as greenToken, t as ArrayLiteralAst, u as DeclarationAst, ut as printSyntax, v as GenericBlockMemberAst, w as ModelAttributeAst, x as GreenToken, y as GreenElement, z as Range } from "./parse-BLbPHv4U-Y4lID7XQ.mjs";
|
|
3
3
|
//#region ../../../1-framework/2-authoring/psl-parser/dist/syntax.d.mts
|
|
4
4
|
//#region src/syntax/green-builder.d.ts
|
|
5
5
|
declare class GreenNodeBuilder {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as createSyntaxTree, c as findFirstChild, i as any, l as printSyntax, n as SyntaxToken, o as filterChildren, r as TokenAtOffset, s as findChildToken, t as SyntaxNode } from "./ast-helpers-2XRnkQEO-BxG5qx3Q.mjs";
|
|
2
2
|
import { C as TypeAnnotationAst, S as TaggedLiteralExprAst, T as castExpression, _ as NumberLiteralExprAst, a as CompositeTypeDeclarationAst, b as QualifiedNameAst, c as FieldDeclarationAst, d as IdentifierAst, f as KeyValuePairAst, g as NamespaceDeclarationAst, h as NamedTypeDeclarationAst, i as BooleanLiteralExprAst, l as FunctionCallAst, m as ModelDeclarationAst, n as AttributeArgAst, o as DocumentAst, p as ModelAttributeAst, r as AttributeArgListAst, s as FieldAttributeAst, t as ArrayLiteralAst, u as GenericBlockDeclarationAst, v as ObjectFieldAst, w as TypesBlockAst, x as StringLiteralExprAst, y as ObjectLiteralExprAst } from "./declarations-CcEBlusF-DXJwQ_ze.mjs";
|
|
3
|
-
import { a as greenToken, i as greenNode, n as PslSources, o as parse, r as SourceFile, t as GreenNodeBuilder } from "./parse-
|
|
3
|
+
import { a as greenToken, i as greenNode, n as PslSources, o as parse, r as SourceFile, t as GreenNodeBuilder } from "./parse-81Q8fvfm-iWuq9WLS.mjs";
|
|
4
4
|
//#region ../../../1-framework/2-authoring/psl-parser/dist/syntax.mjs
|
|
5
5
|
const TRIVIA_KINDS = /* @__PURE__ */ new Set([
|
|
6
6
|
"Whitespace",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psl-parser__syntax.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/syntax.mjs"],"sourcesContent":["import { a as printSyntax, c as TokenAtOffset, i as findFirstChild, l as createSyntaxTree, n as filterChildren, o as SyntaxNode, r as findChildToken, s as SyntaxToken, t as any } from \"./ast-helpers-2XRnkQEO.mjs\";\nimport { C as castExpression, S as TaggedLiteralExprAst, T as IdentifierAst, _ as FunctionCallAst, a as KeyValuePairAst, b as ObjectLiteralExprAst, c as NamespaceDeclarationAst, d as AttributeArgListAst, f as FieldAttributeAst, g as BooleanLiteralExprAst, h as AttributeArgAst, i as GenericBlockDeclarationAst, l as TypesBlockAst, m as ArrayLiteralAst, n as DocumentAst, o as ModelDeclarationAst, p as ModelAttributeAst, r as FieldDeclarationAst, s as NamedTypeDeclarationAst, t as CompositeTypeDeclarationAst, u as TypeAnnotationAst, v as NumberLiteralExprAst, w as QualifiedNameAst, x as StringLiteralExprAst, y as ObjectFieldAst } from \"./declarations-CcEBlusF.mjs\";\nimport { a as PslSources, i as greenToken, n as GreenNodeBuilder, o as SourceFile, r as greenNode, t as parse } from \"./parse-
|
|
1
|
+
{"version":3,"file":"psl-parser__syntax.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/syntax.mjs"],"sourcesContent":["import { a as printSyntax, c as TokenAtOffset, i as findFirstChild, l as createSyntaxTree, n as filterChildren, o as SyntaxNode, r as findChildToken, s as SyntaxToken, t as any } from \"./ast-helpers-2XRnkQEO.mjs\";\nimport { C as castExpression, S as TaggedLiteralExprAst, T as IdentifierAst, _ as FunctionCallAst, a as KeyValuePairAst, b as ObjectLiteralExprAst, c as NamespaceDeclarationAst, d as AttributeArgListAst, f as FieldAttributeAst, g as BooleanLiteralExprAst, h as AttributeArgAst, i as GenericBlockDeclarationAst, l as TypesBlockAst, m as ArrayLiteralAst, n as DocumentAst, o as ModelDeclarationAst, p as ModelAttributeAst, r as FieldDeclarationAst, s as NamedTypeDeclarationAst, t as CompositeTypeDeclarationAst, u as TypeAnnotationAst, v as NumberLiteralExprAst, w as QualifiedNameAst, x as StringLiteralExprAst, y as ObjectFieldAst } from \"./declarations-CcEBlusF.mjs\";\nimport { a as PslSources, i as greenToken, n as GreenNodeBuilder, o as SourceFile, r as greenNode, t as parse } from \"./parse-81Q8fvfm.mjs\";\n//#region src/syntax/navigation.ts\nconst TRIVIA_KINDS = /* @__PURE__ */ new Set([\n\t\"Whitespace\",\n\t\"Newline\",\n\t\"Comment\"\n]);\n/** Whether a token kind is trivia (whitespace, newline, or comment). */\nfunction isTriviaKind(kind) {\n\treturn TRIVIA_KINDS.has(kind);\n}\n/** Whether a token is trivia. */\nfunction isTrivia(token) {\n\treturn isTriviaKind(token.kind);\n}\n/**\n* The first non-trivia token at or beyond `token` in `direction`. Returns\n* `token` itself when it is already significant.\n*/\nfunction skipTriviaToken(token, direction) {\n\tlet current = token;\n\twhile (current !== void 0 && isTrivia(current)) current = direction === \"next\" ? current.nextToken : current.prevToken;\n\treturn current;\n}\n/**\n* The nearest sibling of `element` (within the same parent) in `direction` that\n* is not a trivia token. Nodes are always significant.\n*/\nfunction nonTriviaSibling(element, direction) {\n\tlet sibling = step(element, direction);\n\twhile (sibling !== void 0) {\n\t\tif (!(sibling instanceof SyntaxToken) || !isTrivia(sibling)) return sibling;\n\t\tsibling = step(sibling, direction);\n\t}\n}\nfunction step(element, direction) {\n\treturn direction === \"next\" ? element.nextSiblingOrToken : element.prevSiblingOrToken;\n}\n//#endregion\nexport { ArrayLiteralAst, AttributeArgAst, AttributeArgListAst, BooleanLiteralExprAst, CompositeTypeDeclarationAst, DocumentAst, FieldAttributeAst, FieldDeclarationAst, FunctionCallAst, GenericBlockDeclarationAst, GreenNodeBuilder, IdentifierAst, KeyValuePairAst, ModelAttributeAst, ModelDeclarationAst, NamedTypeDeclarationAst, NamespaceDeclarationAst, NumberLiteralExprAst, ObjectFieldAst, ObjectLiteralExprAst, PslSources, QualifiedNameAst, SourceFile, StringLiteralExprAst, SyntaxNode, SyntaxToken, TaggedLiteralExprAst, TokenAtOffset, TypeAnnotationAst, TypesBlockAst, any, castExpression, createSyntaxTree, filterChildren, findChildToken, findFirstChild, greenNode, greenToken, isTrivia, isTriviaKind, nonTriviaSibling, parse, printSyntax, skipTriviaToken };\n\n//# sourceMappingURL=syntax.mjs.map"],"mappings":";;;;AAIA,MAAM,+BAA+B,IAAI,IAAI;CAC5C;CACA;CACA;AACD,CAAC;;AAED,SAAS,aAAa,MAAM;CAC3B,OAAO,aAAa,IAAI,IAAI;AAC7B;;AAEA,SAAS,SAAS,OAAO;CACxB,OAAO,aAAa,MAAM,IAAI;AAC/B;;;;;AAKA,SAAS,gBAAgB,OAAO,WAAW;CAC1C,IAAI,UAAU;CACd,OAAO,YAAY,KAAK,KAAK,SAAS,OAAO,GAAG,UAAU,cAAc,SAAS,QAAQ,YAAY,QAAQ;CAC7G,OAAO;AACR;;;;;AAKA,SAAS,iBAAiB,SAAS,WAAW;CAC7C,IAAI,UAAU,KAAK,SAAS,SAAS;CACrC,OAAO,YAAY,KAAK,GAAG;EAC1B,IAAI,EAAE,mBAAmB,gBAAgB,CAAC,SAAS,OAAO,GAAG,OAAO;EACpE,UAAU,KAAK,SAAS,SAAS;CAClC;AACD;AACA,SAAS,KAAK,SAAS,WAAW;CACjC,OAAO,cAAc,SAAS,QAAQ,qBAAqB,QAAQ;AACpE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { U as PslSpan } from "./framework-authoring-Lssvcd3X-DsgKz6mc.mjs";
|
|
2
2
|
import "./psl-ast-BOzFRzI0.mjs";
|
|
3
|
-
import { D as NamespaceDeclarationAst, E as NamedTypeDeclarationAst, G as SyntaxNode, L as PslSources, M as ParseDiagnostic, T as ModelDeclarationAst, Y as TypeAnnotationAst, _ as GenericBlockDeclarationAst, f as DocumentAst, h as FieldDeclarationAst, l as CompositeTypeDeclarationAst, m as FieldAttributeAst, p as ExpressionAst, w as ModelAttributeAst } from "./parse-
|
|
4
|
-
//#region ../../../1-framework/2-authoring/psl-parser/dist/symbol-table-
|
|
3
|
+
import { D as NamespaceDeclarationAst, E as NamedTypeDeclarationAst, G as SyntaxNode, L as PslSources, M as ParseDiagnostic, T as ModelDeclarationAst, Y as TypeAnnotationAst, _ as GenericBlockDeclarationAst, f as DocumentAst, h as FieldDeclarationAst, l as CompositeTypeDeclarationAst, m as FieldAttributeAst, p as ExpressionAst, w as ModelAttributeAst } from "./parse-BLbPHv4U-Y4lID7XQ.mjs";
|
|
4
|
+
//#region ../../../1-framework/2-authoring/psl-parser/dist/symbol-table-cNWLdZRx.d.mts
|
|
5
5
|
//#region src/resolve.d.ts
|
|
6
6
|
interface ResolvedAttributeArg {
|
|
7
7
|
readonly kind: 'positional' | 'named';
|
|
@@ -120,4 +120,4 @@ interface SymbolTableResult {
|
|
|
120
120
|
declare function buildSymbolTable(options: BuildSymbolTableOptions): SymbolTableResult;
|
|
121
121
|
//#endregion
|
|
122
122
|
export { nodePslSpan as _, ModelSymbol as a, readResolvedConstructorCall as b, ResolvedAttribute as c, ResolvedTypeConstructorCall as d, SymbolTable as f, keywordPslSpan as g, buildSymbolTable as h, FieldSymbol as i, ResolvedAttributeArg as l, TopLevelScope as m, BuildSymbolTableOptions as n, NamedTypeSymbol as o, SymbolTableResult as p, CompositeTypeSymbol as r, NamespaceSymbol as s, BlockSymbol as t, ResolvedNamedTypeBinding as u, readResolvedAttribute as v, readResolvedAttributes as y };
|
|
123
|
-
//# sourceMappingURL=symbol-table-
|
|
123
|
+
//# sourceMappingURL=symbol-table-cNWLdZRx-Cj1Gb8HJ.d.mts.map
|
package/dist/{symbol-table-uBpYeTjB-CYN4_SgJ.d.mts.map → symbol-table-cNWLdZRx-Cj1Gb8HJ.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-table-
|
|
1
|
+
{"version":3,"file":"symbol-table-cNWLdZRx-Cj1Gb8HJ.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/symbol-table-cNWLdZRx.d.mts"],"mappings":";;;;;UAGU;WACC;WACA;WACA;WACA,aAAa;WACb,MAAM;;UAEP,kBAAkB,cAAc,oBAAoB,oBAAoB,oBAAoB;WAC3F;WACA,eAAe;WACf,MAAM;WACN,MAAM;;UAEP;WACC;WACA,eAAe;WACf,MAAM;;iBAEA,sBAAsB,cAAc,oBAAoB,mBAAmB,WAAW,OAAO,SAAS,aAAa,kBAAkB;iBACrI,uBAAuB,cAAc,oBAAoB,mBAAmB,YAAY,SAAS,QAAQ,SAAS,sBAAsB,kBAAkB;iBAC1J,4BAA4B,YAAY,+BAA+B,SAAS,aAAa;iBAC7F,YAAY,MAAM,YAAY,SAAS,aAAa;;iBAEpD,eAAe,MAAM,YAAY,iBAAiB,SAAS,aAAa;;;UAG/E;WACC,UAAU;;UAEX;WACC,YAAY,eAAe;WAC3B,YAAY,eAAe;WAC3B,QAAQ,eAAe;WACvB,QAAQ,eAAe;WACvB,gBAAgB,eAAe;;UAEhC;WACC;WACA;WACA;aACE,MAAM;aACN,MAAM;;WAER,QAAQ,eAAe;WACvB,gBAAgB,eAAe;WAC/B,QAAQ,eAAe;;UAExB;WACC;WACA;WACA,MAAM;WACN,MAAM;WACN,QAAQ,eAAe;WACvB,qBAAqB,kBAAkB;;UAExC;WACC;WACA;WACA,MAAM;WACN,MAAM;WACN,QAAQ,eAAe;WACvB,qBAAqB,kBAAkB;;UAExC;WACC;WACA;WACA;WACA,MAAM;WACN,MAAM;;UAEP;WACC;WACA,kBAAkB;WAClB;WACA,qBAAqB,kBAAkB;;;;;;;UAOxC,wBAAwB;WACvB;WACA;WACA,MAAM;WACN,MAAM;;UAEP;WACC;WACA;WACA,MAAM;WACN,MAAM;WACN;WACA;WACA;WACA;WACA;WACA,kBAAkB;WAClB,qBAAqB,kBAAkB;;WAEvC;;UAED;WACC,oBAAoB;WACpB,SAAS;;UAEV;WACC,aAAa;WACb,sBAAsB;;;;;;iBAMhB,iBAAiB,SAAS,0BAA0B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-framework",
|
|
3
|
-
"version": "8.0.0-rc.14-dev.
|
|
3
|
+
"version": "8.0.0-rc.14-dev.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
"uniku": "^0.5.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@internal/config": "8.0.0-rc.14-dev.
|
|
20
|
-
"@internal/contract": "8.0.0-rc.14-dev.
|
|
21
|
-
"@internal/contract-authoring": "8.0.0-rc.14-dev.
|
|
22
|
-
"@internal/errors": "8.0.0-rc.14-dev.
|
|
23
|
-
"@internal/framework-components": "8.0.0-rc.14-dev.
|
|
24
|
-
"@internal/ids": "8.0.0-rc.14-dev.
|
|
25
|
-
"@internal/operations": "8.0.0-rc.14-dev.
|
|
26
|
-
"@internal/psl-parser": "8.0.0-rc.14-dev.
|
|
27
|
-
"@internal/psl-printer": "8.0.0-rc.14-dev.
|
|
28
|
-
"@internal/ts-render": "8.0.0-rc.14-dev.
|
|
29
|
-
"@repo/tsconfig": "8.0.0-rc.14-dev.
|
|
30
|
-
"@internal/publish-surface": "8.0.0-rc.14-dev.
|
|
31
|
-
"@repo/tsdown": "8.0.0-rc.14-dev.
|
|
32
|
-
"@internal/utils": "8.0.0-rc.14-dev.
|
|
19
|
+
"@internal/config": "8.0.0-rc.14-dev.4",
|
|
20
|
+
"@internal/contract": "8.0.0-rc.14-dev.4",
|
|
21
|
+
"@internal/contract-authoring": "8.0.0-rc.14-dev.4",
|
|
22
|
+
"@internal/errors": "8.0.0-rc.14-dev.4",
|
|
23
|
+
"@internal/framework-components": "8.0.0-rc.14-dev.4",
|
|
24
|
+
"@internal/ids": "8.0.0-rc.14-dev.4",
|
|
25
|
+
"@internal/operations": "8.0.0-rc.14-dev.4",
|
|
26
|
+
"@internal/psl-parser": "8.0.0-rc.14-dev.4",
|
|
27
|
+
"@internal/psl-printer": "8.0.0-rc.14-dev.4",
|
|
28
|
+
"@internal/ts-render": "8.0.0-rc.14-dev.4",
|
|
29
|
+
"@repo/tsconfig": "8.0.0-rc.14-dev.4",
|
|
30
|
+
"@internal/publish-surface": "8.0.0-rc.14-dev.4",
|
|
31
|
+
"@repo/tsdown": "8.0.0-rc.14-dev.4",
|
|
32
|
+
"@internal/utils": "8.0.0-rc.14-dev.4",
|
|
33
33
|
"tsdown": "0.22.14",
|
|
34
34
|
"typescript": "5.9.3",
|
|
35
35
|
"vitest": "5.0.0-rc.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-types-DmSch3ta.d.mts","names":[],"sources":["../../../../1-framework/1-core/config/dist/config-types.d.mts"],"mappings":";;;;;;;;;;UAMU;WACC;WACA;WACA;;UAED;WACC,OAAO;WACP,KAAK;;UAEN;WACC;WACA;WACA;WACA,OAAO;;WAEP;;;;;;WAMA,OAAO,SAAS;;UAEjB;WACC;WACA,sBAAsB;WACtB,OAAO;;UAER;WACC;;WAEA,4BAA4B,oBAAoB;WAChD,wBAAwB;WACxB,aAAa;;WAEb,gBAAgB;WAChB,yBAAyB;;;;;;;WAOzB;WACA,cAAc;;;;WAId,iBAAiB,YAAY;;;;;;;KAOnC;UACK;;;;;;WAMC;WACA,OAAO,SAAS,0BAA0B,QAAQ,OAAO,UAAU;;UAEpE,kCAAkC;WACjC;;UAED,yCAAyC;WACxC;;KAEN,yBAAyB,4BAA4B;;;;;;UAMhD;;;;;WAKC,QAAQ;;;;;;;WAOR;;UAED;WACC;WACA;;;;;;;cAOG;iBACG,wBAAwB,UAAU,iBAAiB;WACzD;;;;;;;;;;UAUD,iBAAiB,mCAAmC,mCAAmC;WACtF,QAAQ,wBAAwB;WAChC,QAAQ,wBAAwB,WAAW;WAC3C,SAAS,yBAAyB,WAAW;WAC7C,sBAAsB,2BAA2B,WAAW;;;;;;;WAO5D,SAAS,wBAAwB,WAAW,WAAW,sBAAsB,WAAW,YAAY;;;;;WAKpG;;;;;;aAME,aAAa;;;;;;WAMf,WAAW;;;;WAIX;;aAEE;;WAEF,YAAY;;;;;;;WAOZ;;;;;;;;;;;;;;;iBAeM,aAAa,mCAAmC,mCAAmC,QAAQ,iBAAiB,WAAW,aAAa,iBAAiB,WAAW;;;;;;;;iBAQhK,0BAA0B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-DAVL8A2m-CdprLvJq.mjs","names":["#filename","#text","#lineStarts","#lineIndexAt","#lineStartAt","#lineEndAt","#sourcesByRoot","#stack","#tokenizer","#sourceFile","#diagnostics","#offset","#depth","#builder","#advance"],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/parse-DAVL8A2m.mjs"],"sourcesContent":["import { r as isTerminatedStringLiteral, t as Tokenizer } from \"./tokenizer-BMz7z2KR.mjs\";\nimport { l as createSyntaxTree } from \"./ast-helpers-2XRnkQEO.mjs\";\nimport { n as DocumentAst } from \"./declarations-CcEBlusF.mjs\";\nimport { UNSPECIFIED_PSL_NAMESPACE_ID } from \"@internal/framework-components/psl-ast\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/source-file.ts\nconst CARRIAGE_RETURN = 13;\nconst LINE_FEED = 10;\nvar SourceFile = class {\n\t#filename;\n\t#text;\n\t#lineStarts;\n\tconstructor(filename, text) {\n\t\tthis.#filename = filename;\n\t\tthis.#text = text;\n\t\tconst lineStarts = [0];\n\t\tfor (let offset = 0; offset < text.length; offset++) if (text.charCodeAt(offset) === LINE_FEED) lineStarts.push(offset + 1);\n\t\tthis.#lineStarts = lineStarts;\n\t}\n\tget filename() {\n\t\treturn this.#filename;\n\t}\n\tget text() {\n\t\treturn this.#text;\n\t}\n\tget length() {\n\t\treturn this.#text.length;\n\t}\n\tget lineCount() {\n\t\treturn this.#lineStarts.length;\n\t}\n\tlineStartOffsets() {\n\t\treturn this.#lineStarts;\n\t}\n\tlineStartOffset(line) {\n\t\tif (line <= 0) return 0;\n\t\treturn this.#lineStarts[line] ?? this.#text.length;\n\t}\n\tlineEndOffset(line) {\n\t\tif (line < 0) return 0;\n\t\tconst nextLineStart = this.#lineStarts[line + 1];\n\t\tif (nextLineStart === void 0) return this.#text.length;\n\t\tconst lineFeedOffset = nextLineStart - 1;\n\t\tconst carriageReturnOffset = lineFeedOffset - 1;\n\t\treturn this.#text.charCodeAt(carriageReturnOffset) === CARRIAGE_RETURN ? carriageReturnOffset : lineFeedOffset;\n\t}\n\tpositionAt(offset) {\n\t\tconst clamped = clamp(offset, 0, this.#text.length);\n\t\tconst line = this.#lineIndexAt(clamped);\n\t\treturn {\n\t\t\tline,\n\t\t\tcharacter: clamped - this.#lineStartAt(line)\n\t\t};\n\t}\n\toffsetAt(position) {\n\t\tconst line = clamp(position.line, 0, this.#lineStarts.length - 1);\n\t\tconst lineStart = this.#lineStartAt(line);\n\t\tconst lineEnd = this.#lineEndAt(line);\n\t\treturn clamp(lineStart + position.character, lineStart, lineEnd);\n\t}\n\toffsetToPslPosition(offset) {\n\t\tconst position = this.positionAt(offset);\n\t\treturn {\n\t\t\toffset,\n\t\t\tline: position.line + 1,\n\t\t\tcolumn: position.character + 1\n\t\t};\n\t}\n\trangeToPslSpan(range) {\n\t\treturn {\n\t\t\tstart: this.offsetToPslPosition(this.offsetAt(range.start)),\n\t\t\tend: this.offsetToPslPosition(this.offsetAt(range.end))\n\t\t};\n\t}\n\tpslSpanToRange(span) {\n\t\treturn {\n\t\t\tstart: this.positionAt(span.start.offset),\n\t\t\tend: this.positionAt(span.end.offset)\n\t\t};\n\t}\n\t#lineStartAt(line) {\n\t\treturn this.#lineStarts[line] ?? 0;\n\t}\n\t#lineEndAt(line) {\n\t\treturn line + 1 < this.#lineStarts.length ? this.#lineStartAt(line + 1) - 1 : this.#text.length;\n\t}\n\t#lineIndexAt(offset) {\n\t\tconst lineStarts = this.#lineStarts;\n\t\tlet low = 0;\n\t\tlet high = lineStarts.length - 1;\n\t\twhile (low < high) {\n\t\t\tconst mid = low + high + 1 >>> 1;\n\t\t\tif ((lineStarts[mid] ?? 0) <= offset) low = mid;\n\t\t\telse high = mid - 1;\n\t\t}\n\t\treturn low;\n\t}\n};\nvar PslSources = class PslSources {\n\t#sourcesByRoot = /* @__PURE__ */ new Map();\n\tconstructor(entries) {\n\t\tfor (const [root, sourceFile] of entries) this.#sourcesByRoot.set(root, sourceFile);\n\t}\n\t/**\n\t* A new registry uniting this one with `others` — e.g. the per-document\n\t* `PslSources` registries `parse()` returns for each member of a\n\t* multi-file schema, united into the one registry `buildSymbolTable` and\n\t* the interpreters expect.\n\t*/\n\tmerge(...others) {\n\t\treturn new PslSources([...this.#sourcesByRoot, ...others.flatMap((other) => [...other.#sourcesByRoot])]);\n\t}\n\tsourceFileNamed(filename) {\n\t\tlet match;\n\t\tfor (const sourceFile of this.#sourcesByRoot.values()) {\n\t\t\tif (sourceFile.filename !== filename) continue;\n\t\t\tif (match !== void 0 && match.text !== sourceFile.text) throw new InternalError(`Ambiguous PSL diagnostic filename \"${filename}\": registered sources have different text`);\n\t\t\tmatch = sourceFile;\n\t\t}\n\t\tif (match === void 0) throw new InternalError(`No SourceFile registered for PSL diagnostic filename \"${filename}\"`);\n\t\treturn match;\n\t}\n\tsourceFileFor(node) {\n\t\tconst root = node.root();\n\t\tconst sourceFile = this.#sourcesByRoot.get(root);\n\t\tif (sourceFile === void 0) throw new InternalError(\"No SourceFile registered for PSL syntax root\");\n\t\treturn sourceFile;\n\t}\n};\nfunction clamp(value, min, max) {\n\tif (value < min) return min;\n\tif (value > max) return max;\n\treturn value;\n}\n//#endregion\n//#region src/syntax/green.ts\nfunction greenToken(kind, text) {\n\treturn {\n\t\ttype: \"token\",\n\t\tkind,\n\t\ttext\n\t};\n}\nfunction greenNode(kind, children) {\n\tlet textLength = 0;\n\tfor (const child of children) textLength += child.type === \"token\" ? child.text.length : child.textLength;\n\treturn {\n\t\ttype: \"node\",\n\t\tkind,\n\t\tchildren,\n\t\ttextLength\n\t};\n}\n//#endregion\n//#region src/syntax/green-builder.ts\nvar GreenNodeBuilder = class {\n\t#stack = [];\n\tstartNode(kind) {\n\t\tthis.#stack.push({\n\t\t\tkind,\n\t\t\tchildren: []\n\t\t});\n\t}\n\ttoken(kind, text) {\n\t\tconst current = this.#stack.at(-1);\n\t\tif (!current) throw new InternalError(\"GreenNodeBuilder: token() called with no open node\");\n\t\tcurrent.children.push(greenToken(kind, text));\n\t}\n\tfinishNode() {\n\t\tconst completed = this.#stack.pop();\n\t\tif (!completed) throw new InternalError(\"GreenNodeBuilder: finishNode() called with no open node\");\n\t\tconst node = greenNode(completed.kind, completed.children);\n\t\tconst parent = this.#stack.at(-1);\n\t\tif (parent) parent.children.push(node);\n\t\treturn node;\n\t}\n};\n//#endregion\n//#region src/parse.ts\nconst TRIVIA_KINDS = /* @__PURE__ */ new Set([\n\t\"Whitespace\",\n\t\"Newline\",\n\t\"Comment\"\n]);\n/**\n* The fault-tolerant parser substrate the parse functions below drive. Trivia is flushed\n* into the enclosing open node, so every child node spans exactly its first\n* through last significant token.\n*/\nvar Cursor = class {\n\t#tokenizer;\n\t#sourceFile;\n\t#builder = new GreenNodeBuilder();\n\t#diagnostics = [];\n\t#offset = 0;\n\t#depth = 0;\n\tconstructor(filename, source) {\n\t\tthis.#tokenizer = new Tokenizer(source);\n\t\tthis.#sourceFile = new SourceFile(filename, source);\n\t}\n\tget diagnostics() {\n\t\treturn this.#diagnostics;\n\t}\n\tget sourceFile() {\n\t\treturn this.#sourceFile;\n\t}\n\tpeekKind(ahead = 0) {\n\t\treturn this.peekToken(ahead).kind;\n\t}\n\tpeekToken(ahead = 0) {\n\t\tlet rawIndex = 0;\n\t\tlet remaining = ahead;\n\t\tfor (;;) {\n\t\t\tconst token = this.#tokenizer.peek(rawIndex);\n\t\t\tif (token.kind === \"Eof\") return token;\n\t\t\tif (TRIVIA_KINDS.has(token.kind)) {\n\t\t\t\trawIndex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (remaining === 0) return token;\n\t\t\tremaining--;\n\t\t\trawIndex++;\n\t\t}\n\t}\n\t/** Span of the significant token `lookahead` positions ahead (`mark(0)` = the next). */\n\tmark(lookahead = 0) {\n\t\tlet rawIndex = 0;\n\t\tlet offset = this.#offset;\n\t\tlet remaining = lookahead;\n\t\tfor (;;) {\n\t\t\tconst token = this.#tokenizer.peek(rawIndex);\n\t\t\tif (token.kind === \"Eof\") return {\n\t\t\t\toffset,\n\t\t\t\tlength: token.text.length\n\t\t\t};\n\t\t\tif (!TRIVIA_KINDS.has(token.kind) && remaining === 0) return {\n\t\t\t\toffset,\n\t\t\t\tlength: token.text.length\n\t\t\t};\n\t\t\tif (!TRIVIA_KINDS.has(token.kind)) remaining--;\n\t\t\toffset += token.text.length;\n\t\t\trawIndex++;\n\t\t}\n\t}\n\t/**\n\t* Zero-width mark just past the last consumed significant token — anchors an\n\t* \"expected here\" diagnostic, e.g. the `{` missing after a declaration's name.\n\t*/\n\tmarkAfterLastToken() {\n\t\treturn {\n\t\t\toffset: this.#offset,\n\t\t\tlength: 0\n\t\t};\n\t}\n\tstartNode(kind) {\n\t\tif (this.#depth > 0) this.flushTrivia();\n\t\tthis.#builder.startNode(kind);\n\t\tthis.#depth++;\n\t}\n\tfinishNode() {\n\t\tthis.#depth--;\n\t\treturn this.#builder.finishNode();\n\t}\n\tbump() {\n\t\tthis.flushTrivia();\n\t\tconst token = this.#tokenizer.peek();\n\t\tif (token.kind === \"Eof\") return token;\n\t\tthis.#builder.token(token.kind, token.text);\n\t\tthis.#advance();\n\t\treturn token;\n\t}\n\trecoverToSyncPoint() {\n\t\tfor (;;) {\n\t\t\tconst token = this.#tokenizer.peek();\n\t\t\tif (token.kind === \"Eof\" || token.kind === \"Newline\" || token.kind === \"RBrace\") return;\n\t\t\tthis.#builder.token(token.kind, token.text);\n\t\t\tthis.#advance();\n\t\t}\n\t}\n\tflushTrivia() {\n\t\tfor (;;) {\n\t\t\tconst token = this.#tokenizer.peek();\n\t\t\tif (!TRIVIA_KINDS.has(token.kind)) return;\n\t\t\tthis.#builder.token(token.kind, token.text);\n\t\t\tthis.#advance();\n\t\t}\n\t}\n\tdiagnostic(code, message, mark) {\n\t\tconst start = mark.offset;\n\t\tconst end = start + mark.length;\n\t\tthis.#diagnostics.push({\n\t\t\tfilename: this.#sourceFile.filename,\n\t\t\tcode,\n\t\t\tmessage,\n\t\t\trange: {\n\t\t\t\tstart: this.#sourceFile.positionAt(start),\n\t\t\t\tend: this.#sourceFile.positionAt(end)\n\t\t\t}\n\t\t});\n\t}\n\t#advance() {\n\t\tthis.#offset += this.#tokenizer.next().text.length;\n\t}\n};\nfunction parseIdentifier(cursor) {\n\tcursor.startNode(\"Identifier\");\n\tcursor.bump();\n\tcursor.finishNode();\n}\n/**\n* Returns `undefined` when the next significant token does not start a\n* recognised expression, leaving recovery to the caller.\n*/\nfunction parseExpression(cursor) {\n\treturn parseStringLiteralExpr(cursor) ?? parseNumberLiteralExpr(cursor) ?? parseArrayLiteral(cursor) ?? parseObjectLiteralExpr(cursor) ?? parseTaggedLiteral(cursor) ?? parseFunctionCall(cursor) ?? parseBooleanLiteralExpr(cursor) ?? parseIdentifierExpr(cursor);\n}\n/** A string literal outside a tagged literal, where a backtick string is refused. */\nfunction parseStringLiteralExpr(cursor) {\n\tif (cursor.peekKind() !== \"StringLiteral\") return void 0;\n\tif (cursor.peekToken().text.startsWith(\"`\")) cursor.diagnostic(\"PSL_BACKTICK_STRING_REQUIRES_TAG\", \"A backtick string must follow a tag, as in tag`...`.\", cursor.mark());\n\treturn parseStringLiteral(cursor);\n}\nfunction parseStringLiteral(cursor) {\n\tconst stringMark = cursor.mark();\n\tconst text = cursor.peekToken().text;\n\tcursor.startNode(\"StringLiteralExpr\");\n\tcursor.bump();\n\tif (!isTerminatedStringLiteral(text)) cursor.diagnostic(\"PSL_UNTERMINATED_STRING\", \"Unterminated string literal\", stringMark);\n\treturn cursor.finishNode();\n}\nfunction parseNumberLiteralExpr(cursor) {\n\tif (cursor.peekKind() !== \"NumberLiteral\") return void 0;\n\tcursor.startNode(\"NumberLiteralExpr\");\n\tcursor.bump();\n\treturn cursor.finishNode();\n}\n/**\n* Parses a namespace-qualified name `[space ':']? Ident ('.' Ident)*`. The\n* caller guarantees a leading `Ident`.\n*\n* Parsing the whole chain up front lets a position decide\n* constructor-vs-reference by peeking exactly one token for `(`, with no scan of\n* the dotted chain's length.\n*/\nfunction parseQualifiedName(cursor) {\n\tcursor.startNode(\"QualifiedName\");\n\tparseIdentifier(cursor);\n\tparseQualifiedSegments(cursor, \"Colon\");\n\tparseQualifiedSegments(cursor, \"Dot\");\n\tcursor.finishNode();\n}\n/**\n* A well-formed name carries at most one colon space and one dot namespace, so\n* each separator past the first of its kind reports `PSL_INVALID_QUALIFIED_NAME`.\n* The separator is consumed regardless, keeping the lossless round-trip intact.\n*/\nfunction parseQualifiedSegments(cursor, separator) {\n\tlet seen = 0;\n\twhile (cursor.peekKind() === separator) {\n\t\tseen++;\n\t\tconst separatorMark = cursor.mark();\n\t\tcursor.bump();\n\t\tif (seen > 1) cursor.diagnostic(\"PSL_INVALID_QUALIFIED_NAME\", \"Qualified name has too many segments\", separatorMark);\n\t\tif (cursor.peekKind() === \"Ident\") parseIdentifier(cursor);\n\t\telse cursor.diagnostic(\"PSL_INVALID_QUALIFIED_NAME\", \"Qualified name is missing a name after the separator\", cursor.mark());\n\t}\n}\n/**\n* Whether the next tokens open a tagged literal: a bare `Ident` or a\n* namespace-qualified `Ident.Ident`, then a string. Trivia may sit anywhere\n* between them. Bounded like {@link isCallAhead}.\n*/\nfunction isTaggedLiteralAhead(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return false;\n\tif (cursor.peekKind(1) === \"StringLiteral\") return true;\n\treturn cursor.peekKind(1) === \"Dot\" && cursor.peekKind(2) === \"Ident\" && cursor.peekKind(3) === \"StringLiteral\";\n}\n/** Parses `` tag`body` ``, `tag\"body\"`, or `tag'body'`: a qualified name, then a string literal. */\nfunction parseTaggedLiteral(cursor) {\n\tif (!isTaggedLiteralAhead(cursor)) return void 0;\n\tcursor.startNode(\"TaggedLiteral\");\n\tparseQualifiedName(cursor);\n\tparseStringLiteral(cursor);\n\treturn cursor.finishNode();\n}\nfunction parseBooleanLiteralExpr(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tconst text = cursor.peekToken().text;\n\tif (text !== \"true\" && text !== \"false\") return void 0;\n\tcursor.startNode(\"BooleanLiteralExpr\");\n\tcursor.bump();\n\treturn cursor.finishNode();\n}\nfunction parseIdentifierExpr(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tcursor.startNode(\"Identifier\");\n\tcursor.bump();\n\treturn cursor.finishNode();\n}\nfunction parseArrayLiteral(cursor) {\n\tif (cursor.peekKind() !== \"LBracket\") return void 0;\n\tcursor.startNode(\"ArrayLiteral\");\n\tcursor.bump();\n\twhile (cursor.peekKind() !== \"RBracket\" && cursor.peekKind() !== \"Eof\") {\n\t\tif (!parseExpression(cursor)) break;\n\t\tif (cursor.peekKind() === \"Comma\") cursor.bump();\n\t\telse break;\n\t}\n\tif (cursor.peekKind() === \"RBracket\") cursor.bump();\n\treturn cursor.finishNode();\n}\nfunction parseObjectLiteralExpr(cursor) {\n\tif (cursor.peekKind() !== \"LBrace\") return void 0;\n\tconst braceMark = cursor.mark();\n\tcursor.startNode(\"ObjectLiteralExpr\");\n\tcursor.bump();\n\twhile (cursor.peekKind() !== \"RBrace\" && cursor.peekKind() !== \"Eof\") {\n\t\tparseObjectField(cursor);\n\t\tif (cursor.peekKind() === \"Comma\") cursor.bump();\n\t\telse if (cursor.peekKind() === \"Ident\") cursor.diagnostic(\"PSL_INVALID_OBJECT_LITERAL\", \"Expected \\\",\\\" between object-literal fields\", cursor.markAfterLastToken());\n\t\telse break;\n\t}\n\tif (cursor.peekKind() === \"RBrace\") cursor.bump();\n\telse cursor.diagnostic(\"PSL_INVALID_OBJECT_LITERAL\", \"Unterminated object literal\", braceMark);\n\treturn cursor.finishNode();\n}\nfunction parseObjectField(cursor) {\n\tcursor.startNode(\"ObjectField\");\n\tconst keyMark = cursor.mark();\n\tconst keyText = cursor.peekToken().text;\n\tif (cursor.peekKind() === \"Ident\") parseIdentifier(cursor);\n\telse if (cursor.peekKind() === \"StringLiteral\") parseStringLiteralExpr(cursor);\n\tif (cursor.peekKind() === \"Colon\") {\n\t\tcursor.bump();\n\t\tif (!parseExpression(cursor)) cursor.diagnostic(\"PSL_INVALID_OBJECT_LITERAL\", \"Expected a value after \\\":\\\"\", cursor.mark());\n\t} else {\n\t\tcursor.diagnostic(\"PSL_INVALID_OBJECT_LITERAL\", `Expected \":\" after \"${keyText}\"`, keyMark);\n\t\tif (!(cursor.peekKind() === \"Ident\" && cursor.peekKind(1) === \"Colon\")) parseExpression(cursor);\n\t}\n\treturn cursor.finishNode();\n}\n/**\n* Whether the next tokens open a call: a bare `Ident(` or a namespace-qualified\n* `Ident.Ident(`. The lookahead is deliberately bounded so a bare dotted\n* reference like `a.b` is not mistaken for a call, rather than scanning an\n* unbounded dotted chain ahead to find the paren.\n*/\nfunction isCallAhead(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return false;\n\tif (cursor.peekKind(1) === \"LParen\") return true;\n\treturn cursor.peekKind(1) === \"Dot\" && cursor.peekKind(2) === \"Ident\" && cursor.peekKind(3) === \"LParen\";\n}\n/**\n* Parses a function/constructor call — bare `autoincrement()` or qualified\n* `temporal.updatedAt()`. Returns `undefined` unless {@link isCallAhead}\n* confirms a trailing `(`, so the `parseExpression` chain falls through to the\n* boolean and bare-identifier forms.\n*/\nfunction parseFunctionCall(cursor) {\n\tif (!isCallAhead(cursor)) return void 0;\n\tcursor.startNode(\"FunctionCall\");\n\tparseQualifiedName(cursor);\n\tif (cursor.peekKind() === \"LParen\") parseParenArgs(cursor);\n\treturn cursor.finishNode();\n}\n/** Parses a parenthesised, comma-separated `AttributeArg` list into the currently open node. */\nfunction parseParenArgs(cursor) {\n\tcursor.bump();\n\twhile (cursor.peekKind() !== \"RParen\" && cursor.peekKind() !== \"Eof\") {\n\t\tparseAttributeArg(cursor);\n\t\tif (cursor.peekKind() === \"Comma\") cursor.bump();\n\t\telse break;\n\t}\n\tif (cursor.peekKind() === \"RParen\") cursor.bump();\n}\nfunction parseAttributeArg(cursor) {\n\tconst kind = cursor.peekKind();\n\tif (kind !== \"Ident\" && kind !== \"StringLiteral\" && kind !== \"NumberLiteral\" && kind !== \"LBracket\" && kind !== \"LBrace\") return;\n\tcursor.startNode(\"AttributeArg\");\n\tif (cursor.peekKind() === \"Ident\" && cursor.peekKind(1) === \"Colon\") {\n\t\tparseIdentifier(cursor);\n\t\tcursor.bump();\n\t}\n\tparseArgValue(cursor);\n\tcursor.finishNode();\n}\nfunction parseArgValue(cursor) {\n\tparseExpression(cursor);\n}\nfunction parseAttributeArgList(cursor) {\n\tcursor.startNode(\"AttributeArgList\");\n\tparseParenArgs(cursor);\n\treturn cursor.finishNode();\n}\nfunction parseAttribute(cursor) {\n\tconst isBlockAttribute = cursor.peekKind() === \"DoubleAt\";\n\tconst attributeMark = cursor.mark();\n\tcursor.startNode(isBlockAttribute ? \"ModelAttribute\" : \"FieldAttribute\");\n\tcursor.bump();\n\tif (cursor.peekKind() === \"Ident\") parseQualifiedName(cursor);\n\telse cursor.diagnostic(\"PSL_INVALID_ATTRIBUTE_SYNTAX\", \"Attribute name expected\", attributeMark);\n\tif (cursor.peekKind() === \"LParen\") parseAttributeArgList(cursor);\n\treturn cursor.finishNode();\n}\n/**\n* A type annotation: `QualifiedName (argList)? ([])? (?)?`, e.g.\n* `pgvector.Vector(1536)[]?`. When the field has no type, no node is emitted —\n* a missing type is the absence of a `TypeAnnotation`, not a zero-width one.\n*/\nfunction parseTypeAnnotation(cursor) {\n\tconst kind = cursor.peekKind();\n\tif (kind !== \"Ident\" && kind !== \"LBracket\" && kind !== \"Question\") return;\n\tcursor.startNode(\"TypeAnnotation\");\n\tif (cursor.peekKind() === \"Ident\") {\n\t\tparseQualifiedName(cursor);\n\t\tif (cursor.peekKind() === \"LParen\") parseAttributeArgList(cursor);\n\t}\n\tif (cursor.peekKind() === \"LBracket\") {\n\t\tcursor.bump();\n\t\tif (cursor.peekKind() === \"RBracket\") cursor.bump();\n\t}\n\tif (cursor.peekKind() === \"Question\") cursor.bump();\n\tcursor.finishNode();\n}\n/**\n* Parses a full PSL document. Never throws — malformed input yields diagnostics\n* and a recovered tree, not an exception.\n*/\nfunction parse(source, filename) {\n\tconst cursor = new Cursor(filename, source);\n\tconst root = createSyntaxTree(parseDocument(cursor));\n\tconst document = DocumentAst.cast(root) ?? new DocumentAst(root);\n\tconst sources = new PslSources([[document.syntax, cursor.sourceFile]]);\n\treturn {\n\t\tdocument,\n\t\tdiagnostics: cursor.diagnostics,\n\t\tsources\n\t};\n}\nfunction parseDocument(cursor) {\n\tcursor.startNode(\"Document\");\n\twhile (cursor.peekKind() !== \"Eof\") parseDeclaration(cursor, false);\n\tcursor.flushTrivia();\n\treturn cursor.finishNode();\n}\nconst RESERVED_BLOCK_KEYWORDS = /* @__PURE__ */ new Set([\n\t\"model\",\n\t\"namespace\",\n\t\"type\",\n\t\"types\"\n]);\nfunction keywordIs(cursor, keyword) {\n\treturn cursor.peekKind() === \"Ident\" && cursor.peekToken().text === keyword;\n}\n/**\n* Each alternative is a no-op on non-match, consuming nothing, so the\n* forward-only cursor is never left half-consumed by a rejected alternative.\n* Recovery runs via the `if (!node)` tail rather than as a `??` arm, because it\n* appends raw tokens to the open parent instead of returning a child node.\n*/\nfunction parseDeclaration(cursor, insideNamespace) {\n\tconst name = cursor.peekKind(1) === \"Ident\" ? cursor.peekToken(1).text : \"\";\n\tif (insideNamespace && keywordIs(cursor, \"namespace\")) cursor.diagnostic(\"PSL_INVALID_NAMESPACE_BLOCK\", `Recursive \"namespace ${name}\" block is not allowed; namespace blocks may not nest`, cursor.mark());\n\telse if (insideNamespace && keywordIs(cursor, \"types\")) cursor.diagnostic(\"PSL_INVALID_NAMESPACE_BLOCK\", \"`types` blocks must be declared at the document top level, not inside a namespace block\", cursor.mark());\n\telse if (keywordIs(cursor, \"namespace\") && name === UNSPECIFIED_PSL_NAMESPACE_ID) cursor.diagnostic(\"PSL_INVALID_NAMESPACE_BLOCK\", `Namespace name \"${UNSPECIFIED_PSL_NAMESPACE_ID}\" is reserved for the parser-synthesised bucket for top-level declarations`, cursor.mark(1));\n\tif (!(parseModel(cursor) ?? parseNamespace(cursor) ?? parseCompositeType(cursor) ?? parseTypesBlock(cursor) ?? parseGenericBlock(cursor))) parseUnsupportedTopLevel(cursor);\n}\n/**\n* Reports only the first missing piece — a missing name suppresses the\n* missing-brace diagnostic. `nameRequired` is false only for the `types` block.\n*/\nfunction parseBlock(cursor, kind, nameRequired, parseMember) {\n\tconst keyword = cursor.peekToken().text;\n\tconst keywordMark = cursor.mark();\n\tcursor.startNode(kind);\n\tcursor.bump();\n\tconst hasName = nameRequired && cursor.peekKind() === \"Ident\";\n\tif (hasName) parseIdentifier(cursor);\n\tif (nameRequired && !hasName) cursor.diagnostic(\"PSL_INVALID_DECLARATION\", `Expected a name after \"${keyword}\"`, keywordMark);\n\telse if (cursor.peekKind() !== \"LBrace\") cursor.diagnostic(\"PSL_INVALID_DECLARATION\", `Expected \"{\" to open the \"${keyword}\" block`, cursor.markAfterLastToken());\n\tif (cursor.peekKind() === \"LBrace\") parseBlockBody(cursor, parseMember);\n\telse cursor.recoverToSyncPoint();\n\treturn cursor.finishNode();\n}\nfunction parseModel(cursor) {\n\tif (!keywordIs(cursor, \"model\")) return void 0;\n\treturn parseBlock(cursor, \"ModelDeclaration\", true, parseModelMember);\n}\n/**\n* Excluding the reserved keywords keeps a malformed reserved block (e.g. `model\n* {` with no name) routed to its dedicated parser. The generic keyword set is\n* open, so a bare identifier with no brace (e.g. `oops`) is read as an unfinished\n* custom declaration rather than unsupported content.\n*/\nfunction parseGenericBlock(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tconst keyword = cursor.peekToken().text;\n\tif (RESERVED_BLOCK_KEYWORDS.has(keyword)) return void 0;\n\tconst hasName = cursor.peekKind(1) === \"Ident\" && cursor.peekKind(2) === \"LBrace\";\n\tcursor.startNode(\"GenericBlockDeclaration\");\n\tcursor.bump();\n\tif (hasName) parseIdentifier(cursor);\n\tif (cursor.peekKind() === \"LBrace\") parseBlockBody(cursor, genericBlockMemberParser(keyword));\n\telse {\n\t\tcursor.diagnostic(\"PSL_INVALID_DECLARATION\", `Expected \"{\" to open the \"${keyword}\" block`, cursor.markAfterLastToken());\n\t\tcursor.recoverToSyncPoint();\n\t}\n\treturn cursor.finishNode();\n}\nfunction parseNamespace(cursor) {\n\tif (!keywordIs(cursor, \"namespace\")) return void 0;\n\treturn parseBlock(cursor, \"Namespace\", true, (inner) => parseDeclaration(inner, true));\n}\nfunction parseCompositeType(cursor) {\n\tif (!keywordIs(cursor, \"type\")) return void 0;\n\treturn parseBlock(cursor, \"CompositeTypeDeclaration\", true, parseModelMember);\n}\n/** `types` (plural) is the no-name types block; the singular `type` is the composite type above. */\nfunction parseTypesBlock(cursor) {\n\tif (!keywordIs(cursor, \"types\")) return void 0;\n\treturn parseBlock(cursor, \"TypesBlock\", false, parseNamedTypeMember);\n}\n/** Every `parseMember` consumes at least one significant token, so the loop always terminates. */\nfunction parseBlockBody(cursor, parseMember) {\n\tconst braceMark = cursor.mark();\n\tcursor.bump();\n\tfor (;;) {\n\t\tconst kind = cursor.peekKind();\n\t\tif (kind === \"RBrace\" || kind === \"Eof\") break;\n\t\tparseMember(cursor);\n\t}\n\tif (cursor.peekKind() === \"RBrace\") cursor.bump();\n\telse cursor.diagnostic(\"PSL_UNTERMINATED_BLOCK\", \"Unterminated block declaration\", braceMark);\n}\nfunction parseUnsupportedTopLevel(cursor) {\n\tconst offending = cursor.peekToken().text;\n\tconst message = cursor.peekKind(1) === \"LBrace\" ? `Unsupported top-level block \"${offending}\"` : `Unsupported top-level declaration \"${offending}\"`;\n\tcursor.diagnostic(\"PSL_UNSUPPORTED_TOP_LEVEL_BLOCK\", message, cursor.mark());\n\tcursor.bump();\n\tcursor.recoverToSyncPoint();\n}\n/**\n* Matches a leading `@@` block attribute, a no-op otherwise. Single-`@`\n* attributes belong to fields and are parsed inside `parseField`.\n*/\nfunction parseBlockAttribute(cursor) {\n\tif (cursor.peekKind() !== \"DoubleAt\") return void 0;\n\treturn parseAttribute(cursor);\n}\nfunction parseModelMember(cursor) {\n\tif (!(parseBlockAttribute(cursor) ?? parseField(cursor))) invalidMember(cursor, \"PSL_INVALID_MODEL_MEMBER\", `Invalid model member declaration \"${cursor.peekToken().text}\"`);\n}\nfunction parseNamedTypeMember(cursor) {\n\tif (!parseNamedType(cursor)) invalidMember(cursor, \"PSL_INVALID_TYPES_MEMBER\", `Invalid types declaration \"${cursor.peekToken().text}\"`);\n}\n/**\n* A `view` body is read like a model body. Every other generic block reads `key = value` entries\n* and bare keys, and in an `enum` block those may carry `@` attributes (`USER @map(\"user\")`). Each\n* interpreter decides whether it accepts the block and its members.\n*/\nfunction genericBlockMemberParser(keyword) {\n\tif (keyword === \"view\") return parseModelMember;\n\tif (keyword === \"enum\") return parseEnumMember;\n\treturn parseKeyValueMember;\n}\n/**\n* A generic-block member is either a `@@`-block attribute or a `key = value`\n* entry. The block-attribute alternative is purely syntactic — it does not judge\n* whether the attribute is valid for the block's kind.\n*/\nfunction parseKeyValueMember(cursor) {\n\tif (!(parseBlockAttribute(cursor) ?? parseKeyValue(cursor))) invalidMember(cursor, \"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", \"Invalid block entry\");\n}\nfunction parseEnumMember(cursor) {\n\tif (!(parseBlockAttribute(cursor) ?? parseKeyValue(cursor, { memberAttributes: true }))) invalidMember(cursor, \"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", \"Invalid block entry\");\n}\nfunction invalidMember(cursor, code, message) {\n\tcursor.diagnostic(code, message, cursor.mark());\n\tcursor.bump();\n\tcursor.recoverToSyncPoint();\n}\nfunction parseField(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tcursor.startNode(\"FieldDeclaration\");\n\tconst nameMark = cursor.mark();\n\tconst nameText = cursor.peekToken().text;\n\tparseIdentifier(cursor);\n\tif (cursor.peekKind() !== \"Ident\") cursor.diagnostic(\"PSL_INVALID_MODEL_MEMBER\", `Expected a type after field \"${nameText}\"`, nameMark);\n\tparseTypeAnnotation(cursor);\n\twhile (cursor.peekKind() === \"At\") parseAttribute(cursor);\n\treturn cursor.finishNode();\n}\nfunction parseNamedType(cursor) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tcursor.startNode(\"NamedTypeDeclaration\");\n\tconst nameMark = cursor.mark();\n\tconst nameText = cursor.peekToken().text;\n\tparseIdentifier(cursor);\n\tif (cursor.peekKind() === \"Equals\") cursor.bump();\n\telse cursor.diagnostic(\"PSL_INVALID_TYPES_MEMBER\", `Expected \"=\" after \"${nameText}\"`, nameMark);\n\tparseTypeAnnotation(cursor);\n\twhile (cursor.peekKind() === \"At\") parseAttribute(cursor);\n\treturn cursor.finishNode();\n}\n/**\n* A generic-block entry is either `key = value` or a bare `key` (committing a\n* `KeyValuePair` carrying only the key). With `memberAttributes` (enum blocks) any number of `@`\n* attributes may follow, as in `USER @map(\"user\")`. A `key =` with no following expression is\n* flagged.\n*/\nfunction parseKeyValue(cursor, options = { memberAttributes: false }) {\n\tif (cursor.peekKind() !== \"Ident\") return void 0;\n\tcursor.startNode(\"KeyValuePair\");\n\tparseIdentifier(cursor);\n\tif (cursor.peekKind() === \"Equals\") {\n\t\tcursor.bump();\n\t\tif (!parseExpression(cursor)) cursor.diagnostic(\"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", \"Expected a value after \\\"=\\\"\", cursor.mark());\n\t}\n\twhile (options.memberAttributes && cursor.peekKind() === \"At\") parseAttribute(cursor);\n\treturn cursor.finishNode();\n}\n//#endregion\nexport { PslSources as a, greenToken as i, GreenNodeBuilder as n, SourceFile as o, greenNode as r, parse as t };\n\n//# sourceMappingURL=parse-DAVL8A2m.mjs.map"],"mappings":";;;;;;AAMA,MAAM,kBAAkB;AACxB,MAAM,YAAY;AAClB,IAAI,aAAa,MAAM;CACtB;CACA;CACA;CACA,YAAY,UAAU,MAAM;EAC3B,KAAKA,YAAY;EACjB,KAAKC,QAAQ;EACb,MAAM,aAAa,CAAC,CAAC;EACrB,KAAK,IAAI,SAAS,GAAG,SAAS,KAAK,QAAQ,UAAU,IAAI,KAAK,WAAW,MAAM,MAAM,WAAW,WAAW,KAAK,SAAS,CAAC;EAC1H,KAAKC,cAAc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