@openrewrite/rewrite 8.63.0 → 8.63.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/java/index.d.ts +1 -0
- package/dist/java/index.d.ts.map +1 -1
- package/dist/java/index.js +1 -0
- package/dist/java/index.js.map +1 -1
- package/dist/java/rpc.d.ts +2 -0
- package/dist/java/rpc.d.ts.map +1 -1
- package/dist/java/rpc.js +749 -410
- package/dist/java/rpc.js.map +1 -1
- package/dist/java/tree.d.ts +1 -1
- package/dist/java/tree.d.ts.map +1 -1
- package/dist/java/type-visitor.d.ts +48 -0
- package/dist/java/type-visitor.d.ts.map +1 -0
- package/dist/java/type-visitor.js +260 -0
- package/dist/java/type-visitor.js.map +1 -0
- package/dist/java/type.d.ts +2 -0
- package/dist/java/type.d.ts.map +1 -1
- package/dist/java/type.js +0 -317
- package/dist/java/type.js.map +1 -1
- package/dist/java/visitor.d.ts.map +1 -1
- package/dist/java/visitor.js +579 -363
- package/dist/java/visitor.js.map +1 -1
- package/dist/javascript/preconditions.d.ts +1 -1
- package/dist/javascript/preconditions.d.ts.map +1 -1
- package/dist/javascript/preconditions.js +7 -6
- package/dist/javascript/preconditions.js.map +1 -1
- package/dist/javascript/rpc.js +430 -350
- package/dist/javascript/rpc.js.map +1 -1
- package/dist/javascript/tree.d.ts +1 -1
- package/dist/javascript/tree.d.ts.map +1 -1
- package/dist/javascript/type-mapping.d.ts.map +1 -1
- package/dist/javascript/type-mapping.js +7 -0
- package/dist/javascript/type-mapping.js.map +1 -1
- package/dist/javascript/visitor.d.ts.map +1 -1
- package/dist/javascript/visitor.js +504 -309
- package/dist/javascript/visitor.js.map +1 -1
- package/dist/json/visitor.d.ts.map +1 -1
- package/dist/json/visitor.js +46 -21
- package/dist/json/visitor.js.map +1 -1
- package/dist/rpc/queue.d.ts +7 -4
- package/dist/rpc/queue.d.ts.map +1 -1
- package/dist/rpc/queue.js +22 -32
- package/dist/rpc/queue.js.map +1 -1
- package/dist/rpc/request/generate.d.ts.map +1 -1
- package/dist/rpc/request/generate.js +2 -3
- package/dist/rpc/request/generate.js.map +1 -1
- package/dist/rpc/request/get-languages.d.ts.map +1 -1
- package/dist/rpc/request/get-languages.js +4 -3
- package/dist/rpc/request/get-languages.js.map +1 -1
- package/dist/rpc/request/get-object.d.ts +1 -1
- package/dist/rpc/request/get-object.d.ts.map +1 -1
- package/dist/rpc/request/get-object.js +8 -7
- package/dist/rpc/request/get-object.js.map +1 -1
- package/dist/rpc/request/get-recipes.d.ts.map +1 -1
- package/dist/rpc/request/get-recipes.js +2 -2
- package/dist/rpc/request/get-recipes.js.map +1 -1
- package/dist/rpc/request/index.d.ts +1 -0
- package/dist/rpc/request/index.d.ts.map +1 -1
- package/dist/rpc/request/index.js +1 -0
- package/dist/rpc/request/index.js.map +1 -1
- package/dist/rpc/request/install-recipes.d.ts.map +1 -1
- package/dist/rpc/request/install-recipes.js +30 -21
- package/dist/rpc/request/install-recipes.js.map +1 -1
- package/dist/rpc/request/metrics.d.ts +10 -10
- package/dist/rpc/request/metrics.d.ts.map +1 -1
- package/dist/rpc/request/metrics.js +38 -31
- package/dist/rpc/request/metrics.js.map +1 -1
- package/dist/rpc/request/parse.d.ts.map +1 -1
- package/dist/rpc/request/parse.js +10 -12
- package/dist/rpc/request/parse.js.map +1 -1
- package/dist/rpc/request/prepare-recipe.d.ts.map +1 -1
- package/dist/rpc/request/prepare-recipe.js +4 -4
- package/dist/rpc/request/prepare-recipe.js.map +1 -1
- package/dist/rpc/request/print.d.ts +1 -1
- package/dist/rpc/request/print.d.ts.map +1 -1
- package/dist/rpc/request/print.js +10 -6
- package/dist/rpc/request/print.js.map +1 -1
- package/dist/rpc/request/trace-get-object.d.ts +5 -0
- package/dist/rpc/request/trace-get-object.d.ts.map +1 -0
- package/dist/rpc/request/trace-get-object.js +3 -0
- package/dist/rpc/request/trace-get-object.js.map +1 -0
- package/dist/rpc/request/visit.d.ts.map +1 -1
- package/dist/rpc/request/visit.js +2 -3
- package/dist/rpc/request/visit.js.map +1 -1
- package/dist/rpc/rewrite-rpc.d.ts +2 -3
- package/dist/rpc/rewrite-rpc.d.ts.map +1 -1
- package/dist/rpc/rewrite-rpc.js +14 -5
- package/dist/rpc/rewrite-rpc.js.map +1 -1
- package/dist/rpc/server.d.ts.map +1 -1
- package/dist/rpc/server.js +15 -44
- package/dist/rpc/server.js.map +1 -1
- package/dist/rpc/trace.d.ts +1 -1
- package/dist/rpc/trace.d.ts.map +1 -1
- package/dist/rpc/trace.js +3 -3
- package/dist/rpc/trace.js.map +1 -1
- package/dist/util.d.ts +6 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +14 -0
- package/dist/util.js.map +1 -1
- package/dist/version.txt +1 -1
- package/package.json +1 -1
- package/src/java/index.ts +1 -0
- package/src/java/rpc.ts +726 -537
- package/src/java/tree.ts +1 -1
- package/src/java/type-visitor.ts +241 -0
- package/src/java/type.ts +13 -277
- package/src/java/visitor.ts +581 -378
- package/src/javascript/preconditions.ts +7 -6
- package/src/javascript/rpc.ts +431 -360
- package/src/javascript/tree.ts +1 -1
- package/src/javascript/type-mapping.ts +7 -0
- package/src/javascript/visitor.ts +505 -310
- package/src/json/visitor.ts +47 -22
- package/src/rpc/queue.ts +20 -17
- package/src/rpc/request/generate.ts +31 -25
- package/src/rpc/request/get-languages.ts +18 -10
- package/src/rpc/request/get-object.ts +42 -34
- package/src/rpc/request/get-recipes.ts +15 -8
- package/src/rpc/request/index.ts +1 -0
- package/src/rpc/request/install-recipes.ts +96 -79
- package/src/rpc/request/metrics.ts +54 -48
- package/src/rpc/request/parse.ts +31 -25
- package/src/rpc/request/prepare-recipe.ts +31 -23
- package/src/rpc/request/print.ts +28 -14
- package/src/rpc/request/trace-get-object.ts +4 -0
- package/src/rpc/request/visit.ts +22 -16
- package/src/rpc/rewrite-rpc.ts +23 -10
- package/src/rpc/server.ts +17 -52
- package/src/rpc/trace.ts +3 -3
- package/src/util.ts +14 -0
- package/dist/rpc/chrome-profiler.d.ts +0 -25
- package/dist/rpc/chrome-profiler.d.ts.map +0 -1
- package/dist/rpc/chrome-profiler.js +0 -405
- package/dist/rpc/chrome-profiler.js.map +0 -1
- package/src/rpc/chrome-profiler.ts +0 -373
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
import {mapAsync} from "../util";
|
|
18
|
+
import {mapAsync, updateIfChanged} from "../util";
|
|
19
19
|
import {SourceFile} from "../tree";
|
|
20
20
|
import {ValidImmerRecipeReturnType} from "../visitor";
|
|
21
21
|
import {Expression, J, Type, JavaVisitor, NameTree, Statement, TypedTree} from "../java";
|
|
@@ -77,10 +77,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
77
77
|
}
|
|
78
78
|
alias = expression as JS.Alias;
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
const updates: any = {
|
|
81
|
+
prefix: await this.visitSpace(alias.prefix, p),
|
|
82
|
+
markers: await this.visitMarkers(alias.markers, p),
|
|
83
|
+
propertyName: await this.visitRightPadded(alias.propertyName, p),
|
|
84
|
+
alias: await this.visitDefined<Expression>(alias.alias, p)
|
|
85
|
+
};
|
|
86
|
+
return updateIfChanged(alias, updates);
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
protected async visitArrowFunction(arrowFunction: JS.ArrowFunction, p: P): Promise<J | undefined> {
|
|
@@ -96,21 +99,27 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
96
99
|
}
|
|
97
100
|
arrowFunction = statement as JS.ArrowFunction;
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
const updates: any = {
|
|
103
|
+
prefix: await this.visitSpace(arrowFunction.prefix, p),
|
|
104
|
+
markers: await this.visitMarkers(arrowFunction.markers, p),
|
|
105
|
+
leadingAnnotations: await mapAsync(arrowFunction.leadingAnnotations, item => this.visitDefined<J.Annotation>(item, p)),
|
|
106
|
+
modifiers: await mapAsync(arrowFunction.modifiers, item => this.visitDefined<J.Modifier>(item, p)),
|
|
107
|
+
typeParameters: arrowFunction.typeParameters && await this.visitDefined<J.TypeParameters>(arrowFunction.typeParameters, p),
|
|
108
|
+
lambda: await this.visitDefined<J.Lambda>(arrowFunction.lambda, p),
|
|
109
|
+
returnTypeExpression: arrowFunction.returnTypeExpression && await this.visitDefined<TypedTree>(arrowFunction.returnTypeExpression, p)
|
|
110
|
+
};
|
|
111
|
+
return updateIfChanged(arrowFunction, updates);
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
protected async visitAs(as_: JS.As, p: P): Promise<J | undefined> {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
const updates: any = {
|
|
116
|
+
prefix: await this.visitSpace(as_.prefix, p),
|
|
117
|
+
markers: await this.visitMarkers(as_.markers, p),
|
|
118
|
+
left: await this.visitRightPadded<Expression>(as_.left, p),
|
|
119
|
+
right: await this.visitDefined<Expression>(as_.right, p),
|
|
120
|
+
type: as_.type && await this.visitType(as_.type, p)
|
|
121
|
+
};
|
|
122
|
+
return updateIfChanged(as_, updates);
|
|
114
123
|
}
|
|
115
124
|
|
|
116
125
|
protected async visitAwait(await_: JS.Await, p: P): Promise<J | undefined> {
|
|
@@ -120,57 +129,78 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
120
129
|
}
|
|
121
130
|
await_ = expression as JS.Await;
|
|
122
131
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
132
|
+
const updates: any = {
|
|
133
|
+
prefix: await this.visitSpace(await_.prefix, p),
|
|
134
|
+
markers: await this.visitMarkers(await_.markers, p),
|
|
135
|
+
expression: await this.visitDefined<Expression>(await_.expression, p),
|
|
136
|
+
type: await_.type && await this.visitType(await_.type, p)
|
|
137
|
+
};
|
|
138
|
+
return updateIfChanged(await_, updates);
|
|
127
139
|
}
|
|
128
140
|
|
|
129
141
|
protected async visitJsxTag(element: JSX.Tag, p: P): Promise<J | undefined> {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
const updates: any = {
|
|
143
|
+
prefix: await this.visitSpace(element.prefix, p),
|
|
144
|
+
markers: await this.visitMarkers(element.markers, p),
|
|
145
|
+
openName: await this.visitLeftPadded(element.openName, p),
|
|
146
|
+
typeArguments: element.typeArguments && await this.visitContainer(element.typeArguments, p),
|
|
147
|
+
afterName: await this.visitSpace(element.afterName, p),
|
|
148
|
+
attributes: await mapAsync(element.attributes, attr => this.visitRightPadded(attr, p)),
|
|
149
|
+
selfClosing: element.selfClosing && await this.visitSpace(element.selfClosing, p),
|
|
150
|
+
children: element.children && await mapAsync(element.children, child => this.visit(child, p)),
|
|
151
|
+
closingName: element.closingName && await this.visitLeftPadded(element.closingName, p),
|
|
152
|
+
afterClosingName: element.afterClosingName && await this.visitSpace(element.afterClosingName, p)
|
|
153
|
+
};
|
|
154
|
+
return updateIfChanged(element, updates);
|
|
140
155
|
}
|
|
141
156
|
|
|
142
157
|
protected async visitJsxAttribute(attribute: JSX.Attribute, p: P): Promise<J | undefined> {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
158
|
+
const updates: any = {
|
|
159
|
+
prefix: await this.visitSpace(attribute.prefix, p),
|
|
160
|
+
markers: await this.visitMarkers(attribute.markers, p),
|
|
161
|
+
key: await this.visitDefined<J.Identifier | JSX.NamespacedName>(attribute.key, p),
|
|
162
|
+
value: attribute.value && await this.visitLeftPadded(attribute.value, p)
|
|
163
|
+
};
|
|
164
|
+
return updateIfChanged(attribute, updates);
|
|
147
165
|
}
|
|
148
166
|
|
|
149
167
|
protected async visitJsxSpreadAttribute(spread: JSX.SpreadAttribute, p: P): Promise<J | undefined> {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
168
|
+
const updates: any = {
|
|
169
|
+
prefix: await this.visitSpace(spread.prefix, p),
|
|
170
|
+
markers: await this.visitMarkers(spread.markers, p),
|
|
171
|
+
dots: await this.visitSpace(spread.dots, p),
|
|
172
|
+
expression: await this.visitRightPadded(spread.expression, p)
|
|
173
|
+
};
|
|
174
|
+
return updateIfChanged(spread, updates);
|
|
154
175
|
}
|
|
155
176
|
|
|
156
177
|
protected async visitJsxEmbeddedExpression(expr: JSX.EmbeddedExpression, p: P): Promise<J | undefined> {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
178
|
+
const updates: any = {
|
|
179
|
+
prefix: await this.visitSpace(expr.prefix, p),
|
|
180
|
+
markers: await this.visitMarkers(expr.markers, p),
|
|
181
|
+
expression: await this.visitRightPadded(expr.expression, p)
|
|
182
|
+
};
|
|
183
|
+
return updateIfChanged(expr, updates);
|
|
160
184
|
}
|
|
161
185
|
|
|
162
186
|
protected async visitJsxNamespacedName(ns: JSX.NamespacedName, p: P): Promise<J | undefined> {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
187
|
+
const updates: any = {
|
|
188
|
+
prefix: await this.visitSpace(ns.prefix, p),
|
|
189
|
+
markers: await this.visitMarkers(ns.markers, p),
|
|
190
|
+
namespace: await this.visitDefined<J.Identifier>(ns.namespace, p),
|
|
191
|
+
name: await this.visitLeftPadded(ns.name, p)
|
|
192
|
+
};
|
|
193
|
+
return updateIfChanged(ns, updates);
|
|
167
194
|
}
|
|
168
195
|
|
|
169
196
|
protected async visitJsCompilationUnit(compilationUnit: JS.CompilationUnit, p: P): Promise<J | undefined> {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
197
|
+
const updates: any = {
|
|
198
|
+
prefix: await this.visitSpace(compilationUnit.prefix, p),
|
|
199
|
+
markers: await this.visitMarkers(compilationUnit.markers, p),
|
|
200
|
+
statements: await mapAsync(compilationUnit.statements, stmt => this.visitRightPadded(stmt, p)),
|
|
201
|
+
eof: await this.visitSpace(compilationUnit.eof, p)
|
|
202
|
+
};
|
|
203
|
+
return updateIfChanged(compilationUnit, updates);
|
|
174
204
|
}
|
|
175
205
|
|
|
176
206
|
protected async visitConditionalType(conditionalType: JS.ConditionalType, p: P): Promise<J | undefined> {
|
|
@@ -180,11 +210,14 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
180
210
|
}
|
|
181
211
|
conditionalType = expression as JS.ConditionalType;
|
|
182
212
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
213
|
+
const updates: any = {
|
|
214
|
+
prefix: await this.visitSpace(conditionalType.prefix, p),
|
|
215
|
+
markers: await this.visitMarkers(conditionalType.markers, p),
|
|
216
|
+
checkType: await this.visitDefined<Expression>(conditionalType.checkType, p),
|
|
217
|
+
condition: await this.visitLeftPadded(conditionalType.condition, p),
|
|
218
|
+
type: conditionalType.type && await this.visitType(conditionalType.type, p)
|
|
219
|
+
};
|
|
220
|
+
return updateIfChanged(conditionalType, updates);
|
|
188
221
|
}
|
|
189
222
|
|
|
190
223
|
protected async visitDelete(delete_: JS.Delete, p: P): Promise<J | undefined> {
|
|
@@ -200,9 +233,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
200
233
|
}
|
|
201
234
|
delete_ = statement as JS.Delete;
|
|
202
235
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
236
|
+
const updates: any = {
|
|
237
|
+
prefix: await this.visitSpace(delete_.prefix, p),
|
|
238
|
+
markers: await this.visitMarkers(delete_.markers, p),
|
|
239
|
+
expression: await this.visitDefined<Expression>(delete_.expression, p)
|
|
240
|
+
};
|
|
241
|
+
return updateIfChanged(delete_, updates);
|
|
206
242
|
}
|
|
207
243
|
|
|
208
244
|
protected async visitExpressionStatement(expressionStatement: JS.ExpressionStatement, p: P): Promise<J | undefined> {
|
|
@@ -218,9 +254,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
218
254
|
}
|
|
219
255
|
expressionStatement = statement as JS.ExpressionStatement;
|
|
220
256
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
257
|
+
const updates: any = {
|
|
258
|
+
prefix: await this.visitSpace(expressionStatement.prefix, p),
|
|
259
|
+
markers: await this.visitMarkers(expressionStatement.markers, p),
|
|
260
|
+
expression: await this.visitDefined<Expression>(expressionStatement.expression, p)
|
|
261
|
+
};
|
|
262
|
+
return updateIfChanged(expressionStatement, updates);
|
|
224
263
|
}
|
|
225
264
|
|
|
226
265
|
protected async visitExpressionWithTypeArguments(expressionWithTypeArguments: JS.ExpressionWithTypeArguments, p: P): Promise<J | undefined> {
|
|
@@ -230,11 +269,14 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
230
269
|
}
|
|
231
270
|
expressionWithTypeArguments = expression as JS.ExpressionWithTypeArguments;
|
|
232
271
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
272
|
+
const updates: any = {
|
|
273
|
+
prefix: await this.visitSpace(expressionWithTypeArguments.prefix, p),
|
|
274
|
+
markers: await this.visitMarkers(expressionWithTypeArguments.markers, p),
|
|
275
|
+
clazz: await this.visitDefined<J>(expressionWithTypeArguments.clazz, p),
|
|
276
|
+
typeArguments: expressionWithTypeArguments.typeArguments && await this.visitContainer(expressionWithTypeArguments.typeArguments, p),
|
|
277
|
+
type: expressionWithTypeArguments.type && await this.visitType(expressionWithTypeArguments.type, p)
|
|
278
|
+
};
|
|
279
|
+
return updateIfChanged(expressionWithTypeArguments, updates);
|
|
238
280
|
}
|
|
239
281
|
|
|
240
282
|
protected async visitFunctionCall(functionCall: JS.FunctionCall, p: P): Promise<J | undefined> {
|
|
@@ -265,12 +307,15 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
265
307
|
}
|
|
266
308
|
functionType = expression as JS.FunctionType;
|
|
267
309
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
310
|
+
const updates: any = {
|
|
311
|
+
prefix: await this.visitSpace(functionType.prefix, p),
|
|
312
|
+
markers: await this.visitMarkers(functionType.markers, p),
|
|
313
|
+
constructorType: await this.visitLeftPadded(functionType.constructorType, p),
|
|
314
|
+
typeParameters: functionType.typeParameters && await this.visitDefined<J.TypeParameters>(functionType.typeParameters, p),
|
|
315
|
+
parameters: await this.visitContainer(functionType.parameters, p),
|
|
316
|
+
returnType: await this.visitLeftPadded(functionType.returnType, p)
|
|
317
|
+
};
|
|
318
|
+
return updateIfChanged(functionType, updates);
|
|
274
319
|
}
|
|
275
320
|
|
|
276
321
|
protected async visitInferType(inferType: JS.InferType, p: P): Promise<J | undefined> {
|
|
@@ -280,10 +325,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
280
325
|
}
|
|
281
326
|
inferType = expression as JS.InferType;
|
|
282
327
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
328
|
+
const updates: any = {
|
|
329
|
+
prefix: await this.visitSpace(inferType.prefix, p),
|
|
330
|
+
markers: await this.visitMarkers(inferType.markers, p),
|
|
331
|
+
typeParameter: await this.visitLeftPadded(inferType.typeParameter, p),
|
|
332
|
+
type: inferType.type && await this.visitType(inferType.type, p)
|
|
333
|
+
};
|
|
334
|
+
return updateIfChanged(inferType, updates);
|
|
287
335
|
}
|
|
288
336
|
|
|
289
337
|
protected async visitImportType(importType: JS.ImportType, p: P): Promise<J | undefined> {
|
|
@@ -293,13 +341,16 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
293
341
|
}
|
|
294
342
|
importType = expression as JS.ImportType;
|
|
295
343
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
344
|
+
const updates: any = {
|
|
345
|
+
prefix: await this.visitSpace(importType.prefix, p),
|
|
346
|
+
markers: await this.visitMarkers(importType.markers, p),
|
|
347
|
+
hasTypeof: await this.visitRightPadded(importType.hasTypeof, p),
|
|
348
|
+
argumentAndAttributes: await this.visitContainer(importType.argumentAndAttributes, p),
|
|
349
|
+
qualifier: importType.qualifier && await this.visitLeftPadded(importType.qualifier, p),
|
|
350
|
+
typeArguments: importType.typeArguments && await this.visitContainer(importType.typeArguments, p),
|
|
351
|
+
type: importType.type && await this.visitType(importType.type, p)
|
|
352
|
+
};
|
|
353
|
+
return updateIfChanged(importType, updates);
|
|
303
354
|
}
|
|
304
355
|
|
|
305
356
|
protected async visitImportDeclaration(jsImport: JS.Import, p: P): Promise<J | undefined> {
|
|
@@ -309,20 +360,26 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
309
360
|
}
|
|
310
361
|
jsImport = statement as JS.Import;
|
|
311
362
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
363
|
+
const updates: any = {
|
|
364
|
+
prefix: await this.visitSpace(jsImport.prefix, p),
|
|
365
|
+
markers: await this.visitMarkers(jsImport.markers, p),
|
|
366
|
+
modifiers: await mapAsync(jsImport.modifiers, item => this.visitDefined<J.Modifier>(item, p)),
|
|
367
|
+
importClause: jsImport.importClause && await this.visitDefined<JS.ImportClause>(jsImport.importClause, p),
|
|
368
|
+
moduleSpecifier: jsImport.moduleSpecifier && await this.visitLeftPadded(jsImport.moduleSpecifier, p),
|
|
369
|
+
attributes: jsImport.attributes && await this.visitDefined<JS.ImportAttributes>(jsImport.attributes, p),
|
|
370
|
+
initializer: jsImport.initializer && await this.visitLeftPadded(jsImport.initializer, p)
|
|
371
|
+
};
|
|
372
|
+
return updateIfChanged(jsImport, updates);
|
|
319
373
|
}
|
|
320
374
|
|
|
321
375
|
protected async visitImportClause(importClause: JS.ImportClause, p: P): Promise<J | undefined> {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
376
|
+
const updates: any = {
|
|
377
|
+
prefix: await this.visitSpace(importClause.prefix, p),
|
|
378
|
+
markers: await this.visitMarkers(importClause.markers, p),
|
|
379
|
+
name: importClause.name && await this.visitRightPadded(importClause.name, p),
|
|
380
|
+
namedBindings: importClause.namedBindings && await this.visitDefined<Expression>(importClause.namedBindings, p)
|
|
381
|
+
};
|
|
382
|
+
return updateIfChanged(importClause, updates);
|
|
326
383
|
}
|
|
327
384
|
|
|
328
385
|
protected async visitNamedImports(namedImports: JS.NamedImports, p: P): Promise<J | undefined> {
|
|
@@ -332,10 +389,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
332
389
|
}
|
|
333
390
|
namedImports = expression as JS.NamedImports;
|
|
334
391
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
392
|
+
const updates: any = {
|
|
393
|
+
prefix: await this.visitSpace(namedImports.prefix, p),
|
|
394
|
+
markers: await this.visitMarkers(namedImports.markers, p),
|
|
395
|
+
elements: await this.visitContainer(namedImports.elements, p),
|
|
396
|
+
type: namedImports.type && await this.visitType(namedImports.type, p)
|
|
397
|
+
};
|
|
398
|
+
return updateIfChanged(namedImports, updates);
|
|
339
399
|
}
|
|
340
400
|
|
|
341
401
|
protected async visitImportSpecifier(importSpecifier: JS.ImportSpecifier, p: P): Promise<J | undefined> {
|
|
@@ -345,25 +405,34 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
345
405
|
}
|
|
346
406
|
importSpecifier = expression as JS.ImportSpecifier;
|
|
347
407
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
408
|
+
const updates: any = {
|
|
409
|
+
prefix: await this.visitSpace(importSpecifier.prefix, p),
|
|
410
|
+
markers: await this.visitMarkers(importSpecifier.markers, p),
|
|
411
|
+
importType: await this.visitLeftPadded(importSpecifier.importType, p),
|
|
412
|
+
specifier: await this.visitDefined<JS.Alias | J.Identifier>(importSpecifier.specifier, p),
|
|
413
|
+
type: importSpecifier.type && await this.visitType(importSpecifier.type, p)
|
|
414
|
+
};
|
|
415
|
+
return updateIfChanged(importSpecifier, updates);
|
|
353
416
|
}
|
|
354
417
|
|
|
355
418
|
protected async visitImportAttributes(importAttributes: JS.ImportAttributes, p: P): Promise<J | undefined> {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
419
|
+
const updates: any = {
|
|
420
|
+
prefix: await this.visitSpace(importAttributes.prefix, p),
|
|
421
|
+
markers: await this.visitMarkers(importAttributes.markers, p),
|
|
422
|
+
elements: await this.visitContainer(importAttributes.elements, p)
|
|
423
|
+
};
|
|
424
|
+
return updateIfChanged(importAttributes, updates);
|
|
359
425
|
}
|
|
360
426
|
|
|
361
427
|
protected async visitImportTypeAttributes(importTypeAttributes: JS.ImportTypeAttributes, p: P): Promise<J | undefined> {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
428
|
+
const updates: any = {
|
|
429
|
+
prefix: await this.visitSpace(importTypeAttributes.prefix, p),
|
|
430
|
+
markers: await this.visitMarkers(importTypeAttributes.markers, p),
|
|
431
|
+
token: await this.visitRightPadded(importTypeAttributes.token, p),
|
|
432
|
+
elements: await this.visitContainer(importTypeAttributes.elements, p),
|
|
433
|
+
end: await this.visitSpace(importTypeAttributes.end, p)
|
|
434
|
+
};
|
|
435
|
+
return updateIfChanged(importTypeAttributes, updates);
|
|
367
436
|
}
|
|
368
437
|
|
|
369
438
|
protected async visitImportAttribute(importAttribute: JS.ImportAttribute, p: P): Promise<J | undefined> {
|
|
@@ -373,19 +442,25 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
373
442
|
}
|
|
374
443
|
importAttribute = statement as JS.ImportAttribute;
|
|
375
444
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
445
|
+
const updates: any = {
|
|
446
|
+
prefix: await this.visitSpace(importAttribute.prefix, p),
|
|
447
|
+
markers: await this.visitMarkers(importAttribute.markers, p),
|
|
448
|
+
name: await this.visitDefined<Expression>(importAttribute.name, p),
|
|
449
|
+
value: await this.visitLeftPadded(importAttribute.value, p)
|
|
450
|
+
};
|
|
451
|
+
return updateIfChanged(importAttribute, updates);
|
|
380
452
|
}
|
|
381
453
|
|
|
382
454
|
protected async visitBinaryExtensions(jsBinary: JS.Binary, p: P): Promise<J | undefined> {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
455
|
+
const updates: any = {
|
|
456
|
+
prefix: await this.visitSpace(jsBinary.prefix, p),
|
|
457
|
+
markers: await this.visitMarkers(jsBinary.markers, p),
|
|
458
|
+
left: await this.visitDefined<Expression>(jsBinary.left, p),
|
|
459
|
+
operator: await this.visitLeftPadded(jsBinary.operator, p),
|
|
460
|
+
right: await this.visitDefined<Expression>(jsBinary.right, p),
|
|
461
|
+
type: jsBinary.type && await this.visitType(jsBinary.type, p)
|
|
462
|
+
};
|
|
463
|
+
return updateIfChanged(jsBinary, updates);
|
|
389
464
|
}
|
|
390
465
|
|
|
391
466
|
protected async visitLiteralType(literalType: JS.LiteralType, p: P): Promise<J | undefined> {
|
|
@@ -395,10 +470,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
395
470
|
}
|
|
396
471
|
literalType = expression as JS.LiteralType;
|
|
397
472
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
473
|
+
const updates: any = {
|
|
474
|
+
prefix: await this.visitSpace(literalType.prefix, p),
|
|
475
|
+
markers: await this.visitMarkers(literalType.markers, p),
|
|
476
|
+
literal: await this.visitDefined<Expression>(literalType.literal, p),
|
|
477
|
+
type: (await this.visitType(literalType.type, p))!
|
|
478
|
+
};
|
|
479
|
+
return updateIfChanged(literalType, updates);
|
|
402
480
|
}
|
|
403
481
|
|
|
404
482
|
protected async visitMappedType(mappedType: JS.MappedType, p: P): Promise<J | undefined> {
|
|
@@ -408,29 +486,38 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
408
486
|
}
|
|
409
487
|
mappedType = expression as JS.MappedType;
|
|
410
488
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
489
|
+
const updates: any = {
|
|
490
|
+
prefix: await this.visitSpace(mappedType.prefix, p),
|
|
491
|
+
markers: await this.visitMarkers(mappedType.markers, p),
|
|
492
|
+
prefixToken: mappedType.prefixToken && await this.visitLeftPadded(mappedType.prefixToken, p),
|
|
493
|
+
hasReadonly: await this.visitLeftPadded(mappedType.hasReadonly, p),
|
|
494
|
+
keysRemapping: await this.visitDefined<JS.MappedType.KeysRemapping>(mappedType.keysRemapping, p),
|
|
495
|
+
suffixToken: mappedType.suffixToken && await this.visitLeftPadded(mappedType.suffixToken, p),
|
|
496
|
+
hasQuestionToken: await this.visitLeftPadded(mappedType.hasQuestionToken, p),
|
|
497
|
+
valueType: await this.visitContainer(mappedType.valueType, p),
|
|
498
|
+
type: mappedType.type && await this.visitType(mappedType.type, p)
|
|
499
|
+
};
|
|
500
|
+
return updateIfChanged(mappedType, updates);
|
|
420
501
|
}
|
|
421
502
|
|
|
422
503
|
protected async visitMappedTypeKeysRemapping(keysRemapping: JS.MappedType.KeysRemapping, p: P): Promise<J | undefined> {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
504
|
+
const updates: any = {
|
|
505
|
+
prefix: await this.visitSpace(keysRemapping.prefix, p),
|
|
506
|
+
markers: await this.visitMarkers(keysRemapping.markers, p),
|
|
507
|
+
typeParameter: await this.visitRightPadded(keysRemapping.typeParameter, p),
|
|
508
|
+
nameType: keysRemapping.nameType && await this.visitRightPadded(keysRemapping.nameType, p)
|
|
509
|
+
};
|
|
510
|
+
return updateIfChanged(keysRemapping, updates);
|
|
427
511
|
}
|
|
428
512
|
|
|
429
513
|
protected async visitMappedTypeParameter(mappedTypeParameter: JS.MappedType.Parameter, p: P): Promise<J | undefined> {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
514
|
+
const updates: any = {
|
|
515
|
+
prefix: await this.visitSpace(mappedTypeParameter.prefix, p),
|
|
516
|
+
markers: await this.visitMarkers(mappedTypeParameter.markers, p),
|
|
517
|
+
name: await this.visitDefined<Expression>(mappedTypeParameter.name, p),
|
|
518
|
+
iterateType: await this.visitLeftPadded(mappedTypeParameter.iterateType, p)
|
|
519
|
+
};
|
|
520
|
+
return updateIfChanged(mappedTypeParameter, updates);
|
|
434
521
|
}
|
|
435
522
|
|
|
436
523
|
protected async visitObjectBindingPattern(objectBindingPattern: JS.ObjectBindingPattern, p: P): Promise<J | undefined> {
|
|
@@ -440,13 +527,16 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
440
527
|
}
|
|
441
528
|
objectBindingPattern = expression as JS.ObjectBindingPattern;
|
|
442
529
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
530
|
+
const updates: any = {
|
|
531
|
+
prefix: await this.visitSpace(objectBindingPattern.prefix, p),
|
|
532
|
+
markers: await this.visitMarkers(objectBindingPattern.markers, p),
|
|
533
|
+
leadingAnnotations: await mapAsync(objectBindingPattern.leadingAnnotations, item => this.visitDefined<J.Annotation>(item, p)),
|
|
534
|
+
modifiers: await mapAsync(objectBindingPattern.modifiers, item => this.visitDefined<J.Modifier>(item, p)),
|
|
535
|
+
typeExpression: objectBindingPattern.typeExpression && await this.visitDefined<TypedTree>(objectBindingPattern.typeExpression, p),
|
|
536
|
+
bindings: await this.visitContainer(objectBindingPattern.bindings, p),
|
|
537
|
+
initializer: objectBindingPattern.initializer && await this.visitLeftPadded(objectBindingPattern.initializer, p)
|
|
538
|
+
};
|
|
539
|
+
return updateIfChanged(objectBindingPattern, updates);
|
|
450
540
|
}
|
|
451
541
|
|
|
452
542
|
protected async visitPropertyAssignment(propertyAssignment: JS.PropertyAssignment, p: P): Promise<J | undefined> {
|
|
@@ -456,10 +546,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
456
546
|
}
|
|
457
547
|
propertyAssignment = statement as JS.PropertyAssignment;
|
|
458
548
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
549
|
+
const updates: any = {
|
|
550
|
+
prefix: await this.visitSpace(propertyAssignment.prefix, p),
|
|
551
|
+
markers: await this.visitMarkers(propertyAssignment.markers, p),
|
|
552
|
+
name: await this.visitRightPadded(propertyAssignment.name, p),
|
|
553
|
+
initializer: propertyAssignment.initializer && await this.visitDefined<Expression>(propertyAssignment.initializer, p)
|
|
554
|
+
};
|
|
555
|
+
return updateIfChanged(propertyAssignment, updates);
|
|
463
556
|
}
|
|
464
557
|
|
|
465
558
|
protected async visitSatisfiesExpression(satisfiesExpression: JS.SatisfiesExpression, p: P): Promise<J | undefined> {
|
|
@@ -469,11 +562,14 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
469
562
|
}
|
|
470
563
|
satisfiesExpression = expression as JS.SatisfiesExpression;
|
|
471
564
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
565
|
+
const updates: any = {
|
|
566
|
+
prefix: await this.visitSpace(satisfiesExpression.prefix, p),
|
|
567
|
+
markers: await this.visitMarkers(satisfiesExpression.markers, p),
|
|
568
|
+
expression: await this.visitDefined<J>(satisfiesExpression.expression, p),
|
|
569
|
+
satisfiesType: await this.visitLeftPadded(satisfiesExpression.satisfiesType, p),
|
|
570
|
+
type: satisfiesExpression.type && await this.visitType(satisfiesExpression.type, p)
|
|
571
|
+
};
|
|
572
|
+
return updateIfChanged(satisfiesExpression, updates);
|
|
477
573
|
}
|
|
478
574
|
|
|
479
575
|
protected async visitScopedVariableDeclarations(scopedVariableDeclarations: JS.ScopedVariableDeclarations, p: P): Promise<J | undefined> {
|
|
@@ -483,10 +579,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
483
579
|
}
|
|
484
580
|
scopedVariableDeclarations = statement as JS.ScopedVariableDeclarations;
|
|
485
581
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
582
|
+
const updates: any = {
|
|
583
|
+
prefix: await this.visitSpace(scopedVariableDeclarations.prefix, p),
|
|
584
|
+
markers: await this.visitMarkers(scopedVariableDeclarations.markers, p),
|
|
585
|
+
modifiers: await mapAsync(scopedVariableDeclarations.modifiers, item => this.visitDefined<J.Modifier>(item, p)),
|
|
586
|
+
variables: await mapAsync(scopedVariableDeclarations.variables, item => this.visitRightPadded(item, p))
|
|
587
|
+
};
|
|
588
|
+
return updateIfChanged(scopedVariableDeclarations, updates);
|
|
490
589
|
}
|
|
491
590
|
|
|
492
591
|
protected async visitStatementExpression(statementExpression: JS.StatementExpression, p: P): Promise<J | undefined> {
|
|
@@ -502,9 +601,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
502
601
|
}
|
|
503
602
|
statementExpression = statement as JS.StatementExpression;
|
|
504
603
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
604
|
+
const updates: any = {
|
|
605
|
+
prefix: await this.visitSpace(statementExpression.prefix, p),
|
|
606
|
+
markers: await this.visitMarkers(statementExpression.markers, p),
|
|
607
|
+
statement: await this.visitDefined<Statement>(statementExpression.statement, p)
|
|
608
|
+
};
|
|
609
|
+
return updateIfChanged(statementExpression, updates);
|
|
508
610
|
}
|
|
509
611
|
|
|
510
612
|
protected async visitTaggedTemplateExpression(taggedTemplateExpression: JS.TaggedTemplateExpression, p: P): Promise<J | undefined> {
|
|
@@ -520,12 +622,15 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
520
622
|
}
|
|
521
623
|
taggedTemplateExpression = statement as JS.TaggedTemplateExpression;
|
|
522
624
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
625
|
+
const updates: any = {
|
|
626
|
+
prefix: await this.visitSpace(taggedTemplateExpression.prefix, p),
|
|
627
|
+
markers: await this.visitMarkers(taggedTemplateExpression.markers, p),
|
|
628
|
+
tag: taggedTemplateExpression.tag && await this.visitRightPadded(taggedTemplateExpression.tag, p),
|
|
629
|
+
typeArguments: taggedTemplateExpression.typeArguments && await this.visitContainer(taggedTemplateExpression.typeArguments, p),
|
|
630
|
+
templateExpression: await this.visitDefined<Expression>(taggedTemplateExpression.templateExpression, p),
|
|
631
|
+
type: taggedTemplateExpression.type && await this.visitType(taggedTemplateExpression.type, p)
|
|
632
|
+
};
|
|
633
|
+
return updateIfChanged(taggedTemplateExpression, updates);
|
|
529
634
|
}
|
|
530
635
|
|
|
531
636
|
protected async visitTemplateExpression(templateExpression: JS.TemplateExpression, p: P): Promise<J | undefined> {
|
|
@@ -541,18 +646,24 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
541
646
|
}
|
|
542
647
|
templateExpression = statement as JS.TemplateExpression;
|
|
543
648
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
649
|
+
const updates: any = {
|
|
650
|
+
prefix: await this.visitSpace(templateExpression.prefix, p),
|
|
651
|
+
markers: await this.visitMarkers(templateExpression.markers, p),
|
|
652
|
+
head: await this.visitDefined<J.Literal>(templateExpression.head, p),
|
|
653
|
+
spans: await mapAsync(templateExpression.spans, item => this.visitRightPadded(item, p)),
|
|
654
|
+
type: templateExpression.type && await this.visitType(templateExpression.type, p)
|
|
655
|
+
};
|
|
656
|
+
return updateIfChanged(templateExpression, updates);
|
|
549
657
|
}
|
|
550
658
|
|
|
551
659
|
protected async visitTemplateExpressionSpan(span: JS.TemplateExpression.Span, p: P): Promise<J | undefined> {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
660
|
+
const updates: any = {
|
|
661
|
+
prefix: await this.visitSpace(span.prefix, p),
|
|
662
|
+
markers: await this.visitMarkers(span.markers, p),
|
|
663
|
+
expression: await this.visitDefined<J>(span.expression, p),
|
|
664
|
+
tail: await this.visitDefined<J.Literal>(span.tail, p)
|
|
665
|
+
};
|
|
666
|
+
return updateIfChanged(span, updates);
|
|
556
667
|
}
|
|
557
668
|
|
|
558
669
|
protected async visitTuple(tuple: JS.Tuple, p: P): Promise<J | undefined> {
|
|
@@ -562,10 +673,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
562
673
|
}
|
|
563
674
|
tuple = expression as JS.Tuple;
|
|
564
675
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
676
|
+
const updates: any = {
|
|
677
|
+
prefix: await this.visitSpace(tuple.prefix, p),
|
|
678
|
+
markers: await this.visitMarkers(tuple.markers, p),
|
|
679
|
+
elements: await this.visitContainer(tuple.elements, p),
|
|
680
|
+
type: tuple.type && await this.visitType(tuple.type, p)
|
|
681
|
+
};
|
|
682
|
+
return updateIfChanged(tuple, updates);
|
|
569
683
|
}
|
|
570
684
|
|
|
571
685
|
protected async visitTypeDeclaration(typeDeclaration: JS.TypeDeclaration, p: P): Promise<J | undefined> {
|
|
@@ -575,13 +689,16 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
575
689
|
}
|
|
576
690
|
typeDeclaration = statement as JS.TypeDeclaration;
|
|
577
691
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
692
|
+
const updates: any = {
|
|
693
|
+
prefix: await this.visitSpace(typeDeclaration.prefix, p),
|
|
694
|
+
markers: await this.visitMarkers(typeDeclaration.markers, p),
|
|
695
|
+
modifiers: await mapAsync(typeDeclaration.modifiers, item => this.visitDefined<J.Modifier>(item, p)),
|
|
696
|
+
name: await this.visitLeftPadded(typeDeclaration.name, p),
|
|
697
|
+
typeParameters: typeDeclaration.typeParameters && await this.visitDefined<J.TypeParameters>(typeDeclaration.typeParameters, p),
|
|
698
|
+
initializer: await this.visitLeftPadded(typeDeclaration.initializer, p),
|
|
699
|
+
type: typeDeclaration.type && await this.visitType(typeDeclaration.type, p)
|
|
700
|
+
};
|
|
701
|
+
return updateIfChanged(typeDeclaration, updates);
|
|
585
702
|
}
|
|
586
703
|
|
|
587
704
|
protected async visitTypeOf(typeOf: JS.TypeOf, p: P): Promise<J | undefined> {
|
|
@@ -591,10 +708,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
591
708
|
}
|
|
592
709
|
typeOf = expression as JS.TypeOf;
|
|
593
710
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
711
|
+
const updates: any = {
|
|
712
|
+
prefix: await this.visitSpace(typeOf.prefix, p),
|
|
713
|
+
markers: await this.visitMarkers(typeOf.markers, p),
|
|
714
|
+
expression: await this.visitDefined<Expression>(typeOf.expression, p),
|
|
715
|
+
type: typeOf.type && await this.visitType(typeOf.type, p)
|
|
716
|
+
};
|
|
717
|
+
return updateIfChanged(typeOf, updates);
|
|
598
718
|
}
|
|
599
719
|
|
|
600
720
|
protected async visitTypeTreeExpression(typeTreeExpression: JS.TypeTreeExpression, p: P): Promise<J | undefined> {
|
|
@@ -604,18 +724,24 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
604
724
|
}
|
|
605
725
|
typeTreeExpression = expression as JS.TypeTreeExpression;
|
|
606
726
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
727
|
+
const updates: any = {
|
|
728
|
+
prefix: await this.visitSpace(typeTreeExpression.prefix, p),
|
|
729
|
+
markers: await this.visitMarkers(typeTreeExpression.markers, p),
|
|
730
|
+
expression: await this.visitDefined<Expression>(typeTreeExpression.expression, p)
|
|
731
|
+
};
|
|
732
|
+
return updateIfChanged(typeTreeExpression, updates);
|
|
610
733
|
}
|
|
611
734
|
|
|
612
735
|
protected async visitAssignmentOperationExtensions(assignmentOperation: JS.AssignmentOperation, p: P): Promise<J | undefined> {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
736
|
+
const updates: any = {
|
|
737
|
+
prefix: await this.visitSpace(assignmentOperation.prefix, p),
|
|
738
|
+
markers: await this.visitMarkers(assignmentOperation.markers, p),
|
|
739
|
+
variable: await this.visitDefined<Expression>(assignmentOperation.variable, p),
|
|
740
|
+
operator: await this.visitLeftPadded(assignmentOperation.operator, p),
|
|
741
|
+
assignment: await this.visitDefined<Expression>(assignmentOperation.assignment, p),
|
|
742
|
+
type: assignmentOperation.type && await this.visitType(assignmentOperation.type, p)
|
|
743
|
+
};
|
|
744
|
+
return updateIfChanged(assignmentOperation, updates);
|
|
619
745
|
}
|
|
620
746
|
|
|
621
747
|
protected async visitIndexedAccessType(indexedAccessType: JS.IndexedAccessType, p: P): Promise<J | undefined> {
|
|
@@ -625,18 +751,24 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
625
751
|
}
|
|
626
752
|
indexedAccessType = expression as JS.IndexedAccessType;
|
|
627
753
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
754
|
+
const updates: any = {
|
|
755
|
+
prefix: await this.visitSpace(indexedAccessType.prefix, p),
|
|
756
|
+
markers: await this.visitMarkers(indexedAccessType.markers, p),
|
|
757
|
+
objectType: await this.visitDefined<TypedTree>(indexedAccessType.objectType, p),
|
|
758
|
+
indexType: await this.visitDefined<TypedTree>(indexedAccessType.indexType, p),
|
|
759
|
+
type: indexedAccessType.type && await this.visitType(indexedAccessType.type, p)
|
|
760
|
+
};
|
|
761
|
+
return updateIfChanged(indexedAccessType, updates);
|
|
633
762
|
}
|
|
634
763
|
|
|
635
764
|
protected async visitIndexedAccessTypeIndexType(indexType: JS.IndexedAccessType.IndexType, p: P): Promise<J | undefined> {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
765
|
+
const updates: any = {
|
|
766
|
+
prefix: await this.visitSpace(indexType.prefix, p),
|
|
767
|
+
markers: await this.visitMarkers(indexType.markers, p),
|
|
768
|
+
element: await this.visitRightPadded(indexType.element, p),
|
|
769
|
+
type: indexType.type && await this.visitType(indexType.type, p)
|
|
770
|
+
};
|
|
771
|
+
return updateIfChanged(indexType, updates);
|
|
640
772
|
}
|
|
641
773
|
|
|
642
774
|
protected async visitTypeQuery(typeQuery: JS.TypeQuery, p: P): Promise<J | undefined> {
|
|
@@ -646,11 +778,14 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
646
778
|
}
|
|
647
779
|
typeQuery = expression as JS.TypeQuery;
|
|
648
780
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
781
|
+
const updates: any = {
|
|
782
|
+
prefix: await this.visitSpace(typeQuery.prefix, p),
|
|
783
|
+
markers: await this.visitMarkers(typeQuery.markers, p),
|
|
784
|
+
typeExpression: await this.visitDefined<TypedTree>(typeQuery.typeExpression, p),
|
|
785
|
+
typeArguments: typeQuery.typeArguments && await this.visitContainer(typeQuery.typeArguments, p),
|
|
786
|
+
type: typeQuery.type && await this.visitType(typeQuery.type, p)
|
|
787
|
+
};
|
|
788
|
+
return updateIfChanged(typeQuery, updates);
|
|
654
789
|
}
|
|
655
790
|
|
|
656
791
|
protected async visitTypeInfo(typeInfo: JS.TypeInfo, p: P): Promise<J | undefined> {
|
|
@@ -660,9 +795,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
660
795
|
}
|
|
661
796
|
typeInfo = expression as JS.TypeInfo;
|
|
662
797
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
798
|
+
const updates: any = {
|
|
799
|
+
prefix: await this.visitSpace(typeInfo.prefix, p),
|
|
800
|
+
markers: await this.visitMarkers(typeInfo.markers, p),
|
|
801
|
+
typeIdentifier: await this.visitDefined<TypedTree>(typeInfo.typeIdentifier, p)
|
|
802
|
+
};
|
|
803
|
+
return updateIfChanged(typeInfo, updates);
|
|
666
804
|
}
|
|
667
805
|
|
|
668
806
|
protected async visitComputedPropertyName(computedPropertyName: JS.ComputedPropertyName, p: P): Promise<J | undefined> {
|
|
@@ -672,9 +810,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
672
810
|
}
|
|
673
811
|
computedPropertyName = expression as JS.ComputedPropertyName;
|
|
674
812
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
813
|
+
const updates: any = {
|
|
814
|
+
prefix: await this.visitSpace(computedPropertyName.prefix, p),
|
|
815
|
+
markers: await this.visitMarkers(computedPropertyName.markers, p),
|
|
816
|
+
expression: await this.visitRightPadded(computedPropertyName.expression, p)
|
|
817
|
+
};
|
|
818
|
+
return updateIfChanged(computedPropertyName, updates);
|
|
678
819
|
}
|
|
679
820
|
|
|
680
821
|
protected async visitTypeOperator(typeOperator: JS.TypeOperator, p: P): Promise<J | undefined> {
|
|
@@ -684,9 +825,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
684
825
|
}
|
|
685
826
|
typeOperator = expression as JS.TypeOperator;
|
|
686
827
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
828
|
+
const updates: any = {
|
|
829
|
+
prefix: await this.visitSpace(typeOperator.prefix, p),
|
|
830
|
+
markers: await this.visitMarkers(typeOperator.markers, p),
|
|
831
|
+
expression: await this.visitLeftPadded(typeOperator.expression, p)
|
|
832
|
+
};
|
|
833
|
+
return updateIfChanged(typeOperator, updates);
|
|
690
834
|
}
|
|
691
835
|
|
|
692
836
|
protected async visitTypePredicate(typePredicate: JS.TypePredicate, p: P): Promise<J | undefined> {
|
|
@@ -696,12 +840,15 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
696
840
|
}
|
|
697
841
|
typePredicate = expression as JS.TypePredicate;
|
|
698
842
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
843
|
+
const updates: any = {
|
|
844
|
+
prefix: await this.visitSpace(typePredicate.prefix, p),
|
|
845
|
+
markers: await this.visitMarkers(typePredicate.markers, p),
|
|
846
|
+
asserts: await this.visitLeftPadded(typePredicate.asserts, p),
|
|
847
|
+
parameterName: await this.visitDefined<J.Identifier>(typePredicate.parameterName, p),
|
|
848
|
+
expression: typePredicate.expression && await this.visitLeftPadded(typePredicate.expression, p),
|
|
849
|
+
type: typePredicate.type && await this.visitType(typePredicate.type, p)
|
|
850
|
+
};
|
|
851
|
+
return updateIfChanged(typePredicate, updates);
|
|
705
852
|
}
|
|
706
853
|
|
|
707
854
|
protected async visitUnion(union: JS.Union, p: P): Promise<J | undefined> {
|
|
@@ -711,10 +858,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
711
858
|
}
|
|
712
859
|
union = expression as JS.Union;
|
|
713
860
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
861
|
+
const updates: any = {
|
|
862
|
+
prefix: await this.visitSpace(union.prefix, p),
|
|
863
|
+
markers: await this.visitMarkers(union.markers, p),
|
|
864
|
+
types: await mapAsync(union.types, item => this.visitRightPadded(item, p)),
|
|
865
|
+
type: union.type && await this.visitType(union.type, p)
|
|
866
|
+
};
|
|
867
|
+
return updateIfChanged(union, updates);
|
|
718
868
|
}
|
|
719
869
|
|
|
720
870
|
protected async visitIntersection(intersection: JS.Intersection, p: P): Promise<J | undefined> {
|
|
@@ -724,10 +874,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
724
874
|
}
|
|
725
875
|
intersection = expression as JS.Intersection;
|
|
726
876
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
877
|
+
const updates: any = {
|
|
878
|
+
prefix: await this.visitSpace(intersection.prefix, p),
|
|
879
|
+
markers: await this.visitMarkers(intersection.markers, p),
|
|
880
|
+
types: await mapAsync(intersection.types, item => this.visitRightPadded(item, p)),
|
|
881
|
+
type: intersection.type && await this.visitType(intersection.type, p)
|
|
882
|
+
};
|
|
883
|
+
return updateIfChanged(intersection, updates);
|
|
731
884
|
}
|
|
732
885
|
|
|
733
886
|
protected async visitVoid(void_: JS.Void, p: P): Promise<J | undefined> {
|
|
@@ -737,9 +890,12 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
737
890
|
}
|
|
738
891
|
void_ = expression as JS.Void;
|
|
739
892
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
893
|
+
const updates: any = {
|
|
894
|
+
prefix: await this.visitSpace(void_.prefix, p),
|
|
895
|
+
markers: await this.visitMarkers(void_.markers, p),
|
|
896
|
+
expression: await this.visitDefined<Expression>(void_.expression, p)
|
|
897
|
+
};
|
|
898
|
+
return updateIfChanged(void_, updates);
|
|
743
899
|
}
|
|
744
900
|
|
|
745
901
|
protected async visitWithStatement(withStatement: JS.WithStatement, p: P): Promise<J | undefined> {
|
|
@@ -749,10 +905,13 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
749
905
|
}
|
|
750
906
|
withStatement = statement as JS.WithStatement;
|
|
751
907
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
908
|
+
const updates: any = {
|
|
909
|
+
prefix: await this.visitSpace(withStatement.prefix, p),
|
|
910
|
+
markers: await this.visitMarkers(withStatement.markers, p),
|
|
911
|
+
expression: await this.visitDefined<J.ControlParentheses<Expression>>(withStatement.expression, p),
|
|
912
|
+
body: await this.visitRightPadded(withStatement.body, p)
|
|
913
|
+
};
|
|
914
|
+
return updateIfChanged(withStatement, updates);
|
|
756
915
|
}
|
|
757
916
|
|
|
758
917
|
protected async visitIndexSignatureDeclaration(indexSignatureDeclaration: JS.IndexSignatureDeclaration, p: P): Promise<J | undefined> {
|
|
@@ -762,12 +921,15 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
762
921
|
}
|
|
763
922
|
indexSignatureDeclaration = statement as JS.IndexSignatureDeclaration;
|
|
764
923
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
924
|
+
const updates: any = {
|
|
925
|
+
prefix: await this.visitSpace(indexSignatureDeclaration.prefix, p),
|
|
926
|
+
markers: await this.visitMarkers(indexSignatureDeclaration.markers, p),
|
|
927
|
+
modifiers: await mapAsync(indexSignatureDeclaration.modifiers, item => this.visitDefined<J.Modifier>(item, p)),
|
|
928
|
+
parameters: await this.visitContainer(indexSignatureDeclaration.parameters, p),
|
|
929
|
+
typeExpression: await this.visitLeftPadded(indexSignatureDeclaration.typeExpression, p),
|
|
930
|
+
type: indexSignatureDeclaration.type && await this.visitType(indexSignatureDeclaration.type, p)
|
|
931
|
+
};
|
|
932
|
+
return updateIfChanged(indexSignatureDeclaration, updates);
|
|
771
933
|
}
|
|
772
934
|
|
|
773
935
|
protected async visitComputedPropertyMethodDeclaration(computedPropMethod: JS.ComputedPropertyMethodDeclaration, p: P): Promise<J | undefined> {
|
|
@@ -777,29 +939,38 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
777
939
|
}
|
|
778
940
|
computedPropMethod = statement as JS.ComputedPropertyMethodDeclaration;
|
|
779
941
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
942
|
+
const updates: any = {
|
|
943
|
+
prefix: await this.visitSpace(computedPropMethod.prefix, p),
|
|
944
|
+
markers: await this.visitMarkers(computedPropMethod.markers, p),
|
|
945
|
+
leadingAnnotations: await mapAsync(computedPropMethod.leadingAnnotations, item => this.visitDefined<J.Annotation>(item, p)),
|
|
946
|
+
modifiers: await mapAsync(computedPropMethod.modifiers, item => this.visitDefined<J.Modifier>(item, p)),
|
|
947
|
+
typeParameters: computedPropMethod.typeParameters && await this.visitDefined<J.TypeParameters>(computedPropMethod.typeParameters, p),
|
|
948
|
+
returnTypeExpression: computedPropMethod.returnTypeExpression && await this.visitDefined<TypedTree>(computedPropMethod.returnTypeExpression, p),
|
|
949
|
+
name: await this.visitDefined<ComputedPropertyName>(computedPropMethod.name, p),
|
|
950
|
+
parameters: await this.visitContainer(computedPropMethod.parameters, p),
|
|
951
|
+
body: computedPropMethod.body && await this.visitDefined<J.Block>(computedPropMethod.body, p),
|
|
952
|
+
methodType: computedPropMethod.methodType && (await this.visitType(computedPropMethod.methodType, p) as Type.Method)
|
|
953
|
+
};
|
|
954
|
+
return updateIfChanged(computedPropMethod, updates);
|
|
790
955
|
}
|
|
791
956
|
|
|
792
957
|
protected async visitForOfLoop(forOfLoop: JS.ForOfLoop, p: P): Promise<J | undefined> {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
958
|
+
const updates: any = {
|
|
959
|
+
prefix: await this.visitSpace(forOfLoop.prefix, p),
|
|
960
|
+
markers: await this.visitMarkers(forOfLoop.markers, p),
|
|
961
|
+
loop: await this.visitDefined<J.ForEachLoop>(forOfLoop.loop, p)
|
|
962
|
+
};
|
|
963
|
+
return updateIfChanged(forOfLoop, updates);
|
|
796
964
|
}
|
|
797
965
|
|
|
798
966
|
protected async visitForInLoop(forInLoop: JS.ForInLoop, p: P): Promise<J | undefined> {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
967
|
+
const updates: any = {
|
|
968
|
+
prefix: await this.visitSpace(forInLoop.prefix, p),
|
|
969
|
+
markers: await this.visitMarkers(forInLoop.markers, p),
|
|
970
|
+
control: await this.visitDefined<JS.ForInLoop.Control>(forInLoop.control, p),
|
|
971
|
+
body: await this.visitRightPadded(forInLoop.body, p)
|
|
972
|
+
};
|
|
973
|
+
return updateIfChanged(forInLoop, updates);
|
|
803
974
|
}
|
|
804
975
|
|
|
805
976
|
protected async visitNamespaceDeclaration(namespaceDeclaration: JS.NamespaceDeclaration, p: P): Promise<J | undefined> {
|
|
@@ -809,26 +980,35 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
809
980
|
}
|
|
810
981
|
namespaceDeclaration = statement as JS.NamespaceDeclaration;
|
|
811
982
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
983
|
+
const updates: any = {
|
|
984
|
+
prefix: await this.visitSpace(namespaceDeclaration.prefix, p),
|
|
985
|
+
markers: await this.visitMarkers(namespaceDeclaration.markers, p),
|
|
986
|
+
modifiers: await mapAsync(namespaceDeclaration.modifiers, item => this.visitDefined<J.Modifier>(item, p)),
|
|
987
|
+
keywordType: await this.visitLeftPadded(namespaceDeclaration.keywordType, p),
|
|
988
|
+
name: await this.visitRightPadded(namespaceDeclaration.name, p),
|
|
989
|
+
body: namespaceDeclaration.body && await this.visitDefined<J.Block>(namespaceDeclaration.body, p)
|
|
990
|
+
};
|
|
991
|
+
return updateIfChanged(namespaceDeclaration, updates);
|
|
818
992
|
}
|
|
819
993
|
|
|
820
994
|
protected async visitTypeLiteral(typeLiteral: JS.TypeLiteral, p: P): Promise<J | undefined> {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
995
|
+
const updates: any = {
|
|
996
|
+
prefix: await this.visitSpace(typeLiteral.prefix, p),
|
|
997
|
+
markers: await this.visitMarkers(typeLiteral.markers, p),
|
|
998
|
+
members: await this.visitDefined<J.Block>(typeLiteral.members, p),
|
|
999
|
+
type: typeLiteral.type && await this.visitType(typeLiteral.type, p)
|
|
1000
|
+
};
|
|
1001
|
+
return updateIfChanged(typeLiteral, updates);
|
|
825
1002
|
}
|
|
826
1003
|
|
|
827
1004
|
protected async visitArrayBindingPattern(arrayBindingPattern: JS.ArrayBindingPattern, p: P): Promise<J | undefined> {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
1005
|
+
const updates: any = {
|
|
1006
|
+
prefix: await this.visitSpace(arrayBindingPattern.prefix, p),
|
|
1007
|
+
markers: await this.visitMarkers(arrayBindingPattern.markers, p),
|
|
1008
|
+
elements: await this.visitContainer(arrayBindingPattern.elements, p),
|
|
1009
|
+
type: arrayBindingPattern.type && await this.visitType(arrayBindingPattern.type, p)
|
|
1010
|
+
};
|
|
1011
|
+
return updateIfChanged(arrayBindingPattern, updates);
|
|
832
1012
|
}
|
|
833
1013
|
|
|
834
1014
|
protected async visitBindingElement(bindingElement: JS.BindingElement, p: P): Promise<J | undefined> {
|
|
@@ -838,12 +1018,15 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
838
1018
|
}
|
|
839
1019
|
bindingElement = statement as JS.BindingElement;
|
|
840
1020
|
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
1021
|
+
const updates: any = {
|
|
1022
|
+
prefix: await this.visitSpace(bindingElement.prefix, p),
|
|
1023
|
+
markers: await this.visitMarkers(bindingElement.markers, p),
|
|
1024
|
+
propertyName: bindingElement.propertyName && await this.visitRightPadded(bindingElement.propertyName, p),
|
|
1025
|
+
name: await this.visitDefined<TypedTree>(bindingElement.name, p),
|
|
1026
|
+
initializer: bindingElement.initializer && await this.visitLeftPadded(bindingElement.initializer, p),
|
|
1027
|
+
variableType: bindingElement.variableType && (await this.visitType(bindingElement.variableType, p) as Type.Variable)
|
|
1028
|
+
};
|
|
1029
|
+
return updateIfChanged(bindingElement, updates);
|
|
847
1030
|
}
|
|
848
1031
|
|
|
849
1032
|
protected async visitExportDeclaration(exportDeclaration: JS.ExportDeclaration, p: P): Promise<J | undefined> {
|
|
@@ -853,13 +1036,16 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
853
1036
|
}
|
|
854
1037
|
exportDeclaration = statement as JS.ExportDeclaration;
|
|
855
1038
|
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
1039
|
+
const updates: any = {
|
|
1040
|
+
prefix: await this.visitSpace(exportDeclaration.prefix, p),
|
|
1041
|
+
markers: await this.visitMarkers(exportDeclaration.markers, p),
|
|
1042
|
+
modifiers: await mapAsync(exportDeclaration.modifiers, item => this.visitDefined<J.Modifier>(item, p)),
|
|
1043
|
+
typeOnly: await this.visitLeftPadded(exportDeclaration.typeOnly, p),
|
|
1044
|
+
exportClause: exportDeclaration.exportClause && await this.visitDefined<Expression>(exportDeclaration.exportClause, p),
|
|
1045
|
+
moduleSpecifier: exportDeclaration.moduleSpecifier && await this.visitLeftPadded(exportDeclaration.moduleSpecifier, p),
|
|
1046
|
+
attributes: exportDeclaration.attributes && await this.visitDefined<JS.ImportAttributes>(exportDeclaration.attributes, p)
|
|
1047
|
+
};
|
|
1048
|
+
return updateIfChanged(exportDeclaration, updates);
|
|
863
1049
|
}
|
|
864
1050
|
|
|
865
1051
|
protected async visitExportAssignment(exportAssignment: JS.ExportAssignment, p: P): Promise<J | undefined> {
|
|
@@ -869,24 +1055,33 @@ export class JavaScriptVisitor<P> extends JavaVisitor<P> {
|
|
|
869
1055
|
}
|
|
870
1056
|
exportAssignment = statement as JS.ExportAssignment;
|
|
871
1057
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1058
|
+
const updates: any = {
|
|
1059
|
+
prefix: await this.visitSpace(exportAssignment.prefix, p),
|
|
1060
|
+
markers: await this.visitMarkers(exportAssignment.markers, p),
|
|
1061
|
+
expression: await this.visitLeftPadded<Expression>(exportAssignment.expression, p)
|
|
1062
|
+
};
|
|
1063
|
+
return updateIfChanged(exportAssignment, updates);
|
|
875
1064
|
}
|
|
876
1065
|
|
|
877
1066
|
protected async visitNamedExports(namedExports: JS.NamedExports, p: P): Promise<J | undefined> {
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
1067
|
+
const updates: any = {
|
|
1068
|
+
prefix: await this.visitSpace(namedExports.prefix, p),
|
|
1069
|
+
markers: await this.visitMarkers(namedExports.markers, p),
|
|
1070
|
+
elements: await this.visitContainer(namedExports.elements, p),
|
|
1071
|
+
type: namedExports.type && await this.visitType(namedExports.type, p)
|
|
1072
|
+
};
|
|
1073
|
+
return updateIfChanged(namedExports, updates);
|
|
882
1074
|
}
|
|
883
1075
|
|
|
884
1076
|
protected async visitExportSpecifier(exportSpecifier: JS.ExportSpecifier, p: P): Promise<J | undefined> {
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
1077
|
+
const updates: any = {
|
|
1078
|
+
prefix: await this.visitSpace(exportSpecifier.prefix, p),
|
|
1079
|
+
markers: await this.visitMarkers(exportSpecifier.markers, p),
|
|
1080
|
+
typeOnly: await this.visitLeftPadded(exportSpecifier.typeOnly, p),
|
|
1081
|
+
specifier: await this.visitDefined<Expression>(exportSpecifier.specifier, p),
|
|
1082
|
+
type: exportSpecifier.type && await this.visitType(exportSpecifier.type, p)
|
|
1083
|
+
};
|
|
1084
|
+
return updateIfChanged(exportSpecifier, updates);
|
|
890
1085
|
}
|
|
891
1086
|
|
|
892
1087
|
override async accept<J2 extends J, P2 extends P>(j: J2, p: P2): Promise<J | undefined> {
|