@prisma-next/psl-parser 0.14.0-dev.19 → 0.14.0-dev.20
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/declarations-D9h_ihD3.mjs.map +1 -1
- package/dist/format.d.mts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/{parse-BjZ1LPe6.d.mts → parse-DX12Jvsh.d.mts} +40 -40
- package/dist/parse-DX12Jvsh.d.mts.map +1 -0
- package/dist/syntax.d.mts +1 -1
- package/package.json +5 -5
- package/src/syntax/ast/attributes.ts +5 -6
- package/src/syntax/ast/declarations.ts +18 -19
- package/src/syntax/ast/expressions.ts +12 -13
- package/src/syntax/ast/identifier.ts +2 -3
- package/src/syntax/ast/qualified-name.ts +3 -4
- package/src/syntax/ast/type-annotation.ts +4 -5
- package/src/syntax/ast-helpers.ts +3 -3
- package/dist/parse-BjZ1LPe6.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations-D9h_ihD3.mjs","names":["#penultimateSegment","#lastSegment","#separatorCount"],"sources":["../src/syntax/red.ts","../src/syntax/ast-helpers.ts","../src/syntax/ast/identifier.ts","../src/syntax/ast/qualified-name.ts","../src/syntax/ast/expressions.ts","../src/syntax/ast/attributes.ts","../src/syntax/ast/type-annotation.ts","../src/syntax/ast/declarations.ts"],"sourcesContent":["import type { Token } from '../tokenizer';\nimport type { GreenElement, GreenNode } from './green';\nimport type { SyntaxKind } from './syntax-kind';\n\n/**\n * A token in the red tree. Unlike the green-layer {@link Token} (kind + text\n * only), a red token also carries its absolute `offset` within the source,\n * computed lazily as the tree is walked.\n */\nexport interface SyntaxToken extends Token {\n readonly offset: number;\n}\n\nexport type SyntaxElement = SyntaxNode | SyntaxToken;\n\nexport class SyntaxNode {\n readonly green: GreenNode;\n readonly offset: number;\n readonly parent: SyntaxNode | undefined;\n\n constructor(green: GreenNode, offset: number, parent: SyntaxNode | undefined) {\n this.green = green;\n this.offset = offset;\n this.parent = parent;\n }\n\n get kind(): SyntaxKind {\n return this.green.kind;\n }\n\n get textLength(): number {\n return this.green.textLength;\n }\n\n get firstChild(): SyntaxElement | undefined {\n return childAt(this, 0);\n }\n\n get lastChild(): SyntaxElement | undefined {\n const len = this.green.children.length;\n if (len === 0) return undefined;\n return childAt(this, len - 1);\n }\n\n get nextSibling(): SyntaxElement | undefined {\n if (!this.parent) return undefined;\n const siblings = this.parent.green.children;\n let offset = this.parent.offset;\n let found = false;\n for (const child of siblings) {\n if (found) {\n return wrapElement(child, offset, this.parent);\n }\n const childLen = elementTextLength(child);\n if (child.type === 'node' && offset === this.offset && child === this.green) {\n found = true;\n }\n offset += childLen;\n }\n return undefined;\n }\n\n get prevSibling(): SyntaxElement | undefined {\n if (!this.parent) return undefined;\n const siblings = this.parent.green.children;\n let offset = this.parent.offset;\n let prev: { green: GreenElement; offset: number } | undefined;\n for (const child of siblings) {\n if (child.type === 'node' && offset === this.offset && child === this.green) {\n if (!prev) return undefined;\n return wrapElement(prev.green, prev.offset, this.parent);\n }\n prev = { green: child, offset };\n offset += elementTextLength(child);\n }\n return undefined;\n }\n\n *children(): Iterable<SyntaxElement> {\n let offset = this.offset;\n for (const child of this.green.children) {\n yield wrapElement(child, offset, this);\n offset += elementTextLength(child);\n }\n }\n\n *childNodes(): Iterable<SyntaxNode> {\n for (const child of this.children()) {\n if (child instanceof SyntaxNode) yield child;\n }\n }\n\n *ancestors(): Iterable<SyntaxNode> {\n let current: SyntaxNode | undefined = this.parent;\n while (current) {\n yield current;\n current = current.parent;\n }\n }\n\n *descendants(): Iterable<SyntaxElement> {\n const stack: SyntaxElement[] = [this];\n for (let el = stack.pop(); el !== undefined; el = stack.pop()) {\n yield el;\n if (el instanceof SyntaxNode) {\n const children = Array.from(el.children());\n for (let i = children.length - 1; i >= 0; i--) {\n const child = children[i];\n if (child !== undefined) {\n stack.push(child);\n }\n }\n }\n }\n }\n\n *tokens(): Iterable<SyntaxToken> {\n for (const el of this.descendants()) {\n if (!(el instanceof SyntaxNode)) {\n yield el;\n }\n }\n }\n}\n\nfunction elementTextLength(el: GreenElement): number {\n return el.type === 'token' ? el.text.length : el.textLength;\n}\n\nfunction wrapElement(green: GreenElement, offset: number, parent: SyntaxNode): SyntaxElement {\n if (green.type === 'token') {\n const token: SyntaxToken = { kind: green.kind, text: green.text, offset };\n return token;\n }\n return new SyntaxNode(green, offset, parent);\n}\n\nfunction childAt(node: SyntaxNode, index: number): SyntaxElement | undefined {\n const children = node.green.children;\n const target = children[index];\n if (target === undefined) return undefined;\n let offset = node.offset;\n for (let i = 0; i < index; i++) {\n const child = children[i];\n if (child !== undefined) {\n offset += elementTextLength(child);\n }\n }\n return wrapElement(target, offset, node);\n}\n\nexport function createSyntaxTree(green: GreenNode): SyntaxNode {\n return new SyntaxNode(green, 0, undefined);\n}\n","import type { Token, TokenKind } from '../tokenizer';\nimport { SyntaxNode } from './red';\n\nexport interface AstNode {\n readonly syntax: SyntaxNode;\n}\n\nexport function findChildToken(node: SyntaxNode, kind: TokenKind): Token | undefined {\n for (const child of node.children()) {\n if (!(child instanceof SyntaxNode) && child.kind === kind) {\n return child;\n }\n }\n return undefined;\n}\n\nexport function findFirstChild<T>(\n node: SyntaxNode,\n cast: (node: SyntaxNode) => T | undefined,\n): T | undefined {\n for (const child of node.childNodes()) {\n const result = cast(child);\n if (result !== undefined) return result;\n }\n return undefined;\n}\n\nexport function* filterChildren<T>(\n node: SyntaxNode,\n cast: (node: SyntaxNode) => T | undefined,\n): Iterable<T> {\n for (const child of node.childNodes()) {\n const result = cast(child);\n if (result !== undefined) yield result;\n }\n}\n\n/**\n * Raw source text of a CST node, verbatim (quotes and brackets preserved). For\n * the decoded value of a string literal, decode it instead.\n */\nexport function printSyntax(node: SyntaxNode): string {\n let text = '';\n for (const token of node.tokens()) {\n text += token.text;\n }\n return text;\n}\n","import type { Token } from '../../tokenizer';\nimport type { AstNode } from '../ast-helpers';\nimport { findChildToken } from '../ast-helpers';\nimport type { SyntaxNode } from '../red';\n\nexport class IdentifierAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n token(): Token | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): string | undefined {\n return this.token()?.text;\n }\n\n static cast(node: SyntaxNode): IdentifierAst | undefined {\n return node.kind === 'Identifier' ? new IdentifierAst(node) : undefined;\n }\n}\n","import type { Token } from '../../tokenizer';\nimport type { AstNode } from '../ast-helpers';\nimport { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';\nimport { SyntaxNode } from '../red';\nimport { IdentifierAst } from './identifier';\n\n/** A namespace-qualified name, e.g. `pgvector.Vector` or `supabase:auth.User`. */\nexport class QualifiedNameAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n #lastSegment(): IdentifierAst | undefined {\n let last: IdentifierAst | undefined;\n for (const segment of filterChildren(this.syntax, IdentifierAst.cast)) {\n last = segment;\n }\n return last;\n }\n\n #penultimateSegment(): IdentifierAst | undefined {\n let last: IdentifierAst | undefined;\n let penultimate: IdentifierAst | undefined;\n for (const segment of filterChildren(this.syntax, IdentifierAst.cast)) {\n penultimate = last;\n last = segment;\n }\n return penultimate;\n }\n\n #separatorCount(kind: 'Dot' | 'Colon'): number {\n let count = 0;\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode) && child.kind === kind) count++;\n }\n return count;\n }\n\n colon(): Token | undefined {\n return findChildToken(this.syntax, 'Colon');\n }\n\n dot(): Token | undefined {\n return findChildToken(this.syntax, 'Dot');\n }\n\n space(): IdentifierAst | undefined {\n if (!this.colon()) return undefined;\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n namespace(): IdentifierAst | undefined {\n if (!this.dot()) return undefined;\n return this.#penultimateSegment();\n }\n\n identifier(): IdentifierAst | undefined {\n return this.#lastSegment();\n }\n\n /**\n * Every identifier segment, in source order. A bare `Vector` yields\n * `['Vector']`; a qualified `pgvector.Vector` yields `['pgvector', 'Vector']`.\n */\n path(): readonly string[] {\n const segments: string[] = [];\n for (const segment of filterChildren(this.syntax, IdentifierAst.cast)) {\n const text = segment.token()?.text;\n if (text !== undefined) segments.push(text);\n }\n return segments;\n }\n\n /**\n * Flags a malformed name with more qualifier segments than allowed (a second\n * `:`-space or a second `.`-namespace).\n */\n isOverQualified(): boolean {\n return this.#separatorCount('Dot') > 1 || this.#separatorCount('Colon') > 1;\n }\n\n static cast(node: SyntaxNode): QualifiedNameAst | undefined {\n return node.kind === 'QualifiedName' ? new QualifiedNameAst(node) : undefined;\n }\n}\n","import type { Token } from '../../tokenizer';\nimport type { AstNode } from '../ast-helpers';\nimport { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';\nimport { SyntaxNode } from '../red';\nimport { IdentifierAst } from './identifier';\nimport { QualifiedNameAst } from './qualified-name';\n\nexport class FunctionCallAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n /** The qualified-name callee, or `undefined` when identifier segments sit directly under the node. */\n name(): QualifiedNameAst | undefined {\n return findFirstChild(this.syntax, QualifiedNameAst.cast);\n }\n\n /**\n * The dotted call path, in source order. A bare `Vector(…)` yields\n * `['Vector']`; a namespace-qualified `pgvector.Vector(…)` yields\n * `['pgvector', 'Vector']`. Empty when the call carries no identifier.\n */\n path(): readonly string[] {\n const qualified = this.name();\n const segments: string[] = [];\n for (const segment of filterChildren(qualified?.syntax ?? this.syntax, IdentifierAst.cast)) {\n const text = segment.token()?.text;\n if (text !== undefined) segments.push(text);\n }\n return segments;\n }\n\n lparen(): Token | undefined {\n return findChildToken(this.syntax, 'LParen');\n }\n\n rparen(): Token | undefined {\n return findChildToken(this.syntax, 'RParen');\n }\n\n *args(): Iterable<AttributeArgAst> {\n yield* filterChildren(this.syntax, AttributeArgAst.cast);\n }\n\n static cast(node: SyntaxNode): FunctionCallAst | undefined {\n return node.kind === 'FunctionCall' ? new FunctionCallAst(node) : undefined;\n }\n}\n\nexport class ArrayLiteralAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n lbracket(): Token | undefined {\n return findChildToken(this.syntax, 'LBracket');\n }\n\n rbracket(): Token | undefined {\n return findChildToken(this.syntax, 'RBracket');\n }\n\n *elements(): Iterable<ExpressionAst> {\n yield* filterChildren(this.syntax, castExpression);\n }\n\n static cast(node: SyntaxNode): ArrayLiteralAst | undefined {\n return node.kind === 'ArrayLiteral' ? new ArrayLiteralAst(node) : undefined;\n }\n}\n\nconst HEX = /^[0-9a-fA-F]+$/;\n\nfunction decodeFixedHex(raw: string, start: number, width: number): string | undefined {\n if (start + width > raw.length) return undefined;\n const hex = raw.slice(start, start + width);\n if (!HEX.test(hex)) return undefined;\n return String.fromCharCode(Number.parseInt(hex, 16));\n}\n\nfunction decodeStringLiteral(raw: string): string {\n let out = '';\n let i = 0;\n while (i < raw.length) {\n const ch = raw.charAt(i);\n if (ch !== '\\\\' || i + 1 >= raw.length) {\n out += ch;\n i++;\n continue;\n }\n const next = raw.charAt(i + 1);\n switch (next) {\n case 'n':\n out += '\\n';\n i += 2;\n continue;\n case 'r':\n out += '\\r';\n i += 2;\n continue;\n case 't':\n out += '\\t';\n i += 2;\n continue;\n case '\"':\n out += '\"';\n i += 2;\n continue;\n case \"'\":\n out += \"'\";\n i += 2;\n continue;\n case '\\\\':\n out += '\\\\';\n i += 2;\n continue;\n case 'x': {\n const decoded = decodeFixedHex(raw, i + 2, 2);\n if (decoded === undefined) {\n out += '\\\\x';\n i += 2;\n continue;\n }\n out += decoded;\n i += 4;\n continue;\n }\n case 'u': {\n const decoded = decodeFixedHex(raw, i + 2, 4);\n if (decoded === undefined) {\n out += '\\\\u';\n i += 2;\n continue;\n }\n out += decoded;\n i += 6;\n continue;\n }\n default:\n out += `\\\\${next}`;\n i += 2;\n continue;\n }\n }\n return out;\n}\n\nexport class StringLiteralExprAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n token(): Token | undefined {\n return findChildToken(this.syntax, 'StringLiteral');\n }\n\n value(): string | undefined {\n const tok = this.token();\n if (!tok) return undefined;\n return decodeStringLiteral(tok.text.slice(1, -1));\n }\n\n static cast(node: SyntaxNode): StringLiteralExprAst | undefined {\n return node.kind === 'StringLiteralExpr' ? new StringLiteralExprAst(node) : undefined;\n }\n}\n\nexport class NumberLiteralExprAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n token(): Token | undefined {\n return findChildToken(this.syntax, 'NumberLiteral');\n }\n\n value(): number | undefined {\n const tok = this.token();\n if (!tok) return undefined;\n return Number(tok.text);\n }\n\n static cast(node: SyntaxNode): NumberLiteralExprAst | undefined {\n return node.kind === 'NumberLiteralExpr' ? new NumberLiteralExprAst(node) : undefined;\n }\n}\n\nexport class BooleanLiteralExprAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n token(): Token | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n value(): boolean | undefined {\n const tok = this.token();\n if (!tok) return undefined;\n if (tok.text === 'true') return true;\n if (tok.text === 'false') return false;\n return undefined;\n }\n\n static cast(node: SyntaxNode): BooleanLiteralExprAst | undefined {\n return node.kind === 'BooleanLiteralExpr' ? new BooleanLiteralExprAst(node) : undefined;\n }\n}\n\nexport class ObjectLiteralExprAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n lbrace(): Token | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): Token | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *fields(): Iterable<ObjectFieldAst> {\n yield* filterChildren(this.syntax, ObjectFieldAst.cast);\n }\n\n static cast(node: SyntaxNode): ObjectLiteralExprAst | undefined {\n return node.kind === 'ObjectLiteralExpr' ? new ObjectLiteralExprAst(node) : undefined;\n }\n}\n\nexport class ObjectFieldAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n key(): IdentifierAst | undefined {\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Colon') break;\n continue;\n }\n return IdentifierAst.cast(child);\n }\n return undefined;\n }\n\n /**\n * The field's logical key name, unquoted. An identifier key (`length:`) yields\n * its text; a string-literal key (`\"length\":`) yields the decoded string.\n * `undefined` when the field carries no key node.\n */\n keyName(): string | undefined {\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Colon') break;\n continue;\n }\n const identifier = IdentifierAst.cast(child);\n if (identifier) return identifier.token()?.text;\n const stringKey = StringLiteralExprAst.cast(child);\n if (stringKey) return stringKey.value();\n return undefined;\n }\n return undefined;\n }\n\n colon(): Token | undefined {\n return findChildToken(this.syntax, 'Colon');\n }\n\n value(): ExpressionAst | undefined {\n if (this.colon()) {\n let pastColon = false;\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Colon') pastColon = true;\n continue;\n }\n if (pastColon) {\n const expr = castExpression(child);\n if (expr) return expr;\n }\n }\n return undefined;\n }\n return findFirstChild(this.syntax, castExpression);\n }\n\n static cast(node: SyntaxNode): ObjectFieldAst | undefined {\n return node.kind === 'ObjectField' ? new ObjectFieldAst(node) : undefined;\n }\n}\n\nexport type ExpressionAst =\n | FunctionCallAst\n | ArrayLiteralAst\n | StringLiteralExprAst\n | NumberLiteralExprAst\n | BooleanLiteralExprAst\n | ObjectLiteralExprAst\n | IdentifierAst;\n\nexport function castExpression(node: SyntaxNode): ExpressionAst | undefined {\n return (\n FunctionCallAst.cast(node) ??\n ArrayLiteralAst.cast(node) ??\n StringLiteralExprAst.cast(node) ??\n NumberLiteralExprAst.cast(node) ??\n BooleanLiteralExprAst.cast(node) ??\n ObjectLiteralExprAst.cast(node) ??\n IdentifierAst.cast(node)\n );\n}\n\nexport class AttributeArgAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n name(): IdentifierAst | undefined {\n if (!this.colon()) return undefined;\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n colon(): Token | undefined {\n return findChildToken(this.syntax, 'Colon');\n }\n\n value(): ExpressionAst | undefined {\n if (this.colon()) {\n let pastColon = false;\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Colon') pastColon = true;\n continue;\n }\n if (pastColon) {\n const expr = castExpression(child);\n if (expr) return expr;\n }\n }\n return undefined;\n }\n return findFirstChild(this.syntax, castExpression);\n }\n\n static cast(node: SyntaxNode): AttributeArgAst | undefined {\n return node.kind === 'AttributeArg' ? new AttributeArgAst(node) : undefined;\n }\n}\n","import type { Token } from '../../tokenizer';\nimport type { AstNode } from '../ast-helpers';\nimport { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';\nimport type { SyntaxNode } from '../red';\nimport { AttributeArgAst } from './expressions';\nimport { QualifiedNameAst } from './qualified-name';\n\nexport class AttributeArgListAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n lparen(): Token | undefined {\n return findChildToken(this.syntax, 'LParen');\n }\n\n rparen(): Token | undefined {\n return findChildToken(this.syntax, 'RParen');\n }\n\n *args(): Iterable<AttributeArgAst> {\n yield* filterChildren(this.syntax, AttributeArgAst.cast);\n }\n\n static cast(node: SyntaxNode): AttributeArgListAst | undefined {\n return node.kind === 'AttributeArgList' ? new AttributeArgListAst(node) : undefined;\n }\n}\n\nexport class FieldAttributeAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n at(): Token | undefined {\n return findChildToken(this.syntax, 'At');\n }\n\n name(): QualifiedNameAst | undefined {\n return findFirstChild(this.syntax, QualifiedNameAst.cast);\n }\n\n argList(): AttributeArgListAst | undefined {\n return findFirstChild(this.syntax, AttributeArgListAst.cast);\n }\n\n static cast(node: SyntaxNode): FieldAttributeAst | undefined {\n return node.kind === 'FieldAttribute' ? new FieldAttributeAst(node) : undefined;\n }\n}\n\nexport class ModelAttributeAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n doubleAt(): Token | undefined {\n return findChildToken(this.syntax, 'DoubleAt');\n }\n\n name(): QualifiedNameAst | undefined {\n return findFirstChild(this.syntax, QualifiedNameAst.cast);\n }\n\n argList(): AttributeArgListAst | undefined {\n return findFirstChild(this.syntax, AttributeArgListAst.cast);\n }\n\n static cast(node: SyntaxNode): ModelAttributeAst | undefined {\n return node.kind === 'ModelAttribute' ? new ModelAttributeAst(node) : undefined;\n }\n}\n","import type { Token } from '../../tokenizer';\nimport type { AstNode } from '../ast-helpers';\nimport { findChildToken, findFirstChild } from '../ast-helpers';\nimport type { SyntaxNode } from '../red';\nimport { AttributeArgListAst } from './attributes';\nimport { QualifiedNameAst } from './qualified-name';\n\nexport class TypeAnnotationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n /** The annotation's reference, doubling as the constructor callee when an {@link argList} follows. */\n name(): QualifiedNameAst | undefined {\n return findFirstChild(this.syntax, QualifiedNameAst.cast);\n }\n\n /** Present when the annotation is a constructor (`Vector(1536)`) rather than a plain reference. */\n argList(): AttributeArgListAst | undefined {\n return findFirstChild(this.syntax, AttributeArgListAst.cast);\n }\n\n isConstructor(): boolean {\n return this.argList() !== undefined;\n }\n\n lbracket(): Token | undefined {\n return findChildToken(this.syntax, 'LBracket');\n }\n\n rbracket(): Token | undefined {\n return findChildToken(this.syntax, 'RBracket');\n }\n\n questionMark(): Token | undefined {\n return findChildToken(this.syntax, 'Question');\n }\n\n isList(): boolean {\n return this.lbracket() !== undefined;\n }\n\n isOptional(): boolean {\n return this.questionMark() !== undefined;\n }\n\n static cast(node: SyntaxNode): TypeAnnotationAst | undefined {\n return node.kind === 'TypeAnnotation' ? new TypeAnnotationAst(node) : undefined;\n }\n}\n","import type { Token } from '../../tokenizer';\nimport type { AstNode } from '../ast-helpers';\nimport { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';\nimport { SyntaxNode } from '../red';\nimport { FieldAttributeAst, ModelAttributeAst } from './attributes';\nimport type { ExpressionAst } from './expressions';\nimport { castExpression } from './expressions';\nimport { IdentifierAst } from './identifier';\nimport { TypeAnnotationAst } from './type-annotation';\n\n/**\n * What may appear inside a `namespace` block: models, composite types, and\n * extension (block) declarations. `types {}` blocks and nested `namespace`\n * blocks are document-only, so they are not namespace members.\n */\nexport type NamespaceMemberAst =\n | ModelDeclarationAst\n | CompositeTypeDeclarationAst\n | GenericBlockDeclarationAst;\n\nfunction castNamespaceMember(node: SyntaxNode): NamespaceMemberAst | undefined {\n return (\n ModelDeclarationAst.cast(node) ??\n CompositeTypeDeclarationAst.cast(node) ??\n GenericBlockDeclarationAst.cast(node)\n );\n}\n\nexport class DocumentAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n *declarations(): Iterable<NamespaceMemberAst | TypesBlockAst | NamespaceDeclarationAst> {\n yield* filterChildren(\n this.syntax,\n (node) =>\n castNamespaceMember(node) ?? TypesBlockAst.cast(node) ?? NamespaceDeclarationAst.cast(node),\n );\n }\n\n static cast(node: SyntaxNode): DocumentAst | undefined {\n return node.kind === 'Document' ? new DocumentAst(node) : undefined;\n }\n}\n\nexport class ModelDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): Token | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n lbrace(): Token | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): Token | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *fields(): Iterable<FieldDeclarationAst> {\n yield* filterChildren(this.syntax, FieldDeclarationAst.cast);\n }\n\n *attributes(): Iterable<ModelAttributeAst> {\n yield* filterChildren(this.syntax, ModelAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): ModelDeclarationAst | undefined {\n return node.kind === 'ModelDeclaration' ? new ModelDeclarationAst(node) : undefined;\n }\n}\n\nexport class CompositeTypeDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): Token | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n lbrace(): Token | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): Token | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *fields(): Iterable<FieldDeclarationAst> {\n yield* filterChildren(this.syntax, FieldDeclarationAst.cast);\n }\n\n *attributes(): Iterable<ModelAttributeAst> {\n yield* filterChildren(this.syntax, ModelAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): CompositeTypeDeclarationAst | undefined {\n return node.kind === 'CompositeTypeDeclaration'\n ? new CompositeTypeDeclarationAst(node)\n : undefined;\n }\n}\n\nexport class NamespaceDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): Token | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n lbrace(): Token | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): Token | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *declarations(): Iterable<NamespaceMemberAst> {\n yield* filterChildren(this.syntax, castNamespaceMember);\n }\n\n static cast(node: SyntaxNode): NamespaceDeclarationAst | undefined {\n return node.kind === 'Namespace' ? new NamespaceDeclarationAst(node) : undefined;\n }\n}\n\nexport class TypesBlockAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): Token | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n lbrace(): Token | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): Token | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *declarations(): Iterable<NamedTypeDeclarationAst> {\n yield* filterChildren(this.syntax, NamedTypeDeclarationAst.cast);\n }\n\n static cast(node: SyntaxNode): TypesBlockAst | undefined {\n return node.kind === 'TypesBlock' ? new TypesBlockAst(node) : undefined;\n }\n}\n\nexport class GenericBlockDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): Token | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n lbrace(): Token | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): Token | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *entries(): Iterable<KeyValuePairAst> {\n yield* filterChildren(this.syntax, KeyValuePairAst.cast);\n }\n\n *attributes(): Iterable<ModelAttributeAst> {\n yield* filterChildren(this.syntax, ModelAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): GenericBlockDeclarationAst | undefined {\n return node.kind === 'GenericBlockDeclaration'\n ? new GenericBlockDeclarationAst(node)\n : undefined;\n }\n}\n\nexport class KeyValuePairAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n key(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n equals(): Token | undefined {\n return findChildToken(this.syntax, 'Equals');\n }\n\n value(): ExpressionAst | undefined {\n let pastEquals = false;\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Equals') pastEquals = true;\n continue;\n }\n if (pastEquals) {\n const expr = castExpression(child);\n if (expr) return expr;\n }\n }\n return undefined;\n }\n\n static cast(node: SyntaxNode): KeyValuePairAst | undefined {\n return node.kind === 'KeyValuePair' ? new KeyValuePairAst(node) : undefined;\n }\n}\n\nexport class FieldDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n typeAnnotation(): TypeAnnotationAst | undefined {\n return findFirstChild(this.syntax, TypeAnnotationAst.cast);\n }\n\n *attributes(): Iterable<FieldAttributeAst> {\n yield* filterChildren(this.syntax, FieldAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): FieldDeclarationAst | undefined {\n return node.kind === 'FieldDeclaration' ? new FieldDeclarationAst(node) : undefined;\n }\n}\n\nexport class NamedTypeDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n equals(): Token | undefined {\n return findChildToken(this.syntax, 'Equals');\n }\n\n typeAnnotation(): TypeAnnotationAst | undefined {\n return findFirstChild(this.syntax, TypeAnnotationAst.cast);\n }\n\n *attributes(): Iterable<FieldAttributeAst> {\n yield* filterChildren(this.syntax, FieldAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): NamedTypeDeclarationAst | undefined {\n return node.kind === 'NamedTypeDeclaration' ? new NamedTypeDeclarationAst(node) :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gBAAgB,IAAI,IAAI,KAAA;CACpE;AACF;AAEA,IAAa,sBAAb,MAAa,oBAAuC;CAClD;CAEA,YAAY,QAAoB;EAC9B,KAAK,SAAS;CAChB;CAEA,OAAkC;EAChC,OAAO,eAAe,KAAK,QAAQ,cAAc,IAAI;CACvD;CAEA,iBAAgD;EAC9C,OAAO,eAAe,KAAK,QAAQ,kBAAkB,IAAI;CAC3D;CAEA,CAAC,aAA0C;EACzC,OAAO,eAAe,KAAK,QAAQ,kBAAkB,IAAI;CAC3D;CAEA,OAAO,KAAK,MAAmD;EAC7D,OAAO,KAAK,SAAS,qBAAqB,IAAI,oBAAoB,IAAI,IAAI,KAAA;CAC5E;AACF;AAEA,IAAa,0BAAb,MAAa,wBAA2C;CACtD;CAEA,YAAY,QAAoB;EAC9B,KAAK,SAAS;CAChB;CAEA,OAAkC;EAChC,OAAO,eAAe,KAAK,QAAQ,cAAc,IAAI;CACvD;CAEA,SAA4B;EAC1B,OAAO,eAAe,KAAK,QAAQ,QAAQ;CAC7C;CAEA,iBAAgD;EAC9C,OAAO,eAAe,KAAK,QAAQ,kBAAkB,IAAI;CAC3D;CAEA,CAAC,aAA0C;EACzC,OAAO,eAAe,KAAK,QAAQ,kBAAkB,IAAI;CAC3D;CAEA,OAAO,KAAK,MAAuD;EACjE,OAAO,KAAK,SAAS,yBAAyB,IAAI,wBAAwB,IAAI,IAAI,KAAA;CACpF;AACF"}
|
|
1
|
+
{"version":3,"file":"declarations-D9h_ihD3.mjs","names":["#penultimateSegment","#lastSegment","#separatorCount"],"sources":["../src/syntax/red.ts","../src/syntax/ast-helpers.ts","../src/syntax/ast/identifier.ts","../src/syntax/ast/qualified-name.ts","../src/syntax/ast/expressions.ts","../src/syntax/ast/attributes.ts","../src/syntax/ast/type-annotation.ts","../src/syntax/ast/declarations.ts"],"sourcesContent":["import type { Token } from '../tokenizer';\nimport type { GreenElement, GreenNode } from './green';\nimport type { SyntaxKind } from './syntax-kind';\n\n/**\n * A token in the red tree. Unlike the green-layer {@link Token} (kind + text\n * only), a red token also carries its absolute `offset` within the source,\n * computed lazily as the tree is walked.\n */\nexport interface SyntaxToken extends Token {\n readonly offset: number;\n}\n\nexport type SyntaxElement = SyntaxNode | SyntaxToken;\n\nexport class SyntaxNode {\n readonly green: GreenNode;\n readonly offset: number;\n readonly parent: SyntaxNode | undefined;\n\n constructor(green: GreenNode, offset: number, parent: SyntaxNode | undefined) {\n this.green = green;\n this.offset = offset;\n this.parent = parent;\n }\n\n get kind(): SyntaxKind {\n return this.green.kind;\n }\n\n get textLength(): number {\n return this.green.textLength;\n }\n\n get firstChild(): SyntaxElement | undefined {\n return childAt(this, 0);\n }\n\n get lastChild(): SyntaxElement | undefined {\n const len = this.green.children.length;\n if (len === 0) return undefined;\n return childAt(this, len - 1);\n }\n\n get nextSibling(): SyntaxElement | undefined {\n if (!this.parent) return undefined;\n const siblings = this.parent.green.children;\n let offset = this.parent.offset;\n let found = false;\n for (const child of siblings) {\n if (found) {\n return wrapElement(child, offset, this.parent);\n }\n const childLen = elementTextLength(child);\n if (child.type === 'node' && offset === this.offset && child === this.green) {\n found = true;\n }\n offset += childLen;\n }\n return undefined;\n }\n\n get prevSibling(): SyntaxElement | undefined {\n if (!this.parent) return undefined;\n const siblings = this.parent.green.children;\n let offset = this.parent.offset;\n let prev: { green: GreenElement; offset: number } | undefined;\n for (const child of siblings) {\n if (child.type === 'node' && offset === this.offset && child === this.green) {\n if (!prev) return undefined;\n return wrapElement(prev.green, prev.offset, this.parent);\n }\n prev = { green: child, offset };\n offset += elementTextLength(child);\n }\n return undefined;\n }\n\n *children(): Iterable<SyntaxElement> {\n let offset = this.offset;\n for (const child of this.green.children) {\n yield wrapElement(child, offset, this);\n offset += elementTextLength(child);\n }\n }\n\n *childNodes(): Iterable<SyntaxNode> {\n for (const child of this.children()) {\n if (child instanceof SyntaxNode) yield child;\n }\n }\n\n *ancestors(): Iterable<SyntaxNode> {\n let current: SyntaxNode | undefined = this.parent;\n while (current) {\n yield current;\n current = current.parent;\n }\n }\n\n *descendants(): Iterable<SyntaxElement> {\n const stack: SyntaxElement[] = [this];\n for (let el = stack.pop(); el !== undefined; el = stack.pop()) {\n yield el;\n if (el instanceof SyntaxNode) {\n const children = Array.from(el.children());\n for (let i = children.length - 1; i >= 0; i--) {\n const child = children[i];\n if (child !== undefined) {\n stack.push(child);\n }\n }\n }\n }\n }\n\n *tokens(): Iterable<SyntaxToken> {\n for (const el of this.descendants()) {\n if (!(el instanceof SyntaxNode)) {\n yield el;\n }\n }\n }\n}\n\nfunction elementTextLength(el: GreenElement): number {\n return el.type === 'token' ? el.text.length : el.textLength;\n}\n\nfunction wrapElement(green: GreenElement, offset: number, parent: SyntaxNode): SyntaxElement {\n if (green.type === 'token') {\n const token: SyntaxToken = { kind: green.kind, text: green.text, offset };\n return token;\n }\n return new SyntaxNode(green, offset, parent);\n}\n\nfunction childAt(node: SyntaxNode, index: number): SyntaxElement | undefined {\n const children = node.green.children;\n const target = children[index];\n if (target === undefined) return undefined;\n let offset = node.offset;\n for (let i = 0; i < index; i++) {\n const child = children[i];\n if (child !== undefined) {\n offset += elementTextLength(child);\n }\n }\n return wrapElement(target, offset, node);\n}\n\nexport function createSyntaxTree(green: GreenNode): SyntaxNode {\n return new SyntaxNode(green, 0, undefined);\n}\n","import type { TokenKind } from '../tokenizer';\nimport { SyntaxNode, type SyntaxToken } from './red';\n\nexport interface AstNode {\n readonly syntax: SyntaxNode;\n}\n\nexport function findChildToken(node: SyntaxNode, kind: TokenKind): SyntaxToken | undefined {\n for (const child of node.children()) {\n if (!(child instanceof SyntaxNode) && child.kind === kind) {\n return child;\n }\n }\n return undefined;\n}\n\nexport function findFirstChild<T>(\n node: SyntaxNode,\n cast: (node: SyntaxNode) => T | undefined,\n): T | undefined {\n for (const child of node.childNodes()) {\n const result = cast(child);\n if (result !== undefined) return result;\n }\n return undefined;\n}\n\nexport function* filterChildren<T>(\n node: SyntaxNode,\n cast: (node: SyntaxNode) => T | undefined,\n): Iterable<T> {\n for (const child of node.childNodes()) {\n const result = cast(child);\n if (result !== undefined) yield result;\n }\n}\n\n/**\n * Raw source text of a CST node, verbatim (quotes and brackets preserved). For\n * the decoded value of a string literal, decode it instead.\n */\nexport function printSyntax(node: SyntaxNode): string {\n let text = '';\n for (const token of node.tokens()) {\n text += token.text;\n }\n return text;\n}\n","import type { AstNode } from '../ast-helpers';\nimport { findChildToken } from '../ast-helpers';\nimport type { SyntaxNode, SyntaxToken } from '../red';\n\nexport class IdentifierAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n token(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): string | undefined {\n return this.token()?.text;\n }\n\n static cast(node: SyntaxNode): IdentifierAst | undefined {\n return node.kind === 'Identifier' ? new IdentifierAst(node) : undefined;\n }\n}\n","import type { AstNode } from '../ast-helpers';\nimport { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';\nimport { SyntaxNode, type SyntaxToken } from '../red';\nimport { IdentifierAst } from './identifier';\n\n/** A namespace-qualified name, e.g. `pgvector.Vector` or `supabase:auth.User`. */\nexport class QualifiedNameAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n #lastSegment(): IdentifierAst | undefined {\n let last: IdentifierAst | undefined;\n for (const segment of filterChildren(this.syntax, IdentifierAst.cast)) {\n last = segment;\n }\n return last;\n }\n\n #penultimateSegment(): IdentifierAst | undefined {\n let last: IdentifierAst | undefined;\n let penultimate: IdentifierAst | undefined;\n for (const segment of filterChildren(this.syntax, IdentifierAst.cast)) {\n penultimate = last;\n last = segment;\n }\n return penultimate;\n }\n\n #separatorCount(kind: 'Dot' | 'Colon'): number {\n let count = 0;\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode) && child.kind === kind) count++;\n }\n return count;\n }\n\n colon(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Colon');\n }\n\n dot(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Dot');\n }\n\n space(): IdentifierAst | undefined {\n if (!this.colon()) return undefined;\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n namespace(): IdentifierAst | undefined {\n if (!this.dot()) return undefined;\n return this.#penultimateSegment();\n }\n\n identifier(): IdentifierAst | undefined {\n return this.#lastSegment();\n }\n\n /**\n * Every identifier segment, in source order. A bare `Vector` yields\n * `['Vector']`; a qualified `pgvector.Vector` yields `['pgvector', 'Vector']`.\n */\n path(): readonly string[] {\n const segments: string[] = [];\n for (const segment of filterChildren(this.syntax, IdentifierAst.cast)) {\n const text = segment.token()?.text;\n if (text !== undefined) segments.push(text);\n }\n return segments;\n }\n\n /**\n * Flags a malformed name with more qualifier segments than allowed (a second\n * `:`-space or a second `.`-namespace).\n */\n isOverQualified(): boolean {\n return this.#separatorCount('Dot') > 1 || this.#separatorCount('Colon') > 1;\n }\n\n static cast(node: SyntaxNode): QualifiedNameAst | undefined {\n return node.kind === 'QualifiedName' ? new QualifiedNameAst(node) : undefined;\n }\n}\n","import type { AstNode } from '../ast-helpers';\nimport { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';\nimport { SyntaxNode, type SyntaxToken } from '../red';\nimport { IdentifierAst } from './identifier';\nimport { QualifiedNameAst } from './qualified-name';\n\nexport class FunctionCallAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n /** The qualified-name callee, or `undefined` when identifier segments sit directly under the node. */\n name(): QualifiedNameAst | undefined {\n return findFirstChild(this.syntax, QualifiedNameAst.cast);\n }\n\n /**\n * The dotted call path, in source order. A bare `Vector(…)` yields\n * `['Vector']`; a namespace-qualified `pgvector.Vector(…)` yields\n * `['pgvector', 'Vector']`. Empty when the call carries no identifier.\n */\n path(): readonly string[] {\n const qualified = this.name();\n const segments: string[] = [];\n for (const segment of filterChildren(qualified?.syntax ?? this.syntax, IdentifierAst.cast)) {\n const text = segment.token()?.text;\n if (text !== undefined) segments.push(text);\n }\n return segments;\n }\n\n lparen(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LParen');\n }\n\n rparen(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RParen');\n }\n\n *args(): Iterable<AttributeArgAst> {\n yield* filterChildren(this.syntax, AttributeArgAst.cast);\n }\n\n static cast(node: SyntaxNode): FunctionCallAst | undefined {\n return node.kind === 'FunctionCall' ? new FunctionCallAst(node) : undefined;\n }\n}\n\nexport class ArrayLiteralAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n lbracket(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LBracket');\n }\n\n rbracket(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RBracket');\n }\n\n *elements(): Iterable<ExpressionAst> {\n yield* filterChildren(this.syntax, castExpression);\n }\n\n static cast(node: SyntaxNode): ArrayLiteralAst | undefined {\n return node.kind === 'ArrayLiteral' ? new ArrayLiteralAst(node) : undefined;\n }\n}\n\nconst HEX = /^[0-9a-fA-F]+$/;\n\nfunction decodeFixedHex(raw: string, start: number, width: number): string | undefined {\n if (start + width > raw.length) return undefined;\n const hex = raw.slice(start, start + width);\n if (!HEX.test(hex)) return undefined;\n return String.fromCharCode(Number.parseInt(hex, 16));\n}\n\nfunction decodeStringLiteral(raw: string): string {\n let out = '';\n let i = 0;\n while (i < raw.length) {\n const ch = raw.charAt(i);\n if (ch !== '\\\\' || i + 1 >= raw.length) {\n out += ch;\n i++;\n continue;\n }\n const next = raw.charAt(i + 1);\n switch (next) {\n case 'n':\n out += '\\n';\n i += 2;\n continue;\n case 'r':\n out += '\\r';\n i += 2;\n continue;\n case 't':\n out += '\\t';\n i += 2;\n continue;\n case '\"':\n out += '\"';\n i += 2;\n continue;\n case \"'\":\n out += \"'\";\n i += 2;\n continue;\n case '\\\\':\n out += '\\\\';\n i += 2;\n continue;\n case 'x': {\n const decoded = decodeFixedHex(raw, i + 2, 2);\n if (decoded === undefined) {\n out += '\\\\x';\n i += 2;\n continue;\n }\n out += decoded;\n i += 4;\n continue;\n }\n case 'u': {\n const decoded = decodeFixedHex(raw, i + 2, 4);\n if (decoded === undefined) {\n out += '\\\\u';\n i += 2;\n continue;\n }\n out += decoded;\n i += 6;\n continue;\n }\n default:\n out += `\\\\${next}`;\n i += 2;\n continue;\n }\n }\n return out;\n}\n\nexport class StringLiteralExprAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n token(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'StringLiteral');\n }\n\n value(): string | undefined {\n const tok = this.token();\n if (!tok) return undefined;\n return decodeStringLiteral(tok.text.slice(1, -1));\n }\n\n static cast(node: SyntaxNode): StringLiteralExprAst | undefined {\n return node.kind === 'StringLiteralExpr' ? new StringLiteralExprAst(node) : undefined;\n }\n}\n\nexport class NumberLiteralExprAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n token(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'NumberLiteral');\n }\n\n value(): number | undefined {\n const tok = this.token();\n if (!tok) return undefined;\n return Number(tok.text);\n }\n\n static cast(node: SyntaxNode): NumberLiteralExprAst | undefined {\n return node.kind === 'NumberLiteralExpr' ? new NumberLiteralExprAst(node) : undefined;\n }\n}\n\nexport class BooleanLiteralExprAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n token(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n value(): boolean | undefined {\n const tok = this.token();\n if (!tok) return undefined;\n if (tok.text === 'true') return true;\n if (tok.text === 'false') return false;\n return undefined;\n }\n\n static cast(node: SyntaxNode): BooleanLiteralExprAst | undefined {\n return node.kind === 'BooleanLiteralExpr' ? new BooleanLiteralExprAst(node) : undefined;\n }\n}\n\nexport class ObjectLiteralExprAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n lbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *fields(): Iterable<ObjectFieldAst> {\n yield* filterChildren(this.syntax, ObjectFieldAst.cast);\n }\n\n static cast(node: SyntaxNode): ObjectLiteralExprAst | undefined {\n return node.kind === 'ObjectLiteralExpr' ? new ObjectLiteralExprAst(node) : undefined;\n }\n}\n\nexport class ObjectFieldAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n key(): IdentifierAst | undefined {\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Colon') break;\n continue;\n }\n return IdentifierAst.cast(child);\n }\n return undefined;\n }\n\n /**\n * The field's logical key name, unquoted. An identifier key (`length:`) yields\n * its text; a string-literal key (`\"length\":`) yields the decoded string.\n * `undefined` when the field carries no key node.\n */\n keyName(): string | undefined {\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Colon') break;\n continue;\n }\n const identifier = IdentifierAst.cast(child);\n if (identifier) return identifier.token()?.text;\n const stringKey = StringLiteralExprAst.cast(child);\n if (stringKey) return stringKey.value();\n return undefined;\n }\n return undefined;\n }\n\n colon(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Colon');\n }\n\n value(): ExpressionAst | undefined {\n if (this.colon()) {\n let pastColon = false;\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Colon') pastColon = true;\n continue;\n }\n if (pastColon) {\n const expr = castExpression(child);\n if (expr) return expr;\n }\n }\n return undefined;\n }\n return findFirstChild(this.syntax, castExpression);\n }\n\n static cast(node: SyntaxNode): ObjectFieldAst | undefined {\n return node.kind === 'ObjectField' ? new ObjectFieldAst(node) : undefined;\n }\n}\n\nexport type ExpressionAst =\n | FunctionCallAst\n | ArrayLiteralAst\n | StringLiteralExprAst\n | NumberLiteralExprAst\n | BooleanLiteralExprAst\n | ObjectLiteralExprAst\n | IdentifierAst;\n\nexport function castExpression(node: SyntaxNode): ExpressionAst | undefined {\n return (\n FunctionCallAst.cast(node) ??\n ArrayLiteralAst.cast(node) ??\n StringLiteralExprAst.cast(node) ??\n NumberLiteralExprAst.cast(node) ??\n BooleanLiteralExprAst.cast(node) ??\n ObjectLiteralExprAst.cast(node) ??\n IdentifierAst.cast(node)\n );\n}\n\nexport class AttributeArgAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n name(): IdentifierAst | undefined {\n if (!this.colon()) return undefined;\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n colon(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Colon');\n }\n\n value(): ExpressionAst | undefined {\n if (this.colon()) {\n let pastColon = false;\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Colon') pastColon = true;\n continue;\n }\n if (pastColon) {\n const expr = castExpression(child);\n if (expr) return expr;\n }\n }\n return undefined;\n }\n return findFirstChild(this.syntax, castExpression);\n }\n\n static cast(node: SyntaxNode): AttributeArgAst | undefined {\n return node.kind === 'AttributeArg' ? new AttributeArgAst(node) : undefined;\n }\n}\n","import type { AstNode } from '../ast-helpers';\nimport { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';\nimport type { SyntaxNode, SyntaxToken } from '../red';\nimport { AttributeArgAst } from './expressions';\nimport { QualifiedNameAst } from './qualified-name';\n\nexport class AttributeArgListAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n lparen(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LParen');\n }\n\n rparen(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RParen');\n }\n\n *args(): Iterable<AttributeArgAst> {\n yield* filterChildren(this.syntax, AttributeArgAst.cast);\n }\n\n static cast(node: SyntaxNode): AttributeArgListAst | undefined {\n return node.kind === 'AttributeArgList' ? new AttributeArgListAst(node) : undefined;\n }\n}\n\nexport class FieldAttributeAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n at(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'At');\n }\n\n name(): QualifiedNameAst | undefined {\n return findFirstChild(this.syntax, QualifiedNameAst.cast);\n }\n\n argList(): AttributeArgListAst | undefined {\n return findFirstChild(this.syntax, AttributeArgListAst.cast);\n }\n\n static cast(node: SyntaxNode): FieldAttributeAst | undefined {\n return node.kind === 'FieldAttribute' ? new FieldAttributeAst(node) : undefined;\n }\n}\n\nexport class ModelAttributeAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n doubleAt(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'DoubleAt');\n }\n\n name(): QualifiedNameAst | undefined {\n return findFirstChild(this.syntax, QualifiedNameAst.cast);\n }\n\n argList(): AttributeArgListAst | undefined {\n return findFirstChild(this.syntax, AttributeArgListAst.cast);\n }\n\n static cast(node: SyntaxNode): ModelAttributeAst | undefined {\n return node.kind === 'ModelAttribute' ? new ModelAttributeAst(node) : undefined;\n }\n}\n","import type { AstNode } from '../ast-helpers';\nimport { findChildToken, findFirstChild } from '../ast-helpers';\nimport type { SyntaxNode, SyntaxToken } from '../red';\nimport { AttributeArgListAst } from './attributes';\nimport { QualifiedNameAst } from './qualified-name';\n\nexport class TypeAnnotationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n /** The annotation's reference, doubling as the constructor callee when an {@link argList} follows. */\n name(): QualifiedNameAst | undefined {\n return findFirstChild(this.syntax, QualifiedNameAst.cast);\n }\n\n /** Present when the annotation is a constructor (`Vector(1536)`) rather than a plain reference. */\n argList(): AttributeArgListAst | undefined {\n return findFirstChild(this.syntax, AttributeArgListAst.cast);\n }\n\n isConstructor(): boolean {\n return this.argList() !== undefined;\n }\n\n lbracket(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LBracket');\n }\n\n rbracket(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RBracket');\n }\n\n questionMark(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Question');\n }\n\n isList(): boolean {\n return this.lbracket() !== undefined;\n }\n\n isOptional(): boolean {\n return this.questionMark() !== undefined;\n }\n\n static cast(node: SyntaxNode): TypeAnnotationAst | undefined {\n return node.kind === 'TypeAnnotation' ? new TypeAnnotationAst(node) : undefined;\n }\n}\n","import type { AstNode } from '../ast-helpers';\nimport { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';\nimport { SyntaxNode, type SyntaxToken } from '../red';\nimport { FieldAttributeAst, ModelAttributeAst } from './attributes';\nimport type { ExpressionAst } from './expressions';\nimport { castExpression } from './expressions';\nimport { IdentifierAst } from './identifier';\nimport { TypeAnnotationAst } from './type-annotation';\n\n/**\n * What may appear inside a `namespace` block: models, composite types, and\n * extension (block) declarations. `types {}` blocks and nested `namespace`\n * blocks are document-only, so they are not namespace members.\n */\nexport type NamespaceMemberAst =\n | ModelDeclarationAst\n | CompositeTypeDeclarationAst\n | GenericBlockDeclarationAst;\n\nfunction castNamespaceMember(node: SyntaxNode): NamespaceMemberAst | undefined {\n return (\n ModelDeclarationAst.cast(node) ??\n CompositeTypeDeclarationAst.cast(node) ??\n GenericBlockDeclarationAst.cast(node)\n );\n}\n\nexport class DocumentAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n *declarations(): Iterable<NamespaceMemberAst | TypesBlockAst | NamespaceDeclarationAst> {\n yield* filterChildren(\n this.syntax,\n (node) =>\n castNamespaceMember(node) ?? TypesBlockAst.cast(node) ?? NamespaceDeclarationAst.cast(node),\n );\n }\n\n static cast(node: SyntaxNode): DocumentAst | undefined {\n return node.kind === 'Document' ? new DocumentAst(node) : undefined;\n }\n}\n\nexport class ModelDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n lbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *fields(): Iterable<FieldDeclarationAst> {\n yield* filterChildren(this.syntax, FieldDeclarationAst.cast);\n }\n\n *attributes(): Iterable<ModelAttributeAst> {\n yield* filterChildren(this.syntax, ModelAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): ModelDeclarationAst | undefined {\n return node.kind === 'ModelDeclaration' ? new ModelDeclarationAst(node) : undefined;\n }\n}\n\nexport class CompositeTypeDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n lbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *fields(): Iterable<FieldDeclarationAst> {\n yield* filterChildren(this.syntax, FieldDeclarationAst.cast);\n }\n\n *attributes(): Iterable<ModelAttributeAst> {\n yield* filterChildren(this.syntax, ModelAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): CompositeTypeDeclarationAst | undefined {\n return node.kind === 'CompositeTypeDeclaration'\n ? new CompositeTypeDeclarationAst(node)\n : undefined;\n }\n}\n\nexport class NamespaceDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n lbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *declarations(): Iterable<NamespaceMemberAst> {\n yield* filterChildren(this.syntax, castNamespaceMember);\n }\n\n static cast(node: SyntaxNode): NamespaceDeclarationAst | undefined {\n return node.kind === 'Namespace' ? new NamespaceDeclarationAst(node) : undefined;\n }\n}\n\nexport class TypesBlockAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n lbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *declarations(): Iterable<NamedTypeDeclarationAst> {\n yield* filterChildren(this.syntax, NamedTypeDeclarationAst.cast);\n }\n\n static cast(node: SyntaxNode): TypesBlockAst | undefined {\n return node.kind === 'TypesBlock' ? new TypesBlockAst(node) : undefined;\n }\n}\n\nexport class GenericBlockDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n keyword(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Ident');\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n lbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'LBrace');\n }\n\n rbrace(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'RBrace');\n }\n\n *entries(): Iterable<KeyValuePairAst> {\n yield* filterChildren(this.syntax, KeyValuePairAst.cast);\n }\n\n *attributes(): Iterable<ModelAttributeAst> {\n yield* filterChildren(this.syntax, ModelAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): GenericBlockDeclarationAst | undefined {\n return node.kind === 'GenericBlockDeclaration'\n ? new GenericBlockDeclarationAst(node)\n : undefined;\n }\n}\n\nexport class KeyValuePairAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n key(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n equals(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Equals');\n }\n\n value(): ExpressionAst | undefined {\n let pastEquals = false;\n for (const child of this.syntax.children()) {\n if (!(child instanceof SyntaxNode)) {\n if (child.kind === 'Equals') pastEquals = true;\n continue;\n }\n if (pastEquals) {\n const expr = castExpression(child);\n if (expr) return expr;\n }\n }\n return undefined;\n }\n\n static cast(node: SyntaxNode): KeyValuePairAst | undefined {\n return node.kind === 'KeyValuePair' ? new KeyValuePairAst(node) : undefined;\n }\n}\n\nexport class FieldDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n typeAnnotation(): TypeAnnotationAst | undefined {\n return findFirstChild(this.syntax, TypeAnnotationAst.cast);\n }\n\n *attributes(): Iterable<FieldAttributeAst> {\n yield* filterChildren(this.syntax, FieldAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): FieldDeclarationAst | undefined {\n return node.kind === 'FieldDeclaration' ? new FieldDeclarationAst(node) : undefined;\n }\n}\n\nexport class NamedTypeDeclarationAst implements AstNode {\n readonly syntax: SyntaxNode;\n\n constructor(syntax: SyntaxNode) {\n this.syntax = syntax;\n }\n\n name(): IdentifierAst | undefined {\n return findFirstChild(this.syntax, IdentifierAst.cast);\n }\n\n equals(): SyntaxToken | undefined {\n return findChildToken(this.syntax, 'Equals');\n }\n\n typeAnnotation(): TypeAnnotationAst | undefined {\n return findFirstChild(this.syntax, TypeAnnotationAst.cast);\n }\n\n *attributes(): Iterable<FieldAttributeAst> {\n yield* filterChildren(this.syntax, FieldAttributeAst.cast);\n }\n\n static cast(node: SyntaxNode): NamedTypeDeclarationAst | undefined {\n return node.kind === 'NamedTypeDeclaration' ? new NamedTypeDeclarationAst(node) : undefined;\n }\n}\n"],"mappings":";AAeA,IAAa,aAAb,MAAa,WAAW;CACtB;CACA;CACA;CAEA,YAAY,OAAkB,QAAgB,QAAgC;EAC5E,KAAK,QAAQ;EACb,KAAK,SAAS;EACd,KAAK,SAAS;CAChB;CAEA,IAAI,OAAmB;EACrB,OAAO,KAAK,MAAM;CACpB;CAEA,IAAI,aAAqB;EACvB,OAAO,KAAK,MAAM;CACpB;CAEA,IAAI,aAAwC;EAC1C,OAAO,QAAQ,MAAM,CAAC;CACxB;CAEA,IAAI,YAAuC;EACzC,MAAM,MAAM,KAAK,MAAM,SAAS;EAChC,IAAI,QAAQ,GAAG,OAAO,KAAA;EACtB,OAAO,QAAQ,MAAM,MAAM,CAAC;CAC9B;CAEA,IAAI,cAAyC;EAC3C,IAAI,CAAC,KAAK,QAAQ,OAAO,KAAA;EACzB,MAAM,WAAW,KAAK,OAAO,MAAM;EACnC,IAAI,SAAS,KAAK,OAAO;EACzB,IAAI,QAAQ;EACZ,KAAK,MAAM,SAAS,UAAU;GAC5B,IAAI,OACF,OAAO,YAAY,OAAO,QAAQ,KAAK,MAAM;GAE/C,MAAM,WAAW,kBAAkB,KAAK;GACxC,IAAI,MAAM,SAAS,UAAU,WAAW,KAAK,UAAU,UAAU,KAAK,OACp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,KAAK,SAAS,yBAAyB,IAAI,wBAAwB,IAAI,IAAI,KAAA;CACpF;AACF"}
|
package/dist/format.d.mts
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as SyntaxNode, K as Range, _ as ModelAttributeAst, a as DocumentAst, d as NamespaceDeclarationAst, g as FieldAttributeAst, i as CompositeTypeDeclarationAst, l as ModelDeclarationAst, m as TypeAnnotationAst, o as FieldDeclarationAst, q as SourceFile, s as GenericBlockDeclarationAst, t as ParseDiagnostic, u as NamedTypeDeclarationAst } from "./parse-
|
|
1
|
+
import { I as SyntaxNode, K as Range, _ as ModelAttributeAst, a as DocumentAst, d as NamespaceDeclarationAst, g as FieldAttributeAst, i as CompositeTypeDeclarationAst, l as ModelDeclarationAst, m as TypeAnnotationAst, o as FieldDeclarationAst, q as SourceFile, s as GenericBlockDeclarationAst, t as ParseDiagnostic, u as NamedTypeDeclarationAst } from "./parse-DX12Jvsh.mjs";
|
|
2
2
|
import { PslAttribute, PslAttribute as PslAttribute$1, PslAttributeArgument, PslAttributeNamedArgument, PslAttributePositionalArgument, PslAttributeTarget, PslCompositeType, PslDefaultFunctionValue, PslDefaultLiteralValue, PslDefaultValue, PslDiagnostic, PslDiagnostic as PslDiagnostic$1, PslDiagnosticCode, PslDocumentAst, PslExtensionBlock, PslExtensionBlock as PslExtensionBlock$1, PslExtensionBlockAttribute, PslExtensionBlockAttributeArg, PslExtensionBlockParamBare, PslExtensionBlockParamList, PslExtensionBlockParamOption, PslExtensionBlockParamRef, PslExtensionBlockParamScalarValue, PslExtensionBlockParamValue, PslField, PslFieldAttribute, PslModel, PslModelAttribute, PslNamedTypeDeclaration, PslNamespace, PslPosition, PslSpan, PslSpan as PslSpan$1, PslTypeConstructorCall, PslTypesBlock, flatPslModels, namespacePslExtensionBlocks } from "@prisma-next/framework-components/psl-ast";
|
|
3
3
|
import { AuthoringPslBlockDescriptor, AuthoringPslBlockDescriptorNamespace } from "@prisma-next/framework-components/authoring";
|
|
4
4
|
import { CodecLookup } from "@prisma-next/framework-components/codec";
|
|
@@ -73,7 +73,7 @@ declare function createSyntaxTree(green: GreenNode): SyntaxNode;
|
|
|
73
73
|
interface AstNode {
|
|
74
74
|
readonly syntax: SyntaxNode;
|
|
75
75
|
}
|
|
76
|
-
declare function findChildToken(node: SyntaxNode, kind: TokenKind):
|
|
76
|
+
declare function findChildToken(node: SyntaxNode, kind: TokenKind): SyntaxToken | undefined;
|
|
77
77
|
declare function findFirstChild<T>(node: SyntaxNode, cast: (node: SyntaxNode) => T | undefined): T | undefined;
|
|
78
78
|
declare function filterChildren<T>(node: SyntaxNode, cast: (node: SyntaxNode) => T | undefined): Iterable<T>;
|
|
79
79
|
/**
|
|
@@ -86,7 +86,7 @@ declare function printSyntax(node: SyntaxNode): string;
|
|
|
86
86
|
declare class IdentifierAst implements AstNode {
|
|
87
87
|
readonly syntax: SyntaxNode;
|
|
88
88
|
constructor(syntax: SyntaxNode);
|
|
89
|
-
token():
|
|
89
|
+
token(): SyntaxToken | undefined;
|
|
90
90
|
name(): string | undefined;
|
|
91
91
|
static cast(node: SyntaxNode): IdentifierAst | undefined;
|
|
92
92
|
}
|
|
@@ -97,8 +97,8 @@ declare class QualifiedNameAst implements AstNode {
|
|
|
97
97
|
#private;
|
|
98
98
|
readonly syntax: SyntaxNode;
|
|
99
99
|
constructor(syntax: SyntaxNode);
|
|
100
|
-
colon():
|
|
101
|
-
dot():
|
|
100
|
+
colon(): SyntaxToken | undefined;
|
|
101
|
+
dot(): SyntaxToken | undefined;
|
|
102
102
|
space(): IdentifierAst | undefined;
|
|
103
103
|
namespace(): IdentifierAst | undefined;
|
|
104
104
|
identifier(): IdentifierAst | undefined;
|
|
@@ -127,45 +127,45 @@ declare class FunctionCallAst implements AstNode {
|
|
|
127
127
|
* `['pgvector', 'Vector']`. Empty when the call carries no identifier.
|
|
128
128
|
*/
|
|
129
129
|
path(): readonly string[];
|
|
130
|
-
lparen():
|
|
131
|
-
rparen():
|
|
130
|
+
lparen(): SyntaxToken | undefined;
|
|
131
|
+
rparen(): SyntaxToken | undefined;
|
|
132
132
|
args(): Iterable<AttributeArgAst>;
|
|
133
133
|
static cast(node: SyntaxNode): FunctionCallAst | undefined;
|
|
134
134
|
}
|
|
135
135
|
declare class ArrayLiteralAst implements AstNode {
|
|
136
136
|
readonly syntax: SyntaxNode;
|
|
137
137
|
constructor(syntax: SyntaxNode);
|
|
138
|
-
lbracket():
|
|
139
|
-
rbracket():
|
|
138
|
+
lbracket(): SyntaxToken | undefined;
|
|
139
|
+
rbracket(): SyntaxToken | undefined;
|
|
140
140
|
elements(): Iterable<ExpressionAst>;
|
|
141
141
|
static cast(node: SyntaxNode): ArrayLiteralAst | undefined;
|
|
142
142
|
}
|
|
143
143
|
declare class StringLiteralExprAst implements AstNode {
|
|
144
144
|
readonly syntax: SyntaxNode;
|
|
145
145
|
constructor(syntax: SyntaxNode);
|
|
146
|
-
token():
|
|
146
|
+
token(): SyntaxToken | undefined;
|
|
147
147
|
value(): string | undefined;
|
|
148
148
|
static cast(node: SyntaxNode): StringLiteralExprAst | undefined;
|
|
149
149
|
}
|
|
150
150
|
declare class NumberLiteralExprAst implements AstNode {
|
|
151
151
|
readonly syntax: SyntaxNode;
|
|
152
152
|
constructor(syntax: SyntaxNode);
|
|
153
|
-
token():
|
|
153
|
+
token(): SyntaxToken | undefined;
|
|
154
154
|
value(): number | undefined;
|
|
155
155
|
static cast(node: SyntaxNode): NumberLiteralExprAst | undefined;
|
|
156
156
|
}
|
|
157
157
|
declare class BooleanLiteralExprAst implements AstNode {
|
|
158
158
|
readonly syntax: SyntaxNode;
|
|
159
159
|
constructor(syntax: SyntaxNode);
|
|
160
|
-
token():
|
|
160
|
+
token(): SyntaxToken | undefined;
|
|
161
161
|
value(): boolean | undefined;
|
|
162
162
|
static cast(node: SyntaxNode): BooleanLiteralExprAst | undefined;
|
|
163
163
|
}
|
|
164
164
|
declare class ObjectLiteralExprAst implements AstNode {
|
|
165
165
|
readonly syntax: SyntaxNode;
|
|
166
166
|
constructor(syntax: SyntaxNode);
|
|
167
|
-
lbrace():
|
|
168
|
-
rbrace():
|
|
167
|
+
lbrace(): SyntaxToken | undefined;
|
|
168
|
+
rbrace(): SyntaxToken | undefined;
|
|
169
169
|
fields(): Iterable<ObjectFieldAst>;
|
|
170
170
|
static cast(node: SyntaxNode): ObjectLiteralExprAst | undefined;
|
|
171
171
|
}
|
|
@@ -179,7 +179,7 @@ declare class ObjectFieldAst implements AstNode {
|
|
|
179
179
|
* `undefined` when the field carries no key node.
|
|
180
180
|
*/
|
|
181
181
|
keyName(): string | undefined;
|
|
182
|
-
colon():
|
|
182
|
+
colon(): SyntaxToken | undefined;
|
|
183
183
|
value(): ExpressionAst | undefined;
|
|
184
184
|
static cast(node: SyntaxNode): ObjectFieldAst | undefined;
|
|
185
185
|
}
|
|
@@ -189,7 +189,7 @@ declare class AttributeArgAst implements AstNode {
|
|
|
189
189
|
readonly syntax: SyntaxNode;
|
|
190
190
|
constructor(syntax: SyntaxNode);
|
|
191
191
|
name(): IdentifierAst | undefined;
|
|
192
|
-
colon():
|
|
192
|
+
colon(): SyntaxToken | undefined;
|
|
193
193
|
value(): ExpressionAst | undefined;
|
|
194
194
|
static cast(node: SyntaxNode): AttributeArgAst | undefined;
|
|
195
195
|
}
|
|
@@ -198,15 +198,15 @@ declare class AttributeArgAst implements AstNode {
|
|
|
198
198
|
declare class AttributeArgListAst implements AstNode {
|
|
199
199
|
readonly syntax: SyntaxNode;
|
|
200
200
|
constructor(syntax: SyntaxNode);
|
|
201
|
-
lparen():
|
|
202
|
-
rparen():
|
|
201
|
+
lparen(): SyntaxToken | undefined;
|
|
202
|
+
rparen(): SyntaxToken | undefined;
|
|
203
203
|
args(): Iterable<AttributeArgAst>;
|
|
204
204
|
static cast(node: SyntaxNode): AttributeArgListAst | undefined;
|
|
205
205
|
}
|
|
206
206
|
declare class FieldAttributeAst implements AstNode {
|
|
207
207
|
readonly syntax: SyntaxNode;
|
|
208
208
|
constructor(syntax: SyntaxNode);
|
|
209
|
-
at():
|
|
209
|
+
at(): SyntaxToken | undefined;
|
|
210
210
|
name(): QualifiedNameAst | undefined;
|
|
211
211
|
argList(): AttributeArgListAst | undefined;
|
|
212
212
|
static cast(node: SyntaxNode): FieldAttributeAst | undefined;
|
|
@@ -214,7 +214,7 @@ declare class FieldAttributeAst implements AstNode {
|
|
|
214
214
|
declare class ModelAttributeAst implements AstNode {
|
|
215
215
|
readonly syntax: SyntaxNode;
|
|
216
216
|
constructor(syntax: SyntaxNode);
|
|
217
|
-
doubleAt():
|
|
217
|
+
doubleAt(): SyntaxToken | undefined;
|
|
218
218
|
name(): QualifiedNameAst | undefined;
|
|
219
219
|
argList(): AttributeArgListAst | undefined;
|
|
220
220
|
static cast(node: SyntaxNode): ModelAttributeAst | undefined;
|
|
@@ -229,9 +229,9 @@ declare class TypeAnnotationAst implements AstNode {
|
|
|
229
229
|
/** Present when the annotation is a constructor (`Vector(1536)`) rather than a plain reference. */
|
|
230
230
|
argList(): AttributeArgListAst | undefined;
|
|
231
231
|
isConstructor(): boolean;
|
|
232
|
-
lbracket():
|
|
233
|
-
rbracket():
|
|
234
|
-
questionMark():
|
|
232
|
+
lbracket(): SyntaxToken | undefined;
|
|
233
|
+
rbracket(): SyntaxToken | undefined;
|
|
234
|
+
questionMark(): SyntaxToken | undefined;
|
|
235
235
|
isList(): boolean;
|
|
236
236
|
isOptional(): boolean;
|
|
237
237
|
static cast(node: SyntaxNode): TypeAnnotationAst | undefined;
|
|
@@ -253,10 +253,10 @@ declare class DocumentAst implements AstNode {
|
|
|
253
253
|
declare class ModelDeclarationAst implements AstNode {
|
|
254
254
|
readonly syntax: SyntaxNode;
|
|
255
255
|
constructor(syntax: SyntaxNode);
|
|
256
|
-
keyword():
|
|
256
|
+
keyword(): SyntaxToken | undefined;
|
|
257
257
|
name(): IdentifierAst | undefined;
|
|
258
|
-
lbrace():
|
|
259
|
-
rbrace():
|
|
258
|
+
lbrace(): SyntaxToken | undefined;
|
|
259
|
+
rbrace(): SyntaxToken | undefined;
|
|
260
260
|
fields(): Iterable<FieldDeclarationAst>;
|
|
261
261
|
attributes(): Iterable<ModelAttributeAst>;
|
|
262
262
|
static cast(node: SyntaxNode): ModelDeclarationAst | undefined;
|
|
@@ -264,10 +264,10 @@ declare class ModelDeclarationAst implements AstNode {
|
|
|
264
264
|
declare class CompositeTypeDeclarationAst implements AstNode {
|
|
265
265
|
readonly syntax: SyntaxNode;
|
|
266
266
|
constructor(syntax: SyntaxNode);
|
|
267
|
-
keyword():
|
|
267
|
+
keyword(): SyntaxToken | undefined;
|
|
268
268
|
name(): IdentifierAst | undefined;
|
|
269
|
-
lbrace():
|
|
270
|
-
rbrace():
|
|
269
|
+
lbrace(): SyntaxToken | undefined;
|
|
270
|
+
rbrace(): SyntaxToken | undefined;
|
|
271
271
|
fields(): Iterable<FieldDeclarationAst>;
|
|
272
272
|
attributes(): Iterable<ModelAttributeAst>;
|
|
273
273
|
static cast(node: SyntaxNode): CompositeTypeDeclarationAst | undefined;
|
|
@@ -275,29 +275,29 @@ declare class CompositeTypeDeclarationAst implements AstNode {
|
|
|
275
275
|
declare class NamespaceDeclarationAst implements AstNode {
|
|
276
276
|
readonly syntax: SyntaxNode;
|
|
277
277
|
constructor(syntax: SyntaxNode);
|
|
278
|
-
keyword():
|
|
278
|
+
keyword(): SyntaxToken | undefined;
|
|
279
279
|
name(): IdentifierAst | undefined;
|
|
280
|
-
lbrace():
|
|
281
|
-
rbrace():
|
|
280
|
+
lbrace(): SyntaxToken | undefined;
|
|
281
|
+
rbrace(): SyntaxToken | undefined;
|
|
282
282
|
declarations(): Iterable<NamespaceMemberAst>;
|
|
283
283
|
static cast(node: SyntaxNode): NamespaceDeclarationAst | undefined;
|
|
284
284
|
}
|
|
285
285
|
declare class TypesBlockAst implements AstNode {
|
|
286
286
|
readonly syntax: SyntaxNode;
|
|
287
287
|
constructor(syntax: SyntaxNode);
|
|
288
|
-
keyword():
|
|
289
|
-
lbrace():
|
|
290
|
-
rbrace():
|
|
288
|
+
keyword(): SyntaxToken | undefined;
|
|
289
|
+
lbrace(): SyntaxToken | undefined;
|
|
290
|
+
rbrace(): SyntaxToken | undefined;
|
|
291
291
|
declarations(): Iterable<NamedTypeDeclarationAst>;
|
|
292
292
|
static cast(node: SyntaxNode): TypesBlockAst | undefined;
|
|
293
293
|
}
|
|
294
294
|
declare class GenericBlockDeclarationAst implements AstNode {
|
|
295
295
|
readonly syntax: SyntaxNode;
|
|
296
296
|
constructor(syntax: SyntaxNode);
|
|
297
|
-
keyword():
|
|
297
|
+
keyword(): SyntaxToken | undefined;
|
|
298
298
|
name(): IdentifierAst | undefined;
|
|
299
|
-
lbrace():
|
|
300
|
-
rbrace():
|
|
299
|
+
lbrace(): SyntaxToken | undefined;
|
|
300
|
+
rbrace(): SyntaxToken | undefined;
|
|
301
301
|
entries(): Iterable<KeyValuePairAst>;
|
|
302
302
|
attributes(): Iterable<ModelAttributeAst>;
|
|
303
303
|
static cast(node: SyntaxNode): GenericBlockDeclarationAst | undefined;
|
|
@@ -306,7 +306,7 @@ declare class KeyValuePairAst implements AstNode {
|
|
|
306
306
|
readonly syntax: SyntaxNode;
|
|
307
307
|
constructor(syntax: SyntaxNode);
|
|
308
308
|
key(): IdentifierAst | undefined;
|
|
309
|
-
equals():
|
|
309
|
+
equals(): SyntaxToken | undefined;
|
|
310
310
|
value(): ExpressionAst | undefined;
|
|
311
311
|
static cast(node: SyntaxNode): KeyValuePairAst | undefined;
|
|
312
312
|
}
|
|
@@ -322,7 +322,7 @@ declare class NamedTypeDeclarationAst implements AstNode {
|
|
|
322
322
|
readonly syntax: SyntaxNode;
|
|
323
323
|
constructor(syntax: SyntaxNode);
|
|
324
324
|
name(): IdentifierAst | undefined;
|
|
325
|
-
equals():
|
|
325
|
+
equals(): SyntaxToken | undefined;
|
|
326
326
|
typeAnnotation(): TypeAnnotationAst | undefined;
|
|
327
327
|
attributes(): Iterable<FieldAttributeAst>;
|
|
328
328
|
static cast(node: SyntaxNode): NamedTypeDeclarationAst | undefined;
|
|
@@ -346,4 +346,4 @@ interface ParseResult {
|
|
|
346
346
|
declare function parse(source: string): ParseResult;
|
|
347
347
|
//#endregion
|
|
348
348
|
export { AstNode as A, GreenNode as B, NumberLiteralExprAst as C, castExpression as D, StringLiteralExprAst as E, SyntaxElement as F, Position as G, greenNode as H, SyntaxNode as I, Range as K, SyntaxToken as L, findChildToken as M, findFirstChild as N, QualifiedNameAst as O, printSyntax as P, createSyntaxTree as R, FunctionCallAst as S, ObjectLiteralExprAst as T, greenToken as U, GreenToken as V, SyntaxKind as W, ModelAttributeAst as _, DocumentAst as a, BooleanLiteralExprAst as b, KeyValuePairAst as c, NamespaceDeclarationAst as d, NamespaceMemberAst as f, FieldAttributeAst as g, AttributeArgListAst as h, CompositeTypeDeclarationAst as i, filterChildren as j, IdentifierAst as k, ModelDeclarationAst as l, TypeAnnotationAst as m, ParseResult as n, FieldDeclarationAst as o, TypesBlockAst as p, SourceFile as q, parse as r, GenericBlockDeclarationAst as s, ParseDiagnostic as t, NamedTypeDeclarationAst as u, ArrayLiteralAst as v, ObjectFieldAst as w, ExpressionAst as x, AttributeArgAst as y, GreenElement as z };
|
|
349
|
-
//# sourceMappingURL=parse-
|
|
349
|
+
//# sourceMappingURL=parse-DX12Jvsh.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-DX12Jvsh.d.mts","names":[],"sources":["../src/source-file.ts","../src/syntax/syntax-kind.ts","../src/syntax/green.ts","../src/syntax/red.ts","../src/syntax/ast-helpers.ts","../src/syntax/ast/identifier.ts","../src/syntax/ast/qualified-name.ts","../src/syntax/ast/expressions.ts","../src/syntax/ast/attributes.ts","../src/syntax/ast/type-annotation.ts","../src/syntax/ast/declarations.ts","../src/parse.ts"],"mappings":";;;;UAEiB,QAAA;EAAA,SACN,IAAA;EAAA,SACA,SAAS;AAAA;AAAA,UAGH,KAAA;EAAA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cAEL,MAAA,EAAQ,UAAA;EAIpB,IAAA,IAAQ,aAAA;EAIR,cAAA,IAAkB,iBAAA;EAIjB,UAAA,IAAc,QAAA,CAAS,iBAAA;EAAA,OAIjB,IAAA,CAAK,IAAA,EAAM,UAAA,GAAa,mBAAA;AAAA;AAAA,cAKpB,uBAAA,YAAmC,OAAA;EAAA,SACrC,MAAA,EAAQ,UAAA;cAEL,MAAA,EAAQ,UAAA;EAIpB,IAAA,IAAQ,aAAA;EAIR,MAAA,IAAU,WAAA;EAIV,cAAA,IAAkB,iBAAA;EAIjB,UAAA,IAAc,QAAA,CAAS,iBAAA;EAAA,OAIjB,IAAA,CAAK,IAAA,EAAM,UAAA,GAAa,uBAAA;AAAA;;;UCnShB,eAAA;EAAA,SACN,IAAA,EAAM,iBAAA;EAAA,SACN,OAAA;EAAA,SACA,KAAA,EAAO,KAAK;AAAA;AAAA,UAGN,WAAA;EAAA,SACN,QAAA,EAAU,WAAA;EAAA,SACV,WAAA,WAAsB,eAAA;EAAA,SACtB,UAAA,EAAY,UAAA;AAAA;;;;;iBA6bP,KAAA,CAAM,MAAA,WAAiB,WAAW"}
|
package/dist/syntax.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AstNode, B as GreenNode, C as NumberLiteralExprAst, D as castExpression, E as StringLiteralExprAst, F as SyntaxElement, G as Position, H as greenNode, I as SyntaxNode, K as Range, L as SyntaxToken, M as findChildToken, N as findFirstChild, O as QualifiedNameAst, P as printSyntax, R as createSyntaxTree, S as FunctionCallAst, T as ObjectLiteralExprAst, U as greenToken, V as GreenToken, W as SyntaxKind, _ as ModelAttributeAst, a as DocumentAst, b as BooleanLiteralExprAst, c as KeyValuePairAst, d as NamespaceDeclarationAst, f as NamespaceMemberAst, g as FieldAttributeAst, h as AttributeArgListAst, i as CompositeTypeDeclarationAst, j as filterChildren, k as IdentifierAst, l as ModelDeclarationAst, m as TypeAnnotationAst, n as ParseResult, o as FieldDeclarationAst, p as TypesBlockAst, q as SourceFile, r as parse, s as GenericBlockDeclarationAst, t as ParseDiagnostic, u as NamedTypeDeclarationAst, v as ArrayLiteralAst, w as ObjectFieldAst, x as ExpressionAst, y as AttributeArgAst, z as GreenElement } from "./parse-
|
|
1
|
+
import { A as AstNode, B as GreenNode, C as NumberLiteralExprAst, D as castExpression, E as StringLiteralExprAst, F as SyntaxElement, G as Position, H as greenNode, I as SyntaxNode, K as Range, L as SyntaxToken, M as findChildToken, N as findFirstChild, O as QualifiedNameAst, P as printSyntax, R as createSyntaxTree, S as FunctionCallAst, T as ObjectLiteralExprAst, U as greenToken, V as GreenToken, W as SyntaxKind, _ as ModelAttributeAst, a as DocumentAst, b as BooleanLiteralExprAst, c as KeyValuePairAst, d as NamespaceDeclarationAst, f as NamespaceMemberAst, g as FieldAttributeAst, h as AttributeArgListAst, i as CompositeTypeDeclarationAst, j as filterChildren, k as IdentifierAst, l as ModelDeclarationAst, m as TypeAnnotationAst, n as ParseResult, o as FieldDeclarationAst, p as TypesBlockAst, q as SourceFile, r as parse, s as GenericBlockDeclarationAst, t as ParseDiagnostic, u as NamedTypeDeclarationAst, v as ArrayLiteralAst, w as ObjectFieldAst, x as ExpressionAst, y as AttributeArgAst, z as GreenElement } from "./parse-DX12Jvsh.mjs";
|
|
2
2
|
import { n as TokenKind } from "./tokenizer-DcYI0Xrq.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/syntax/green-builder.d.ts
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/psl-parser",
|
|
3
|
-
"version": "0.14.0-dev.
|
|
3
|
+
"version": "0.14.0-dev.20",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"description": "Reusable parser for Prisma Schema Language (PSL)",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@prisma-next/framework-components": "0.14.0-dev.
|
|
10
|
-
"@prisma-next/utils": "0.14.0-dev.
|
|
9
|
+
"@prisma-next/framework-components": "0.14.0-dev.20",
|
|
10
|
+
"@prisma-next/utils": "0.14.0-dev.20"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@prisma-next/tsconfig": "0.14.0-dev.
|
|
14
|
-
"@prisma-next/tsdown": "0.14.0-dev.
|
|
13
|
+
"@prisma-next/tsconfig": "0.14.0-dev.20",
|
|
14
|
+
"@prisma-next/tsdown": "0.14.0-dev.20",
|
|
15
15
|
"tsdown": "0.22.1",
|
|
16
16
|
"typescript": "5.9.3",
|
|
17
17
|
"vitest": "4.1.8"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Token } from '../../tokenizer';
|
|
2
1
|
import type { AstNode } from '../ast-helpers';
|
|
3
2
|
import { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';
|
|
4
|
-
import type { SyntaxNode } from '../red';
|
|
3
|
+
import type { SyntaxNode, SyntaxToken } from '../red';
|
|
5
4
|
import { AttributeArgAst } from './expressions';
|
|
6
5
|
import { QualifiedNameAst } from './qualified-name';
|
|
7
6
|
|
|
@@ -12,11 +11,11 @@ export class AttributeArgListAst implements AstNode {
|
|
|
12
11
|
this.syntax = syntax;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
lparen():
|
|
14
|
+
lparen(): SyntaxToken | undefined {
|
|
16
15
|
return findChildToken(this.syntax, 'LParen');
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
rparen():
|
|
18
|
+
rparen(): SyntaxToken | undefined {
|
|
20
19
|
return findChildToken(this.syntax, 'RParen');
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -36,7 +35,7 @@ export class FieldAttributeAst implements AstNode {
|
|
|
36
35
|
this.syntax = syntax;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
at():
|
|
38
|
+
at(): SyntaxToken | undefined {
|
|
40
39
|
return findChildToken(this.syntax, 'At');
|
|
41
40
|
}
|
|
42
41
|
|
|
@@ -60,7 +59,7 @@ export class ModelAttributeAst implements AstNode {
|
|
|
60
59
|
this.syntax = syntax;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
doubleAt():
|
|
62
|
+
doubleAt(): SyntaxToken | undefined {
|
|
64
63
|
return findChildToken(this.syntax, 'DoubleAt');
|
|
65
64
|
}
|
|
66
65
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Token } from '../../tokenizer';
|
|
2
1
|
import type { AstNode } from '../ast-helpers';
|
|
3
2
|
import { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';
|
|
4
|
-
import { SyntaxNode } from '../red';
|
|
3
|
+
import { SyntaxNode, type SyntaxToken } from '../red';
|
|
5
4
|
import { FieldAttributeAst, ModelAttributeAst } from './attributes';
|
|
6
5
|
import type { ExpressionAst } from './expressions';
|
|
7
6
|
import { castExpression } from './expressions';
|
|
@@ -53,7 +52,7 @@ export class ModelDeclarationAst implements AstNode {
|
|
|
53
52
|
this.syntax = syntax;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
keyword():
|
|
55
|
+
keyword(): SyntaxToken | undefined {
|
|
57
56
|
return findChildToken(this.syntax, 'Ident');
|
|
58
57
|
}
|
|
59
58
|
|
|
@@ -61,11 +60,11 @@ export class ModelDeclarationAst implements AstNode {
|
|
|
61
60
|
return findFirstChild(this.syntax, IdentifierAst.cast);
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
lbrace():
|
|
63
|
+
lbrace(): SyntaxToken | undefined {
|
|
65
64
|
return findChildToken(this.syntax, 'LBrace');
|
|
66
65
|
}
|
|
67
66
|
|
|
68
|
-
rbrace():
|
|
67
|
+
rbrace(): SyntaxToken | undefined {
|
|
69
68
|
return findChildToken(this.syntax, 'RBrace');
|
|
70
69
|
}
|
|
71
70
|
|
|
@@ -89,7 +88,7 @@ export class CompositeTypeDeclarationAst implements AstNode {
|
|
|
89
88
|
this.syntax = syntax;
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
keyword():
|
|
91
|
+
keyword(): SyntaxToken | undefined {
|
|
93
92
|
return findChildToken(this.syntax, 'Ident');
|
|
94
93
|
}
|
|
95
94
|
|
|
@@ -97,11 +96,11 @@ export class CompositeTypeDeclarationAst implements AstNode {
|
|
|
97
96
|
return findFirstChild(this.syntax, IdentifierAst.cast);
|
|
98
97
|
}
|
|
99
98
|
|
|
100
|
-
lbrace():
|
|
99
|
+
lbrace(): SyntaxToken | undefined {
|
|
101
100
|
return findChildToken(this.syntax, 'LBrace');
|
|
102
101
|
}
|
|
103
102
|
|
|
104
|
-
rbrace():
|
|
103
|
+
rbrace(): SyntaxToken | undefined {
|
|
105
104
|
return findChildToken(this.syntax, 'RBrace');
|
|
106
105
|
}
|
|
107
106
|
|
|
@@ -127,7 +126,7 @@ export class NamespaceDeclarationAst implements AstNode {
|
|
|
127
126
|
this.syntax = syntax;
|
|
128
127
|
}
|
|
129
128
|
|
|
130
|
-
keyword():
|
|
129
|
+
keyword(): SyntaxToken | undefined {
|
|
131
130
|
return findChildToken(this.syntax, 'Ident');
|
|
132
131
|
}
|
|
133
132
|
|
|
@@ -135,11 +134,11 @@ export class NamespaceDeclarationAst implements AstNode {
|
|
|
135
134
|
return findFirstChild(this.syntax, IdentifierAst.cast);
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
lbrace():
|
|
137
|
+
lbrace(): SyntaxToken | undefined {
|
|
139
138
|
return findChildToken(this.syntax, 'LBrace');
|
|
140
139
|
}
|
|
141
140
|
|
|
142
|
-
rbrace():
|
|
141
|
+
rbrace(): SyntaxToken | undefined {
|
|
143
142
|
return findChildToken(this.syntax, 'RBrace');
|
|
144
143
|
}
|
|
145
144
|
|
|
@@ -159,15 +158,15 @@ export class TypesBlockAst implements AstNode {
|
|
|
159
158
|
this.syntax = syntax;
|
|
160
159
|
}
|
|
161
160
|
|
|
162
|
-
keyword():
|
|
161
|
+
keyword(): SyntaxToken | undefined {
|
|
163
162
|
return findChildToken(this.syntax, 'Ident');
|
|
164
163
|
}
|
|
165
164
|
|
|
166
|
-
lbrace():
|
|
165
|
+
lbrace(): SyntaxToken | undefined {
|
|
167
166
|
return findChildToken(this.syntax, 'LBrace');
|
|
168
167
|
}
|
|
169
168
|
|
|
170
|
-
rbrace():
|
|
169
|
+
rbrace(): SyntaxToken | undefined {
|
|
171
170
|
return findChildToken(this.syntax, 'RBrace');
|
|
172
171
|
}
|
|
173
172
|
|
|
@@ -187,7 +186,7 @@ export class GenericBlockDeclarationAst implements AstNode {
|
|
|
187
186
|
this.syntax = syntax;
|
|
188
187
|
}
|
|
189
188
|
|
|
190
|
-
keyword():
|
|
189
|
+
keyword(): SyntaxToken | undefined {
|
|
191
190
|
return findChildToken(this.syntax, 'Ident');
|
|
192
191
|
}
|
|
193
192
|
|
|
@@ -195,11 +194,11 @@ export class GenericBlockDeclarationAst implements AstNode {
|
|
|
195
194
|
return findFirstChild(this.syntax, IdentifierAst.cast);
|
|
196
195
|
}
|
|
197
196
|
|
|
198
|
-
lbrace():
|
|
197
|
+
lbrace(): SyntaxToken | undefined {
|
|
199
198
|
return findChildToken(this.syntax, 'LBrace');
|
|
200
199
|
}
|
|
201
200
|
|
|
202
|
-
rbrace():
|
|
201
|
+
rbrace(): SyntaxToken | undefined {
|
|
203
202
|
return findChildToken(this.syntax, 'RBrace');
|
|
204
203
|
}
|
|
205
204
|
|
|
@@ -229,7 +228,7 @@ export class KeyValuePairAst implements AstNode {
|
|
|
229
228
|
return findFirstChild(this.syntax, IdentifierAst.cast);
|
|
230
229
|
}
|
|
231
230
|
|
|
232
|
-
equals():
|
|
231
|
+
equals(): SyntaxToken | undefined {
|
|
233
232
|
return findChildToken(this.syntax, 'Equals');
|
|
234
233
|
}
|
|
235
234
|
|
|
@@ -288,7 +287,7 @@ export class NamedTypeDeclarationAst implements AstNode {
|
|
|
288
287
|
return findFirstChild(this.syntax, IdentifierAst.cast);
|
|
289
288
|
}
|
|
290
289
|
|
|
291
|
-
equals():
|
|
290
|
+
equals(): SyntaxToken | undefined {
|
|
292
291
|
return findChildToken(this.syntax, 'Equals');
|
|
293
292
|
}
|
|
294
293
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Token } from '../../tokenizer';
|
|
2
1
|
import type { AstNode } from '../ast-helpers';
|
|
3
2
|
import { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';
|
|
4
|
-
import { SyntaxNode } from '../red';
|
|
3
|
+
import { SyntaxNode, type SyntaxToken } from '../red';
|
|
5
4
|
import { IdentifierAst } from './identifier';
|
|
6
5
|
import { QualifiedNameAst } from './qualified-name';
|
|
7
6
|
|
|
@@ -32,11 +31,11 @@ export class FunctionCallAst implements AstNode {
|
|
|
32
31
|
return segments;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
lparen():
|
|
34
|
+
lparen(): SyntaxToken | undefined {
|
|
36
35
|
return findChildToken(this.syntax, 'LParen');
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
rparen():
|
|
38
|
+
rparen(): SyntaxToken | undefined {
|
|
40
39
|
return findChildToken(this.syntax, 'RParen');
|
|
41
40
|
}
|
|
42
41
|
|
|
@@ -56,11 +55,11 @@ export class ArrayLiteralAst implements AstNode {
|
|
|
56
55
|
this.syntax = syntax;
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
lbracket():
|
|
58
|
+
lbracket(): SyntaxToken | undefined {
|
|
60
59
|
return findChildToken(this.syntax, 'LBracket');
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
rbracket():
|
|
62
|
+
rbracket(): SyntaxToken | undefined {
|
|
64
63
|
return findChildToken(this.syntax, 'RBracket');
|
|
65
64
|
}
|
|
66
65
|
|
|
@@ -156,7 +155,7 @@ export class StringLiteralExprAst implements AstNode {
|
|
|
156
155
|
this.syntax = syntax;
|
|
157
156
|
}
|
|
158
157
|
|
|
159
|
-
token():
|
|
158
|
+
token(): SyntaxToken | undefined {
|
|
160
159
|
return findChildToken(this.syntax, 'StringLiteral');
|
|
161
160
|
}
|
|
162
161
|
|
|
@@ -178,7 +177,7 @@ export class NumberLiteralExprAst implements AstNode {
|
|
|
178
177
|
this.syntax = syntax;
|
|
179
178
|
}
|
|
180
179
|
|
|
181
|
-
token():
|
|
180
|
+
token(): SyntaxToken | undefined {
|
|
182
181
|
return findChildToken(this.syntax, 'NumberLiteral');
|
|
183
182
|
}
|
|
184
183
|
|
|
@@ -200,7 +199,7 @@ export class BooleanLiteralExprAst implements AstNode {
|
|
|
200
199
|
this.syntax = syntax;
|
|
201
200
|
}
|
|
202
201
|
|
|
203
|
-
token():
|
|
202
|
+
token(): SyntaxToken | undefined {
|
|
204
203
|
return findChildToken(this.syntax, 'Ident');
|
|
205
204
|
}
|
|
206
205
|
|
|
@@ -224,11 +223,11 @@ export class ObjectLiteralExprAst implements AstNode {
|
|
|
224
223
|
this.syntax = syntax;
|
|
225
224
|
}
|
|
226
225
|
|
|
227
|
-
lbrace():
|
|
226
|
+
lbrace(): SyntaxToken | undefined {
|
|
228
227
|
return findChildToken(this.syntax, 'LBrace');
|
|
229
228
|
}
|
|
230
229
|
|
|
231
|
-
rbrace():
|
|
230
|
+
rbrace(): SyntaxToken | undefined {
|
|
232
231
|
return findChildToken(this.syntax, 'RBrace');
|
|
233
232
|
}
|
|
234
233
|
|
|
@@ -279,7 +278,7 @@ export class ObjectFieldAst implements AstNode {
|
|
|
279
278
|
return undefined;
|
|
280
279
|
}
|
|
281
280
|
|
|
282
|
-
colon():
|
|
281
|
+
colon(): SyntaxToken | undefined {
|
|
283
282
|
return findChildToken(this.syntax, 'Colon');
|
|
284
283
|
}
|
|
285
284
|
|
|
@@ -339,7 +338,7 @@ export class AttributeArgAst implements AstNode {
|
|
|
339
338
|
return findFirstChild(this.syntax, IdentifierAst.cast);
|
|
340
339
|
}
|
|
341
340
|
|
|
342
|
-
colon():
|
|
341
|
+
colon(): SyntaxToken | undefined {
|
|
343
342
|
return findChildToken(this.syntax, 'Colon');
|
|
344
343
|
}
|
|
345
344
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Token } from '../../tokenizer';
|
|
2
1
|
import type { AstNode } from '../ast-helpers';
|
|
3
2
|
import { findChildToken } from '../ast-helpers';
|
|
4
|
-
import type { SyntaxNode } from '../red';
|
|
3
|
+
import type { SyntaxNode, SyntaxToken } from '../red';
|
|
5
4
|
|
|
6
5
|
export class IdentifierAst implements AstNode {
|
|
7
6
|
readonly syntax: SyntaxNode;
|
|
@@ -10,7 +9,7 @@ export class IdentifierAst implements AstNode {
|
|
|
10
9
|
this.syntax = syntax;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
token():
|
|
12
|
+
token(): SyntaxToken | undefined {
|
|
14
13
|
return findChildToken(this.syntax, 'Ident');
|
|
15
14
|
}
|
|
16
15
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Token } from '../../tokenizer';
|
|
2
1
|
import type { AstNode } from '../ast-helpers';
|
|
3
2
|
import { filterChildren, findChildToken, findFirstChild } from '../ast-helpers';
|
|
4
|
-
import { SyntaxNode } from '../red';
|
|
3
|
+
import { SyntaxNode, type SyntaxToken } from '../red';
|
|
5
4
|
import { IdentifierAst } from './identifier';
|
|
6
5
|
|
|
7
6
|
/** A namespace-qualified name, e.g. `pgvector.Vector` or `supabase:auth.User`. */
|
|
@@ -38,11 +37,11 @@ export class QualifiedNameAst implements AstNode {
|
|
|
38
37
|
return count;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
colon():
|
|
40
|
+
colon(): SyntaxToken | undefined {
|
|
42
41
|
return findChildToken(this.syntax, 'Colon');
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
dot():
|
|
44
|
+
dot(): SyntaxToken | undefined {
|
|
46
45
|
return findChildToken(this.syntax, 'Dot');
|
|
47
46
|
}
|
|
48
47
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Token } from '../../tokenizer';
|
|
2
1
|
import type { AstNode } from '../ast-helpers';
|
|
3
2
|
import { findChildToken, findFirstChild } from '../ast-helpers';
|
|
4
|
-
import type { SyntaxNode } from '../red';
|
|
3
|
+
import type { SyntaxNode, SyntaxToken } from '../red';
|
|
5
4
|
import { AttributeArgListAst } from './attributes';
|
|
6
5
|
import { QualifiedNameAst } from './qualified-name';
|
|
7
6
|
|
|
@@ -26,15 +25,15 @@ export class TypeAnnotationAst implements AstNode {
|
|
|
26
25
|
return this.argList() !== undefined;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
lbracket():
|
|
28
|
+
lbracket(): SyntaxToken | undefined {
|
|
30
29
|
return findChildToken(this.syntax, 'LBracket');
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
rbracket():
|
|
32
|
+
rbracket(): SyntaxToken | undefined {
|
|
34
33
|
return findChildToken(this.syntax, 'RBracket');
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
questionMark():
|
|
36
|
+
questionMark(): SyntaxToken | undefined {
|
|
38
37
|
return findChildToken(this.syntax, 'Question');
|
|
39
38
|
}
|
|
40
39
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { SyntaxNode } from './red';
|
|
1
|
+
import type { TokenKind } from '../tokenizer';
|
|
2
|
+
import { SyntaxNode, type SyntaxToken } from './red';
|
|
3
3
|
|
|
4
4
|
export interface AstNode {
|
|
5
5
|
readonly syntax: SyntaxNode;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export function findChildToken(node: SyntaxNode, kind: TokenKind):
|
|
8
|
+
export function findChildToken(node: SyntaxNode, kind: TokenKind): SyntaxToken | undefined {
|
|
9
9
|
for (const child of node.children()) {
|
|
10
10
|
if (!(child instanceof SyntaxNode) && child.kind === kind) {
|
|
11
11
|
return child;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-BjZ1LPe6.d.mts","names":[],"sources":["../src/source-file.ts","../src/syntax/syntax-kind.ts","../src/syntax/green.ts","../src/syntax/red.ts","../src/syntax/ast-helpers.ts","../src/syntax/ast/identifier.ts","../src/syntax/ast/qualified-name.ts","../src/syntax/ast/expressions.ts","../src/syntax/ast/attributes.ts","../src/syntax/ast/type-annotation.ts","../src/syntax/ast/declarations.ts","../src/parse.ts"],"mappings":";;;;UAEiB,QAAA;EAAA,SACN,IAAA;EAAA,SACA,SAAS;AAAA;AAAA,UAGH,KAAA;EAAA,SACN,KAAA,EAAO,QAAA;EAAA,SACP,GAAA,EAAK,QAAQ;AAAA;AAAA,cAGX,UAAA;EAAA;cAIC,IAAA;EAAA,IAWR,IAAA;EAAA,IAIA,MAAA;EAAA,IAIA,SAAA;EAIJ,gBAAA;EAIA,UAAA,CAAW,MAAA,WAAiB,QAAA;EAM5B,QAAA,CAAS,QAAA,EAAU,QAAQ;AAAA;;;KCjDjB,UAAA;;;UCGK,UAAA;EAAA,SACN,IAAA;EAAA,SACA,IAAA,EAAM,SAAS;EAAA,SACf,IAAA;AAAA;AAAA,UAGM,SAAA;EAAA,SACN,IAAA;EAAA,SACA,IAAA,EAAM,UAAA;EAAA,SACN,QAAA,EAAU,aAAA,CAAc,YAAA;EAAA,SACxB,UAAA;AAAA;AAAA,KAGC,YAAA,GAAe,SAAA,GAAY,UAAU;AAAA,iBAEjC,UAAA,CAAW,IAAA,EAAM,SAAA,EAAW,IAAA,WAAe,UAAU;AAAA,iBAIrD,SAAA,CAAU,IAAA,EAAM,UAAA,EAAY,QAAA,EAAU,aAAA,CAAc,YAAA,IAAgB,SAAA;;;;AFpBpF;;;;UGOiB,WAAA,SAAoB,KAAK;EAAA,SAC/B,MAAM;AAAA;AAAA,KAGL,aAAA,GAAgB,UAAA,GAAa,WAAW;AAAA,cAEvC,UAAA;EAAA,SACF,KAAA,EAAO,SAAA;EAAA,SACP,MAAA;EAAA,SACA,MAAA,EAAQ,UAAA;cAEL,KAAA,EAAO,SAAA,EAAW,MAAA,UAAgB,MAAA,EAAQ,UAAA;EAAA,IAMlD,IAAA,IAAQ,UAAA;E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