semantifold 0.1.0
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/LICENSE +15 -0
- package/README.md +71 -0
- package/build/index.d.ts +54 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +45 -0
- package/build/src/backends/identifiers.d.ts +19 -0
- package/build/src/backends/identifiers.d.ts.map +1 -0
- package/build/src/backends/identifiers.js +93 -0
- package/build/src/backends/index.d.ts +35 -0
- package/build/src/backends/index.d.ts.map +1 -0
- package/build/src/backends/index.js +149 -0
- package/build/src/backends/java.d.ts +8 -0
- package/build/src/backends/java.d.ts.map +1 -0
- package/build/src/backends/java.js +172 -0
- package/build/src/backends/javascript.d.ts +8 -0
- package/build/src/backends/javascript.d.ts.map +1 -0
- package/build/src/backends/javascript.js +173 -0
- package/build/src/backends/php.d.ts +8 -0
- package/build/src/backends/php.d.ts.map +1 -0
- package/build/src/backends/php.js +175 -0
- package/build/src/backends/ruby.d.ts +8 -0
- package/build/src/backends/ruby.d.ts.map +1 -0
- package/build/src/backends/ruby.js +155 -0
- package/build/src/backends/scalars.d.ts +15 -0
- package/build/src/backends/scalars.d.ts.map +1 -0
- package/build/src/backends/scalars.js +138 -0
- package/build/src/backends/shared.d.ts +26 -0
- package/build/src/backends/shared.d.ts.map +1 -0
- package/build/src/backends/shared.js +424 -0
- package/build/src/backends/typescript.d.ts +8 -0
- package/build/src/backends/typescript.d.ts.map +1 -0
- package/build/src/backends/typescript.js +160 -0
- package/build/src/backends/writer.d.ts +87 -0
- package/build/src/backends/writer.d.ts.map +1 -0
- package/build/src/backends/writer.js +207 -0
- package/build/src/diagnostic.d.ts +67 -0
- package/build/src/diagnostic.d.ts.map +1 -0
- package/build/src/diagnostic.js +96 -0
- package/build/src/frontends/index.d.ts +14 -0
- package/build/src/frontends/index.d.ts.map +1 -0
- package/build/src/frontends/index.js +36 -0
- package/build/src/frontends/java.d.ts +12 -0
- package/build/src/frontends/java.d.ts.map +1 -0
- package/build/src/frontends/java.js +630 -0
- package/build/src/frontends/javascript-typescript.d.ts +19 -0
- package/build/src/frontends/javascript-typescript.d.ts.map +1 -0
- package/build/src/frontends/javascript-typescript.js +633 -0
- package/build/src/frontends/php.d.ts +12 -0
- package/build/src/frontends/php.d.ts.map +1 -0
- package/build/src/frontends/php.js +523 -0
- package/build/src/frontends/ruby.d.ts +12 -0
- package/build/src/frontends/ruby.d.ts.map +1 -0
- package/build/src/frontends/ruby.js +515 -0
- package/build/src/frontends/scalars.d.ts +19 -0
- package/build/src/frontends/scalars.d.ts.map +1 -0
- package/build/src/frontends/scalars.js +71 -0
- package/build/src/mapping.d.ts +160 -0
- package/build/src/mapping.d.ts.map +1 -0
- package/build/src/mapping.js +1120 -0
- package/build/src/semantic/location.d.ts +61 -0
- package/build/src/semantic/location.d.ts.map +1 -0
- package/build/src/semantic/location.js +142 -0
- package/build/src/semantic/operators.d.ts +16 -0
- package/build/src/semantic/operators.d.ts.map +1 -0
- package/build/src/semantic/operators.js +24 -0
- package/build/src/semantic/provenance.d.ts +74 -0
- package/build/src/semantic/provenance.d.ts.map +1 -0
- package/build/src/semantic/provenance.js +577 -0
- package/build/src/semantic/scalars.d.ts +19 -0
- package/build/src/semantic/scalars.d.ts.map +1 -0
- package/build/src/semantic/scalars.js +40 -0
- package/build/src/semantic/types.d.ts +1003 -0
- package/build/src/semantic/types.d.ts.map +1 -0
- package/build/src/semantic/types.js +279 -0
- package/build/src/semantic/validate.d.ts +60 -0
- package/build/src/semantic/validate.d.ts.map +1 -0
- package/build/src/semantic/validate.js +472 -0
- package/docs/architecture.md +39 -0
- package/docs/coding-standards.md +7 -0
- package/docs/goals.md +7 -0
- package/docs/language-support.md +69 -0
- package/docs/plans/2026-09-02-initial-toolchain.md +54 -0
- package/docs/source-maps.md +134 -0
- package/docs/testing.md +25 -0
- package/index.js +63 -0
- package/package.json +69 -0
- package/src/backends/identifiers.js +101 -0
- package/src/backends/index.js +159 -0
- package/src/backends/java.js +182 -0
- package/src/backends/javascript.js +184 -0
- package/src/backends/php.js +184 -0
- package/src/backends/ruby.js +163 -0
- package/src/backends/scalars.js +120 -0
- package/src/backends/shared.js +456 -0
- package/src/backends/typescript.js +168 -0
- package/src/backends/writer.js +224 -0
- package/src/diagnostic.js +103 -0
- package/src/frontends/index.js +36 -0
- package/src/frontends/java.js +735 -0
- package/src/frontends/javascript-typescript.js +718 -0
- package/src/frontends/php.js +593 -0
- package/src/frontends/ruby.js +622 -0
- package/src/frontends/scalars.js +77 -0
- package/src/mapping.js +1260 -0
- package/src/semantic/location.js +154 -0
- package/src/semantic/operators.js +28 -0
- package/src/semantic/provenance.js +629 -0
- package/src/semantic/scalars.js +44 -0
- package/src/semantic/types.js +319 -0
- package/src/semantic/validate.js +529 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/** @typedef {"php" | "ruby" | "javascript" | "typescript" | "java"} SemanticLanguage */
|
|
4
|
+
/** @typedef {"integer" | "boolean" | "string"} SemanticTypeName */
|
|
5
|
+
/** @typedef {"IntegerNegate" | "BooleanNot"} SemanticUnaryOperation */
|
|
6
|
+
/** @typedef {"IntegerAdd" | "IntegerSubtract" | "IntegerMultiply" | "BooleanAnd" | "BooleanOr" | "IntegerEqual" | "IntegerNotEqual" | "BooleanEqual" | "BooleanNotEqual" | "StringEqual" | "StringNotEqual" | "IntegerLessThan" | "IntegerLessThanOrEqual" | "IntegerGreaterThan" | "IntegerGreaterThanOrEqual" | "StringConcat"} SemanticBinaryOperation */
|
|
7
|
+
/** @typedef {"function" | "parameter" | "local"} SemanticSymbolKind */
|
|
8
|
+
/** @typedef {"declaration" | "read" | "write" | "call"} SemanticSymbolRole */
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @typedef SourcePoint
|
|
12
|
+
* @property {number} line - One-based line.
|
|
13
|
+
* @property {number} column - One-based UTF-16 code-unit column.
|
|
14
|
+
* @property {number} offset - Zero-based UTF-16 source offset.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @typedef SourceLocation
|
|
19
|
+
* @property {string} filename - Originating filename.
|
|
20
|
+
* @property {SourcePoint} start - Inclusive start.
|
|
21
|
+
* @property {SourcePoint} end - Exclusive end.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @typedef RegisteredSource
|
|
26
|
+
* @property {string} id - Registry-local deterministic source identity.
|
|
27
|
+
* @property {string} filename - Original filename, preserved verbatim.
|
|
28
|
+
* @property {string | null} content - Original source content, preserved verbatim when available.
|
|
29
|
+
* @property {SemanticLanguage | null} language - Parser language when known.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @typedef SourceOrigin
|
|
34
|
+
* @property {"source"} kind - Direct source provenance.
|
|
35
|
+
* @property {string} sourceId - Registered source identity.
|
|
36
|
+
* @property {SourceLocation} location - Exact original range.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @typedef RelatedOrigin
|
|
41
|
+
* @property {string} sourceId - Registered source identity.
|
|
42
|
+
* @property {SourceLocation} location - Related original range.
|
|
43
|
+
* @property {string} [nodeId] - Related semantic node identity.
|
|
44
|
+
* @property {string} [symbolId] - Related semantic symbol identity.
|
|
45
|
+
* @property {string} [role] - Relationship role.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @typedef DerivedOrigin
|
|
50
|
+
* @property {"derived"} kind - Provenance derived from one or more origins.
|
|
51
|
+
* @property {RelatedOrigin[]} origins - Ordered, non-empty original ranges.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @typedef SyntheticOrigin
|
|
56
|
+
* @property {"synthetic"} kind - Source-free generated or semantic scaffolding.
|
|
57
|
+
* @property {string} reason - Stable human-readable reason.
|
|
58
|
+
* @property {RelatedOrigin[]} relatedOrigins - Ordered related ranges, possibly empty.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/** @typedef {SourceOrigin | DerivedOrigin | SyntheticOrigin} SemanticOrigin */
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @typedef SemanticNodeSourceProvenance
|
|
65
|
+
* @property {"SemantifoldNodeProvenance"} schema - Association discriminator.
|
|
66
|
+
* @property {1} version - Association version.
|
|
67
|
+
* @property {SemanticOrigin} origin - Source association independent of traversal position.
|
|
68
|
+
* @property {Readonly<Record<string, SourceLocation>>} ranges - Exact semantic-token subranges by role.
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @typedef SemanticNodeProvenance
|
|
73
|
+
* @property {string} id - Deterministic module-local node identity.
|
|
74
|
+
* @property {string} path - JSON Pointer from the semantic module root.
|
|
75
|
+
* @property {SemanticNode["kind"] | "TypeReference"} kind - Semantic node kind.
|
|
76
|
+
* @property {SemanticOrigin} origin - Closed provenance value.
|
|
77
|
+
* @property {Readonly<Record<string, SourceLocation>>} ranges - Exact semantic-token subranges by role.
|
|
78
|
+
* @property {string} [symbolId] - Resolved declared/referenced symbol identity.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @typedef SemanticSymbolReference
|
|
83
|
+
* @property {string} nodeId - Referring semantic node identity.
|
|
84
|
+
* @property {SemanticSymbolRole} role - Reference role.
|
|
85
|
+
* @property {SourceLocation} location - Exact reference range.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @typedef SemanticSymbolProvenance
|
|
90
|
+
* @property {string} id - Deterministic module-local symbol identity.
|
|
91
|
+
* @property {string} name - Semantic symbol name.
|
|
92
|
+
* @property {SemanticSymbolKind} kind - Symbol category.
|
|
93
|
+
* @property {string} declarationNodeId - Declaring node identity.
|
|
94
|
+
* @property {SourceLocation} location - Exact declaration-name range.
|
|
95
|
+
* @property {SemanticSymbolReference[]} references - Ordered resolved references.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @typedef SemanticProvenance
|
|
100
|
+
* @property {"SemantifoldProvenance"} schema - Schema discriminator.
|
|
101
|
+
* @property {1} version - Schema version.
|
|
102
|
+
* @property {"utf16"} coordinateSystem - Offset and column unit.
|
|
103
|
+
* @property {RegisteredSource[]} sources - Versioned source registry.
|
|
104
|
+
* @property {SemanticNodeProvenance[]} nodes - Deterministic node index.
|
|
105
|
+
* @property {SemanticSymbolProvenance[]} symbols - Deterministic symbol index.
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
/** @typedef {"exact" | "anchor" | "synthetic"} MappingKind */
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @typedef SemantifoldMappingSpan
|
|
112
|
+
* @property {SourceLocation} generated - Generated half-open range.
|
|
113
|
+
* @property {MappingKind} mappingKind - Mapping precision.
|
|
114
|
+
* @property {SemanticOrigin} origin - Closed original provenance.
|
|
115
|
+
* @property {string} [nodeId] - Related canonical semantic node.
|
|
116
|
+
* @property {string} [symbolId] - Related canonical semantic symbol.
|
|
117
|
+
* @property {string} [role] - Semantic token role.
|
|
118
|
+
* @property {string} [name] - Useful symbol name for Source Map v3.
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @typedef GeneratedSource
|
|
123
|
+
* @property {string} filename - Output filename.
|
|
124
|
+
* @property {SemanticLanguage} language - Output language.
|
|
125
|
+
* @property {string} content - Exact generated LF source.
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @typedef SemantifoldMapping
|
|
130
|
+
* @property {"SemantifoldMapping"} schema - Schema discriminator.
|
|
131
|
+
* @property {1} version - Schema version.
|
|
132
|
+
* @property {"utf16"} coordinateSystem - Offset and column unit.
|
|
133
|
+
* @property {GeneratedSource} generated - Generated program identity and content.
|
|
134
|
+
* @property {RegisteredSource[]} sources - Original source registry.
|
|
135
|
+
* @property {SemanticNodeProvenance[]} nodes - Canonical semantic node index.
|
|
136
|
+
* @property {SemanticSymbolProvenance[]} symbols - Canonical semantic symbol index.
|
|
137
|
+
* @property {SemantifoldMappingSpan[]} spans - Ordered generated ranges.
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @typedef GeneratedArtifact
|
|
142
|
+
* @property {string} code - Generated output program, including any requested directive.
|
|
143
|
+
* @property {string} filename - Generated output filename.
|
|
144
|
+
* @property {SemanticLanguage} language - Output language.
|
|
145
|
+
* @property {SemantifoldMapping} mapping - Authoritative rich mapping.
|
|
146
|
+
* @property {import("@jridgewell/gen-mapping").EncodedSourceMap} sourceMap - Source Map v3 projection.
|
|
147
|
+
* @property {string} sourceMapFilename - Default external Source Map filename.
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @typedef TypeReference
|
|
152
|
+
* @property {"TypeReference"} kind - Node discriminator.
|
|
153
|
+
* @property {SemanticTypeName} name - Normalized type name.
|
|
154
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance that survives semantic transforms.
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @typedef Parameter
|
|
159
|
+
* @property {"Parameter"} kind - Node discriminator.
|
|
160
|
+
* @property {string} name - Parameter name.
|
|
161
|
+
* @property {TypeReference} type - Parameter type.
|
|
162
|
+
* @property {SourceLocation} location - Source location.
|
|
163
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @typedef IdentifierExpression
|
|
168
|
+
* @property {"IdentifierExpression"} kind - Node discriminator.
|
|
169
|
+
* @property {string} name - Referenced name.
|
|
170
|
+
* @property {SourceLocation} location - Source location.
|
|
171
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @typedef IntegerLiteral
|
|
176
|
+
* @property {"IntegerLiteral"} kind - Node discriminator.
|
|
177
|
+
* @property {number} value - JavaScript-safe integer value.
|
|
178
|
+
* @property {SourceLocation} location - Source location.
|
|
179
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @typedef BooleanLiteral
|
|
184
|
+
* @property {"BooleanLiteral"} kind - Node discriminator.
|
|
185
|
+
* @property {boolean} value - Boolean value.
|
|
186
|
+
* @property {SourceLocation} location - Source location.
|
|
187
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @typedef StringLiteral
|
|
192
|
+
* @property {"StringLiteral"} kind - Node discriminator.
|
|
193
|
+
* @property {string} value - Unicode string value.
|
|
194
|
+
* @property {SourceLocation} location - Source location.
|
|
195
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* @typedef UnaryExpression
|
|
200
|
+
* @property {"UnaryExpression"} kind - Node discriminator.
|
|
201
|
+
* @property {SemanticUnaryOperation} operation - Closed semantic operation.
|
|
202
|
+
* @property {Expression} operand - Operand evaluated exactly once.
|
|
203
|
+
* @property {SemanticTypeName} type - Explicit operation result type.
|
|
204
|
+
* @property {SourceLocation} location - Source location.
|
|
205
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @typedef BinaryExpression
|
|
210
|
+
* @property {"BinaryExpression"} kind - Node discriminator.
|
|
211
|
+
* @property {SemanticBinaryOperation} operation - Closed semantic operation.
|
|
212
|
+
* @property {Expression} left - Left operand.
|
|
213
|
+
* @property {Expression} right - Right operand.
|
|
214
|
+
* @property {SemanticTypeName} type - Explicit operation result type.
|
|
215
|
+
* @property {SourceLocation} location - Source location.
|
|
216
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* @typedef CallExpression
|
|
221
|
+
* @property {"CallExpression"} kind - Node discriminator.
|
|
222
|
+
* @property {string} callee - Function name.
|
|
223
|
+
* @property {Expression[]} arguments - Positional arguments.
|
|
224
|
+
* @property {SourceLocation} location - Source location.
|
|
225
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
/** @typedef {IdentifierExpression | IntegerLiteral | BooleanLiteral | StringLiteral | UnaryExpression | BinaryExpression | CallExpression} Expression */
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* @typedef LocalDeclaration
|
|
232
|
+
* @property {"LocalDeclaration"} kind - Node discriminator.
|
|
233
|
+
* @property {string} name - Declared local name.
|
|
234
|
+
* @property {TypeReference} type - Explicit local type.
|
|
235
|
+
* @property {boolean} mutable - Whether later assignment is allowed.
|
|
236
|
+
* @property {Expression} initializer - Required initializer expression.
|
|
237
|
+
* @property {SourceLocation} location - Declaration source location.
|
|
238
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
239
|
+
*/
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @typedef AssignmentStatement
|
|
243
|
+
* @property {"AssignmentStatement"} kind - Node discriminator.
|
|
244
|
+
* @property {IdentifierExpression} target - Simple local assignment target.
|
|
245
|
+
* @property {Expression} expression - Assigned expression.
|
|
246
|
+
* @property {SourceLocation} location - Assignment source location.
|
|
247
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
248
|
+
*/
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @typedef ReturnStatement
|
|
252
|
+
* @property {"ReturnStatement"} kind - Node discriminator.
|
|
253
|
+
* @property {Expression} expression - Returned expression.
|
|
254
|
+
* @property {SourceLocation} location - Source location.
|
|
255
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
256
|
+
*/
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @typedef IfStatement
|
|
260
|
+
* @property {"IfStatement"} kind - Node discriminator.
|
|
261
|
+
* @property {Expression} condition - Branch condition.
|
|
262
|
+
* @property {Block} consequent - True branch.
|
|
263
|
+
* @property {Block} [alternate] - False branch, absent when execution falls through.
|
|
264
|
+
* @property {SourceLocation} location - Source location.
|
|
265
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
266
|
+
*/
|
|
267
|
+
|
|
268
|
+
/** @typedef {LocalDeclaration | AssignmentStatement} LocalStatement */
|
|
269
|
+
/** @typedef {LocalStatement | IfStatement | ReturnStatement | PrintStatement} Statement */
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @typedef Block
|
|
273
|
+
* @property {"Block"} kind - Node discriminator.
|
|
274
|
+
* @property {Statement[]} statements - Ordered statements in one lexical scope.
|
|
275
|
+
* @property {SourceLocation} location - Source location.
|
|
276
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @typedef FunctionDeclaration
|
|
281
|
+
* @property {"FunctionDeclaration"} kind - Node discriminator.
|
|
282
|
+
* @property {string} name - Function name.
|
|
283
|
+
* @property {Parameter[]} parameters - Function parameters.
|
|
284
|
+
* @property {TypeReference} returnType - Return type.
|
|
285
|
+
* @property {Block} body - Function body.
|
|
286
|
+
* @property {SourceLocation} location - Source location.
|
|
287
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
288
|
+
*/
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* @typedef PrintStatement
|
|
292
|
+
* @property {"PrintStatement"} kind - Node discriminator.
|
|
293
|
+
* @property {Expression} expression - Printed expression.
|
|
294
|
+
* @property {SourceLocation} location - Source location.
|
|
295
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* @typedef EntryPoint
|
|
300
|
+
* @property {"EntryPoint"} kind - Node discriminator.
|
|
301
|
+
* @property {Block} body - Entry-point body.
|
|
302
|
+
* @property {SourceLocation} location - Source location.
|
|
303
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
304
|
+
*/
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @typedef SemanticModule
|
|
308
|
+
* @property {"Module"} kind - Node discriminator.
|
|
309
|
+
* @property {FunctionDeclaration[]} functions - Top-level functions.
|
|
310
|
+
* @property {EntryPoint} entryPoint - Executable entry point.
|
|
311
|
+
* @property {SourceLocation} location - Source location.
|
|
312
|
+
* @property {SemanticNodeSourceProvenance} [sourceProvenance] - Node-associated provenance.
|
|
313
|
+
* @property {SemanticProvenance} [provenance] - Parser-authored source and identity index; optional for legacy caller-authored modules.
|
|
314
|
+
*/
|
|
315
|
+
|
|
316
|
+
/** @typedef {SemanticModule | FunctionDeclaration | Parameter | Block | Statement | EntryPoint | Expression | TypeReference} SemanticNode */
|
|
317
|
+
/** @typedef {SemanticNode} SemanticNodeWithoutLocations */
|
|
318
|
+
|
|
319
|
+
export {}
|