@openrewrite/rewrite 8.72.2 → 8.72.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/execution.js +3 -16
- package/dist/execution.js.map +1 -1
- package/dist/index.js +34 -49
- package/dist/index.js.map +1 -1
- package/dist/java/markers.js +12 -29
- package/dist/java/markers.js.map +1 -1
- package/dist/java/print.js +2 -13
- package/dist/java/print.js.map +1 -1
- package/dist/java/rpc.js +1344 -1725
- package/dist/java/rpc.js.map +1 -1
- package/dist/java/type-visitor.js +143 -184
- package/dist/java/type-visitor.js.map +1 -1
- package/dist/java/visitor.js +1072 -1249
- package/dist/java/visitor.js.map +1 -1
- package/dist/javascript/add-import.js +495 -534
- package/dist/javascript/add-import.js.map +1 -1
- package/dist/javascript/autodetect.js +116 -159
- package/dist/javascript/autodetect.js.map +1 -1
- package/dist/javascript/cleanup/add-parse-int-radix.js +41 -57
- package/dist/javascript/cleanup/add-parse-int-radix.js.map +1 -1
- package/dist/javascript/cleanup/prefer-optional-chain.js +89 -105
- package/dist/javascript/cleanup/prefer-optional-chain.js.map +1 -1
- package/dist/javascript/cleanup/use-object-property-shorthand.js +74 -95
- package/dist/javascript/cleanup/use-object-property-shorthand.js.map +1 -1
- package/dist/javascript/comparator.js +815 -1167
- package/dist/javascript/comparator.js.map +1 -1
- package/dist/javascript/dependency-workspace.js +206 -219
- package/dist/javascript/dependency-workspace.js.map +1 -1
- package/dist/javascript/format/format.js +682 -908
- package/dist/javascript/format/format.js.map +1 -1
- package/dist/javascript/format/minimum-viable-spacing-visitor.js +152 -231
- package/dist/javascript/format/minimum-viable-spacing-visitor.js.map +1 -1
- package/dist/javascript/format/normalize-whitespace-visitor.js +12 -31
- package/dist/javascript/format/normalize-whitespace-visitor.js.map +1 -1
- package/dist/javascript/format/prettier-config-loader.js +134 -153
- package/dist/javascript/format/prettier-config-loader.js.map +1 -1
- package/dist/javascript/format/prettier-format.js +112 -129
- package/dist/javascript/format/prettier-format.js.map +1 -1
- package/dist/javascript/format/tabs-and-indents-visitor.js +112 -136
- package/dist/javascript/format/tabs-and-indents-visitor.js.map +1 -1
- package/dist/javascript/markers.js +59 -92
- package/dist/javascript/markers.js.map +1 -1
- package/dist/javascript/migrate/es6/modernize-octal-escape-sequences.js +39 -52
- package/dist/javascript/migrate/es6/modernize-octal-escape-sequences.js.map +1 -1
- package/dist/javascript/migrate/es6/modernize-octal-literals.js +25 -38
- package/dist/javascript/migrate/es6/modernize-octal-literals.js.map +1 -1
- package/dist/javascript/migrate/es6/remove-duplicate-object-keys.js +66 -82
- package/dist/javascript/migrate/es6/remove-duplicate-object-keys.js.map +1 -1
- package/dist/javascript/migrate/typescript/export-assignment-to-export-default.js +10 -23
- package/dist/javascript/migrate/typescript/export-assignment-to-export-default.js.map +1 -1
- package/dist/javascript/node-resolution-result.js +137 -166
- package/dist/javascript/node-resolution-result.js.map +1 -1
- package/dist/javascript/package-json-parser.js +312 -343
- package/dist/javascript/package-json-parser.js.map +1 -1
- package/dist/javascript/package-manager.js +145 -170
- package/dist/javascript/package-manager.js.map +1 -1
- package/dist/javascript/parser.d.ts.map +1 -1
- package/dist/javascript/parser.js +94 -68
- package/dist/javascript/parser.js.map +1 -1
- package/dist/javascript/print.js +1572 -1835
- package/dist/javascript/print.js.map +1 -1
- package/dist/javascript/project-parser.js +151 -172
- package/dist/javascript/project-parser.js.map +1 -1
- package/dist/javascript/recipes/add-dependency.js +140 -175
- package/dist/javascript/recipes/add-dependency.js.map +1 -1
- package/dist/javascript/recipes/async-callback-in-sync-array-method.js +20 -36
- package/dist/javascript/recipes/async-callback-in-sync-array-method.js.map +1 -1
- package/dist/javascript/recipes/auto-format.js +3 -14
- package/dist/javascript/recipes/auto-format.js.map +1 -1
- package/dist/javascript/recipes/change-import.js +447 -495
- package/dist/javascript/recipes/change-import.js.map +1 -1
- package/dist/javascript/recipes/order-imports.js +162 -175
- package/dist/javascript/recipes/order-imports.js.map +1 -1
- package/dist/javascript/recipes/upgrade-dependency-version.js +167 -197
- package/dist/javascript/recipes/upgrade-dependency-version.js.map +1 -1
- package/dist/javascript/recipes/upgrade-transitive-dependency-version.js +166 -193
- package/dist/javascript/recipes/upgrade-transitive-dependency-version.js.map +1 -1
- package/dist/javascript/remove-import.js +689 -724
- package/dist/javascript/remove-import.js.map +1 -1
- package/dist/javascript/rpc.js +1007 -1332
- package/dist/javascript/rpc.js.map +1 -1
- package/dist/javascript/search/find-dependency.js +84 -110
- package/dist/javascript/search/find-dependency.js.map +1 -1
- package/dist/javascript/search/uses-method.js +5 -19
- package/dist/javascript/search/uses-method.js.map +1 -1
- package/dist/javascript/search/uses-type.js +9 -20
- package/dist/javascript/search/uses-type.js.map +1 -1
- package/dist/javascript/templating/comparator.js +737 -822
- package/dist/javascript/templating/comparator.js.map +1 -1
- package/dist/javascript/templating/engine.js +211 -245
- package/dist/javascript/templating/engine.js.map +1 -1
- package/dist/javascript/templating/pattern.js +169 -190
- package/dist/javascript/templating/pattern.js.map +1 -1
- package/dist/javascript/templating/placeholder-replacement.js +172 -210
- package/dist/javascript/templating/placeholder-replacement.js.map +1 -1
- package/dist/javascript/templating/rewrite.js +75 -97
- package/dist/javascript/templating/rewrite.js.map +1 -1
- package/dist/javascript/templating/template.js +69 -82
- package/dist/javascript/templating/template.js.map +1 -1
- package/dist/javascript/tree-debug.js +109 -137
- package/dist/javascript/tree-debug.js.map +1 -1
- package/dist/javascript/visitor.js +1090 -1254
- package/dist/javascript/visitor.js.map +1 -1
- package/dist/json/print.js +72 -103
- package/dist/json/print.js.map +1 -1
- package/dist/json/rpc.js +120 -181
- package/dist/json/rpc.js.map +1 -1
- package/dist/json/visitor.js +69 -100
- package/dist/json/visitor.js.map +1 -1
- package/dist/marketplace.js +20 -33
- package/dist/marketplace.js.map +1 -1
- package/dist/parse-error.js +41 -62
- package/dist/parse-error.js.map +1 -1
- package/dist/parser.js +7 -18
- package/dist/parser.js.map +1 -1
- package/dist/path-utils.js +46 -59
- package/dist/path-utils.js.map +1 -1
- package/dist/preconditions.js +30 -47
- package/dist/preconditions.js.map +1 -1
- package/dist/print.js +6 -19
- package/dist/print.js.map +1 -1
- package/dist/recipe.js +42 -73
- package/dist/recipe.js.map +1 -1
- package/dist/rpc/index.js +74 -115
- package/dist/rpc/index.js.map +1 -1
- package/dist/rpc/queue.js +71 -90
- package/dist/rpc/queue.js.map +1 -1
- package/dist/rpc/recipe.js +32 -57
- package/dist/rpc/recipe.js.map +1 -1
- package/dist/rpc/request/generate.js +4 -13
- package/dist/rpc/request/generate.js.map +1 -1
- package/dist/rpc/request/get-languages.js +2 -11
- package/dist/rpc/request/get-languages.js.map +1 -1
- package/dist/rpc/request/get-marketplace.js +9 -20
- package/dist/rpc/request/get-marketplace.js.map +1 -1
- package/dist/rpc/request/get-object.js +4 -13
- package/dist/rpc/request/get-object.js.map +1 -1
- package/dist/rpc/request/install-recipes.js +25 -36
- package/dist/rpc/request/install-recipes.js.map +1 -1
- package/dist/rpc/request/metrics.js +8 -17
- package/dist/rpc/request/metrics.js.map +1 -1
- package/dist/rpc/request/parse-project.js +36 -45
- package/dist/rpc/request/parse-project.js.map +1 -1
- package/dist/rpc/request/parse.js +5 -14
- package/dist/rpc/request/parse.js.map +1 -1
- package/dist/rpc/request/prepare-recipe.js +37 -52
- package/dist/rpc/request/prepare-recipe.js.map +1 -1
- package/dist/rpc/request/print.js +5 -14
- package/dist/rpc/request/print.js.map +1 -1
- package/dist/rpc/request/visit.js +56 -71
- package/dist/rpc/request/visit.js.map +1 -1
- package/dist/rpc/rewrite-rpc.js +70 -97
- package/dist/rpc/rewrite-rpc.js.map +1 -1
- package/dist/rpc/server.js +76 -89
- package/dist/rpc/server.js.map +1 -1
- package/dist/run.js +47 -66
- package/dist/run.js.map +1 -1
- package/dist/search/is-source-file.js +8 -19
- package/dist/search/is-source-file.js.map +1 -1
- package/dist/test/rewrite-test.js +154 -188
- package/dist/test/rewrite-test.js.map +1 -1
- package/dist/text/print.js +23 -38
- package/dist/text/print.js.map +1 -1
- package/dist/text/rpc.js +29 -44
- package/dist/text/rpc.js.map +1 -1
- package/dist/text/visitor.js +16 -33
- package/dist/text/visitor.js.map +1 -1
- package/dist/util.js +13 -24
- package/dist/util.js.map +1 -1
- package/dist/version.txt +1 -1
- package/dist/visitor.js +84 -115
- package/dist/visitor.js.map +1 -1
- package/dist/yaml/index.d.ts +2 -0
- package/dist/yaml/index.d.ts.map +1 -1
- package/dist/yaml/index.js +2 -0
- package/dist/yaml/index.js.map +1 -1
- package/dist/yaml/markers.d.ts +21 -0
- package/dist/yaml/markers.d.ts.map +1 -0
- package/dist/yaml/markers.js +37 -0
- package/dist/yaml/markers.js.map +1 -0
- package/dist/yaml/parser.d.ts.map +1 -1
- package/dist/yaml/parser.js +4 -1
- package/dist/yaml/parser.js.map +1 -1
- package/dist/yaml/print.d.ts +1 -1
- package/dist/yaml/print.d.ts.map +1 -1
- package/dist/yaml/print.js +175 -208
- package/dist/yaml/print.js.map +1 -1
- package/dist/yaml/rpc.js +154 -219
- package/dist/yaml/rpc.js.map +1 -1
- package/dist/yaml/visitor.js +78 -113
- package/dist/yaml/visitor.js.map +1 -1
- package/package.json +1 -1
- package/src/javascript/parser.ts +56 -14
- package/src/yaml/index.ts +2 -0
- package/src/yaml/markers.ts +70 -0
- package/src/yaml/parser.ts +5 -1
- package/src/yaml/print.ts +5 -2
package/dist/java/rpc.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.JavaReceiver = exports.JavaSender = void 0;
|
|
13
4
|
exports.registerJLanguageCodecs = registerJLanguageCodecs;
|
|
@@ -34,263 +25,219 @@ const type_1 = require("./type");
|
|
|
34
25
|
const type_visitor_1 = require("./type-visitor");
|
|
35
26
|
const util_1 = require("../util");
|
|
36
27
|
class TypeSender extends type_visitor_1.TypeVisitor {
|
|
37
|
-
visitPrimitive(primitive, q) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
visitGenericTypeVariable(generic, q) {
|
|
126
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
yield q.getAndSend(generic, g => g.name);
|
|
128
|
-
// Convert TypeScript enum to Java enum string
|
|
129
|
-
yield q.getAndSend(generic, g => {
|
|
130
|
-
switch (g.variance) {
|
|
131
|
-
case type_1.Type.GenericTypeVariable.Variance.Covariant:
|
|
132
|
-
return 'COVARIANT';
|
|
133
|
-
case type_1.Type.GenericTypeVariable.Variance.Contravariant:
|
|
134
|
-
return 'CONTRAVARIANT';
|
|
135
|
-
case type_1.Type.GenericTypeVariable.Variance.Invariant:
|
|
136
|
-
default:
|
|
137
|
-
return 'INVARIANT';
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
yield q.getAndSendList(generic, g => (g.bounds || []).map(b => (0, rpc_1.asRef)(b)), t => type_1.Type.signature(t), b => this.visit(b, q));
|
|
141
|
-
return generic;
|
|
28
|
+
async visitPrimitive(primitive, q) {
|
|
29
|
+
await q.getAndSend(primitive, p => p.keyword);
|
|
30
|
+
return primitive;
|
|
31
|
+
}
|
|
32
|
+
async visitClass(cls, q) {
|
|
33
|
+
await q.getAndSend(cls, c => c.flags);
|
|
34
|
+
await q.getAndSend(cls, c => c.classKind);
|
|
35
|
+
await q.getAndSend(cls, c => c.fullyQualifiedName);
|
|
36
|
+
await q.getAndSendList(cls, c => (c.typeParameters || []).map(t => (0, rpc_1.asRef)(t)), t => type_1.Type.signature(t), t => this.visit(t, q));
|
|
37
|
+
await q.getAndSend(cls, c => (0, rpc_1.asRef)(c.supertype), st => this.visit(st, q));
|
|
38
|
+
await q.getAndSend(cls, c => (0, rpc_1.asRef)(c.owningClass), oc => this.visit(oc, q));
|
|
39
|
+
await q.getAndSendList(cls, c => (c.annotations || []).map(a => (0, rpc_1.asRef)(a)), t => type_1.Type.signature(t), a => this.visit(a, q));
|
|
40
|
+
await q.getAndSendList(cls, c => (c.interfaces || []).map(i => (0, rpc_1.asRef)(i)), t => type_1.Type.signature(t), i => this.visit(i, q));
|
|
41
|
+
await q.getAndSendList(cls, c => (c.members || []).map(m => (0, rpc_1.asRef)(m)), t => type_1.Type.signature(t), m => this.visit(m, q));
|
|
42
|
+
await q.getAndSendList(cls, c => (c.methods || []).map(m => (0, rpc_1.asRef)(m)), t => type_1.Type.signature(t), m => this.visit(m, q));
|
|
43
|
+
return cls;
|
|
44
|
+
}
|
|
45
|
+
async visitVariable(variable, q) {
|
|
46
|
+
await q.getAndSend(variable, v => v.name);
|
|
47
|
+
await q.getAndSend(variable, v => v.owner ? (0, rpc_1.asRef)(v.owner) : undefined, owner => this.visit(owner, q));
|
|
48
|
+
await q.getAndSend(variable, v => (0, rpc_1.asRef)(v.type), t => this.visit(t, q));
|
|
49
|
+
await q.getAndSendList(variable, v => (v.annotations || []).map(v2 => (0, rpc_1.asRef)(v2)), t => type_1.Type.signature(t), a => this.visit(a, q));
|
|
50
|
+
return variable;
|
|
51
|
+
}
|
|
52
|
+
async visitAnnotation(annotation, q) {
|
|
53
|
+
await q.getAndSend(annotation, a => (0, rpc_1.asRef)(a.type), t => this.visit(t, q));
|
|
54
|
+
// await q.getAndSendList(annotation, a => (a.values || []).map(v => asRef(v)), v => {
|
|
55
|
+
// let value: any;
|
|
56
|
+
// if (v.kind === Type.Kind.SingleElementValue) {
|
|
57
|
+
// const single = v as Type.Annotation.SingleElementValue;
|
|
58
|
+
// value = single.constantValue !== undefined ? single.constantValue : single.referenceValue;
|
|
59
|
+
// } else {
|
|
60
|
+
// const array = v as Type.Annotation.ArrayElementValue;
|
|
61
|
+
// value = array.constantValues || array.referenceValues;
|
|
62
|
+
// }
|
|
63
|
+
// return `${Type.signature(v.element)}:${value == null ? "null" : value.toString()}`;
|
|
64
|
+
// }, async v => {
|
|
65
|
+
// // Handle element values inline like the Java implementation
|
|
66
|
+
// await q.getAndSend(v, e => asRef(e.element), elem => this.visit(elem, q));
|
|
67
|
+
// if (v.kind === Type.Kind.SingleElementValue) {
|
|
68
|
+
// const single = v as Type.Annotation.SingleElementValue;
|
|
69
|
+
// await q.getAndSend(single, s => s.constantValue);
|
|
70
|
+
// await q.getAndSend(single, s => asRef(s.referenceValue), ref => this.visit(ref, q));
|
|
71
|
+
// } else if (v.kind === Type.Kind.ArrayElementValue) {
|
|
72
|
+
// const array = v as Type.Annotation.ArrayElementValue;
|
|
73
|
+
// await q.getAndSendList(array, a => a.constantValues || [], val => val == null ? "null" : val.toString());
|
|
74
|
+
// await q.getAndSendList(array, a => (a.referenceValues || []).map(r => asRef(r)), t => Type.signature(t), r => this.visit(r, q));
|
|
75
|
+
// }
|
|
76
|
+
// });
|
|
77
|
+
return annotation;
|
|
78
|
+
}
|
|
79
|
+
async visitMethod(method, q) {
|
|
80
|
+
await q.getAndSend(method, m => (0, rpc_1.asRef)(m.declaringType), dt => this.visit(dt, q));
|
|
81
|
+
await q.getAndSend(method, m => m.name);
|
|
82
|
+
await q.getAndSend(method, m => m.flags);
|
|
83
|
+
await q.getAndSend(method, m => (0, rpc_1.asRef)(m.returnType), rt => this.visit(rt, q));
|
|
84
|
+
await q.getAndSendList(method, m => m.parameterNames || [], v => v);
|
|
85
|
+
await q.getAndSendList(method, m => (m.parameterTypes || []).map(t => (0, rpc_1.asRef)(t)), t => type_1.Type.signature(t), pt => this.visit(pt, q));
|
|
86
|
+
await q.getAndSendList(method, m => (m.thrownExceptions || []).map(t => (0, rpc_1.asRef)(t)), t => type_1.Type.signature(t), et => this.visit(et, q));
|
|
87
|
+
await q.getAndSendList(method, m => (m.annotations || []).map(a => (0, rpc_1.asRef)(a)), t => type_1.Type.signature(t), a => this.visit(a, q));
|
|
88
|
+
await q.getAndSendList(method, m => m.defaultValue || undefined, v => v);
|
|
89
|
+
await q.getAndSendList(method, m => m.declaredFormalTypeNames || [], v => v);
|
|
90
|
+
return method;
|
|
91
|
+
}
|
|
92
|
+
async visitArray(array, q) {
|
|
93
|
+
await q.getAndSend(array, a => (0, rpc_1.asRef)(a.elemType), et => this.visit(et, q));
|
|
94
|
+
await q.getAndSendList(array, a => (a.annotations || []).map(ann => (0, rpc_1.asRef)(ann)), t => type_1.Type.signature(t), ann => this.visit(ann, q));
|
|
95
|
+
return array;
|
|
96
|
+
}
|
|
97
|
+
async visitParameterized(parameterized, q) {
|
|
98
|
+
await q.getAndSend(parameterized, p => (0, rpc_1.asRef)(p.type), t => this.visit(t, q));
|
|
99
|
+
await q.getAndSendList(parameterized, p => (p.typeParameters || []).map(tp => (0, rpc_1.asRef)(tp)), t => type_1.Type.signature(t), tp => this.visit(tp, q));
|
|
100
|
+
return parameterized;
|
|
101
|
+
}
|
|
102
|
+
async visitGenericTypeVariable(generic, q) {
|
|
103
|
+
await q.getAndSend(generic, g => g.name);
|
|
104
|
+
// Convert TypeScript enum to Java enum string
|
|
105
|
+
await q.getAndSend(generic, g => {
|
|
106
|
+
switch (g.variance) {
|
|
107
|
+
case type_1.Type.GenericTypeVariable.Variance.Covariant:
|
|
108
|
+
return 'COVARIANT';
|
|
109
|
+
case type_1.Type.GenericTypeVariable.Variance.Contravariant:
|
|
110
|
+
return 'CONTRAVARIANT';
|
|
111
|
+
case type_1.Type.GenericTypeVariable.Variance.Invariant:
|
|
112
|
+
default:
|
|
113
|
+
return 'INVARIANT';
|
|
114
|
+
}
|
|
142
115
|
});
|
|
116
|
+
await q.getAndSendList(generic, g => (g.bounds || []).map(b => (0, rpc_1.asRef)(b)), t => type_1.Type.signature(t), b => this.visit(b, q));
|
|
117
|
+
return generic;
|
|
143
118
|
}
|
|
144
|
-
visitUnion(union, q) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return union;
|
|
148
|
-
});
|
|
119
|
+
async visitUnion(union, q) {
|
|
120
|
+
await q.getAndSendList(union, u => (u.bounds || []).map(b => (0, rpc_1.asRef)(b)), t => type_1.Type.signature(t), b => this.visit(b, q));
|
|
121
|
+
return union;
|
|
149
122
|
}
|
|
150
|
-
visitIntersection(intersection, q) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return intersection;
|
|
154
|
-
});
|
|
123
|
+
async visitIntersection(intersection, q) {
|
|
124
|
+
await q.getAndSendList(intersection, i => (i.bounds || []).map(b => (0, rpc_1.asRef)(b)), t => type_1.Type.signature(t), b => this.visit(b, q));
|
|
125
|
+
return intersection;
|
|
155
126
|
}
|
|
156
127
|
}
|
|
157
128
|
class TypeReceiver extends type_visitor_1.TypeVisitor {
|
|
158
|
-
preVisit(_type, _q) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
visitGenericTypeVariable(generic, q) {
|
|
263
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
264
|
-
generic.name = yield q.receive(generic.name);
|
|
265
|
-
const varianceStr = yield q.receive(generic.variance);
|
|
266
|
-
// Convert Java enum string to TypeScript enum
|
|
267
|
-
switch (varianceStr) {
|
|
268
|
-
case 'COVARIANT':
|
|
269
|
-
generic.variance = type_1.Type.GenericTypeVariable.Variance.Covariant;
|
|
270
|
-
break;
|
|
271
|
-
case 'CONTRAVARIANT':
|
|
272
|
-
generic.variance = type_1.Type.GenericTypeVariable.Variance.Contravariant;
|
|
273
|
-
break;
|
|
274
|
-
case 'INVARIANT':
|
|
275
|
-
default:
|
|
276
|
-
generic.variance = type_1.Type.GenericTypeVariable.Variance.Invariant;
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
generic.bounds = (yield q.receiveList(generic.bounds, b => this.visit(b, q))) || [];
|
|
280
|
-
return generic;
|
|
281
|
-
});
|
|
129
|
+
async preVisit(_type, _q) {
|
|
130
|
+
// Don't call default preVisit to avoid circular references
|
|
131
|
+
return _type;
|
|
132
|
+
}
|
|
133
|
+
async postVisit(_type, _q) {
|
|
134
|
+
// Don't call default postVisit to avoid circular references
|
|
135
|
+
return _type;
|
|
136
|
+
}
|
|
137
|
+
async visitPrimitive(primitive, q) {
|
|
138
|
+
const keyword = await q.receive(primitive.keyword);
|
|
139
|
+
return type_1.Type.Primitive.fromKeyword(keyword);
|
|
140
|
+
}
|
|
141
|
+
async visitClass(cls, q) {
|
|
142
|
+
cls.flags = await q.receive(cls.flags);
|
|
143
|
+
cls.classKind = await q.receive(cls.classKind);
|
|
144
|
+
cls.fullyQualifiedName = await q.receive(cls.fullyQualifiedName);
|
|
145
|
+
cls.typeParameters = await q.receiveList(cls.typeParameters, tp => this.visit(tp, q)) || [];
|
|
146
|
+
cls.supertype = await q.receive(cls.supertype, st => this.visit(st, q));
|
|
147
|
+
cls.owningClass = await q.receive(cls.owningClass, oc => this.visit(oc, q));
|
|
148
|
+
cls.annotations = await q.receiveList(cls.annotations, a => this.visit(a, q)) || [];
|
|
149
|
+
cls.interfaces = await q.receiveList(cls.interfaces, i => this.visit(i, q)) || [];
|
|
150
|
+
cls.members = await q.receiveList(cls.members, m => this.visit(m, q)) || [];
|
|
151
|
+
cls.methods = await q.receiveList(cls.methods, m => this.visit(m, q)) || [];
|
|
152
|
+
return cls;
|
|
153
|
+
}
|
|
154
|
+
async visitVariable(variable, q) {
|
|
155
|
+
variable.name = await q.receive(variable.name);
|
|
156
|
+
variable.owner = await q.receive(variable.owner, owner => this.visit(owner, q));
|
|
157
|
+
variable.type = await q.receive(variable.type, t => this.visit(t, q));
|
|
158
|
+
variable.annotations = await q.receiveList(variable.annotations, a => this.visit(a, q)) || [];
|
|
159
|
+
return variable;
|
|
160
|
+
}
|
|
161
|
+
async visitAnnotation(annotation, q) {
|
|
162
|
+
annotation.type = await q.receive(annotation.type, t => this.visit(t, q));
|
|
163
|
+
// annotation.values = await q.receiveList(annotation.values, async v => {
|
|
164
|
+
// // Handle element values inline like the Java implementation
|
|
165
|
+
// if (v.kind === Type.Kind.SingleElementValue) {
|
|
166
|
+
// const single = v as Type.Annotation.SingleElementValue;
|
|
167
|
+
// const element = await q.receive(single.element, elem => this.visit(elem, q));
|
|
168
|
+
// const constantValue = await q.receive(single.constantValue);
|
|
169
|
+
// const referenceValue = await q.receive(single.referenceValue, ref => this.visit(ref, q));
|
|
170
|
+
// return {
|
|
171
|
+
// kind: Type.Kind.SingleElementValue,
|
|
172
|
+
// element,
|
|
173
|
+
// constantValue,
|
|
174
|
+
// referenceValue
|
|
175
|
+
// } as Type.Annotation.SingleElementValue;
|
|
176
|
+
// } else if (v.kind === Type.Kind.ArrayElementValue) {
|
|
177
|
+
// const array = v as Type.Annotation.ArrayElementValue;
|
|
178
|
+
// const element = await q.receive(array.element, elem => this.visit(elem, q));
|
|
179
|
+
// const constantValues = await q.receiveList(array.constantValues);
|
|
180
|
+
// const referenceValues = await q.receiveList(array.referenceValues, r => this.visit(r, q));
|
|
181
|
+
// return {
|
|
182
|
+
// kind: Type.Kind.ArrayElementValue,
|
|
183
|
+
// element,
|
|
184
|
+
// constantValues,
|
|
185
|
+
// referenceValues
|
|
186
|
+
// } as Type.Annotation.ArrayElementValue;
|
|
187
|
+
// }
|
|
188
|
+
// return v;
|
|
189
|
+
// }) || [];
|
|
190
|
+
return annotation;
|
|
191
|
+
}
|
|
192
|
+
async visitMethod(method, q) {
|
|
193
|
+
method.declaringType = await q.receive(method.declaringType, dt => this.visit(dt, q));
|
|
194
|
+
method.name = await q.receive(method.name);
|
|
195
|
+
method.flags = await q.receive(method.flags);
|
|
196
|
+
method.returnType = await q.receive(method.returnType, rt => this.visit(rt, q));
|
|
197
|
+
method.parameterNames = await q.receiveList(method.parameterNames) || [];
|
|
198
|
+
method.parameterTypes = await q.receiveList(method.parameterTypes, pt => this.visit(pt, q)) || [];
|
|
199
|
+
method.thrownExceptions = await q.receiveList(method.thrownExceptions, et => this.visit(et, q)) || [];
|
|
200
|
+
method.annotations = await q.receiveList(method.annotations, a => this.visit(a, q)) || [];
|
|
201
|
+
method.defaultValue = await q.receiveList(method.defaultValue);
|
|
202
|
+
method.declaredFormalTypeNames = await q.receiveList(method.declaredFormalTypeNames) || [];
|
|
203
|
+
return method;
|
|
204
|
+
}
|
|
205
|
+
async visitArray(array, q) {
|
|
206
|
+
array.elemType = await q.receive(array.elemType, et => this.visit(et, q));
|
|
207
|
+
array.annotations = await q.receiveList(array.annotations, ann => this.visit(ann, q)) || [];
|
|
208
|
+
return array;
|
|
209
|
+
}
|
|
210
|
+
async visitParameterized(parameterized, q) {
|
|
211
|
+
parameterized.type = await q.receive(parameterized.type, t => this.visit(t, q));
|
|
212
|
+
parameterized.typeParameters = await q.receiveList(parameterized.typeParameters, tp => this.visit(tp, q)) || [];
|
|
213
|
+
return parameterized;
|
|
214
|
+
}
|
|
215
|
+
async visitGenericTypeVariable(generic, q) {
|
|
216
|
+
generic.name = await q.receive(generic.name);
|
|
217
|
+
const varianceStr = await q.receive(generic.variance);
|
|
218
|
+
// Convert Java enum string to TypeScript enum
|
|
219
|
+
switch (varianceStr) {
|
|
220
|
+
case 'COVARIANT':
|
|
221
|
+
generic.variance = type_1.Type.GenericTypeVariable.Variance.Covariant;
|
|
222
|
+
break;
|
|
223
|
+
case 'CONTRAVARIANT':
|
|
224
|
+
generic.variance = type_1.Type.GenericTypeVariable.Variance.Contravariant;
|
|
225
|
+
break;
|
|
226
|
+
case 'INVARIANT':
|
|
227
|
+
default:
|
|
228
|
+
generic.variance = type_1.Type.GenericTypeVariable.Variance.Invariant;
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
generic.bounds = await q.receiveList(generic.bounds, b => this.visit(b, q)) || [];
|
|
232
|
+
return generic;
|
|
282
233
|
}
|
|
283
|
-
visitUnion(union, q) {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
return union;
|
|
287
|
-
});
|
|
234
|
+
async visitUnion(union, q) {
|
|
235
|
+
union.bounds = await q.receiveList(union.bounds, b => this.visit(b, q)) || [];
|
|
236
|
+
return union;
|
|
288
237
|
}
|
|
289
|
-
visitIntersection(intersection, q) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
return intersection;
|
|
293
|
-
});
|
|
238
|
+
async visitIntersection(intersection, q) {
|
|
239
|
+
intersection.bounds = await q.receiveList(intersection.bounds, b => this.visit(b, q)) || [];
|
|
240
|
+
return intersection;
|
|
294
241
|
}
|
|
295
242
|
}
|
|
296
243
|
class JavaSender extends visitor_1.JavaVisitor {
|
|
@@ -298,641 +245,487 @@ class JavaSender extends visitor_1.JavaVisitor {
|
|
|
298
245
|
super(...arguments);
|
|
299
246
|
this.typeVisitor = new TypeSender();
|
|
300
247
|
}
|
|
301
|
-
preVisit(j, q) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
return
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
return
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
return
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
return
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
return
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
return
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
return
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
return
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
return
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
return
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
return
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
return
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
return
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
return
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
return
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
yield q.getAndSendList(typeParams, t => t.typeParameters, p => p.element.id, params => this.visitRightPadded(params, q));
|
|
730
|
-
return typeParams;
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
visitUnary(unary, q) {
|
|
734
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
735
|
-
yield q.getAndSend(unary, u => u.operator, op => this.visitLeftPadded(op, q));
|
|
736
|
-
yield q.getAndSend(unary, u => u.expression, expr => this.visit(expr, q));
|
|
737
|
-
yield q.getAndSend(unary, u => (0, rpc_1.asRef)(u.type), type => this.visitType(type, q));
|
|
738
|
-
return unary;
|
|
739
|
-
});
|
|
740
|
-
}
|
|
741
|
-
visitVariable(variable, q) {
|
|
742
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
743
|
-
yield q.getAndSend(variable, v => v.name, name => this.visit(name, q));
|
|
744
|
-
yield q.getAndSendList(variable, v => v.dimensionsAfterName, d => JSON.stringify(d.element), dims => this.visitLeftPadded(dims, q));
|
|
745
|
-
yield q.getAndSend(variable, v => v.initializer, init => this.visitLeftPadded(init, q));
|
|
746
|
-
yield q.getAndSend(variable, v => (0, rpc_1.asRef)(v.variableType), type => this.visitType(type, q));
|
|
747
|
-
return variable;
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
visitWhileLoop(whileLoop, q) {
|
|
751
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
752
|
-
yield q.getAndSend(whileLoop, w => w.condition, cond => this.visit(cond, q));
|
|
753
|
-
yield q.getAndSend(whileLoop, w => w.body, body => this.visitRightPadded(body, q));
|
|
754
|
-
return whileLoop;
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
|
-
visitWildcard(wildcard, q) {
|
|
758
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
759
|
-
yield q.getAndSend(wildcard, w => w.bound, b => this.visitLeftPadded(b, q));
|
|
760
|
-
yield q.getAndSend(wildcard, w => w.boundedType, type => this.visit(type, q));
|
|
761
|
-
return wildcard;
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
visitYield(yieldExpr, q) {
|
|
765
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
766
|
-
yield q.getAndSend(yieldExpr, y => y.implicit);
|
|
767
|
-
yield q.getAndSend(yieldExpr, y => y.value, value => this.visit(value, q));
|
|
768
|
-
return yieldExpr;
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
visitUnknown(unknown, q) {
|
|
772
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
773
|
-
yield q.getAndSend(unknown, u => u.source, source => this.visit(source, q));
|
|
774
|
-
return unknown;
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
visitUnknownSource(source, q) {
|
|
778
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
779
|
-
yield q.getAndSend(source, s => s.text);
|
|
780
|
-
return source;
|
|
781
|
-
});
|
|
782
|
-
}
|
|
783
|
-
visitCompilationUnit(cu, q) {
|
|
784
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
785
|
-
yield q.getAndSend(cu, c => c.sourcePath);
|
|
786
|
-
yield q.getAndSend(cu, c => c.charsetName);
|
|
787
|
-
yield q.getAndSend(cu, c => c.charsetBomMarked);
|
|
788
|
-
yield q.getAndSend(cu, c => c.checksum);
|
|
789
|
-
yield q.getAndSend(cu, c => c.fileAttributes);
|
|
790
|
-
yield q.getAndSend(cu, c => c.packageDeclaration, pkg => this.visitRightPadded(pkg, q));
|
|
791
|
-
yield q.getAndSendList(cu, c => c.imports, imp => imp.element.id, imp => this.visitRightPadded(imp, q));
|
|
792
|
-
yield q.getAndSendList(cu, c => c.classes, cls => cls.id, cls => this.visit(cls, q));
|
|
793
|
-
yield q.getAndSend(cu, c => c.eof, space => this.visitSpace(space, q));
|
|
794
|
-
return cu;
|
|
795
|
-
});
|
|
796
|
-
}
|
|
797
|
-
visitPackage(pkg, q) {
|
|
798
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
799
|
-
yield q.getAndSend(pkg, p => p.expression, expr => this.visit(expr, q));
|
|
800
|
-
yield q.getAndSendList(pkg, p => p.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
801
|
-
return pkg;
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
visitClassDeclaration(cls, q) {
|
|
805
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
806
|
-
yield q.getAndSendList(cls, c => c.leadingAnnotations, annot => annot.id, annot => this.visit(annot, q));
|
|
807
|
-
yield q.getAndSendList(cls, c => c.modifiers, mod => mod.id, mod => this.visit(mod, q));
|
|
808
|
-
yield q.getAndSend(cls, c => c.classKind, kind => this.visit(kind, q));
|
|
809
|
-
yield q.getAndSend(cls, c => c.name, name => this.visit(name, q));
|
|
810
|
-
yield q.getAndSend(cls, c => c.typeParameters, params => this.visitContainer(params, q));
|
|
811
|
-
yield q.getAndSend(cls, c => c.primaryConstructor, cons => this.visitContainer(cons, q));
|
|
812
|
-
yield q.getAndSend(cls, c => c.extends, ext => this.visitLeftPadded(ext, q));
|
|
813
|
-
yield q.getAndSend(cls, c => c.implements, impl => this.visitContainer(impl, q));
|
|
814
|
-
yield q.getAndSend(cls, c => c.permitting, perm => this.visitContainer(perm, q));
|
|
815
|
-
yield q.getAndSend(cls, c => c.body, body => this.visit(body, q));
|
|
816
|
-
return cls;
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
visitClassDeclarationKind(kind, q) {
|
|
820
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
821
|
-
yield q.getAndSendList(kind, k => k.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
822
|
-
yield q.getAndSend(kind, k => k.type);
|
|
823
|
-
return kind;
|
|
824
|
-
});
|
|
825
|
-
}
|
|
826
|
-
visitBlock(block, q) {
|
|
827
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
828
|
-
yield q.getAndSend(block, b => b.static, s => this.visitRightPadded(s, q));
|
|
829
|
-
yield q.getAndSendList(block, b => b.statements, stmt => stmt.element.id, stmt => this.visitRightPadded(stmt, q));
|
|
830
|
-
yield q.getAndSend(block, b => b.end, space => this.visitSpace(space, q));
|
|
831
|
-
return block;
|
|
832
|
-
});
|
|
833
|
-
}
|
|
834
|
-
visitMethodDeclaration(method, q) {
|
|
835
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
836
|
-
yield q.getAndSendList(method, m => m.leadingAnnotations, annot => annot.id, annot => this.visit(annot, q));
|
|
837
|
-
yield q.getAndSendList(method, m => m.modifiers, mod => mod.id, mod => this.visit(mod, q));
|
|
838
|
-
yield q.getAndSend(method, m => m.typeParameters, params => this.visit(params, q));
|
|
839
|
-
yield q.getAndSend(method, m => m.returnTypeExpression, type => this.visit(type, q));
|
|
840
|
-
yield q.getAndSendList(method, m => m.nameAnnotations, a => a.id, name => this.visit(name, q));
|
|
841
|
-
yield q.getAndSend(method, m => m.name, name => this.visit(name, q));
|
|
842
|
-
yield q.getAndSend(method, m => m.parameters, params => this.visitContainer(params, q));
|
|
843
|
-
yield q.getAndSend(method, m => m.throws, throws => this.visitContainer(throws, q));
|
|
844
|
-
yield q.getAndSend(method, m => m.body, body => this.visit(body, q));
|
|
845
|
-
yield q.getAndSend(method, m => m.defaultValue, def => this.visitLeftPadded(def, q));
|
|
846
|
-
yield q.getAndSend(method, m => (0, rpc_1.asRef)(m.methodType), type => this.visitType(type, q));
|
|
847
|
-
return method;
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
visitVariableDeclarations(varDecls, q) {
|
|
851
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
852
|
-
yield q.getAndSendList(varDecls, v => v.leadingAnnotations, annot => annot.id, annot => this.visit(annot, q));
|
|
853
|
-
yield q.getAndSendList(varDecls, v => v.modifiers, mod => mod.id, mod => this.visit(mod, q));
|
|
854
|
-
yield q.getAndSend(varDecls, v => v.typeExpression, type => this.visit(type, q));
|
|
855
|
-
yield q.getAndSend(varDecls, v => v.varargs, space => this.visitSpace(space, q));
|
|
856
|
-
yield q.getAndSendList(varDecls, v => v.variables, variable => variable.element.id, variable => this.visitRightPadded(variable, q));
|
|
857
|
-
return varDecls;
|
|
858
|
-
});
|
|
859
|
-
}
|
|
860
|
-
visitIdentifier(ident, q) {
|
|
861
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
862
|
-
yield q.getAndSendList(ident, id => id.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
863
|
-
yield q.getAndSend(ident, id => id.simpleName);
|
|
864
|
-
yield q.getAndSend(ident, id => (0, rpc_1.asRef)(id.type), type => this.visitType(type, q));
|
|
865
|
-
yield q.getAndSend(ident, id => (0, rpc_1.asRef)(id.fieldType), type => this.visitType(type, q));
|
|
866
|
-
return ident;
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
visitSpace(space, q) {
|
|
870
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
871
|
-
yield q.getAndSendList(space, s => s.comments, c => {
|
|
872
|
-
if (c.kind === tree_1.J.Kind.TextComment) {
|
|
873
|
-
return c.text + c.suffix;
|
|
874
|
-
}
|
|
875
|
-
throw new Error(`Unexpected comment type ${c.kind}`);
|
|
876
|
-
}, (c) => __awaiter(this, void 0, void 0, function* () {
|
|
877
|
-
if (c.kind === tree_1.J.Kind.TextComment) {
|
|
878
|
-
const tc = c;
|
|
879
|
-
yield q.getAndSend(tc, c2 => c2.multiline);
|
|
880
|
-
yield q.getAndSend(tc, c2 => c2.text);
|
|
881
|
-
}
|
|
882
|
-
else {
|
|
883
|
-
throw new Error(`Unexpected comment type ${c.kind}`);
|
|
884
|
-
}
|
|
885
|
-
yield q.getAndSend(c, c2 => c2.suffix);
|
|
886
|
-
yield q.getAndSend(c, c2 => c2.markers);
|
|
887
|
-
}));
|
|
888
|
-
yield q.getAndSend(space, s => s.whitespace);
|
|
889
|
-
return space;
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
visitLeftPadded(left, q) {
|
|
893
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
894
|
-
yield q.getAndSend(left, l => l.before, space => this.visitSpace(space, q));
|
|
895
|
-
if ((0, tree_2.isTree)(left.element)) {
|
|
896
|
-
yield q.getAndSend(left, l => l.element, elem => this.visit(elem, q));
|
|
897
|
-
}
|
|
898
|
-
else if ((0, tree_1.isSpace)(left.element)) {
|
|
899
|
-
yield q.getAndSend(left, l => l.element, space => this.visitSpace(space, q));
|
|
900
|
-
}
|
|
901
|
-
else {
|
|
902
|
-
yield q.getAndSend(left, l => l.element);
|
|
248
|
+
async preVisit(j, q) {
|
|
249
|
+
await q.getAndSend(j, j2 => j2.id);
|
|
250
|
+
await q.getAndSend(j, j2 => j2.prefix, space => this.visitSpace(space, q));
|
|
251
|
+
await q.getAndSend(j, j2 => j2.markers);
|
|
252
|
+
return j;
|
|
253
|
+
}
|
|
254
|
+
async visitAnnotatedType(annotatedType, q) {
|
|
255
|
+
await q.getAndSendList(annotatedType, a => a.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
256
|
+
await q.getAndSend(annotatedType, a => a.typeExpression, type => this.visit(type, q));
|
|
257
|
+
return annotatedType;
|
|
258
|
+
}
|
|
259
|
+
async visitAnnotation(annotation, q) {
|
|
260
|
+
await q.getAndSend(annotation, a => a.annotationType, type => this.visit(type, q));
|
|
261
|
+
await q.getAndSend(annotation, a => a.arguments, args => this.visitContainer(args, q));
|
|
262
|
+
return annotation;
|
|
263
|
+
}
|
|
264
|
+
async visitArrayAccess(arrayAccess, q) {
|
|
265
|
+
await q.getAndSend(arrayAccess, a => a.indexed, indexed => this.visit(indexed, q));
|
|
266
|
+
await q.getAndSend(arrayAccess, a => a.dimension, dim => this.visit(dim, q));
|
|
267
|
+
return arrayAccess;
|
|
268
|
+
}
|
|
269
|
+
async visitArrayDimension(dimension, q) {
|
|
270
|
+
await q.getAndSend(dimension, d => d.index, idx => this.visitRightPadded(idx, q));
|
|
271
|
+
return dimension;
|
|
272
|
+
}
|
|
273
|
+
async visitArrayType(arrayType, q) {
|
|
274
|
+
await q.getAndSend(arrayType, a => a.elementType, type => this.visit(type, q));
|
|
275
|
+
await q.getAndSendList(arrayType, a => a.annotations || [], annot => annot.id, annot => this.visit(annot, q));
|
|
276
|
+
await q.getAndSend(arrayType, a => a.dimension, d => this.visitLeftPadded(d, q));
|
|
277
|
+
await q.getAndSend(arrayType, a => (0, rpc_1.asRef)(a.type), type => this.visitType(type, q));
|
|
278
|
+
return arrayType;
|
|
279
|
+
}
|
|
280
|
+
async visitAssert(assert, q) {
|
|
281
|
+
await q.getAndSend(assert, a => a.condition, cond => this.visit(cond, q));
|
|
282
|
+
await q.getAndSend(assert, a => a.detail, detail => this.visitLeftPadded(detail, q));
|
|
283
|
+
return assert;
|
|
284
|
+
}
|
|
285
|
+
async visitAssignment(assignment, q) {
|
|
286
|
+
await q.getAndSend(assignment, a => a.variable, variable => this.visit(variable, q));
|
|
287
|
+
await q.getAndSend(assignment, a => a.assignment, assign => this.visitLeftPadded(assign, q));
|
|
288
|
+
await q.getAndSend(assignment, a => (0, rpc_1.asRef)(a.type), type => this.visitType(type, q));
|
|
289
|
+
return assignment;
|
|
290
|
+
}
|
|
291
|
+
async visitAssignmentOperation(assignOp, q) {
|
|
292
|
+
await q.getAndSend(assignOp, a => a.variable, variable => this.visit(variable, q));
|
|
293
|
+
await q.getAndSend(assignOp, a => a.operator, op => this.visitLeftPadded(op, q));
|
|
294
|
+
await q.getAndSend(assignOp, a => a.assignment, assign => this.visit(assign, q));
|
|
295
|
+
await q.getAndSend(assignOp, a => (0, rpc_1.asRef)(a.type), type => this.visitType(type, q));
|
|
296
|
+
return assignOp;
|
|
297
|
+
}
|
|
298
|
+
async visitBinary(binary, q) {
|
|
299
|
+
await q.getAndSend(binary, b => b.left, left => this.visit(left, q));
|
|
300
|
+
await q.getAndSend(binary, b => b.operator, op => this.visitLeftPadded(op, q));
|
|
301
|
+
await q.getAndSend(binary, b => b.right, right => this.visit(right, q));
|
|
302
|
+
await q.getAndSend(binary, a => (0, rpc_1.asRef)(a.type), type => this.visitType(type, q));
|
|
303
|
+
return binary;
|
|
304
|
+
}
|
|
305
|
+
async visitBreak(breakStmt, q) {
|
|
306
|
+
await q.getAndSend(breakStmt, b => b.label, label => this.visit(label, q));
|
|
307
|
+
return breakStmt;
|
|
308
|
+
}
|
|
309
|
+
async visitCase(caseStmt, q) {
|
|
310
|
+
await q.getAndSend(caseStmt, c => c.type);
|
|
311
|
+
await q.getAndSend(caseStmt, c => c.caseLabels, labels => this.visitContainer(labels, q));
|
|
312
|
+
await q.getAndSend(caseStmt, c => c.statements, stmts => this.visitContainer(stmts, q));
|
|
313
|
+
await q.getAndSend(caseStmt, c => c.body, body => this.visitRightPadded(body, q));
|
|
314
|
+
await q.getAndSend(caseStmt, c => c.guard, guard => this.visit(guard, q));
|
|
315
|
+
return caseStmt;
|
|
316
|
+
}
|
|
317
|
+
async visitContinue(continueStmt, q) {
|
|
318
|
+
await q.getAndSend(continueStmt, c => c.label, label => this.visit(label, q));
|
|
319
|
+
return continueStmt;
|
|
320
|
+
}
|
|
321
|
+
async visitControlParentheses(controlParens, q) {
|
|
322
|
+
await q.getAndSend(controlParens, c => c.tree, tree => this.visitRightPadded(tree, q));
|
|
323
|
+
return controlParens;
|
|
324
|
+
}
|
|
325
|
+
async visitDeconstructionPattern(pattern, q) {
|
|
326
|
+
await q.getAndSend(pattern, p => p.deconstructor, deconstructor => this.visit(deconstructor, q));
|
|
327
|
+
await q.getAndSend(pattern, p => p.nested, nested => this.visitContainer(nested, q));
|
|
328
|
+
await q.getAndSend(pattern, p => (0, rpc_1.asRef)(p.type), type => this.visitType(type, q));
|
|
329
|
+
return pattern;
|
|
330
|
+
}
|
|
331
|
+
async visitDoWhileLoop(doWhile, q) {
|
|
332
|
+
await q.getAndSend(doWhile, d => d.body, body => this.visitRightPadded(body, q));
|
|
333
|
+
await q.getAndSend(doWhile, d => d.whileCondition, cond => this.visitLeftPadded(cond, q));
|
|
334
|
+
return doWhile;
|
|
335
|
+
}
|
|
336
|
+
async visitEmpty(empty, _q) {
|
|
337
|
+
// No additional properties to send
|
|
338
|
+
return empty;
|
|
339
|
+
}
|
|
340
|
+
async visitEnumValueSet(enumValueSet, q) {
|
|
341
|
+
await q.getAndSendList(enumValueSet, e => e.enums, enumValue => enumValue.element.id, enumValue => this.visitRightPadded(enumValue, q));
|
|
342
|
+
await q.getAndSend(enumValueSet, e => e.terminatedWithSemicolon);
|
|
343
|
+
return enumValueSet;
|
|
344
|
+
}
|
|
345
|
+
async visitEnumValue(enumValue, q) {
|
|
346
|
+
await q.getAndSendList(enumValue, e => e.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
347
|
+
await q.getAndSend(enumValue, e => e.name, name => this.visit(name, q));
|
|
348
|
+
await q.getAndSend(enumValue, e => e.initializer, init => this.visit(init, q));
|
|
349
|
+
return enumValue;
|
|
350
|
+
}
|
|
351
|
+
async visitErroneous(erroneous, q) {
|
|
352
|
+
await q.getAndSend(erroneous, e => e.text);
|
|
353
|
+
return erroneous;
|
|
354
|
+
}
|
|
355
|
+
async visitFieldAccess(fieldAccess, q) {
|
|
356
|
+
await q.getAndSend(fieldAccess, f => f.target, target => this.visit(target, q));
|
|
357
|
+
await q.getAndSend(fieldAccess, f => f.name, name => this.visitLeftPadded(name, q));
|
|
358
|
+
await q.getAndSend(fieldAccess, a => (0, rpc_1.asRef)(a.type), type => this.visitType(type, q));
|
|
359
|
+
return fieldAccess;
|
|
360
|
+
}
|
|
361
|
+
async visitForEachLoop(forEach, q) {
|
|
362
|
+
await q.getAndSend(forEach, f => f.control, control => this.visit(control, q));
|
|
363
|
+
await q.getAndSend(forEach, f => f.body, body => this.visitRightPadded(body, q));
|
|
364
|
+
return forEach;
|
|
365
|
+
}
|
|
366
|
+
async visitForEachLoopControl(control, q) {
|
|
367
|
+
await q.getAndSend(control, c => c.variable, variable => this.visitRightPadded(variable, q));
|
|
368
|
+
await q.getAndSend(control, c => c.iterable, iterable => this.visitRightPadded(iterable, q));
|
|
369
|
+
return control;
|
|
370
|
+
}
|
|
371
|
+
async visitForLoop(forLoop, q) {
|
|
372
|
+
await q.getAndSend(forLoop, f => f.control, control => this.visit(control, q));
|
|
373
|
+
await q.getAndSend(forLoop, f => f.body, body => this.visitRightPadded(body, q));
|
|
374
|
+
return forLoop;
|
|
375
|
+
}
|
|
376
|
+
async visitForLoopControl(control, q) {
|
|
377
|
+
await q.getAndSendList(control, c => c.init, i => i.element.id, i => this.visitRightPadded(i, q));
|
|
378
|
+
await q.getAndSend(control, c => c.condition, c => this.visitRightPadded(c, q));
|
|
379
|
+
await q.getAndSendList(control, c => c.update, u => u.element.id, u => this.visitRightPadded(u, q));
|
|
380
|
+
return control;
|
|
381
|
+
}
|
|
382
|
+
async visitIf(ifStmt, q) {
|
|
383
|
+
await q.getAndSend(ifStmt, i => i.ifCondition, cond => this.visit(cond, q));
|
|
384
|
+
await q.getAndSend(ifStmt, i => i.thenPart, then => this.visitRightPadded(then, q));
|
|
385
|
+
await q.getAndSend(ifStmt, i => i.elsePart, elsePart => this.visit(elsePart, q));
|
|
386
|
+
return ifStmt;
|
|
387
|
+
}
|
|
388
|
+
async visitElse(ifElse, q) {
|
|
389
|
+
await q.getAndSend(ifElse, e => e.body, body => this.visitRightPadded(body, q));
|
|
390
|
+
return ifElse;
|
|
391
|
+
}
|
|
392
|
+
async visitImport(importStmt, q) {
|
|
393
|
+
await q.getAndSend(importStmt, i => i.static, static_ => this.visitLeftPadded(static_, q));
|
|
394
|
+
await q.getAndSend(importStmt, i => i.qualid, qualid => this.visit(qualid, q));
|
|
395
|
+
await q.getAndSend(importStmt, i => i.alias, alias => this.visitLeftPadded(alias, q));
|
|
396
|
+
return importStmt;
|
|
397
|
+
}
|
|
398
|
+
async visitInstanceOf(instanceOf, q) {
|
|
399
|
+
await q.getAndSend(instanceOf, i => i.expression, expr => this.visitRightPadded(expr, q));
|
|
400
|
+
await q.getAndSend(instanceOf, i => i.class, clazz => this.visit(clazz, q));
|
|
401
|
+
await q.getAndSend(instanceOf, i => i.pattern, pattern => this.visit(pattern, q));
|
|
402
|
+
await q.getAndSend(instanceOf, i => (0, rpc_1.asRef)(i.type), type => this.visitType(type, q));
|
|
403
|
+
await q.getAndSend(instanceOf, i => i.modifier, modifier => this.visit(modifier, q));
|
|
404
|
+
return instanceOf;
|
|
405
|
+
}
|
|
406
|
+
async visitIntersectionType(intersectionType, q) {
|
|
407
|
+
await q.getAndSend(intersectionType, i => i.bounds, bounds => this.visitContainer(bounds, q));
|
|
408
|
+
return intersectionType;
|
|
409
|
+
}
|
|
410
|
+
async visitLabel(label, q) {
|
|
411
|
+
await q.getAndSend(label, l => l.label, id => this.visitRightPadded(id, q));
|
|
412
|
+
await q.getAndSend(label, l => l.statement, stmt => this.visit(stmt, q));
|
|
413
|
+
return label;
|
|
414
|
+
}
|
|
415
|
+
async visitLambda(lambda, q) {
|
|
416
|
+
await q.getAndSend(lambda, l => l.parameters, params => this.visit(params, q));
|
|
417
|
+
await q.getAndSend(lambda, l => l.arrow, arrow => this.visitSpace(arrow, q));
|
|
418
|
+
await q.getAndSend(lambda, l => l.body, body => this.visit(body, q));
|
|
419
|
+
await q.getAndSend(lambda, l => (0, rpc_1.asRef)(l.type), type => this.visitType(type, q));
|
|
420
|
+
return lambda;
|
|
421
|
+
}
|
|
422
|
+
async visitLambdaParameters(params, q) {
|
|
423
|
+
await q.getAndSend(params, p => p.parenthesized);
|
|
424
|
+
await q.getAndSendList(params, p => p.parameters, param => param.element.id, param => this.visitRightPadded(param, q));
|
|
425
|
+
return params;
|
|
426
|
+
}
|
|
427
|
+
async visitLiteral(literal, q) {
|
|
428
|
+
await q.getAndSend(literal, l => l.value);
|
|
429
|
+
await q.getAndSend(literal, l => l.valueSource);
|
|
430
|
+
await q.getAndSendList(literal, l => l.unicodeEscapes, e => e.valueSourceIndex + e.codePoint);
|
|
431
|
+
await q.getAndSend(literal, l => (0, rpc_1.asRef)(l.type), type => this.visitType(type, q));
|
|
432
|
+
return literal;
|
|
433
|
+
}
|
|
434
|
+
async visitMemberReference(memberRef, q) {
|
|
435
|
+
await q.getAndSend(memberRef, m => m.containing, cont => this.visitRightPadded(cont, q));
|
|
436
|
+
await q.getAndSend(memberRef, m => m.typeParameters, params => this.visitContainer(params, q));
|
|
437
|
+
await q.getAndSend(memberRef, m => m.reference, ref => this.visitLeftPadded(ref, q));
|
|
438
|
+
await q.getAndSend(memberRef, m => (0, rpc_1.asRef)(m.type), type => this.visitType(type, q));
|
|
439
|
+
await q.getAndSend(memberRef, m => (0, rpc_1.asRef)(m.methodType), type => this.visitType(type, q));
|
|
440
|
+
await q.getAndSend(memberRef, m => (0, rpc_1.asRef)(m.variableType), type => this.visitType(type, q));
|
|
441
|
+
return memberRef;
|
|
442
|
+
}
|
|
443
|
+
async visitMethodInvocation(invocation, q) {
|
|
444
|
+
await q.getAndSend(invocation, m => m.select, select => this.visitRightPadded(select, q));
|
|
445
|
+
await q.getAndSend(invocation, m => m.typeParameters, params => this.visitContainer(params, q));
|
|
446
|
+
await q.getAndSend(invocation, m => m.name, name => this.visit(name, q));
|
|
447
|
+
await q.getAndSend(invocation, m => m.arguments, args => this.visitContainer(args, q));
|
|
448
|
+
await q.getAndSend(invocation, m => (0, rpc_1.asRef)(m.methodType), type => this.visitType(type, q));
|
|
449
|
+
return invocation;
|
|
450
|
+
}
|
|
451
|
+
async visitModifier(modifier, q) {
|
|
452
|
+
await q.getAndSend(modifier, m => m.keyword);
|
|
453
|
+
await q.getAndSend(modifier, m => m.type);
|
|
454
|
+
await q.getAndSendList(modifier, m => m.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
455
|
+
return modifier;
|
|
456
|
+
}
|
|
457
|
+
async visitMultiCatch(multiCatch, q) {
|
|
458
|
+
await q.getAndSendList(multiCatch, m => m.alternatives, alt => alt.element.id, alt => this.visitRightPadded(alt, q));
|
|
459
|
+
return multiCatch;
|
|
460
|
+
}
|
|
461
|
+
async visitNewArray(newArray, q) {
|
|
462
|
+
await q.getAndSend(newArray, n => n.typeExpression, type => this.visit(type, q));
|
|
463
|
+
await q.getAndSendList(newArray, n => n.dimensions, dim => dim.id, dim => this.visit(dim, q));
|
|
464
|
+
await q.getAndSend(newArray, n => n.initializer, init => this.visitContainer(init, q));
|
|
465
|
+
await q.getAndSend(newArray, n => (0, rpc_1.asRef)(n.type), type => this.visitType(type, q));
|
|
466
|
+
return newArray;
|
|
467
|
+
}
|
|
468
|
+
async visitNewClass(newClass, q) {
|
|
469
|
+
await q.getAndSend(newClass, n => n.enclosing, encl => this.visitRightPadded(encl, q));
|
|
470
|
+
await q.getAndSend(newClass, n => n.new, n => this.visitSpace(n, q));
|
|
471
|
+
await q.getAndSend(newClass, n => n.class, clazz => this.visit(clazz, q));
|
|
472
|
+
await q.getAndSend(newClass, n => n.arguments, args => this.visitContainer(args, q));
|
|
473
|
+
await q.getAndSend(newClass, n => n.body, body => this.visit(body, q));
|
|
474
|
+
await q.getAndSend(newClass, n => (0, rpc_1.asRef)(n.constructorType), type => this.visitType(type, q));
|
|
475
|
+
return newClass;
|
|
476
|
+
}
|
|
477
|
+
async visitNullableType(nullableType, q) {
|
|
478
|
+
await q.getAndSendList(nullableType, a => a.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
479
|
+
await q.getAndSend(nullableType, n => n.typeTree, type => this.visitRightPadded(type, q));
|
|
480
|
+
return nullableType;
|
|
481
|
+
}
|
|
482
|
+
async visitParameterizedType(paramType, q) {
|
|
483
|
+
await q.getAndSend(paramType, p => p.class, clazz => this.visit(clazz, q));
|
|
484
|
+
await q.getAndSend(paramType, p => p.typeParameters, params => this.visitContainer(params, q));
|
|
485
|
+
await q.getAndSend(paramType, p => (0, rpc_1.asRef)(p.type), type => this.visitType(type, q));
|
|
486
|
+
return paramType;
|
|
487
|
+
}
|
|
488
|
+
async visitParentheses(parentheses, q) {
|
|
489
|
+
await q.getAndSend(parentheses, p => p.tree, tree => this.visitRightPadded(tree, q));
|
|
490
|
+
return parentheses;
|
|
491
|
+
}
|
|
492
|
+
async visitParenthesizedTypeTree(parenthesizedType, q) {
|
|
493
|
+
await q.getAndSendList(parenthesizedType, a => a.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
494
|
+
await q.getAndSend(parenthesizedType, p => p.parenthesizedType, tree => this.visit(tree, q));
|
|
495
|
+
return parenthesizedType;
|
|
496
|
+
}
|
|
497
|
+
async visitPrimitive(primitive, q) {
|
|
498
|
+
await q.getAndSend(primitive, p => (0, rpc_1.asRef)(p.type), type => this.visitType(type, q));
|
|
499
|
+
return primitive;
|
|
500
|
+
}
|
|
501
|
+
async visitReturn(returnStmt, q) {
|
|
502
|
+
await q.getAndSend(returnStmt, r => r.expression, expr => this.visit(expr, q));
|
|
503
|
+
return returnStmt;
|
|
504
|
+
}
|
|
505
|
+
async visitSwitch(aSwitch, q) {
|
|
506
|
+
await q.getAndSend(aSwitch, s => s.selector, sel => this.visit(sel, q));
|
|
507
|
+
await q.getAndSend(aSwitch, s => s.cases, block => this.visit(block, q));
|
|
508
|
+
return aSwitch;
|
|
509
|
+
}
|
|
510
|
+
async visitSwitchExpression(switchExpr, q) {
|
|
511
|
+
await q.getAndSend(switchExpr, s => s.selector, sel => this.visit(sel, q));
|
|
512
|
+
await q.getAndSend(switchExpr, s => s.cases, block => this.visit(block, q));
|
|
513
|
+
await q.getAndSend(switchExpr, s => (0, rpc_1.asRef)(s.type), type => this.visitType(type, q));
|
|
514
|
+
return switchExpr;
|
|
515
|
+
}
|
|
516
|
+
async visitSynchronized(syncStmt, q) {
|
|
517
|
+
await q.getAndSend(syncStmt, s => s.lock, lock => this.visit(lock, q));
|
|
518
|
+
await q.getAndSend(syncStmt, s => s.body, body => this.visit(body, q));
|
|
519
|
+
return syncStmt;
|
|
520
|
+
}
|
|
521
|
+
async visitTernary(ternary, q) {
|
|
522
|
+
await q.getAndSend(ternary, t => t.condition, cond => this.visit(cond, q));
|
|
523
|
+
await q.getAndSend(ternary, t => t.truePart, truePart => this.visitLeftPadded(truePart, q));
|
|
524
|
+
await q.getAndSend(ternary, t => t.falsePart, falsePart => this.visitLeftPadded(falsePart, q));
|
|
525
|
+
await q.getAndSend(ternary, t => (0, rpc_1.asRef)(t.type), type => this.visitType(type, q));
|
|
526
|
+
return ternary;
|
|
527
|
+
}
|
|
528
|
+
async visitThrow(throwStmt, q) {
|
|
529
|
+
await q.getAndSend(throwStmt, t => t.exception, exc => this.visit(exc, q));
|
|
530
|
+
return throwStmt;
|
|
531
|
+
}
|
|
532
|
+
async visitTry(tryStmt, q) {
|
|
533
|
+
await q.getAndSend(tryStmt, t => t.resources, res => this.visitContainer(res, q));
|
|
534
|
+
await q.getAndSend(tryStmt, t => t.body, body => this.visit(body, q));
|
|
535
|
+
await q.getAndSendList(tryStmt, t => t.catches, catch_ => catch_.id, catch_ => this.visit(catch_, q));
|
|
536
|
+
await q.getAndSend(tryStmt, t => t.finally, fin => this.visitLeftPadded(fin, q));
|
|
537
|
+
return tryStmt;
|
|
538
|
+
}
|
|
539
|
+
async visitTryResource(resource, q) {
|
|
540
|
+
await q.getAndSend(resource, r => r.variableDeclarations, variable => this.visit(variable, q));
|
|
541
|
+
await q.getAndSend(resource, r => r.terminatedWithSemicolon);
|
|
542
|
+
return resource;
|
|
543
|
+
}
|
|
544
|
+
async visitTryCatch(aCatch, q) {
|
|
545
|
+
await q.getAndSend(aCatch, c => c.parameter, param => this.visit(param, q));
|
|
546
|
+
await q.getAndSend(aCatch, c => c.body, body => this.visit(body, q));
|
|
547
|
+
return aCatch;
|
|
548
|
+
}
|
|
549
|
+
async visitTypeCast(typeCast, q) {
|
|
550
|
+
await q.getAndSend(typeCast, t => t.class, clazz => this.visit(clazz, q));
|
|
551
|
+
await q.getAndSend(typeCast, t => t.expression, expr => this.visit(expr, q));
|
|
552
|
+
return typeCast;
|
|
553
|
+
}
|
|
554
|
+
async visitTypeParameter(typeParam, q) {
|
|
555
|
+
await q.getAndSendList(typeParam, t => t.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
556
|
+
await q.getAndSendList(typeParam, t => t.modifiers, mod => mod.id, mod => this.visit(mod, q));
|
|
557
|
+
await q.getAndSend(typeParam, t => t.name, name => this.visit(name, q));
|
|
558
|
+
await q.getAndSend(typeParam, t => t.bounds, bounds => this.visitContainer(bounds, q));
|
|
559
|
+
return typeParam;
|
|
560
|
+
}
|
|
561
|
+
async visitTypeParameters(typeParams, q) {
|
|
562
|
+
await q.getAndSendList(typeParams, a => a.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
563
|
+
await q.getAndSendList(typeParams, t => t.typeParameters, p => p.element.id, params => this.visitRightPadded(params, q));
|
|
564
|
+
return typeParams;
|
|
565
|
+
}
|
|
566
|
+
async visitUnary(unary, q) {
|
|
567
|
+
await q.getAndSend(unary, u => u.operator, op => this.visitLeftPadded(op, q));
|
|
568
|
+
await q.getAndSend(unary, u => u.expression, expr => this.visit(expr, q));
|
|
569
|
+
await q.getAndSend(unary, u => (0, rpc_1.asRef)(u.type), type => this.visitType(type, q));
|
|
570
|
+
return unary;
|
|
571
|
+
}
|
|
572
|
+
async visitVariable(variable, q) {
|
|
573
|
+
await q.getAndSend(variable, v => v.name, name => this.visit(name, q));
|
|
574
|
+
await q.getAndSendList(variable, v => v.dimensionsAfterName, d => JSON.stringify(d.element), dims => this.visitLeftPadded(dims, q));
|
|
575
|
+
await q.getAndSend(variable, v => v.initializer, init => this.visitLeftPadded(init, q));
|
|
576
|
+
await q.getAndSend(variable, v => (0, rpc_1.asRef)(v.variableType), type => this.visitType(type, q));
|
|
577
|
+
return variable;
|
|
578
|
+
}
|
|
579
|
+
async visitWhileLoop(whileLoop, q) {
|
|
580
|
+
await q.getAndSend(whileLoop, w => w.condition, cond => this.visit(cond, q));
|
|
581
|
+
await q.getAndSend(whileLoop, w => w.body, body => this.visitRightPadded(body, q));
|
|
582
|
+
return whileLoop;
|
|
583
|
+
}
|
|
584
|
+
async visitWildcard(wildcard, q) {
|
|
585
|
+
await q.getAndSend(wildcard, w => w.bound, b => this.visitLeftPadded(b, q));
|
|
586
|
+
await q.getAndSend(wildcard, w => w.boundedType, type => this.visit(type, q));
|
|
587
|
+
return wildcard;
|
|
588
|
+
}
|
|
589
|
+
async visitYield(yieldExpr, q) {
|
|
590
|
+
await q.getAndSend(yieldExpr, y => y.implicit);
|
|
591
|
+
await q.getAndSend(yieldExpr, y => y.value, value => this.visit(value, q));
|
|
592
|
+
return yieldExpr;
|
|
593
|
+
}
|
|
594
|
+
async visitUnknown(unknown, q) {
|
|
595
|
+
await q.getAndSend(unknown, u => u.source, source => this.visit(source, q));
|
|
596
|
+
return unknown;
|
|
597
|
+
}
|
|
598
|
+
async visitUnknownSource(source, q) {
|
|
599
|
+
await q.getAndSend(source, s => s.text);
|
|
600
|
+
return source;
|
|
601
|
+
}
|
|
602
|
+
async visitCompilationUnit(cu, q) {
|
|
603
|
+
await q.getAndSend(cu, c => c.sourcePath);
|
|
604
|
+
await q.getAndSend(cu, c => c.charsetName);
|
|
605
|
+
await q.getAndSend(cu, c => c.charsetBomMarked);
|
|
606
|
+
await q.getAndSend(cu, c => c.checksum);
|
|
607
|
+
await q.getAndSend(cu, c => c.fileAttributes);
|
|
608
|
+
await q.getAndSend(cu, c => c.packageDeclaration, pkg => this.visitRightPadded(pkg, q));
|
|
609
|
+
await q.getAndSendList(cu, c => c.imports, imp => imp.element.id, imp => this.visitRightPadded(imp, q));
|
|
610
|
+
await q.getAndSendList(cu, c => c.classes, cls => cls.id, cls => this.visit(cls, q));
|
|
611
|
+
await q.getAndSend(cu, c => c.eof, space => this.visitSpace(space, q));
|
|
612
|
+
return cu;
|
|
613
|
+
}
|
|
614
|
+
async visitPackage(pkg, q) {
|
|
615
|
+
await q.getAndSend(pkg, p => p.expression, expr => this.visit(expr, q));
|
|
616
|
+
await q.getAndSendList(pkg, p => p.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
617
|
+
return pkg;
|
|
618
|
+
}
|
|
619
|
+
async visitClassDeclaration(cls, q) {
|
|
620
|
+
await q.getAndSendList(cls, c => c.leadingAnnotations, annot => annot.id, annot => this.visit(annot, q));
|
|
621
|
+
await q.getAndSendList(cls, c => c.modifiers, mod => mod.id, mod => this.visit(mod, q));
|
|
622
|
+
await q.getAndSend(cls, c => c.classKind, kind => this.visit(kind, q));
|
|
623
|
+
await q.getAndSend(cls, c => c.name, name => this.visit(name, q));
|
|
624
|
+
await q.getAndSend(cls, c => c.typeParameters, params => this.visitContainer(params, q));
|
|
625
|
+
await q.getAndSend(cls, c => c.primaryConstructor, cons => this.visitContainer(cons, q));
|
|
626
|
+
await q.getAndSend(cls, c => c.extends, ext => this.visitLeftPadded(ext, q));
|
|
627
|
+
await q.getAndSend(cls, c => c.implements, impl => this.visitContainer(impl, q));
|
|
628
|
+
await q.getAndSend(cls, c => c.permitting, perm => this.visitContainer(perm, q));
|
|
629
|
+
await q.getAndSend(cls, c => c.body, body => this.visit(body, q));
|
|
630
|
+
return cls;
|
|
631
|
+
}
|
|
632
|
+
async visitClassDeclarationKind(kind, q) {
|
|
633
|
+
await q.getAndSendList(kind, k => k.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
634
|
+
await q.getAndSend(kind, k => k.type);
|
|
635
|
+
return kind;
|
|
636
|
+
}
|
|
637
|
+
async visitBlock(block, q) {
|
|
638
|
+
await q.getAndSend(block, b => b.static, s => this.visitRightPadded(s, q));
|
|
639
|
+
await q.getAndSendList(block, b => b.statements, stmt => stmt.element.id, stmt => this.visitRightPadded(stmt, q));
|
|
640
|
+
await q.getAndSend(block, b => b.end, space => this.visitSpace(space, q));
|
|
641
|
+
return block;
|
|
642
|
+
}
|
|
643
|
+
async visitMethodDeclaration(method, q) {
|
|
644
|
+
await q.getAndSendList(method, m => m.leadingAnnotations, annot => annot.id, annot => this.visit(annot, q));
|
|
645
|
+
await q.getAndSendList(method, m => m.modifiers, mod => mod.id, mod => this.visit(mod, q));
|
|
646
|
+
await q.getAndSend(method, m => m.typeParameters, params => this.visit(params, q));
|
|
647
|
+
await q.getAndSend(method, m => m.returnTypeExpression, type => this.visit(type, q));
|
|
648
|
+
await q.getAndSendList(method, m => m.nameAnnotations, a => a.id, name => this.visit(name, q));
|
|
649
|
+
await q.getAndSend(method, m => m.name, name => this.visit(name, q));
|
|
650
|
+
await q.getAndSend(method, m => m.parameters, params => this.visitContainer(params, q));
|
|
651
|
+
await q.getAndSend(method, m => m.throws, throws => this.visitContainer(throws, q));
|
|
652
|
+
await q.getAndSend(method, m => m.body, body => this.visit(body, q));
|
|
653
|
+
await q.getAndSend(method, m => m.defaultValue, def => this.visitLeftPadded(def, q));
|
|
654
|
+
await q.getAndSend(method, m => (0, rpc_1.asRef)(m.methodType), type => this.visitType(type, q));
|
|
655
|
+
return method;
|
|
656
|
+
}
|
|
657
|
+
async visitVariableDeclarations(varDecls, q) {
|
|
658
|
+
await q.getAndSendList(varDecls, v => v.leadingAnnotations, annot => annot.id, annot => this.visit(annot, q));
|
|
659
|
+
await q.getAndSendList(varDecls, v => v.modifiers, mod => mod.id, mod => this.visit(mod, q));
|
|
660
|
+
await q.getAndSend(varDecls, v => v.typeExpression, type => this.visit(type, q));
|
|
661
|
+
await q.getAndSend(varDecls, v => v.varargs, space => this.visitSpace(space, q));
|
|
662
|
+
await q.getAndSendList(varDecls, v => v.variables, variable => variable.element.id, variable => this.visitRightPadded(variable, q));
|
|
663
|
+
return varDecls;
|
|
664
|
+
}
|
|
665
|
+
async visitIdentifier(ident, q) {
|
|
666
|
+
await q.getAndSendList(ident, id => id.annotations, annot => annot.id, annot => this.visit(annot, q));
|
|
667
|
+
await q.getAndSend(ident, id => id.simpleName);
|
|
668
|
+
await q.getAndSend(ident, id => (0, rpc_1.asRef)(id.type), type => this.visitType(type, q));
|
|
669
|
+
await q.getAndSend(ident, id => (0, rpc_1.asRef)(id.fieldType), type => this.visitType(type, q));
|
|
670
|
+
return ident;
|
|
671
|
+
}
|
|
672
|
+
async visitSpace(space, q) {
|
|
673
|
+
await q.getAndSendList(space, s => s.comments, c => {
|
|
674
|
+
if (c.kind === tree_1.J.Kind.TextComment) {
|
|
675
|
+
return c.text + c.suffix;
|
|
903
676
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
if ((0, tree_2.isTree)(right.element)) {
|
|
911
|
-
yield q.getAndSend(right, r => r.element, elem => this.visit(elem, q));
|
|
677
|
+
throw new Error(`Unexpected comment type ${c.kind}`);
|
|
678
|
+
}, async (c) => {
|
|
679
|
+
if (c.kind === tree_1.J.Kind.TextComment) {
|
|
680
|
+
const tc = c;
|
|
681
|
+
await q.getAndSend(tc, c2 => c2.multiline);
|
|
682
|
+
await q.getAndSend(tc, c2 => c2.text);
|
|
912
683
|
}
|
|
913
684
|
else {
|
|
914
|
-
|
|
685
|
+
throw new Error(`Unexpected comment type ${c.kind}`);
|
|
915
686
|
}
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
return right;
|
|
687
|
+
await q.getAndSend(c, c2 => c2.suffix);
|
|
688
|
+
await q.getAndSend(c, c2 => c2.markers);
|
|
919
689
|
});
|
|
690
|
+
await q.getAndSend(space, s => s.whitespace);
|
|
691
|
+
return space;
|
|
920
692
|
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
693
|
+
async visitLeftPadded(left, q) {
|
|
694
|
+
await q.getAndSend(left, l => l.before, space => this.visitSpace(space, q));
|
|
695
|
+
if ((0, tree_2.isTree)(left.element)) {
|
|
696
|
+
await q.getAndSend(left, l => l.element, elem => this.visit(elem, q));
|
|
697
|
+
}
|
|
698
|
+
else if ((0, tree_1.isSpace)(left.element)) {
|
|
699
|
+
await q.getAndSend(left, l => l.element, space => this.visitSpace(space, q));
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
await q.getAndSend(left, l => l.element);
|
|
703
|
+
}
|
|
704
|
+
await q.getAndSend(left, l => l.markers);
|
|
705
|
+
return left;
|
|
928
706
|
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
707
|
+
async visitRightPadded(right, q) {
|
|
708
|
+
if ((0, tree_2.isTree)(right.element)) {
|
|
709
|
+
await q.getAndSend(right, r => r.element, elem => this.visit(elem, q));
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
await q.getAndSend(right, r => r.element);
|
|
713
|
+
}
|
|
714
|
+
await q.getAndSend(right, r => r.after, space => this.visitSpace(space, q));
|
|
715
|
+
await q.getAndSend(right, r => r.markers);
|
|
716
|
+
return right;
|
|
717
|
+
}
|
|
718
|
+
async visitContainer(container, q) {
|
|
719
|
+
await q.getAndSend(container, c => c.before, space => this.visitSpace(space, q));
|
|
720
|
+
await q.getAndSendList(container, c => c.elements, elem => elem.element.id, elem => this.visitRightPadded(elem, q));
|
|
721
|
+
await q.getAndSend(container, c => c.markers);
|
|
722
|
+
return container;
|
|
723
|
+
}
|
|
724
|
+
async visitType(javaType, q) {
|
|
725
|
+
if (!javaType) {
|
|
726
|
+
return undefined;
|
|
727
|
+
}
|
|
728
|
+
return await this.typeVisitor.visit(javaType, q);
|
|
936
729
|
}
|
|
937
730
|
}
|
|
938
731
|
exports.JavaSender = JavaSender;
|
|
@@ -941,808 +734,654 @@ class JavaReceiver extends visitor_1.JavaVisitor {
|
|
|
941
734
|
super(...arguments);
|
|
942
735
|
this.typeVisitor = new TypeReceiver();
|
|
943
736
|
}
|
|
944
|
-
preVisit(j, q) {
|
|
945
|
-
|
|
946
|
-
try {
|
|
947
|
-
const updates = {
|
|
948
|
-
id: yield q.receive(j.id),
|
|
949
|
-
prefix: yield q.receive(j.prefix, space => this.visitSpace(space, q)),
|
|
950
|
-
markers: yield q.receive(j.markers)
|
|
951
|
-
};
|
|
952
|
-
return (0, util_1.updateIfChanged)(j, updates);
|
|
953
|
-
}
|
|
954
|
-
catch (e) {
|
|
955
|
-
throw e;
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
visitAnnotatedType(annotatedType, q) {
|
|
960
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
961
|
-
const updates = {
|
|
962
|
-
annotations: yield q.receiveListDefined(annotatedType.annotations, annot => this.visit(annot, q)),
|
|
963
|
-
typeExpression: yield q.receive(annotatedType.typeExpression, type => this.visit(type, q))
|
|
964
|
-
};
|
|
965
|
-
return (0, util_1.updateIfChanged)(annotatedType, updates);
|
|
966
|
-
});
|
|
967
|
-
}
|
|
968
|
-
visitAnnotation(annotation, q) {
|
|
969
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
970
|
-
const updates = {
|
|
971
|
-
annotationType: yield q.receive(annotation.annotationType, type => this.visit(type, q)),
|
|
972
|
-
arguments: yield q.receive(annotation.arguments, args => this.visitContainer(args, q))
|
|
973
|
-
};
|
|
974
|
-
return (0, util_1.updateIfChanged)(annotation, updates);
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
visitArrayAccess(arrayAccess, q) {
|
|
978
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
979
|
-
const updates = {
|
|
980
|
-
indexed: yield q.receive(arrayAccess.indexed, indexed => this.visit(indexed, q)),
|
|
981
|
-
dimension: yield q.receive(arrayAccess.dimension, dim => this.visit(dim, q))
|
|
982
|
-
};
|
|
983
|
-
return (0, util_1.updateIfChanged)(arrayAccess, updates);
|
|
984
|
-
});
|
|
985
|
-
}
|
|
986
|
-
visitArrayDimension(dimension, q) {
|
|
987
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
988
|
-
const updates = {
|
|
989
|
-
index: yield q.receive(dimension.index, idx => this.visitRightPadded(idx, q))
|
|
990
|
-
};
|
|
991
|
-
return (0, util_1.updateIfChanged)(dimension, updates);
|
|
992
|
-
});
|
|
993
|
-
}
|
|
994
|
-
visitArrayType(arrayType, q) {
|
|
995
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
996
|
-
const updates = {
|
|
997
|
-
elementType: yield q.receive(arrayType.elementType, type => this.visit(type, q)),
|
|
998
|
-
annotations: yield q.receiveListDefined(arrayType.annotations || [], annot => this.visit(annot, q)),
|
|
999
|
-
dimension: yield q.receive(arrayType.dimension, d => this.visitLeftPadded(d, q)),
|
|
1000
|
-
type: yield q.receive(arrayType.type, type => this.visitType(type, q))
|
|
1001
|
-
};
|
|
1002
|
-
return (0, util_1.updateIfChanged)(arrayType, updates);
|
|
1003
|
-
});
|
|
1004
|
-
}
|
|
1005
|
-
visitAssert(assert, q) {
|
|
1006
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1007
|
-
const updates = {
|
|
1008
|
-
condition: yield q.receive(assert.condition, cond => this.visit(cond, q)),
|
|
1009
|
-
detail: yield q.receive(assert.detail, detail => this.visitOptionalLeftPadded(detail, q))
|
|
1010
|
-
};
|
|
1011
|
-
return (0, util_1.updateIfChanged)(assert, updates);
|
|
1012
|
-
});
|
|
1013
|
-
}
|
|
1014
|
-
visitAssignment(assignment, q) {
|
|
1015
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1016
|
-
const updates = {
|
|
1017
|
-
variable: yield q.receive(assignment.variable, variable => this.visit(variable, q)),
|
|
1018
|
-
assignment: yield q.receive(assignment.assignment, assign => this.visitLeftPadded(assign, q)),
|
|
1019
|
-
type: yield q.receive(assignment.type, type => this.visitType(type, q))
|
|
1020
|
-
};
|
|
1021
|
-
return (0, util_1.updateIfChanged)(assignment, updates);
|
|
1022
|
-
});
|
|
1023
|
-
}
|
|
1024
|
-
visitAssignmentOperation(assignOp, q) {
|
|
1025
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1026
|
-
const updates = {
|
|
1027
|
-
variable: yield q.receive(assignOp.variable, variable => this.visit(variable, q)),
|
|
1028
|
-
operator: yield q.receive(assignOp.operator, op => this.visitLeftPadded(op, q)),
|
|
1029
|
-
assignment: yield q.receive(assignOp.assignment, assign => this.visit(assign, q)),
|
|
1030
|
-
type: yield q.receive(assignOp.type, type => this.visitType(type, q))
|
|
1031
|
-
};
|
|
1032
|
-
return (0, util_1.updateIfChanged)(assignOp, updates);
|
|
1033
|
-
});
|
|
1034
|
-
}
|
|
1035
|
-
visitBinary(binary, q) {
|
|
1036
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
737
|
+
async preVisit(j, q) {
|
|
738
|
+
try {
|
|
1037
739
|
const updates = {
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
type: yield q.receive(binary.type, type => this.visitType(type, q))
|
|
740
|
+
id: await q.receive(j.id),
|
|
741
|
+
prefix: await q.receive(j.prefix, space => this.visitSpace(space, q)),
|
|
742
|
+
markers: await q.receive(j.markers)
|
|
1042
743
|
};
|
|
1043
|
-
return (0, util_1.updateIfChanged)(
|
|
1044
|
-
}
|
|
744
|
+
return (0, util_1.updateIfChanged)(j, updates);
|
|
745
|
+
}
|
|
746
|
+
catch (e) {
|
|
747
|
+
throw e;
|
|
748
|
+
}
|
|
1045
749
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
return
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
return
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
return
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
return
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
return
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
return
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
}
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
return
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
}
|
|
1682
|
-
visitLeftPadded(left, q) {
|
|
1683
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1684
|
-
if (!left) {
|
|
1685
|
-
throw new Error("TreeDataReceiveQueue should have instantiated an empty left padding");
|
|
1686
|
-
}
|
|
1687
|
-
const updates = {
|
|
1688
|
-
before: yield q.receive(left.before, space => this.visitSpace(space, q)),
|
|
1689
|
-
element: yield q.receive(left.element, elem => {
|
|
1690
|
-
if ((0, tree_1.isSpace)(elem)) {
|
|
1691
|
-
return this.visitSpace(elem, q);
|
|
1692
|
-
}
|
|
1693
|
-
else if (typeof elem === 'object' && elem.kind) {
|
|
1694
|
-
// FIXME find a better way to check if it is a `Tree`
|
|
1695
|
-
return this.visit(elem, q);
|
|
1696
|
-
}
|
|
1697
|
-
return elem;
|
|
1698
|
-
}),
|
|
1699
|
-
markers: yield q.receive(left.markers)
|
|
1700
|
-
};
|
|
1701
|
-
return (0, util_1.updateIfChanged)(left, updates);
|
|
1702
|
-
});
|
|
1703
|
-
}
|
|
1704
|
-
visitRightPadded(right, q) {
|
|
1705
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1706
|
-
if (!right) {
|
|
1707
|
-
throw new Error("TreeDataReceiveQueue should have instantiated an empty right padding");
|
|
1708
|
-
}
|
|
1709
|
-
const updates = {
|
|
1710
|
-
element: yield q.receive(right.element, elem => {
|
|
1711
|
-
if ((0, tree_1.isSpace)(elem)) {
|
|
1712
|
-
return this.visitSpace(elem, q);
|
|
1713
|
-
}
|
|
1714
|
-
else if (typeof elem === 'object' && elem.kind) {
|
|
1715
|
-
// FIXME find a better way to check if it is a `Tree`
|
|
1716
|
-
return this.visit(elem, q);
|
|
1717
|
-
}
|
|
1718
|
-
return elem;
|
|
1719
|
-
}),
|
|
1720
|
-
after: yield q.receive(right.after, space => this.visitSpace(space, q)),
|
|
1721
|
-
markers: yield q.receive(right.markers)
|
|
1722
|
-
};
|
|
1723
|
-
return (0, util_1.updateIfChanged)(right, updates);
|
|
1724
|
-
});
|
|
1725
|
-
}
|
|
1726
|
-
visitContainer(container, q) {
|
|
1727
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1728
|
-
const updates = {
|
|
1729
|
-
before: yield q.receive(container.before, space => this.visitSpace(space, q)),
|
|
1730
|
-
elements: yield q.receiveListDefined(container.elements, elem => this.visitRightPadded(elem, q)),
|
|
1731
|
-
markers: yield q.receive(container.markers)
|
|
1732
|
-
};
|
|
1733
|
-
return (0, util_1.updateIfChanged)(container, updates);
|
|
1734
|
-
});
|
|
1735
|
-
}
|
|
1736
|
-
visitType(javaType, q) {
|
|
1737
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1738
|
-
if (!javaType) {
|
|
1739
|
-
return undefined;
|
|
1740
|
-
}
|
|
1741
|
-
else if (javaType.kind === type_1.Type.Kind.Unknown) {
|
|
1742
|
-
return type_1.Type.unknownType;
|
|
1743
|
-
}
|
|
1744
|
-
return yield this.typeVisitor.visit(javaType, q);
|
|
1745
|
-
});
|
|
750
|
+
async visitAnnotatedType(annotatedType, q) {
|
|
751
|
+
const updates = {
|
|
752
|
+
annotations: await q.receiveListDefined(annotatedType.annotations, annot => this.visit(annot, q)),
|
|
753
|
+
typeExpression: await q.receive(annotatedType.typeExpression, type => this.visit(type, q))
|
|
754
|
+
};
|
|
755
|
+
return (0, util_1.updateIfChanged)(annotatedType, updates);
|
|
756
|
+
}
|
|
757
|
+
async visitAnnotation(annotation, q) {
|
|
758
|
+
const updates = {
|
|
759
|
+
annotationType: await q.receive(annotation.annotationType, type => this.visit(type, q)),
|
|
760
|
+
arguments: await q.receive(annotation.arguments, args => this.visitContainer(args, q))
|
|
761
|
+
};
|
|
762
|
+
return (0, util_1.updateIfChanged)(annotation, updates);
|
|
763
|
+
}
|
|
764
|
+
async visitArrayAccess(arrayAccess, q) {
|
|
765
|
+
const updates = {
|
|
766
|
+
indexed: await q.receive(arrayAccess.indexed, indexed => this.visit(indexed, q)),
|
|
767
|
+
dimension: await q.receive(arrayAccess.dimension, dim => this.visit(dim, q))
|
|
768
|
+
};
|
|
769
|
+
return (0, util_1.updateIfChanged)(arrayAccess, updates);
|
|
770
|
+
}
|
|
771
|
+
async visitArrayDimension(dimension, q) {
|
|
772
|
+
const updates = {
|
|
773
|
+
index: await q.receive(dimension.index, idx => this.visitRightPadded(idx, q))
|
|
774
|
+
};
|
|
775
|
+
return (0, util_1.updateIfChanged)(dimension, updates);
|
|
776
|
+
}
|
|
777
|
+
async visitArrayType(arrayType, q) {
|
|
778
|
+
const updates = {
|
|
779
|
+
elementType: await q.receive(arrayType.elementType, type => this.visit(type, q)),
|
|
780
|
+
annotations: await q.receiveListDefined(arrayType.annotations || [], annot => this.visit(annot, q)),
|
|
781
|
+
dimension: await q.receive(arrayType.dimension, d => this.visitLeftPadded(d, q)),
|
|
782
|
+
type: await q.receive(arrayType.type, type => this.visitType(type, q))
|
|
783
|
+
};
|
|
784
|
+
return (0, util_1.updateIfChanged)(arrayType, updates);
|
|
785
|
+
}
|
|
786
|
+
async visitAssert(assert, q) {
|
|
787
|
+
const updates = {
|
|
788
|
+
condition: await q.receive(assert.condition, cond => this.visit(cond, q)),
|
|
789
|
+
detail: await q.receive(assert.detail, detail => this.visitOptionalLeftPadded(detail, q))
|
|
790
|
+
};
|
|
791
|
+
return (0, util_1.updateIfChanged)(assert, updates);
|
|
792
|
+
}
|
|
793
|
+
async visitAssignment(assignment, q) {
|
|
794
|
+
const updates = {
|
|
795
|
+
variable: await q.receive(assignment.variable, variable => this.visit(variable, q)),
|
|
796
|
+
assignment: await q.receive(assignment.assignment, assign => this.visitLeftPadded(assign, q)),
|
|
797
|
+
type: await q.receive(assignment.type, type => this.visitType(type, q))
|
|
798
|
+
};
|
|
799
|
+
return (0, util_1.updateIfChanged)(assignment, updates);
|
|
800
|
+
}
|
|
801
|
+
async visitAssignmentOperation(assignOp, q) {
|
|
802
|
+
const updates = {
|
|
803
|
+
variable: await q.receive(assignOp.variable, variable => this.visit(variable, q)),
|
|
804
|
+
operator: await q.receive(assignOp.operator, op => this.visitLeftPadded(op, q)),
|
|
805
|
+
assignment: await q.receive(assignOp.assignment, assign => this.visit(assign, q)),
|
|
806
|
+
type: await q.receive(assignOp.type, type => this.visitType(type, q))
|
|
807
|
+
};
|
|
808
|
+
return (0, util_1.updateIfChanged)(assignOp, updates);
|
|
809
|
+
}
|
|
810
|
+
async visitBinary(binary, q) {
|
|
811
|
+
const updates = {
|
|
812
|
+
left: await q.receive(binary.left, left => this.visit(left, q)),
|
|
813
|
+
operator: await q.receive(binary.operator, op => this.visitLeftPadded(op, q)),
|
|
814
|
+
right: await q.receive(binary.right, right => this.visit(right, q)),
|
|
815
|
+
type: await q.receive(binary.type, type => this.visitType(type, q))
|
|
816
|
+
};
|
|
817
|
+
return (0, util_1.updateIfChanged)(binary, updates);
|
|
818
|
+
}
|
|
819
|
+
async visitBreak(breakStmt, q) {
|
|
820
|
+
const updates = {
|
|
821
|
+
label: await q.receive(breakStmt.label, label => this.visit(label, q))
|
|
822
|
+
};
|
|
823
|
+
return (0, util_1.updateIfChanged)(breakStmt, updates);
|
|
824
|
+
}
|
|
825
|
+
async visitCase(caseStmt, q) {
|
|
826
|
+
const updates = {
|
|
827
|
+
type: await q.receive(caseStmt.type),
|
|
828
|
+
caseLabels: await q.receive(caseStmt.caseLabels, labels => this.visitContainer(labels, q)),
|
|
829
|
+
statements: await q.receive(caseStmt.statements, stmts => this.visitContainer(stmts, q)),
|
|
830
|
+
body: await q.receive(caseStmt.body, body => this.visitRightPadded(body, q)),
|
|
831
|
+
guard: await q.receive(caseStmt.guard, guard => this.visit(guard, q))
|
|
832
|
+
};
|
|
833
|
+
return (0, util_1.updateIfChanged)(caseStmt, updates);
|
|
834
|
+
}
|
|
835
|
+
async visitContinue(continueStmt, q) {
|
|
836
|
+
const updates = {
|
|
837
|
+
label: await q.receive(continueStmt.label, label => this.visit(label, q))
|
|
838
|
+
};
|
|
839
|
+
return (0, util_1.updateIfChanged)(continueStmt, updates);
|
|
840
|
+
}
|
|
841
|
+
async visitControlParentheses(controlParens, q) {
|
|
842
|
+
const updates = {
|
|
843
|
+
tree: await q.receive(controlParens.tree, tree => this.visitRightPadded(tree, q))
|
|
844
|
+
};
|
|
845
|
+
return (0, util_1.updateIfChanged)(controlParens, updates);
|
|
846
|
+
}
|
|
847
|
+
async visitDeconstructionPattern(pattern, q) {
|
|
848
|
+
const updates = {
|
|
849
|
+
deconstructor: await q.receive(pattern.deconstructor, deconstructor => this.visit(deconstructor, q)),
|
|
850
|
+
nested: await q.receive(pattern.nested, nested => this.visitContainer(nested, q)),
|
|
851
|
+
type: await q.receive(pattern.type, type => this.visitType(type, q))
|
|
852
|
+
};
|
|
853
|
+
return (0, util_1.updateIfChanged)(pattern, updates);
|
|
854
|
+
}
|
|
855
|
+
async visitDoWhileLoop(doWhile, q) {
|
|
856
|
+
const updates = {
|
|
857
|
+
body: await q.receive(doWhile.body, body => this.visitOptionalRightPadded(body, q)),
|
|
858
|
+
whileCondition: await q.receive(doWhile.whileCondition, cond => this.visitLeftPadded(cond, q))
|
|
859
|
+
};
|
|
860
|
+
return (0, util_1.updateIfChanged)(doWhile, updates);
|
|
861
|
+
}
|
|
862
|
+
async visitEmpty(empty) {
|
|
863
|
+
// no additional properties to receive
|
|
864
|
+
return empty;
|
|
865
|
+
}
|
|
866
|
+
async visitEnumValueSet(enumValueSet, q) {
|
|
867
|
+
const updates = {
|
|
868
|
+
enums: await q.receiveListDefined(enumValueSet.enums, enumValue => this.visitRightPadded(enumValue, q)),
|
|
869
|
+
terminatedWithSemicolon: await q.receive(enumValueSet.terminatedWithSemicolon)
|
|
870
|
+
};
|
|
871
|
+
return (0, util_1.updateIfChanged)(enumValueSet, updates);
|
|
872
|
+
}
|
|
873
|
+
async visitEnumValue(enumValue, q) {
|
|
874
|
+
const updates = {
|
|
875
|
+
annotations: await q.receiveListDefined(enumValue.annotations, annot => this.visit(annot, q)),
|
|
876
|
+
name: await q.receive(enumValue.name, name => this.visit(name, q)),
|
|
877
|
+
initializer: await q.receive(enumValue.initializer, init => this.visit(init, q))
|
|
878
|
+
};
|
|
879
|
+
return (0, util_1.updateIfChanged)(enumValue, updates);
|
|
880
|
+
}
|
|
881
|
+
async visitErroneous(erroneous, q) {
|
|
882
|
+
const updates = {
|
|
883
|
+
text: await q.receive(erroneous.text)
|
|
884
|
+
};
|
|
885
|
+
return (0, util_1.updateIfChanged)(erroneous, updates);
|
|
886
|
+
}
|
|
887
|
+
async visitFieldAccess(fieldAccess, q) {
|
|
888
|
+
const updates = {
|
|
889
|
+
target: await q.receive(fieldAccess.target, target => this.visit(target, q)),
|
|
890
|
+
name: await q.receive(fieldAccess.name, name => this.visitLeftPadded(name, q)),
|
|
891
|
+
type: await q.receive(fieldAccess.type, type => this.visitType(type, q))
|
|
892
|
+
};
|
|
893
|
+
return (0, util_1.updateIfChanged)(fieldAccess, updates);
|
|
894
|
+
}
|
|
895
|
+
async visitForEachLoop(forEachLoop, q) {
|
|
896
|
+
const updates = {
|
|
897
|
+
control: await q.receive(forEachLoop.control, c => this.visit(c, q)),
|
|
898
|
+
body: await q.receive(forEachLoop.body, body => this.visitRightPadded(body, q))
|
|
899
|
+
};
|
|
900
|
+
return (0, util_1.updateIfChanged)(forEachLoop, updates);
|
|
901
|
+
}
|
|
902
|
+
async visitForEachLoopControl(control, q) {
|
|
903
|
+
const updates = {
|
|
904
|
+
variable: await q.receive(control.variable, variable => this.visitRightPadded(variable, q)),
|
|
905
|
+
iterable: await q.receive(control.iterable, expr => this.visitRightPadded(expr, q))
|
|
906
|
+
};
|
|
907
|
+
return (0, util_1.updateIfChanged)(control, updates);
|
|
908
|
+
}
|
|
909
|
+
async visitForLoop(forLoop, q) {
|
|
910
|
+
const updates = {
|
|
911
|
+
control: await q.receive(forLoop.control, c => this.visit(c, q)),
|
|
912
|
+
body: await q.receive(forLoop.body, body => this.visitRightPadded(body, q))
|
|
913
|
+
};
|
|
914
|
+
return (0, util_1.updateIfChanged)(forLoop, updates);
|
|
915
|
+
}
|
|
916
|
+
async visitForLoopControl(control, q) {
|
|
917
|
+
const updates = {
|
|
918
|
+
init: await q.receiveListDefined(control.init, init => this.visitRightPadded(init, q)),
|
|
919
|
+
condition: await q.receive(control.condition, cond => this.visitRightPadded(cond, q)),
|
|
920
|
+
update: await q.receiveListDefined(control.update, update => this.visitRightPadded(update, q))
|
|
921
|
+
};
|
|
922
|
+
return (0, util_1.updateIfChanged)(control, updates);
|
|
923
|
+
}
|
|
924
|
+
async visitIf(ifStmt, q) {
|
|
925
|
+
const updates = {
|
|
926
|
+
ifCondition: await q.receive(ifStmt.ifCondition, cond => this.visit(cond, q)),
|
|
927
|
+
thenPart: await q.receive(ifStmt.thenPart, thenPart => this.visitRightPadded(thenPart, q)),
|
|
928
|
+
elsePart: await q.receive(ifStmt.elsePart, elsePart => this.visit(elsePart, q))
|
|
929
|
+
};
|
|
930
|
+
return (0, util_1.updateIfChanged)(ifStmt, updates);
|
|
931
|
+
}
|
|
932
|
+
async visitElse(ifElse, q) {
|
|
933
|
+
const updates = {
|
|
934
|
+
body: await q.receive(ifElse.body, body => this.visitRightPadded(body, q))
|
|
935
|
+
};
|
|
936
|
+
return (0, util_1.updateIfChanged)(ifElse, updates);
|
|
937
|
+
}
|
|
938
|
+
async visitImport(importStmt, q) {
|
|
939
|
+
const updates = {
|
|
940
|
+
static: await q.receive(importStmt.static, s => this.visitLeftPadded(s, q)),
|
|
941
|
+
qualid: await q.receive(importStmt.qualid, qualid => this.visit(qualid, q)),
|
|
942
|
+
alias: await q.receive(importStmt.alias, alias => this.visitLeftPadded(alias, q))
|
|
943
|
+
};
|
|
944
|
+
return (0, util_1.updateIfChanged)(importStmt, updates);
|
|
945
|
+
}
|
|
946
|
+
async visitInstanceOf(instanceOf, q) {
|
|
947
|
+
const updates = {
|
|
948
|
+
expression: await q.receive(instanceOf.expression, expr => this.visitRightPadded(expr, q)),
|
|
949
|
+
class: await q.receive(instanceOf.class, clazz => this.visit(clazz, q)),
|
|
950
|
+
pattern: await q.receive(instanceOf.pattern, pattern => this.visit(pattern, q)),
|
|
951
|
+
type: await q.receive(instanceOf.type, type => this.visitType(type, q)),
|
|
952
|
+
modifier: await q.receive(instanceOf.modifier, mod => this.visit(mod, q))
|
|
953
|
+
};
|
|
954
|
+
return (0, util_1.updateIfChanged)(instanceOf, updates);
|
|
955
|
+
}
|
|
956
|
+
async visitIntersectionType(intersectionType, q) {
|
|
957
|
+
const updates = {
|
|
958
|
+
bounds: await q.receive(intersectionType.bounds, bounds => this.visitContainer(bounds, q))
|
|
959
|
+
};
|
|
960
|
+
return (0, util_1.updateIfChanged)(intersectionType, updates);
|
|
961
|
+
}
|
|
962
|
+
async visitLabel(label, q) {
|
|
963
|
+
const updates = {
|
|
964
|
+
label: await q.receive(label.label, lbl => this.visitRightPadded(lbl, q)),
|
|
965
|
+
statement: await q.receive(label.statement, stmt => this.visit(stmt, q))
|
|
966
|
+
};
|
|
967
|
+
return (0, util_1.updateIfChanged)(label, updates);
|
|
968
|
+
}
|
|
969
|
+
async visitLambda(lambda, q) {
|
|
970
|
+
const updates = {
|
|
971
|
+
parameters: await q.receive(lambda.parameters, params => this.visit(params, q)),
|
|
972
|
+
arrow: await q.receive(lambda.arrow, arrow => this.visitSpace(arrow, q)),
|
|
973
|
+
body: await q.receive(lambda.body, body => this.visit(body, q)),
|
|
974
|
+
type: await q.receive(lambda.type, type => this.visitType(type, q))
|
|
975
|
+
};
|
|
976
|
+
return (0, util_1.updateIfChanged)(lambda, updates);
|
|
977
|
+
}
|
|
978
|
+
async visitLambdaParameters(params, q) {
|
|
979
|
+
const updates = {
|
|
980
|
+
parenthesized: await q.receive(params.parenthesized),
|
|
981
|
+
parameters: await q.receiveListDefined(params.parameters, param => this.visitRightPadded(param, q))
|
|
982
|
+
};
|
|
983
|
+
return (0, util_1.updateIfChanged)(params, updates);
|
|
984
|
+
}
|
|
985
|
+
async visitLiteral(literal, q) {
|
|
986
|
+
const updates = {
|
|
987
|
+
value: await q.receive(literal.value),
|
|
988
|
+
valueSource: await q.receive(literal.valueSource),
|
|
989
|
+
unicodeEscapes: await q.receiveList(literal.unicodeEscapes),
|
|
990
|
+
type: await q.receive(literal.type, type => this.visitType(type, q))
|
|
991
|
+
};
|
|
992
|
+
return (0, util_1.updateIfChanged)(literal, updates);
|
|
993
|
+
}
|
|
994
|
+
async visitMemberReference(memberRef, q) {
|
|
995
|
+
const updates = {
|
|
996
|
+
containing: await q.receive(memberRef.containing, container => this.visitRightPadded(container, q)),
|
|
997
|
+
typeParameters: await q.receive(memberRef.typeParameters, typeParams => this.visitContainer(typeParams, q)),
|
|
998
|
+
reference: await q.receive(memberRef.reference, ref => this.visitLeftPadded(ref, q)),
|
|
999
|
+
type: await q.receive(memberRef.type, type => this.visitType(type, q)),
|
|
1000
|
+
methodType: await q.receive(memberRef.methodType, type => this.visitType(type, q)),
|
|
1001
|
+
variableType: await q.receive(memberRef.variableType, type => this.visitType(type, q))
|
|
1002
|
+
};
|
|
1003
|
+
return (0, util_1.updateIfChanged)(memberRef, updates);
|
|
1004
|
+
}
|
|
1005
|
+
async visitMethodInvocation(methodInvoc, q) {
|
|
1006
|
+
const updates = {
|
|
1007
|
+
select: await q.receive(methodInvoc.select, select => this.visitRightPadded(select, q)),
|
|
1008
|
+
typeParameters: await q.receive(methodInvoc.typeParameters, typeParams => this.visitContainer(typeParams, q)),
|
|
1009
|
+
name: await q.receive(methodInvoc.name, name => this.visit(name, q)),
|
|
1010
|
+
arguments: await q.receive(methodInvoc.arguments, args => this.visitContainer(args, q)),
|
|
1011
|
+
methodType: await q.receive(methodInvoc.methodType, type => this.visitType(type, q))
|
|
1012
|
+
};
|
|
1013
|
+
return (0, util_1.updateIfChanged)(methodInvoc, updates);
|
|
1014
|
+
}
|
|
1015
|
+
async visitModifier(modifier, q) {
|
|
1016
|
+
const updates = {
|
|
1017
|
+
keyword: await q.receive(modifier.keyword),
|
|
1018
|
+
type: await q.receive(modifier.type),
|
|
1019
|
+
annotations: await q.receiveListDefined(modifier.annotations, annot => this.visit(annot, q))
|
|
1020
|
+
};
|
|
1021
|
+
return (0, util_1.updateIfChanged)(modifier, updates);
|
|
1022
|
+
}
|
|
1023
|
+
async visitMultiCatch(multiCatch, q) {
|
|
1024
|
+
const updates = {
|
|
1025
|
+
alternatives: await q.receiveListDefined(multiCatch.alternatives, alt => this.visitRightPadded(alt, q))
|
|
1026
|
+
};
|
|
1027
|
+
return (0, util_1.updateIfChanged)(multiCatch, updates);
|
|
1028
|
+
}
|
|
1029
|
+
async visitNewArray(newArray, q) {
|
|
1030
|
+
const updates = {
|
|
1031
|
+
typeExpression: await q.receive(newArray.typeExpression, type => this.visit(type, q)),
|
|
1032
|
+
dimensions: await q.receiveListDefined(newArray.dimensions, dim => this.visit(dim, q)),
|
|
1033
|
+
initializer: await q.receive(newArray.initializer, init => this.visitContainer(init, q)),
|
|
1034
|
+
type: await q.receive(newArray.type, type => this.visitType(type, q))
|
|
1035
|
+
};
|
|
1036
|
+
return (0, util_1.updateIfChanged)(newArray, updates);
|
|
1037
|
+
}
|
|
1038
|
+
async visitNewClass(newClass, q) {
|
|
1039
|
+
const updates = {
|
|
1040
|
+
enclosing: await q.receive(newClass.enclosing, encl => this.visitRightPadded(encl, q)),
|
|
1041
|
+
new: await q.receive(newClass.new, new_ => this.visitSpace(new_, q)),
|
|
1042
|
+
class: await q.receive(newClass.class, clazz => this.visit(clazz, q)),
|
|
1043
|
+
arguments: await q.receive(newClass.arguments, args => this.visitContainer(args, q)),
|
|
1044
|
+
body: await q.receive(newClass.body, body => this.visit(body, q)),
|
|
1045
|
+
constructorType: await q.receive(newClass.constructorType, type => this.visitType(type, q))
|
|
1046
|
+
};
|
|
1047
|
+
return (0, util_1.updateIfChanged)(newClass, updates);
|
|
1048
|
+
}
|
|
1049
|
+
async visitNullableType(nullableType, q) {
|
|
1050
|
+
const updates = {
|
|
1051
|
+
annotations: await q.receiveListDefined(nullableType.annotations, annot => this.visit(annot, q)),
|
|
1052
|
+
typeTree: await q.receive(nullableType.typeTree, type => this.visitRightPadded(type, q))
|
|
1053
|
+
};
|
|
1054
|
+
return (0, util_1.updateIfChanged)(nullableType, updates);
|
|
1055
|
+
}
|
|
1056
|
+
async visitParameterizedType(paramType, q) {
|
|
1057
|
+
const updates = {
|
|
1058
|
+
class: await q.receive(paramType.class, clazz => this.visit(clazz, q)),
|
|
1059
|
+
typeParameters: await q.receive(paramType.typeParameters, params => this.visitContainer(params, q)),
|
|
1060
|
+
type: await q.receive(paramType.type, type => this.visitType(type, q))
|
|
1061
|
+
};
|
|
1062
|
+
return (0, util_1.updateIfChanged)(paramType, updates);
|
|
1063
|
+
}
|
|
1064
|
+
async visitParentheses(parentheses, q) {
|
|
1065
|
+
const updates = {
|
|
1066
|
+
tree: await q.receive(parentheses.tree, tree => this.visitRightPadded(tree, q))
|
|
1067
|
+
};
|
|
1068
|
+
return (0, util_1.updateIfChanged)(parentheses, updates);
|
|
1069
|
+
}
|
|
1070
|
+
async visitParenthesizedTypeTree(parenthesizedType, q) {
|
|
1071
|
+
const updates = {
|
|
1072
|
+
annotations: await q.receiveListDefined(parenthesizedType.annotations, annot => this.visit(annot, q)),
|
|
1073
|
+
parenthesizedType: await q.receive(parenthesizedType.parenthesizedType, tree => this.visit(tree, q))
|
|
1074
|
+
};
|
|
1075
|
+
return (0, util_1.updateIfChanged)(parenthesizedType, updates);
|
|
1076
|
+
}
|
|
1077
|
+
async visitPrimitive(primitive, q) {
|
|
1078
|
+
const updates = {
|
|
1079
|
+
type: await q.receive(primitive.type, type => this.visitType(type, q))
|
|
1080
|
+
};
|
|
1081
|
+
return (0, util_1.updateIfChanged)(primitive, updates);
|
|
1082
|
+
}
|
|
1083
|
+
async visitSwitch(switchStmt, q) {
|
|
1084
|
+
const updates = {
|
|
1085
|
+
selector: await q.receive(switchStmt.selector, selector => this.visit(selector, q)),
|
|
1086
|
+
cases: await q.receive(switchStmt.cases, cases => this.visit(cases, q))
|
|
1087
|
+
};
|
|
1088
|
+
return (0, util_1.updateIfChanged)(switchStmt, updates);
|
|
1089
|
+
}
|
|
1090
|
+
async visitSwitchExpression(switchExpr, q) {
|
|
1091
|
+
const updates = {
|
|
1092
|
+
selector: await q.receive(switchExpr.selector, selector => this.visit(selector, q)),
|
|
1093
|
+
cases: await q.receive(switchExpr.cases, cases => this.visit(cases, q)),
|
|
1094
|
+
type: await q.receive(switchExpr.type, type => this.visitType(type, q))
|
|
1095
|
+
};
|
|
1096
|
+
return (0, util_1.updateIfChanged)(switchExpr, updates);
|
|
1097
|
+
}
|
|
1098
|
+
async visitTernary(ternary, q) {
|
|
1099
|
+
const updates = {
|
|
1100
|
+
condition: await q.receive(ternary.condition, cond => this.visit(cond, q)),
|
|
1101
|
+
truePart: await q.receive(ternary.truePart, truePart => this.visitLeftPadded(truePart, q)),
|
|
1102
|
+
falsePart: await q.receive(ternary.falsePart, falsePart => this.visitLeftPadded(falsePart, q)),
|
|
1103
|
+
type: await q.receive(ternary.type, type => this.visitType(type, q))
|
|
1104
|
+
};
|
|
1105
|
+
return (0, util_1.updateIfChanged)(ternary, updates);
|
|
1106
|
+
}
|
|
1107
|
+
async visitThrow(throwStmt, q) {
|
|
1108
|
+
const updates = {
|
|
1109
|
+
exception: await q.receive(throwStmt.exception, exception => this.visit(exception, q))
|
|
1110
|
+
};
|
|
1111
|
+
return (0, util_1.updateIfChanged)(throwStmt, updates);
|
|
1112
|
+
}
|
|
1113
|
+
async visitTry(tryStmt, q) {
|
|
1114
|
+
const updates = {
|
|
1115
|
+
resources: await q.receive(tryStmt.resources, resources => this.visitContainer(resources, q)),
|
|
1116
|
+
body: await q.receive(tryStmt.body, body => this.visit(body, q)),
|
|
1117
|
+
catches: await q.receiveListDefined(tryStmt.catches, catchBlock => this.visit(catchBlock, q)),
|
|
1118
|
+
finally: await q.receive(tryStmt.finally, finallyBlock => this.visitOptionalLeftPadded(finallyBlock, q))
|
|
1119
|
+
};
|
|
1120
|
+
return (0, util_1.updateIfChanged)(tryStmt, updates);
|
|
1121
|
+
}
|
|
1122
|
+
async visitTryResource(resource, q) {
|
|
1123
|
+
const updates = {
|
|
1124
|
+
variableDeclarations: await q.receive(resource.variableDeclarations, variables => this.visit(variables, q)),
|
|
1125
|
+
terminatedWithSemicolon: await q.receive(resource.terminatedWithSemicolon)
|
|
1126
|
+
};
|
|
1127
|
+
return (0, util_1.updateIfChanged)(resource, updates);
|
|
1128
|
+
}
|
|
1129
|
+
async visitTryCatch(tryCatch, q) {
|
|
1130
|
+
const updates = {
|
|
1131
|
+
parameter: await q.receive(tryCatch.parameter, param => this.visit(param, q)),
|
|
1132
|
+
body: await q.receive(tryCatch.body, body => this.visit(body, q))
|
|
1133
|
+
};
|
|
1134
|
+
return (0, util_1.updateIfChanged)(tryCatch, updates);
|
|
1135
|
+
}
|
|
1136
|
+
async visitUnary(unary, q) {
|
|
1137
|
+
const updates = {
|
|
1138
|
+
operator: await q.receive(unary.operator, op => this.visitLeftPadded(op, q)),
|
|
1139
|
+
expression: await q.receive(unary.expression, expr => this.visit(expr, q)),
|
|
1140
|
+
type: await q.receive(unary.type, type => this.visitType(type, q))
|
|
1141
|
+
};
|
|
1142
|
+
return (0, util_1.updateIfChanged)(unary, updates);
|
|
1143
|
+
}
|
|
1144
|
+
async visitUnknown(unknown, q) {
|
|
1145
|
+
const updates = {
|
|
1146
|
+
source: await q.receive(unknown.source, source => this.visit(source, q))
|
|
1147
|
+
};
|
|
1148
|
+
return (0, util_1.updateIfChanged)(unknown, updates);
|
|
1149
|
+
}
|
|
1150
|
+
async visitUnknownSource(unknownSource, q) {
|
|
1151
|
+
const updates = {
|
|
1152
|
+
text: await q.receive(unknownSource.text)
|
|
1153
|
+
};
|
|
1154
|
+
return (0, util_1.updateIfChanged)(unknownSource, updates);
|
|
1155
|
+
}
|
|
1156
|
+
async visitVariable(variable, q) {
|
|
1157
|
+
const updates = {
|
|
1158
|
+
name: await q.receive(variable.name, name => this.visit(name, q)),
|
|
1159
|
+
dimensionsAfterName: await q.receiveListDefined(variable.dimensionsAfterName, dim => this.visitLeftPadded(dim, q)),
|
|
1160
|
+
initializer: await q.receive(variable.initializer, init => this.visitOptionalLeftPadded(init, q)),
|
|
1161
|
+
variableType: await q.receive(variable.variableType, type => this.visitType(type, q))
|
|
1162
|
+
};
|
|
1163
|
+
return (0, util_1.updateIfChanged)(variable, updates);
|
|
1164
|
+
}
|
|
1165
|
+
async visitYield(yieldStmt, q) {
|
|
1166
|
+
const updates = {
|
|
1167
|
+
implicit: await q.receive(yieldStmt.implicit),
|
|
1168
|
+
value: await q.receive(yieldStmt.value, value => this.visit(value, q))
|
|
1169
|
+
};
|
|
1170
|
+
return (0, util_1.updateIfChanged)(yieldStmt, updates);
|
|
1171
|
+
}
|
|
1172
|
+
async visitTypeParameters(typeParams, q) {
|
|
1173
|
+
const updates = {
|
|
1174
|
+
annotations: await q.receiveListDefined(typeParams.annotations, annot => this.visit(annot, q)),
|
|
1175
|
+
typeParameters: await q.receiveListDefined(typeParams.typeParameters, param => this.visitRightPadded(param, q))
|
|
1176
|
+
};
|
|
1177
|
+
return (0, util_1.updateIfChanged)(typeParams, updates);
|
|
1178
|
+
}
|
|
1179
|
+
async visitReturn(returnStmt, q) {
|
|
1180
|
+
const updates = {
|
|
1181
|
+
expression: await q.receive(returnStmt.expression, expr => this.visit(expr, q))
|
|
1182
|
+
};
|
|
1183
|
+
return (0, util_1.updateIfChanged)(returnStmt, updates);
|
|
1184
|
+
}
|
|
1185
|
+
async visitSynchronized(synchronizedStmt, q) {
|
|
1186
|
+
const updates = {
|
|
1187
|
+
lock: await q.receive(synchronizedStmt.lock, lock => this.visit(lock, q)),
|
|
1188
|
+
body: await q.receive(synchronizedStmt.body, body => this.visit(body, q))
|
|
1189
|
+
};
|
|
1190
|
+
return (0, util_1.updateIfChanged)(synchronizedStmt, updates);
|
|
1191
|
+
}
|
|
1192
|
+
async visitTypeCast(typeCast, q) {
|
|
1193
|
+
const updates = {
|
|
1194
|
+
class: await q.receive(typeCast.class, typeExpr => this.visit(typeExpr, q)),
|
|
1195
|
+
expression: await q.receive(typeCast.expression, expr => this.visit(expr, q))
|
|
1196
|
+
};
|
|
1197
|
+
return (0, util_1.updateIfChanged)(typeCast, updates);
|
|
1198
|
+
}
|
|
1199
|
+
async visitTypeParameter(typeParameter, q) {
|
|
1200
|
+
const updates = {
|
|
1201
|
+
annotations: await q.receiveListDefined(typeParameter.annotations, annot => this.visit(annot, q)),
|
|
1202
|
+
modifiers: await q.receiveListDefined(typeParameter.modifiers, annot => this.visit(annot, q)),
|
|
1203
|
+
name: await q.receive(typeParameter.name, name => this.visit(name, q)),
|
|
1204
|
+
bounds: await q.receive(typeParameter.bounds, bounds => this.visitContainer(bounds, q))
|
|
1205
|
+
};
|
|
1206
|
+
return (0, util_1.updateIfChanged)(typeParameter, updates);
|
|
1207
|
+
}
|
|
1208
|
+
async visitWhileLoop(whileLoop, q) {
|
|
1209
|
+
const updates = {
|
|
1210
|
+
condition: await q.receive(whileLoop.condition, cond => this.visit(cond, q)),
|
|
1211
|
+
body: await q.receive(whileLoop.body, body => this.visitOptionalRightPadded(body, q))
|
|
1212
|
+
};
|
|
1213
|
+
return (0, util_1.updateIfChanged)(whileLoop, updates);
|
|
1214
|
+
}
|
|
1215
|
+
async visitWildcard(wildcard, q) {
|
|
1216
|
+
const updates = {
|
|
1217
|
+
bound: await q.receive(wildcard.bound, bound => this.visitLeftPadded(bound, q)),
|
|
1218
|
+
boundedType: await q.receive(wildcard.boundedType, type => this.visit(type, q))
|
|
1219
|
+
};
|
|
1220
|
+
return (0, util_1.updateIfChanged)(wildcard, updates);
|
|
1221
|
+
}
|
|
1222
|
+
async visitCompilationUnit(cu, q) {
|
|
1223
|
+
const updates = {
|
|
1224
|
+
sourcePath: await q.receive(cu.sourcePath),
|
|
1225
|
+
charsetName: await q.receive(cu.charsetName),
|
|
1226
|
+
charsetBomMarked: await q.receive(cu.charsetBomMarked),
|
|
1227
|
+
checksum: await q.receive(cu.checksum),
|
|
1228
|
+
fileAttributes: await q.receive(cu.fileAttributes),
|
|
1229
|
+
packageDeclaration: await q.receive(cu.packageDeclaration, pkg => this.visitRightPadded(pkg, q)),
|
|
1230
|
+
imports: await q.receiveListDefined(cu.imports, imp => this.visitRightPadded(imp, q)),
|
|
1231
|
+
classes: await q.receiveListDefined(cu.classes, cls => this.visit(cls, q)),
|
|
1232
|
+
eof: await q.receive(cu.eof, space => this.visitSpace(space, q))
|
|
1233
|
+
};
|
|
1234
|
+
return (0, util_1.updateIfChanged)(cu, updates);
|
|
1235
|
+
}
|
|
1236
|
+
async visitPackage(pkg, q) {
|
|
1237
|
+
const updates = {
|
|
1238
|
+
expression: await q.receive(pkg.expression, expr => this.visit(expr, q)),
|
|
1239
|
+
annotations: await q.receiveListDefined(pkg.annotations, annot => this.visit(annot, q))
|
|
1240
|
+
};
|
|
1241
|
+
return (0, util_1.updateIfChanged)(pkg, updates);
|
|
1242
|
+
}
|
|
1243
|
+
async visitClassDeclaration(cls, q) {
|
|
1244
|
+
const updates = {
|
|
1245
|
+
leadingAnnotations: await q.receiveListDefined(cls.leadingAnnotations, annot => this.visit(annot, q)),
|
|
1246
|
+
modifiers: await q.receiveListDefined(cls.modifiers, mod => this.visit(mod, q)),
|
|
1247
|
+
classKind: await q.receive(cls.classKind, kind => this.visit(kind, q)),
|
|
1248
|
+
name: await q.receive(cls.name, name => this.visit(name, q)),
|
|
1249
|
+
typeParameters: await q.receive(cls.typeParameters, params => this.visitContainer(params, q)),
|
|
1250
|
+
primaryConstructor: await q.receive(cls.primaryConstructor, cons => this.visitContainer(cons, q)),
|
|
1251
|
+
extends: await q.receive(cls.extends, ext => this.visitLeftPadded(ext, q)),
|
|
1252
|
+
implements: await q.receive(cls.implements, impl => this.visitContainer(impl, q)),
|
|
1253
|
+
permitting: await q.receive(cls.permitting, perm => this.visitContainer(perm, q)),
|
|
1254
|
+
body: await q.receive(cls.body, body => this.visit(body, q))
|
|
1255
|
+
};
|
|
1256
|
+
return (0, util_1.updateIfChanged)(cls, updates);
|
|
1257
|
+
}
|
|
1258
|
+
async visitClassDeclarationKind(kind, q) {
|
|
1259
|
+
const updates = {
|
|
1260
|
+
annotations: await q.receiveListDefined(kind.annotations, annot => this.visit(annot, q)),
|
|
1261
|
+
type: await q.receive(kind.type)
|
|
1262
|
+
};
|
|
1263
|
+
return (0, util_1.updateIfChanged)(kind, updates);
|
|
1264
|
+
}
|
|
1265
|
+
async visitBlock(block, q) {
|
|
1266
|
+
const updates = {
|
|
1267
|
+
static: await q.receive(block.static, s => this.visitRightPadded(s, q)),
|
|
1268
|
+
statements: await q.receiveListDefined(block.statements, stmt => this.visitRightPadded(stmt, q)),
|
|
1269
|
+
end: await q.receive(block.end, space => this.visitSpace(space, q))
|
|
1270
|
+
};
|
|
1271
|
+
return (0, util_1.updateIfChanged)(block, updates);
|
|
1272
|
+
}
|
|
1273
|
+
async visitMethodDeclaration(method, q) {
|
|
1274
|
+
const updates = {
|
|
1275
|
+
leadingAnnotations: await q.receiveListDefined(method.leadingAnnotations, annot => this.visit(annot, q)),
|
|
1276
|
+
modifiers: await q.receiveListDefined(method.modifiers, mod => this.visit(mod, q)),
|
|
1277
|
+
typeParameters: await q.receive(method.typeParameters, params => this.visit(params, q)),
|
|
1278
|
+
returnTypeExpression: await q.receive(method.returnTypeExpression, type => this.visit(type, q)),
|
|
1279
|
+
nameAnnotations: (await q.receiveList(method.nameAnnotations, name => this.visit(name, q))),
|
|
1280
|
+
name: await q.receive(method.name, name => this.visit(name, q)),
|
|
1281
|
+
parameters: await q.receive(method.parameters, params => this.visitContainer(params, q)),
|
|
1282
|
+
throws: await q.receive(method.throws, throws => this.visitContainer(throws, q)),
|
|
1283
|
+
body: await q.receive(method.body, body => this.visit(body, q)),
|
|
1284
|
+
defaultValue: await q.receive(method.defaultValue, def => this.visitLeftPadded(def, q)),
|
|
1285
|
+
methodType: await q.receive(method.methodType, type => this.visitType(type, q))
|
|
1286
|
+
};
|
|
1287
|
+
return (0, util_1.updateIfChanged)(method, updates);
|
|
1288
|
+
}
|
|
1289
|
+
async visitVariableDeclarations(varDecls, q) {
|
|
1290
|
+
const updates = {
|
|
1291
|
+
leadingAnnotations: await q.receiveListDefined(varDecls.leadingAnnotations, annot => this.visit(annot, q)),
|
|
1292
|
+
modifiers: await q.receiveListDefined(varDecls.modifiers, mod => this.visit(mod, q)),
|
|
1293
|
+
typeExpression: await q.receive(varDecls.typeExpression, type => this.visit(type, q)),
|
|
1294
|
+
varargs: await q.receive(varDecls.varargs, space => this.visitSpace(space, q)),
|
|
1295
|
+
variables: await q.receiveListDefined(varDecls.variables, variable => this.visitRightPadded(variable, q))
|
|
1296
|
+
};
|
|
1297
|
+
return (0, util_1.updateIfChanged)(varDecls, updates);
|
|
1298
|
+
}
|
|
1299
|
+
async visitIdentifier(ident, q) {
|
|
1300
|
+
const updates = {
|
|
1301
|
+
annotations: await q.receiveListDefined(ident.annotations, annot => this.visit(annot, q)),
|
|
1302
|
+
simpleName: await q.receive(ident.simpleName),
|
|
1303
|
+
type: await q.receive(ident.type, type => this.visitType(type, q)),
|
|
1304
|
+
fieldType: await q.receive(ident.fieldType, type => this.visitType(type, q))
|
|
1305
|
+
};
|
|
1306
|
+
return (0, util_1.updateIfChanged)(ident, updates);
|
|
1307
|
+
}
|
|
1308
|
+
async visitSpace(space, q) {
|
|
1309
|
+
const updates = {
|
|
1310
|
+
comments: await q.receiveListDefined(space.comments, async (c) => {
|
|
1311
|
+
if (c.kind === tree_1.J.Kind.TextComment) {
|
|
1312
|
+
const tc = c;
|
|
1313
|
+
const commentUpdates = {
|
|
1314
|
+
multiline: await q.receive(tc.multiline),
|
|
1315
|
+
text: await q.receive(tc.text),
|
|
1316
|
+
suffix: await q.receive(c.suffix),
|
|
1317
|
+
markers: await q.receive(c.markers)
|
|
1318
|
+
};
|
|
1319
|
+
return (0, util_1.updateIfChanged)(tc, commentUpdates);
|
|
1320
|
+
}
|
|
1321
|
+
else {
|
|
1322
|
+
throw new Error(`Unexpected comment type ${c.kind}`);
|
|
1323
|
+
}
|
|
1324
|
+
}),
|
|
1325
|
+
whitespace: await q.receive(space.whitespace)
|
|
1326
|
+
};
|
|
1327
|
+
return (0, util_1.updateIfChanged)(space, updates);
|
|
1328
|
+
}
|
|
1329
|
+
async visitLeftPadded(left, q) {
|
|
1330
|
+
if (!left) {
|
|
1331
|
+
throw new Error("TreeDataReceiveQueue should have instantiated an empty left padding");
|
|
1332
|
+
}
|
|
1333
|
+
const updates = {
|
|
1334
|
+
before: await q.receive(left.before, space => this.visitSpace(space, q)),
|
|
1335
|
+
element: await q.receive(left.element, elem => {
|
|
1336
|
+
if ((0, tree_1.isSpace)(elem)) {
|
|
1337
|
+
return this.visitSpace(elem, q);
|
|
1338
|
+
}
|
|
1339
|
+
else if (typeof elem === 'object' && elem.kind) {
|
|
1340
|
+
// FIXME find a better way to check if it is a `Tree`
|
|
1341
|
+
return this.visit(elem, q);
|
|
1342
|
+
}
|
|
1343
|
+
return elem;
|
|
1344
|
+
}),
|
|
1345
|
+
markers: await q.receive(left.markers)
|
|
1346
|
+
};
|
|
1347
|
+
return (0, util_1.updateIfChanged)(left, updates);
|
|
1348
|
+
}
|
|
1349
|
+
async visitRightPadded(right, q) {
|
|
1350
|
+
if (!right) {
|
|
1351
|
+
throw new Error("TreeDataReceiveQueue should have instantiated an empty right padding");
|
|
1352
|
+
}
|
|
1353
|
+
const updates = {
|
|
1354
|
+
element: await q.receive(right.element, elem => {
|
|
1355
|
+
if ((0, tree_1.isSpace)(elem)) {
|
|
1356
|
+
return this.visitSpace(elem, q);
|
|
1357
|
+
}
|
|
1358
|
+
else if (typeof elem === 'object' && elem.kind) {
|
|
1359
|
+
// FIXME find a better way to check if it is a `Tree`
|
|
1360
|
+
return this.visit(elem, q);
|
|
1361
|
+
}
|
|
1362
|
+
return elem;
|
|
1363
|
+
}),
|
|
1364
|
+
after: await q.receive(right.after, space => this.visitSpace(space, q)),
|
|
1365
|
+
markers: await q.receive(right.markers)
|
|
1366
|
+
};
|
|
1367
|
+
return (0, util_1.updateIfChanged)(right, updates);
|
|
1368
|
+
}
|
|
1369
|
+
async visitContainer(container, q) {
|
|
1370
|
+
const updates = {
|
|
1371
|
+
before: await q.receive(container.before, space => this.visitSpace(space, q)),
|
|
1372
|
+
elements: await q.receiveListDefined(container.elements, elem => this.visitRightPadded(elem, q)),
|
|
1373
|
+
markers: await q.receive(container.markers)
|
|
1374
|
+
};
|
|
1375
|
+
return (0, util_1.updateIfChanged)(container, updates);
|
|
1376
|
+
}
|
|
1377
|
+
async visitType(javaType, q) {
|
|
1378
|
+
if (!javaType) {
|
|
1379
|
+
return undefined;
|
|
1380
|
+
}
|
|
1381
|
+
else if (javaType.kind === type_1.Type.Kind.Unknown) {
|
|
1382
|
+
return type_1.Type.unknownType;
|
|
1383
|
+
}
|
|
1384
|
+
return await this.typeVisitor.visit(javaType, q);
|
|
1746
1385
|
}
|
|
1747
1386
|
}
|
|
1748
1387
|
exports.JavaReceiver = JavaReceiver;
|
|
@@ -1755,71 +1394,51 @@ function registerJLanguageCodecs(sourceFileType, receiver, sender, extendedKinds
|
|
|
1755
1394
|
for (const kind of kinds) {
|
|
1756
1395
|
if (kind === tree_1.J.Kind.Space) {
|
|
1757
1396
|
rpc_1.RpcCodecs.registerCodec(kind, {
|
|
1758
|
-
rpcReceive(before, q) {
|
|
1759
|
-
return
|
|
1760
|
-
return (yield receiver.visitSpace(before, q));
|
|
1761
|
-
});
|
|
1397
|
+
async rpcReceive(before, q) {
|
|
1398
|
+
return (await receiver.visitSpace(before, q));
|
|
1762
1399
|
},
|
|
1763
|
-
rpcSend(after, q) {
|
|
1764
|
-
|
|
1765
|
-
yield sender.visitSpace(after, q);
|
|
1766
|
-
});
|
|
1400
|
+
async rpcSend(after, q) {
|
|
1401
|
+
await sender.visitSpace(after, q);
|
|
1767
1402
|
}
|
|
1768
1403
|
}, sourceFileType);
|
|
1769
1404
|
}
|
|
1770
1405
|
else if (kind === tree_1.J.Kind.RightPadded) {
|
|
1771
1406
|
rpc_1.RpcCodecs.registerCodec(kind, {
|
|
1772
|
-
rpcReceive(before, q) {
|
|
1773
|
-
return
|
|
1774
|
-
return (yield receiver.visitRightPadded(before, q));
|
|
1775
|
-
});
|
|
1407
|
+
async rpcReceive(before, q) {
|
|
1408
|
+
return (await receiver.visitRightPadded(before, q));
|
|
1776
1409
|
},
|
|
1777
|
-
rpcSend(after, q) {
|
|
1778
|
-
|
|
1779
|
-
yield sender.visitRightPadded(after, q);
|
|
1780
|
-
});
|
|
1410
|
+
async rpcSend(after, q) {
|
|
1411
|
+
await sender.visitRightPadded(after, q);
|
|
1781
1412
|
}
|
|
1782
1413
|
}, sourceFileType);
|
|
1783
1414
|
}
|
|
1784
1415
|
else if (kind === tree_1.J.Kind.LeftPadded) {
|
|
1785
1416
|
rpc_1.RpcCodecs.registerCodec(kind, {
|
|
1786
|
-
rpcReceive(before, q) {
|
|
1787
|
-
return
|
|
1788
|
-
return (yield receiver.visitLeftPadded(before, q));
|
|
1789
|
-
});
|
|
1417
|
+
async rpcReceive(before, q) {
|
|
1418
|
+
return (await receiver.visitLeftPadded(before, q));
|
|
1790
1419
|
},
|
|
1791
|
-
rpcSend(after, q) {
|
|
1792
|
-
|
|
1793
|
-
yield sender.visitLeftPadded(after, q);
|
|
1794
|
-
});
|
|
1420
|
+
async rpcSend(after, q) {
|
|
1421
|
+
await sender.visitLeftPadded(after, q);
|
|
1795
1422
|
}
|
|
1796
1423
|
}, sourceFileType);
|
|
1797
1424
|
}
|
|
1798
1425
|
else if (kind === tree_1.J.Kind.Container) {
|
|
1799
1426
|
rpc_1.RpcCodecs.registerCodec(kind, {
|
|
1800
|
-
rpcReceive(before, q) {
|
|
1801
|
-
return
|
|
1802
|
-
return (yield receiver.visitContainer(before, q));
|
|
1803
|
-
});
|
|
1427
|
+
async rpcReceive(before, q) {
|
|
1428
|
+
return (await receiver.visitContainer(before, q));
|
|
1804
1429
|
},
|
|
1805
|
-
rpcSend(after, q) {
|
|
1806
|
-
|
|
1807
|
-
yield sender.visitContainer(after, q);
|
|
1808
|
-
});
|
|
1430
|
+
async rpcSend(after, q) {
|
|
1431
|
+
await sender.visitContainer(after, q);
|
|
1809
1432
|
}
|
|
1810
1433
|
}, sourceFileType);
|
|
1811
1434
|
}
|
|
1812
1435
|
else {
|
|
1813
1436
|
rpc_1.RpcCodecs.registerCodec(kind, {
|
|
1814
|
-
rpcReceive(before, q) {
|
|
1815
|
-
return
|
|
1816
|
-
return (yield receiver.visit(before, q));
|
|
1817
|
-
});
|
|
1437
|
+
async rpcReceive(before, q) {
|
|
1438
|
+
return (await receiver.visit(before, q));
|
|
1818
1439
|
},
|
|
1819
|
-
rpcSend(after, q) {
|
|
1820
|
-
|
|
1821
|
-
yield sender.visit(after, q);
|
|
1822
|
-
});
|
|
1440
|
+
async rpcSend(after, q) {
|
|
1441
|
+
await sender.visit(after, q);
|
|
1823
1442
|
}
|
|
1824
1443
|
}, sourceFileType);
|
|
1825
1444
|
}
|