@prisma-next/psl-parser 0.14.0-dev.6 → 0.14.0-dev.60
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 → declarations-DR6To8_k.mjs} +295 -55
- package/dist/declarations-DR6To8_k.mjs.map +1 -0
- package/dist/format.d.mts +1 -1
- package/dist/format.mjs +2 -2
- package/dist/index.d.mts +95 -112
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +373 -60
- package/dist/index.mjs.map +1 -1
- package/dist/interpret.d.mts +29 -0
- package/dist/interpret.d.mts.map +1 -0
- package/dist/interpret.mjs +9 -0
- package/dist/interpret.mjs.map +1 -0
- package/dist/{parse-DhEV6av6.mjs → parse-3-vr14ej.mjs} +26 -5
- package/dist/parse-3-vr14ej.mjs.map +1 -0
- package/dist/{parse-BjZ1LPe6.d.mts → parse-BazJr7Ye.d.mts} +128 -51
- package/dist/parse-BazJr7Ye.d.mts.map +1 -0
- package/dist/symbol-table-C-AH04Ug.d.mts +127 -0
- package/dist/symbol-table-C-AH04Ug.d.mts.map +1 -0
- package/dist/syntax.d.mts +20 -2
- package/dist/syntax.d.mts.map +1 -1
- package/dist/syntax.mjs +43 -3
- package/dist/syntax.mjs.map +1 -0
- package/package.json +7 -5
- package/src/attribute-spec/combinators/bool.ts +19 -0
- package/src/attribute-spec/combinators/diagnostic.ts +15 -0
- package/src/attribute-spec/combinators/entity-ref.ts +24 -0
- package/src/attribute-spec/combinators/field-ref.ts +36 -0
- package/src/attribute-spec/combinators/identifier.ts +16 -0
- package/src/attribute-spec/combinators/int.ts +19 -0
- package/src/attribute-spec/combinators/list.ts +43 -0
- package/src/attribute-spec/combinators/one-of.ts +29 -0
- package/src/attribute-spec/combinators/record.ts +43 -0
- package/src/attribute-spec/combinators/str.ts +19 -0
- package/src/attribute-spec/field-attribute.ts +27 -0
- package/src/attribute-spec/interpret.ts +154 -0
- package/src/attribute-spec/model-attribute.ts +27 -0
- package/src/attribute-spec/optional.ts +8 -0
- package/src/attribute-spec/types.ts +72 -0
- package/src/exports/index.ts +30 -0
- package/src/exports/interpret.ts +2 -0
- package/src/exports/syntax.ts +25 -5
- package/src/interpret.ts +40 -0
- package/src/parse.ts +23 -5
- package/src/resolve.ts +4 -1
- package/src/source-file.ts +25 -0
- package/src/syntax/ast/attributes.ts +5 -6
- package/src/syntax/ast/declarations.ts +51 -26
- package/src/syntax/ast/expressions.ts +12 -13
- package/src/syntax/ast/identifier.ts +2 -3
- package/src/syntax/ast/qualified-name.ts +28 -19
- package/src/syntax/ast/type-annotation.ts +4 -5
- package/src/syntax/ast-helpers.ts +27 -3
- package/src/syntax/navigation.ts +55 -0
- package/src/syntax/red.ts +317 -42
- package/dist/declarations-D9h_ihD3.mjs.map +0 -1
- package/dist/parse-BjZ1LPe6.d.mts.map +0 -1
- package/dist/parse-DhEV6av6.mjs.map +0 -1
|
@@ -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,16 @@
|
|
|
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
|
|
8
|
+
export interface BracedBlock extends AstNode {
|
|
9
|
+
lbrace(): SyntaxToken | undefined;
|
|
10
|
+
rbrace(): SyntaxToken | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function findChildToken(node: SyntaxNode, kind: TokenKind): SyntaxToken | undefined {
|
|
9
14
|
for (const child of node.children()) {
|
|
10
15
|
if (!(child instanceof SyntaxNode) && child.kind === kind) {
|
|
11
16
|
return child;
|
|
@@ -35,6 +40,25 @@ export function* filterChildren<T>(
|
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
|
|
43
|
+
type CastTarget<C> = C extends (node: SyntaxNode) => infer R ? Exclude<R, undefined> : never;
|
|
44
|
+
|
|
45
|
+
export function any<Casts extends readonly ((node: SyntaxNode) => unknown)[]>(
|
|
46
|
+
...casts: Casts
|
|
47
|
+
): (node: SyntaxNode) => CastTarget<Casts[number]> | undefined;
|
|
48
|
+
export function any(
|
|
49
|
+
...casts: ReadonlyArray<(node: SyntaxNode) => unknown>
|
|
50
|
+
): (node: SyntaxNode) => unknown {
|
|
51
|
+
return (node) => {
|
|
52
|
+
for (const cast of casts) {
|
|
53
|
+
const result = cast(node);
|
|
54
|
+
if (result !== undefined) {
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
38
62
|
/**
|
|
39
63
|
* Raw source text of a CST node, verbatim (quotes and brackets preserved). For
|
|
40
64
|
* the decoded value of a string literal, decode it instead.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { TokenKind } from '../tokenizer';
|
|
2
|
+
import { type SyntaxElement, SyntaxToken } from './red';
|
|
3
|
+
|
|
4
|
+
/** Direction of a sibling/token walk. */
|
|
5
|
+
export type Direction = 'next' | 'prev';
|
|
6
|
+
|
|
7
|
+
const TRIVIA_KINDS: ReadonlySet<TokenKind> = new Set<TokenKind>([
|
|
8
|
+
'Whitespace',
|
|
9
|
+
'Newline',
|
|
10
|
+
'Comment',
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
/** Whether a token kind is trivia (whitespace, newline, or comment). */
|
|
14
|
+
export function isTriviaKind(kind: TokenKind): boolean {
|
|
15
|
+
return TRIVIA_KINDS.has(kind);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Whether a token is trivia. */
|
|
19
|
+
export function isTrivia(token: SyntaxToken): boolean {
|
|
20
|
+
return isTriviaKind(token.kind);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The first non-trivia token at or beyond `token` in `direction`. Returns
|
|
25
|
+
* `token` itself when it is already significant.
|
|
26
|
+
*/
|
|
27
|
+
export function skipTriviaToken(token: SyntaxToken, direction: Direction): SyntaxToken | undefined {
|
|
28
|
+
let current: SyntaxToken | undefined = token;
|
|
29
|
+
while (current !== undefined && isTrivia(current)) {
|
|
30
|
+
current = direction === 'next' ? current.nextToken : current.prevToken;
|
|
31
|
+
}
|
|
32
|
+
return current;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The nearest sibling of `element` (within the same parent) in `direction` that
|
|
37
|
+
* is not a trivia token. Nodes are always significant.
|
|
38
|
+
*/
|
|
39
|
+
export function nonTriviaSibling(
|
|
40
|
+
element: SyntaxElement,
|
|
41
|
+
direction: Direction,
|
|
42
|
+
): SyntaxElement | undefined {
|
|
43
|
+
let sibling = step(element, direction);
|
|
44
|
+
while (sibling !== undefined) {
|
|
45
|
+
if (!(sibling instanceof SyntaxToken) || !isTrivia(sibling)) {
|
|
46
|
+
return sibling;
|
|
47
|
+
}
|
|
48
|
+
sibling = step(sibling, direction);
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function step(element: SyntaxElement, direction: Direction): SyntaxElement | undefined {
|
|
54
|
+
return direction === 'next' ? element.nextSiblingOrToken : element.prevSiblingOrToken;
|
|
55
|
+
}
|
package/src/syntax/red.ts
CHANGED
|
@@ -1,27 +1,154 @@
|
|
|
1
|
-
import type { Token } from '../tokenizer';
|
|
2
|
-
import type { GreenElement, GreenNode } from './green';
|
|
1
|
+
import type { Token, TokenKind } from '../tokenizer';
|
|
2
|
+
import type { GreenElement, GreenNode, GreenToken } from './green';
|
|
3
3
|
import type { SyntaxKind } from './syntax-kind';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A token in the red tree. Unlike the green-layer {@link Token} (kind + text
|
|
7
|
-
* only), a red token also carries its absolute `offset` within the source
|
|
8
|
-
*
|
|
7
|
+
* only), a red token also carries its absolute `offset` within the source and a
|
|
8
|
+
* link back to its `parent` {@link SyntaxNode}, so a cursor anchored on a token
|
|
9
|
+
* can walk outward (parent, previous/next token, siblings) without re-scanning
|
|
10
|
+
* from the document root.
|
|
9
11
|
*/
|
|
10
|
-
export
|
|
12
|
+
export class SyntaxToken implements Token {
|
|
13
|
+
readonly green: GreenToken;
|
|
14
|
+
readonly kind: TokenKind;
|
|
15
|
+
readonly text: string;
|
|
11
16
|
readonly offset: number;
|
|
17
|
+
readonly parent: SyntaxNode;
|
|
18
|
+
/** Position within the parent's children, enabling O(1) sibling navigation without rescanning the green layer. */
|
|
19
|
+
readonly index: number;
|
|
20
|
+
|
|
21
|
+
constructor(green: GreenToken, offset: number, parent: SyntaxNode, index: number) {
|
|
22
|
+
this.green = green;
|
|
23
|
+
this.kind = green.kind;
|
|
24
|
+
this.text = green.text;
|
|
25
|
+
this.offset = offset;
|
|
26
|
+
this.parent = parent;
|
|
27
|
+
this.index = index;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get textLength(): number {
|
|
31
|
+
return this.text.length;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get endOffset(): number {
|
|
35
|
+
return this.offset + this.textLength;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Whether `offset` falls within this token, inclusive of both ends. */
|
|
39
|
+
isInside(offset: number): boolean {
|
|
40
|
+
return offset >= this.offset && offset <= this.endOffset;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
isOutside(offset: number): boolean {
|
|
44
|
+
return !this.isInside(offset);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The sibling element immediately after this token within its parent. */
|
|
48
|
+
get nextSiblingOrToken(): SyntaxElement | undefined {
|
|
49
|
+
return childAt(this.parent, this.index + 1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The sibling element immediately before this token within its parent. */
|
|
53
|
+
get prevSiblingOrToken(): SyntaxElement | undefined {
|
|
54
|
+
return childAt(this.parent, this.index - 1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The next token in document order, crossing node boundaries. */
|
|
58
|
+
get nextToken(): SyntaxToken | undefined {
|
|
59
|
+
for (let el = climbingNext(this); el !== undefined; el = climbingNext(el)) {
|
|
60
|
+
const token = firstToken(el);
|
|
61
|
+
if (token !== undefined) return token;
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The previous token in document order, crossing node boundaries. */
|
|
67
|
+
get prevToken(): SyntaxToken | undefined {
|
|
68
|
+
for (let el = climbingPrev(this); el !== undefined; el = climbingPrev(el)) {
|
|
69
|
+
const token = lastToken(el);
|
|
70
|
+
if (token !== undefined) return token;
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
12
74
|
}
|
|
13
75
|
|
|
14
76
|
export type SyntaxElement = SyntaxNode | SyntaxToken;
|
|
15
77
|
|
|
78
|
+
/**
|
|
79
|
+
* The result of {@link SyntaxNode.tokenAtOffset}: an offset can fall outside
|
|
80
|
+
* every token (`none`), strictly inside a single token (`single`), or exactly on
|
|
81
|
+
* the seam between two adjacent tokens (`between`). `leftBiased` / `rightBiased`
|
|
82
|
+
* collapse the seam case to one side; for `single` both return the same token,
|
|
83
|
+
* for `none` both return `undefined`.
|
|
84
|
+
*/
|
|
85
|
+
type TokenAtOffsetState =
|
|
86
|
+
| { readonly kind: 'none' }
|
|
87
|
+
| { readonly kind: 'single'; readonly token: SyntaxToken }
|
|
88
|
+
| { readonly kind: 'between'; readonly left: SyntaxToken; readonly right: SyntaxToken };
|
|
89
|
+
|
|
90
|
+
export class TokenAtOffset {
|
|
91
|
+
readonly #state: TokenAtOffsetState;
|
|
92
|
+
|
|
93
|
+
private constructor(state: TokenAtOffsetState) {
|
|
94
|
+
this.#state = state;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static none(): TokenAtOffset {
|
|
98
|
+
return new TokenAtOffset({ kind: 'none' });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
static single(token: SyntaxToken): TokenAtOffset {
|
|
102
|
+
return new TokenAtOffset({ kind: 'single', token });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static between(left: SyntaxToken, right: SyntaxToken): TokenAtOffset {
|
|
106
|
+
return new TokenAtOffset({ kind: 'between', left, right });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
get isEmpty(): boolean {
|
|
110
|
+
return this.#state.kind === 'none';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
get isBetween(): boolean {
|
|
114
|
+
return this.#state.kind === 'between';
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
leftBiased(): SyntaxToken | undefined {
|
|
118
|
+
switch (this.#state.kind) {
|
|
119
|
+
case 'none':
|
|
120
|
+
return undefined;
|
|
121
|
+
case 'single':
|
|
122
|
+
return this.#state.token;
|
|
123
|
+
case 'between':
|
|
124
|
+
return this.#state.left;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
rightBiased(): SyntaxToken | undefined {
|
|
129
|
+
switch (this.#state.kind) {
|
|
130
|
+
case 'none':
|
|
131
|
+
return undefined;
|
|
132
|
+
case 'single':
|
|
133
|
+
return this.#state.token;
|
|
134
|
+
case 'between':
|
|
135
|
+
return this.#state.right;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
16
140
|
export class SyntaxNode {
|
|
17
141
|
readonly green: GreenNode;
|
|
18
142
|
readonly offset: number;
|
|
19
143
|
readonly parent: SyntaxNode | undefined;
|
|
144
|
+
/** Position within the parent's children, enabling O(1) sibling navigation without rescanning the green layer. */
|
|
145
|
+
readonly index: number;
|
|
20
146
|
|
|
21
|
-
constructor(green: GreenNode, offset: number, parent: SyntaxNode | undefined) {
|
|
147
|
+
constructor(green: GreenNode, offset: number, parent: SyntaxNode | undefined, index: number) {
|
|
22
148
|
this.green = green;
|
|
23
149
|
this.offset = offset;
|
|
24
150
|
this.parent = parent;
|
|
151
|
+
this.index = index;
|
|
25
152
|
}
|
|
26
153
|
|
|
27
154
|
get kind(): SyntaxKind {
|
|
@@ -32,6 +159,19 @@ export class SyntaxNode {
|
|
|
32
159
|
return this.green.textLength;
|
|
33
160
|
}
|
|
34
161
|
|
|
162
|
+
get endOffset(): number {
|
|
163
|
+
return this.offset + this.textLength;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Whether `offset` falls within this node, inclusive of both ends. */
|
|
167
|
+
isInside(offset: number): boolean {
|
|
168
|
+
return offset >= this.offset && offset <= this.endOffset;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
isOutside(offset: number): boolean {
|
|
172
|
+
return !this.isInside(offset);
|
|
173
|
+
}
|
|
174
|
+
|
|
35
175
|
get firstChild(): SyntaxElement | undefined {
|
|
36
176
|
return childAt(this, 0);
|
|
37
177
|
}
|
|
@@ -43,44 +183,40 @@ export class SyntaxNode {
|
|
|
43
183
|
}
|
|
44
184
|
|
|
45
185
|
get nextSibling(): SyntaxElement | undefined {
|
|
46
|
-
|
|
47
|
-
const siblings = this.parent.green.children;
|
|
48
|
-
let offset = this.parent.offset;
|
|
49
|
-
let found = false;
|
|
50
|
-
for (const child of siblings) {
|
|
51
|
-
if (found) {
|
|
52
|
-
return wrapElement(child, offset, this.parent);
|
|
53
|
-
}
|
|
54
|
-
const childLen = elementTextLength(child);
|
|
55
|
-
if (child.type === 'node' && offset === this.offset && child === this.green) {
|
|
56
|
-
found = true;
|
|
57
|
-
}
|
|
58
|
-
offset += childLen;
|
|
59
|
-
}
|
|
60
|
-
return undefined;
|
|
186
|
+
return this.parent === undefined ? undefined : childAt(this.parent, this.index + 1);
|
|
61
187
|
}
|
|
62
188
|
|
|
63
189
|
get prevSibling(): SyntaxElement | undefined {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
190
|
+
return this.parent === undefined ? undefined : childAt(this.parent, this.index - 1);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** The sibling element immediately after this node within its parent. */
|
|
194
|
+
get nextSiblingOrToken(): SyntaxElement | undefined {
|
|
195
|
+
return this.nextSibling;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** The sibling element immediately before this node within its parent. */
|
|
199
|
+
get prevSiblingOrToken(): SyntaxElement | undefined {
|
|
200
|
+
return this.prevSibling;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** The first token in this subtree (depth-first), or `undefined` if empty. */
|
|
204
|
+
get firstToken(): SyntaxToken | undefined {
|
|
205
|
+
return firstToken(this);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** The last token in this subtree (depth-first), or `undefined` if empty. */
|
|
209
|
+
get lastToken(): SyntaxToken | undefined {
|
|
210
|
+
return lastToken(this);
|
|
77
211
|
}
|
|
78
212
|
|
|
79
213
|
*children(): Iterable<SyntaxElement> {
|
|
80
214
|
let offset = this.offset;
|
|
215
|
+
let index = 0;
|
|
81
216
|
for (const child of this.green.children) {
|
|
82
|
-
yield wrapElement(child, offset, this);
|
|
217
|
+
yield wrapElement(child, offset, this, index);
|
|
83
218
|
offset += elementTextLength(child);
|
|
219
|
+
index++;
|
|
84
220
|
}
|
|
85
221
|
}
|
|
86
222
|
|
|
@@ -98,6 +234,21 @@ export class SyntaxNode {
|
|
|
98
234
|
}
|
|
99
235
|
}
|
|
100
236
|
|
|
237
|
+
/** The nearest match, testing this node itself before walking its ancestors. */
|
|
238
|
+
findAncestor<T>(cast: (node: SyntaxNode) => T | undefined): T | undefined {
|
|
239
|
+
const self = cast(this);
|
|
240
|
+
if (self !== undefined) {
|
|
241
|
+
return self;
|
|
242
|
+
}
|
|
243
|
+
for (const ancestor of this.ancestors()) {
|
|
244
|
+
const result = cast(ancestor);
|
|
245
|
+
if (result !== undefined) {
|
|
246
|
+
return result;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return undefined;
|
|
250
|
+
}
|
|
251
|
+
|
|
101
252
|
*descendants(): Iterable<SyntaxElement> {
|
|
102
253
|
const stack: SyntaxElement[] = [this];
|
|
103
254
|
for (let el = stack.pop(); el !== undefined; el = stack.pop()) {
|
|
@@ -116,23 +267,147 @@ export class SyntaxNode {
|
|
|
116
267
|
|
|
117
268
|
*tokens(): Iterable<SyntaxToken> {
|
|
118
269
|
for (const el of this.descendants()) {
|
|
119
|
-
if (
|
|
270
|
+
if (el instanceof SyntaxToken) {
|
|
120
271
|
yield el;
|
|
121
272
|
}
|
|
122
273
|
}
|
|
123
274
|
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* The token(s) at `offset`. The between-two-tokens case (offset exactly on a
|
|
278
|
+
* token seam) is represented explicitly so callers can left/right bias.
|
|
279
|
+
*/
|
|
280
|
+
tokenAtOffset(offset: number): TokenAtOffset {
|
|
281
|
+
return tokenAtOffsetOf(this, offset);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* The smallest element fully containing the range `[start, end]`. At a seam
|
|
286
|
+
* (and for empty ranges) the left-hand element is preferred, matching
|
|
287
|
+
* {@link containsOffset}'s inclusive span.
|
|
288
|
+
*/
|
|
289
|
+
coveringElement(start: number, end: number): SyntaxElement {
|
|
290
|
+
let result: SyntaxElement = this;
|
|
291
|
+
for (;;) {
|
|
292
|
+
if (result instanceof SyntaxToken) return result;
|
|
293
|
+
let next: SyntaxElement | undefined;
|
|
294
|
+
for (const child of result.children()) {
|
|
295
|
+
if (containsRange(child, start, end)) {
|
|
296
|
+
next = child;
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (next === undefined) return result;
|
|
301
|
+
result = next;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
124
304
|
}
|
|
125
305
|
|
|
126
306
|
function elementTextLength(el: GreenElement): number {
|
|
127
307
|
return el.type === 'token' ? el.text.length : el.textLength;
|
|
128
308
|
}
|
|
129
309
|
|
|
130
|
-
function
|
|
310
|
+
function elementLength(el: SyntaxElement): number {
|
|
311
|
+
return el instanceof SyntaxToken ? el.text.length : el.textLength;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Whether `el` contains `offset`. The span is inclusive on both ends so a seam
|
|
316
|
+
* offset touches both neighbours.
|
|
317
|
+
*/
|
|
318
|
+
function containsOffset(el: SyntaxElement, offset: number): boolean {
|
|
319
|
+
const start = el.offset;
|
|
320
|
+
const len = elementLength(el);
|
|
321
|
+
return offset >= start && offset <= start + len;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function containsRange(el: SyntaxElement, start: number, end: number): boolean {
|
|
325
|
+
const elStart = el.offset;
|
|
326
|
+
const len = elementLength(el);
|
|
327
|
+
return elStart <= start && end <= elStart + len;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function tokenAtOffsetOf(el: SyntaxElement, offset: number): TokenAtOffset {
|
|
331
|
+
if (el instanceof SyntaxToken) {
|
|
332
|
+
return TokenAtOffset.single(el);
|
|
333
|
+
}
|
|
334
|
+
let left: SyntaxElement | undefined;
|
|
335
|
+
let right: SyntaxElement | undefined;
|
|
336
|
+
for (const child of el.children()) {
|
|
337
|
+
if (!containsOffset(child, offset)) continue;
|
|
338
|
+
if (left === undefined) {
|
|
339
|
+
left = child;
|
|
340
|
+
} else {
|
|
341
|
+
right = child;
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (left === undefined) return TokenAtOffset.none();
|
|
346
|
+
if (right === undefined) return tokenAtOffsetOf(left, offset);
|
|
347
|
+
const leftToken = tokenAtOffsetOf(left, offset).rightBiased();
|
|
348
|
+
const rightToken = tokenAtOffsetOf(right, offset).leftBiased();
|
|
349
|
+
if (leftToken !== undefined && rightToken !== undefined) {
|
|
350
|
+
return TokenAtOffset.between(leftToken, rightToken);
|
|
351
|
+
}
|
|
352
|
+
if (leftToken !== undefined) return TokenAtOffset.single(leftToken);
|
|
353
|
+
if (rightToken !== undefined) return TokenAtOffset.single(rightToken);
|
|
354
|
+
return TokenAtOffset.none();
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function firstToken(el: SyntaxElement): SyntaxToken | undefined {
|
|
358
|
+
if (el instanceof SyntaxToken) return el;
|
|
359
|
+
for (const child of el.children()) {
|
|
360
|
+
const token = firstToken(child);
|
|
361
|
+
if (token !== undefined) return token;
|
|
362
|
+
}
|
|
363
|
+
return undefined;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function lastToken(el: SyntaxElement): SyntaxToken | undefined {
|
|
367
|
+
if (el instanceof SyntaxToken) return el;
|
|
368
|
+
const children = Array.from(el.children());
|
|
369
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
370
|
+
const child = children[i];
|
|
371
|
+
if (child !== undefined) {
|
|
372
|
+
const token = lastToken(child);
|
|
373
|
+
if (token !== undefined) return token;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return undefined;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function climbingNext(el: SyntaxElement): SyntaxElement | undefined {
|
|
380
|
+
let current: SyntaxElement = el;
|
|
381
|
+
for (;;) {
|
|
382
|
+
const parent = current.parent;
|
|
383
|
+
if (parent === undefined) return undefined;
|
|
384
|
+
const sibling = childAt(parent, current.index + 1);
|
|
385
|
+
if (sibling !== undefined) return sibling;
|
|
386
|
+
current = parent;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function climbingPrev(el: SyntaxElement): SyntaxElement | undefined {
|
|
391
|
+
let current: SyntaxElement = el;
|
|
392
|
+
for (;;) {
|
|
393
|
+
const parent = current.parent;
|
|
394
|
+
if (parent === undefined) return undefined;
|
|
395
|
+
const sibling = childAt(parent, current.index - 1);
|
|
396
|
+
if (sibling !== undefined) return sibling;
|
|
397
|
+
current = parent;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function wrapElement(
|
|
402
|
+
green: GreenElement,
|
|
403
|
+
offset: number,
|
|
404
|
+
parent: SyntaxNode,
|
|
405
|
+
index: number,
|
|
406
|
+
): SyntaxElement {
|
|
131
407
|
if (green.type === 'token') {
|
|
132
|
-
|
|
133
|
-
return token;
|
|
408
|
+
return new SyntaxToken(green, offset, parent, index);
|
|
134
409
|
}
|
|
135
|
-
return new SyntaxNode(green, offset, parent);
|
|
410
|
+
return new SyntaxNode(green, offset, parent, index);
|
|
136
411
|
}
|
|
137
412
|
|
|
138
413
|
function childAt(node: SyntaxNode, index: number): SyntaxElement | undefined {
|
|
@@ -146,9 +421,9 @@ function childAt(node: SyntaxNode, index: number): SyntaxElement | undefined {
|
|
|
146
421
|
offset += elementTextLength(child);
|
|
147
422
|
}
|
|
148
423
|
}
|
|
149
|
-
return wrapElement(target, offset, node);
|
|
424
|
+
return wrapElement(target, offset, node, index);
|
|
150
425
|
}
|
|
151
426
|
|
|
152
427
|
export function createSyntaxTree(green: GreenNode): SyntaxNode {
|
|
153
|
-
return new SyntaxNode(green, 0, undefined);
|
|
428
|
+
return new SyntaxNode(green, 0, undefined, 0);
|
|
154
429
|
}
|
|
@@ -1 +0,0 @@
|
|
|
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) : 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,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