@flock/wirespec 0.22.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +166 -154
- package/arrow-arrow-core.mjs.map +1 -1
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1559 -1559
- package/colormath-root-colormath.mjs +441 -441
- package/kotlin-kotlin-stdlib.mjs +2239 -1951
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10246 -10246
- package/kotlin-rgxgen.mjs +1808 -1808
- package/kotlinx-io-kotlinx-io-core.mjs +419 -419
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1868 -1868
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1607 -1586
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1335 -1321
- package/mordant-mordant.mjs.map +1 -1
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +6432 -6170
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +181 -181
- package/wirespec-src-compiler-emitters-kotlin.mjs +143 -143
- package/wirespec-src-compiler-emitters-python.mjs +179 -179
- package/wirespec-src-compiler-emitters-rust.mjs +423 -423
- package/wirespec-src-compiler-emitters-scala.mjs +176 -176
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +254 -255
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +361 -163
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +937 -405
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-asyncapi.mjs +5382 -0
- package/wirespec-src-converter-asyncapi.mjs.map +1 -0
- package/wirespec-src-converter-avro.mjs +1075 -508
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-common.mjs +20 -20
- package/wirespec-src-converter-common.mjs.map +1 -1
- package/wirespec-src-converter-graphql.mjs +6895 -0
- package/wirespec-src-converter-graphql.mjs.map +1 -0
- package/wirespec-src-converter-openapi.mjs +786 -777
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1395 -1395
- package/wirespec-src-plugin-arguments.mjs +204 -184
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +111 -108
- package/wirespec-src-plugin-cli.mjs.map +1 -1
- package/wirespec-src-plugin-npm.d.mts +219 -27
- package/wirespec-src-plugin-npm.mjs +144 -49
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +35 -35
|
@@ -2,29 +2,36 @@ import {
|
|
|
2
2
|
protoOf180f3jzyo7rfj as protoOf,
|
|
3
3
|
initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
|
|
4
4
|
VOID3gxj6tk5isa35 as VOID,
|
|
5
|
+
isInterface3d6p8outrmvmk as isInterface,
|
|
6
|
+
emptyList1g2z5xcrvp2zy as emptyList,
|
|
5
7
|
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
|
|
6
8
|
ArrayList_init_$Create$2byt5m5yn22yy as ArrayList_init_$Create$,
|
|
7
9
|
Unit_instancev9v8hjid95df as Unit_instance,
|
|
10
|
+
listOfNotNull1v4ggfackvuny as listOfNotNull,
|
|
11
|
+
plus310ted5e4i90h as plus,
|
|
8
12
|
joinToString1cxrrlmo0chqs as joinToString,
|
|
9
13
|
listOfvhqybd2zx248 as listOf,
|
|
10
14
|
noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
|
|
11
15
|
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
|
|
12
16
|
firstOrNull1982767dljvdy as firstOrNull,
|
|
13
17
|
trimMarginhyd3fsmh8iev as trimMargin,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
toString22rbkbhdb5cl2 as toString,
|
|
17
|
-
toString1pkumu07cwy4m as toString_0,
|
|
18
|
-
substring3saq8ornu0luv as substring,
|
|
18
|
+
Regex_init_$Create$17zqsmfd15n8x as Regex_init_$Create$,
|
|
19
|
+
toSet2orjxp16sotqu as toSet,
|
|
19
20
|
setOf45ia9pnfhe90 as setOf,
|
|
20
21
|
initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
StringBuilder_init_$Create$3ds9zx2kx9u4d as StringBuilder_init_$Create$,
|
|
23
|
+
charCodeAt1yspne1d8erbm as charCodeAt,
|
|
24
|
+
_Char___init__impl__6a9atx2gndcvjvc5pke as _Char___init__impl__6a9atx,
|
|
25
|
+
getOrNull1cdnsfrisdp41 as getOrNull,
|
|
26
|
+
Char19o2r8palgjof as Char,
|
|
27
|
+
toString22rbkbhdb5cl2 as toString,
|
|
23
28
|
contains3ue2qo8xhmpf1 as contains,
|
|
24
29
|
equals2au1ep9vhcato as equals,
|
|
25
30
|
replace3le3ie7l9k8aq as replace,
|
|
26
31
|
} from './kotlin-kotlin-stdlib.mjs';
|
|
27
32
|
import {
|
|
33
|
+
HasAnnotations19ciafy30ttxa as HasAnnotations,
|
|
34
|
+
Comment3jy4x02mtqi9b as Comment,
|
|
28
35
|
LanguageEmitterxhzgykhux3qm as LanguageEmitter,
|
|
29
36
|
FileExtension_Wirespec_getInstance3awesett59616 as FileExtension_Wirespec_getInstance,
|
|
30
37
|
Emitted12h24rpo4uifw as Emitted,
|
|
@@ -36,8 +43,13 @@ import {
|
|
|
36
43
|
Literal331hu9r04vptz as Literal,
|
|
37
44
|
Paramvfwnys2w6aj1 as Param,
|
|
38
45
|
addBackticks1di5q03fw4yhx as addBackticks,
|
|
46
|
+
get_entriesolr3gz3d9pa6 as get_entries,
|
|
39
47
|
FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
|
|
40
48
|
DefinitionIdentifiervfasqdb33qef as DefinitionIdentifier,
|
|
49
|
+
Dict1p2r7i6z7n6zc as Dict,
|
|
50
|
+
Array3mbygx5cfsbdr as Array_0,
|
|
51
|
+
Singleuujp8ld3qd71 as Single,
|
|
52
|
+
_Comment___get_value__impl__8r3pla1b4ywrwtg22m7 as _Comment___get_value__impl__8r3pla,
|
|
41
53
|
Bytes_instance1cqd1xiwjq94x as Bytes_instance,
|
|
42
54
|
Boolean_instance15wa4iqeayn6f as Boolean_instance,
|
|
43
55
|
String1czvr8pxnm6on as String_0,
|
|
@@ -58,7 +70,7 @@ import {
|
|
|
58
70
|
Anyv7qdq63z63rc as Any,
|
|
59
71
|
Unit2z95clvxm08vr as Unit,
|
|
60
72
|
Iterable29qbzfup67wqp as Iterable,
|
|
61
|
-
Dict3g7w5wia7rncj as
|
|
73
|
+
Dict3g7w5wia7rncj as Dict_0,
|
|
62
74
|
} from './wirespec-src-compiler-core.mjs';
|
|
63
75
|
import {
|
|
64
76
|
NonEmptyList3ak25ihy2gcvs as NonEmptyList,
|
|
@@ -72,11 +84,11 @@ function emit(identifier) {
|
|
|
72
84
|
var tmp;
|
|
73
85
|
if (identifier instanceof DefinitionIdentifier) {
|
|
74
86
|
// Inline function 'kotlin.run' call
|
|
75
|
-
tmp = Companion_getInstance().
|
|
87
|
+
tmp = Companion_getInstance().l22_1.i1(identifier.o1()) ? addBackticks(identifier.o1()) : identifier.o1();
|
|
76
88
|
} else {
|
|
77
89
|
if (identifier instanceof FieldIdentifier) {
|
|
78
90
|
// Inline function 'kotlin.run' call
|
|
79
|
-
tmp = Companion_getInstance().
|
|
91
|
+
tmp = Companion_getInstance().l22_1.i1(identifier.o1()) || !Companion_getInstance().m22_1.rc(identifier.o1()) ? addBackticks(identifier.o1()) : identifier.o1();
|
|
80
92
|
} else {
|
|
81
93
|
noWhenBranchMatchedException();
|
|
82
94
|
}
|
|
@@ -84,47 +96,61 @@ function emit(identifier) {
|
|
|
84
96
|
return tmp;
|
|
85
97
|
}
|
|
86
98
|
initMetadataForInterface(WirespecIdentifierEmitter, 'WirespecIdentifierEmitter');
|
|
87
|
-
function emit_0(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var
|
|
99
|
+
function emit_0(_this__u8e3s4) {
|
|
100
|
+
// Inline function 'kotlin.takeIf' call
|
|
101
|
+
var this_0 = _this__u8e3s4.h19_1;
|
|
102
|
+
var tmp;
|
|
103
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
104
|
+
if (!this_0.r()) {
|
|
105
|
+
tmp = this_0;
|
|
106
|
+
} else {
|
|
107
|
+
tmp = null;
|
|
108
|
+
}
|
|
109
|
+
var tmp0_safe_receiver = tmp;
|
|
110
|
+
var tmp_0;
|
|
98
111
|
if (tmp0_safe_receiver == null) {
|
|
99
|
-
|
|
112
|
+
tmp_0 = null;
|
|
100
113
|
} else {
|
|
101
|
-
|
|
102
|
-
tmp_1 = ' = ' + emit_12(this, tmp0_safe_receiver);
|
|
114
|
+
tmp_0 = joinToString(tmp0_safe_receiver, ', ', '(', ')', VOID, VOID, WirespecMetaDataEmitter$emit$lambda(this));
|
|
103
115
|
}
|
|
104
116
|
// Inline function 'kotlin.text.orEmpty' call
|
|
105
|
-
var tmp0_elvis_lhs =
|
|
106
|
-
|
|
117
|
+
var tmp0_elvis_lhs = tmp_0;
|
|
118
|
+
var tmp$ret$3 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
119
|
+
return '@' + _this__u8e3s4.g19_1 + tmp$ret$3;
|
|
120
|
+
}
|
|
121
|
+
function emit_1(_this__u8e3s4) {
|
|
122
|
+
return '/* ' + _Comment___get_value__impl__8r3pla(_this__u8e3s4) + ' */';
|
|
123
|
+
}
|
|
124
|
+
initMetadataForInterface(WirespecMetaDataEmitter, 'WirespecMetaDataEmitter');
|
|
125
|
+
function emit_2(type, module_0) {
|
|
126
|
+
return trimMargin('\n |type ' + this.es(type.kp_1) + ' {\n |' + this.vs(type.lp_1) + '\n |}\n |');
|
|
107
127
|
}
|
|
108
128
|
function emit_3(_this__u8e3s4) {
|
|
129
|
+
return joinToString(_this__u8e3s4.hp_1, ',\n', VOID, VOID, VOID, VOID, WirespecTypeDefinitionEmitter$emit$lambda(this));
|
|
130
|
+
}
|
|
131
|
+
function emit_4(_this__u8e3s4) {
|
|
132
|
+
return joinToString(_this__u8e3s4.np_1, '', VOID, VOID, VOID, VOID, WirespecTypeDefinitionEmitter$emit$lambda_0(this)) + emitDeclaration(this, _this__u8e3s4);
|
|
133
|
+
}
|
|
134
|
+
function emit_5(_this__u8e3s4) {
|
|
109
135
|
var tmp;
|
|
110
136
|
if (_this__u8e3s4 instanceof Field) {
|
|
111
|
-
tmp = this.
|
|
137
|
+
tmp = this.ws(_this__u8e3s4);
|
|
112
138
|
} else {
|
|
113
139
|
if (_this__u8e3s4 instanceof Spread) {
|
|
114
|
-
tmp = '...' + this.
|
|
140
|
+
tmp = '...' + this.xs(_this__u8e3s4.r1c_1);
|
|
115
141
|
} else {
|
|
116
142
|
noWhenBranchMatchedException();
|
|
117
143
|
}
|
|
118
144
|
}
|
|
119
145
|
return tmp;
|
|
120
146
|
}
|
|
121
|
-
function
|
|
147
|
+
function emit_6(_this__u8e3s4) {
|
|
122
148
|
var tmp;
|
|
123
|
-
if (_this__u8e3s4 instanceof
|
|
124
|
-
tmp = '{ ' + this.
|
|
149
|
+
if (_this__u8e3s4 instanceof Dict_0) {
|
|
150
|
+
tmp = '{ ' + this.xs(_this__u8e3s4.bq_1) + ' }';
|
|
125
151
|
} else {
|
|
126
152
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
127
|
-
tmp = this.
|
|
153
|
+
tmp = this.xs(_this__u8e3s4.yp_1) + '[]';
|
|
128
154
|
} else {
|
|
129
155
|
if (_this__u8e3s4 instanceof Unit) {
|
|
130
156
|
tmp = 'Unit';
|
|
@@ -133,10 +159,10 @@ function emit_4(_this__u8e3s4) {
|
|
|
133
159
|
tmp = 'Any';
|
|
134
160
|
} else {
|
|
135
161
|
if (_this__u8e3s4 instanceof Custom) {
|
|
136
|
-
tmp = _this__u8e3s4.
|
|
162
|
+
tmp = _this__u8e3s4.r18_1;
|
|
137
163
|
} else {
|
|
138
164
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
139
|
-
var t = _this__u8e3s4.
|
|
165
|
+
var t = _this__u8e3s4.t18_1;
|
|
140
166
|
var tmp_0;
|
|
141
167
|
if (t instanceof String_0) {
|
|
142
168
|
tmp_0 = 'String';
|
|
@@ -149,7 +175,7 @@ function emit_4(_this__u8e3s4) {
|
|
|
149
175
|
} else {
|
|
150
176
|
if (t instanceof Integer) {
|
|
151
177
|
var tmp_1;
|
|
152
|
-
switch (t.
|
|
178
|
+
switch (t.b19_1.e3_1) {
|
|
153
179
|
case 0:
|
|
154
180
|
tmp_1 = 'Integer32';
|
|
155
181
|
break;
|
|
@@ -164,7 +190,7 @@ function emit_4(_this__u8e3s4) {
|
|
|
164
190
|
} else {
|
|
165
191
|
if (t instanceof Number_0) {
|
|
166
192
|
var tmp_2;
|
|
167
|
-
switch (t.
|
|
193
|
+
switch (t.w18_1.e3_1) {
|
|
168
194
|
case 0:
|
|
169
195
|
tmp_2 = 'Number32';
|
|
170
196
|
break;
|
|
@@ -194,51 +220,56 @@ function emit_4(_this__u8e3s4) {
|
|
|
194
220
|
}
|
|
195
221
|
// Inline function 'kotlin.let' call
|
|
196
222
|
var it = tmp;
|
|
197
|
-
return _this__u8e3s4.
|
|
223
|
+
return _this__u8e3s4.ot() ? it + '?' : it;
|
|
198
224
|
}
|
|
199
|
-
initMetadataForInterface(WirespecTypeDefinitionEmitter, 'WirespecTypeDefinitionEmitter', VOID, VOID, [WirespecIdentifierEmitter]);
|
|
200
|
-
function
|
|
201
|
-
return 'channel ' + this.
|
|
225
|
+
initMetadataForInterface(WirespecTypeDefinitionEmitter, 'WirespecTypeDefinitionEmitter', VOID, VOID, [WirespecIdentifierEmitter, WirespecMetaDataEmitter]);
|
|
226
|
+
function emit_7(channel) {
|
|
227
|
+
return 'channel ' + this.es(channel.xq_1) + ' -> ' + this.xs(channel.yq_1) + '\n';
|
|
202
228
|
}
|
|
203
229
|
initMetadataForInterface(WirespecChannelDefinitionEmitter, 'WirespecChannelDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
204
|
-
function
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
initMetadataForInterface(WirespecRpcDefinitionEmitter, 'WirespecRpcDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
208
|
-
function emit_7(enum_0, module_0) {
|
|
209
|
-
var tmp = this.ur(enum_0.gs_1);
|
|
230
|
+
function emit_8(enum_0, module_0) {
|
|
231
|
+
var tmp = this.es(enum_0.qs_1);
|
|
210
232
|
var tmp_0 = Spacer_instance.toString();
|
|
211
|
-
return 'enum ' + tmp + ' {\n' + tmp_0 + joinToString(enum_0.
|
|
233
|
+
return 'enum ' + tmp + ' {\n' + tmp_0 + joinToString(enum_0.rs_1, ', ', VOID, VOID, VOID, VOID, WirespecEnumDefinitionEmitter$emit$lambda) + '\n}\n';
|
|
212
234
|
}
|
|
213
235
|
initMetadataForInterface(WirespecEnumDefinitionEmitter, 'WirespecEnumDefinitionEmitter', VOID, VOID, [WirespecIdentifierEmitter]);
|
|
214
|
-
function
|
|
215
|
-
|
|
236
|
+
function emit_9(union) {
|
|
237
|
+
var tmp = this.es(union.br_1);
|
|
238
|
+
return 'type ' + tmp + ' = ' + joinToString(union.cr_1, ' | ', VOID, VOID, VOID, VOID, WirespecUnionDefinitionEmitter$emit$lambda(this)) + '\n';
|
|
239
|
+
}
|
|
240
|
+
initMetadataForInterface(WirespecUnionDefinitionEmitter, 'WirespecUnionDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
241
|
+
function emit_10(part) {
|
|
242
|
+
return trimMargin('\n |part ' + this.es(part.nq_1) + ' {\n |' + this.vs(part.oq_1) + '\n |}\n |');
|
|
216
243
|
}
|
|
217
244
|
initMetadataForInterface(WirespecPartDefinitionEmitter, 'WirespecPartDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
218
|
-
function
|
|
219
|
-
return '
|
|
245
|
+
function emit_11(rpc) {
|
|
246
|
+
return rpc.sq_1.hp_1.r() ? 'rpc ' + this.es(rpc.rq_1) + ' {} -> ' + emitReturn(this, rpc) + '\n' : trimMargin('\n |rpc ' + this.es(rpc.rq_1) + ' {\n |' + this.vs(rpc.sq_1) + '\n |} -> ' + emitReturn(this, rpc) + '\n |');
|
|
247
|
+
}
|
|
248
|
+
initMetadataForInterface(WirespecRpcDefinitionEmitter, 'WirespecRpcDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
249
|
+
function emit_12(refined) {
|
|
250
|
+
return 'type ' + this.es(refined.ls_1) + ' = ' + this.xs(refined.ms_1.w1d(VOID, false)) + this.zs(refined) + '\n';
|
|
220
251
|
}
|
|
221
252
|
function emitValidator(_this__u8e3s4) {
|
|
222
|
-
var type = _this__u8e3s4.
|
|
253
|
+
var type = _this__u8e3s4.ms_1.t18_1;
|
|
223
254
|
var tmp;
|
|
224
255
|
if (type instanceof Integer) {
|
|
225
|
-
var tmp0_safe_receiver = type.
|
|
226
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
256
|
+
var tmp0_safe_receiver = type.c19_1;
|
|
257
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.ys(tmp0_safe_receiver);
|
|
227
258
|
tmp = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
|
|
228
259
|
} else {
|
|
229
260
|
if (type instanceof Number_0) {
|
|
230
|
-
var tmp2_safe_receiver = type.
|
|
261
|
+
var tmp2_safe_receiver = type.x18_1;
|
|
231
262
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : emitDecimal(this, tmp2_safe_receiver);
|
|
232
263
|
tmp = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
|
|
233
264
|
} else {
|
|
234
265
|
if (type instanceof String_0) {
|
|
235
|
-
var tmp4_safe_receiver = type.
|
|
266
|
+
var tmp4_safe_receiver = type.e19_1;
|
|
236
267
|
var tmp_0;
|
|
237
268
|
var tmp_1 = tmp4_safe_receiver;
|
|
238
269
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
239
270
|
tmp_0 = null;
|
|
240
271
|
} else {
|
|
241
|
-
tmp_0 = this.
|
|
272
|
+
tmp_0 = this.ys(new RegExp_0(tmp4_safe_receiver));
|
|
242
273
|
}
|
|
243
274
|
var tmp5_elvis_lhs = tmp_0;
|
|
244
275
|
tmp = tmp5_elvis_lhs == null ? '' : tmp5_elvis_lhs;
|
|
@@ -258,43 +289,67 @@ function emitValidator(_this__u8e3s4) {
|
|
|
258
289
|
return tmp;
|
|
259
290
|
}
|
|
260
291
|
initMetadataForInterface(WirespecRefinedTypeDefinitionEmitter, 'WirespecRefinedTypeDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
261
|
-
function
|
|
262
|
-
var tmp = this.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
var
|
|
268
|
-
|
|
269
|
-
var tmp_1 = emitRequest(this, endpoint.ar_1);
|
|
270
|
-
var tmp_2 = emitPath(this, endpoint.xq_1);
|
|
271
|
-
var tmp_3 = emitQuery(this, endpoint.yq_1);
|
|
272
|
-
var tmp_4 = emitHeader(this, endpoint.zq_1);
|
|
273
|
-
return trimMargin('\n |endpoint ' + tmp + ' ' + tmp_0 + tmp_1 + ' ' + tmp_2 + tmp_3 + tmp_4 + ' -> {\n |' + joinToString(endpoint.br_1, '\n', VOID, VOID, VOID, VOID, WirespecEndpointDefinitionEmitter$emit$lambda(this)) + '\n |}\n |\n ');
|
|
292
|
+
function emit_13(endpoint) {
|
|
293
|
+
var tmp = this.es(endpoint.fr_1);
|
|
294
|
+
var tmp_0 = endpoint.gr_1.toString();
|
|
295
|
+
var tmp_1 = emitRequest(this, endpoint.kr_1);
|
|
296
|
+
var tmp_2 = emitPath(this, endpoint.hr_1);
|
|
297
|
+
var tmp_3 = emitQuery(this, endpoint.ir_1);
|
|
298
|
+
var tmp_4 = emitHeader(this, endpoint.jr_1);
|
|
299
|
+
return trimMargin('\n |endpoint ' + tmp + ' ' + tmp_0 + tmp_1 + ' ' + tmp_2 + tmp_3 + tmp_4 + ' -> {\n |' + joinToString(endpoint.lr_1, '\n', VOID, VOID, VOID, VOID, WirespecEndpointDefinitionEmitter$emit$lambda(this)) + '\n |}\n |\n ');
|
|
274
300
|
}
|
|
275
301
|
initMetadataForInterface(WirespecEndpointDefinitionEmitter, 'WirespecEndpointDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
276
|
-
initMetadataForClass(WirespecEmitter, 'WirespecEmitter', WirespecEmitter, LanguageEmitter, [
|
|
302
|
+
initMetadataForClass(WirespecEmitter, 'WirespecEmitter', WirespecEmitter, LanguageEmitter, [WirespecEnumDefinitionEmitter, WirespecUnionDefinitionEmitter, WirespecPartDefinitionEmitter, WirespecRpcDefinitionEmitter, WirespecRefinedTypeDefinitionEmitter, WirespecIdentifierEmitter, WirespecTypeDefinitionEmitter, WirespecChannelDefinitionEmitter, WirespecEndpointDefinitionEmitter]);
|
|
277
303
|
initMetadataForCompanion(Companion);
|
|
278
304
|
//endregion
|
|
279
305
|
function WirespecChannelDefinitionEmitter() {
|
|
280
306
|
}
|
|
307
|
+
function emitMetaData($this, $receiver) {
|
|
308
|
+
var tmp0_safe_receiver = isInterface($receiver, HasAnnotations) ? $receiver : null;
|
|
309
|
+
// Inline function 'kotlin.collections.orEmpty' call
|
|
310
|
+
var tmp0_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.k1c();
|
|
311
|
+
// Inline function 'kotlin.collections.map' call
|
|
312
|
+
var this_0 = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
|
|
313
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
314
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
315
|
+
var _iterator__ex2g4s = this_0.t();
|
|
316
|
+
while (_iterator__ex2g4s.u()) {
|
|
317
|
+
var item = _iterator__ex2g4s.v();
|
|
318
|
+
var tmp$ret$3 = $this.f22(item);
|
|
319
|
+
destination.x(tmp$ret$3);
|
|
320
|
+
}
|
|
321
|
+
var tmp = destination;
|
|
322
|
+
var tmp1_safe_receiver = $receiver.j1c();
|
|
323
|
+
var tmp_0;
|
|
324
|
+
var tmp_1 = tmp1_safe_receiver;
|
|
325
|
+
if ((tmp_1 == null ? null : new Comment(tmp_1)) == null) {
|
|
326
|
+
tmp_0 = null;
|
|
327
|
+
} else {
|
|
328
|
+
tmp_0 = $this.g22(tmp1_safe_receiver);
|
|
329
|
+
}
|
|
330
|
+
var tmp_2 = plus(tmp, listOfNotNull(tmp_0));
|
|
331
|
+
return joinToString(tmp_2, '', VOID, VOID, VOID, VOID, WirespecEmitter$emitMetaData$lambda);
|
|
332
|
+
}
|
|
333
|
+
function WirespecEmitter$emitMetaData$lambda(it) {
|
|
334
|
+
return it + '\n';
|
|
335
|
+
}
|
|
281
336
|
function WirespecEmitter() {
|
|
282
337
|
LanguageEmitter.call(this);
|
|
283
|
-
this.
|
|
284
|
-
this.
|
|
285
|
-
this.
|
|
286
|
-
this.
|
|
338
|
+
this.h22_1 = FileExtension_Wirespec_getInstance();
|
|
339
|
+
this.i22_1 = true;
|
|
340
|
+
this.j22_1 = null;
|
|
341
|
+
this.k22_1 = '\n';
|
|
287
342
|
}
|
|
288
|
-
protoOf(WirespecEmitter).
|
|
289
|
-
return this.
|
|
343
|
+
protoOf(WirespecEmitter).wp = function () {
|
|
344
|
+
return this.h22_1;
|
|
290
345
|
};
|
|
291
|
-
protoOf(WirespecEmitter).
|
|
292
|
-
return this.
|
|
346
|
+
protoOf(WirespecEmitter).vp = function () {
|
|
347
|
+
return this.i22_1;
|
|
293
348
|
};
|
|
294
|
-
protoOf(WirespecEmitter).
|
|
349
|
+
protoOf(WirespecEmitter).to = function (ast, logger) {
|
|
295
350
|
// Inline function 'kotlin.let' call
|
|
296
|
-
var e = protoOf(LanguageEmitter).
|
|
297
|
-
var tmp = 'wirespec.' + this.
|
|
351
|
+
var e = protoOf(LanguageEmitter).to.call(this, ast, logger);
|
|
352
|
+
var tmp = 'wirespec.' + this.wp().xr_1;
|
|
298
353
|
// Inline function 'arrow.core.NonEmptyList.map' call
|
|
299
354
|
// Inline function 'kotlin.collections.map' call
|
|
300
355
|
var this_0 = _NonEmptyList___get_all__impl__pmf509(e);
|
|
@@ -303,7 +358,7 @@ protoOf(WirespecEmitter).mo = function (ast, logger) {
|
|
|
303
358
|
var _iterator__ex2g4s = this_0.t();
|
|
304
359
|
while (_iterator__ex2g4s.u()) {
|
|
305
360
|
var item = _iterator__ex2g4s.v();
|
|
306
|
-
var tmp$ret$5 = item.
|
|
361
|
+
var tmp$ret$5 = item.iq_1;
|
|
307
362
|
destination.x(tmp$ret$5);
|
|
308
363
|
}
|
|
309
364
|
var tmp$ret$2 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
@@ -311,15 +366,20 @@ protoOf(WirespecEmitter).mo = function (ast, logger) {
|
|
|
311
366
|
var this_1 = new Emitted(tmp, joinToString(new NonEmptyList(tmp$ret$2), '\n'));
|
|
312
367
|
return _NonEmptyList___init__impl__fxd0xp(listOf(this_1));
|
|
313
368
|
};
|
|
314
|
-
protoOf(WirespecEmitter).
|
|
369
|
+
protoOf(WirespecEmitter).cs = function (definition, module_0, logger) {
|
|
370
|
+
// Inline function 'kotlin.let' call
|
|
371
|
+
var emitted = protoOf(LanguageEmitter).cs.call(this, definition, module_0, logger);
|
|
372
|
+
return emitted.lq(VOID, emitMetaData(this, definition) + emitted.iq_1);
|
|
373
|
+
};
|
|
374
|
+
protoOf(WirespecEmitter).ys = function (_this__u8e3s4) {
|
|
315
375
|
var tmp;
|
|
316
376
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
317
|
-
tmp = '(' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
377
|
+
tmp = '(' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.u19_1) + ')';
|
|
318
378
|
} else {
|
|
319
379
|
if (_this__u8e3s4 instanceof Bound) {
|
|
320
|
-
var tmp1_elvis_lhs = _this__u8e3s4.
|
|
380
|
+
var tmp1_elvis_lhs = _this__u8e3s4.z18_1;
|
|
321
381
|
var tmp_0 = tmp1_elvis_lhs == null ? '_' : tmp1_elvis_lhs;
|
|
322
|
-
var tmp2_elvis_lhs = _this__u8e3s4.
|
|
382
|
+
var tmp2_elvis_lhs = _this__u8e3s4.a19_1;
|
|
323
383
|
tmp = '(' + tmp_0 + ', ' + (tmp2_elvis_lhs == null ? '_' : tmp2_elvis_lhs) + ')';
|
|
324
384
|
} else {
|
|
325
385
|
noWhenBranchMatchedException();
|
|
@@ -332,9 +392,9 @@ function emitPath($this, $receiver) {
|
|
|
332
392
|
}
|
|
333
393
|
function emitRequest($this, $receiver) {
|
|
334
394
|
var tmp0_safe_receiver = firstOrNull($receiver);
|
|
335
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
336
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
337
|
-
var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : $this.
|
|
395
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.or_1;
|
|
396
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.qr_1;
|
|
397
|
+
var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : $this.xs(tmp2_safe_receiver);
|
|
338
398
|
var tmp;
|
|
339
399
|
if (tmp3_safe_receiver == null) {
|
|
340
400
|
tmp = null;
|
|
@@ -348,10 +408,11 @@ function emitRequest($this, $receiver) {
|
|
|
348
408
|
}
|
|
349
409
|
function emitQuery($this, $receiver) {
|
|
350
410
|
// Inline function 'kotlin.takeIf' call
|
|
411
|
+
var this_0 = $receiver.hp_1;
|
|
351
412
|
var tmp;
|
|
352
413
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
353
|
-
if (
|
|
354
|
-
tmp =
|
|
414
|
+
if (!this_0.r()) {
|
|
415
|
+
tmp = this_0;
|
|
355
416
|
} else {
|
|
356
417
|
tmp = null;
|
|
357
418
|
}
|
|
@@ -376,10 +437,11 @@ function emitQuery($this, $receiver) {
|
|
|
376
437
|
}
|
|
377
438
|
function emitHeader($this, $receiver) {
|
|
378
439
|
// Inline function 'kotlin.takeIf' call
|
|
440
|
+
var this_0 = $receiver.hp_1;
|
|
379
441
|
var tmp;
|
|
380
442
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
381
|
-
if (
|
|
382
|
-
tmp =
|
|
443
|
+
if (!this_0.r()) {
|
|
444
|
+
tmp = this_0;
|
|
383
445
|
} else {
|
|
384
446
|
tmp = null;
|
|
385
447
|
}
|
|
@@ -402,24 +464,30 @@ function emitHeader($this, $receiver) {
|
|
|
402
464
|
var tmp0_elvis_lhs = tmp_1;
|
|
403
465
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
404
466
|
}
|
|
467
|
+
function WirespecEndpointDefinitionEmitter$emit$lambda$lambda(this$0) {
|
|
468
|
+
return function (annotation) {
|
|
469
|
+
return this$0.f22(annotation) + ' ';
|
|
470
|
+
};
|
|
471
|
+
}
|
|
405
472
|
function WirespecEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
406
473
|
return function (it) {
|
|
407
474
|
var tmp = Spacer_instance.toString();
|
|
408
|
-
var tmp_0 =
|
|
409
|
-
var
|
|
410
|
-
var
|
|
411
|
-
var
|
|
412
|
-
|
|
475
|
+
var tmp_0 = joinToString(it.ur_1, '', VOID, VOID, VOID, VOID, WirespecEndpointDefinitionEmitter$emit$lambda$lambda(this$0));
|
|
476
|
+
var tmp_1 = fixStatus(it.rr_1);
|
|
477
|
+
var tmp0_safe_receiver = it.tr_1;
|
|
478
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qr_1;
|
|
479
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : this$0.xs(tmp1_safe_receiver);
|
|
480
|
+
return tmp + tmp_0 + tmp_1 + ' -> ' + (tmp2_elvis_lhs == null ? 'Unit' : tmp2_elvis_lhs) + emitHeader(this$0, it.sr_1);
|
|
413
481
|
};
|
|
414
482
|
}
|
|
415
483
|
function WirespecEndpointDefinitionEmitter$emitPath$lambda(this$0) {
|
|
416
484
|
return function (it) {
|
|
417
485
|
var tmp;
|
|
418
486
|
if (it instanceof Param) {
|
|
419
|
-
tmp = '{' + it.
|
|
487
|
+
tmp = '{' + it.mr_1.o1() + ': ' + this$0.xs(it.nr_1) + '}';
|
|
420
488
|
} else {
|
|
421
489
|
if (it instanceof Literal) {
|
|
422
|
-
tmp = it.
|
|
490
|
+
tmp = it.a1a_1;
|
|
423
491
|
} else {
|
|
424
492
|
noWhenBranchMatchedException();
|
|
425
493
|
}
|
|
@@ -429,42 +497,57 @@ function WirespecEndpointDefinitionEmitter$emitPath$lambda(this$0) {
|
|
|
429
497
|
}
|
|
430
498
|
function WirespecEndpointDefinitionEmitter$emitQuery$lambda(this$0) {
|
|
431
499
|
return function (it) {
|
|
432
|
-
return this$0.
|
|
500
|
+
return this$0.e22(it);
|
|
433
501
|
};
|
|
434
502
|
}
|
|
435
503
|
function WirespecEndpointDefinitionEmitter$emitHeader$lambda(this$0) {
|
|
436
504
|
return function (it) {
|
|
437
|
-
return this$0.
|
|
505
|
+
return this$0.e22(it);
|
|
438
506
|
};
|
|
439
507
|
}
|
|
440
508
|
function WirespecEndpointDefinitionEmitter() {
|
|
441
509
|
}
|
|
442
|
-
function
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
// Inline function 'kotlin.text.isNotEmpty' call
|
|
446
|
-
if (charSequenceLength($receiver) > 0) {
|
|
447
|
-
// Inline function 'kotlin.text.uppercase' call
|
|
448
|
-
var this_0 = charCodeAt($receiver, 0);
|
|
449
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
450
|
-
// Inline function 'kotlin.js.unsafeCast' call
|
|
451
|
-
var tmp$ret$2 = toString(this_0).toUpperCase();
|
|
452
|
-
tmp = toString_0(tmp$ret$2) + substring($receiver, 1);
|
|
453
|
-
} else {
|
|
454
|
-
tmp = $receiver;
|
|
455
|
-
}
|
|
456
|
-
return tmp;
|
|
510
|
+
function get_entry() {
|
|
511
|
+
_init_properties_WirespecEnumDefinitionEmitter_kt__y5oa4o();
|
|
512
|
+
return entry;
|
|
457
513
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
514
|
+
var entry;
|
|
515
|
+
function get_methods() {
|
|
516
|
+
_init_properties_WirespecEnumDefinitionEmitter_kt__y5oa4o();
|
|
517
|
+
return methods;
|
|
518
|
+
}
|
|
519
|
+
var methods;
|
|
520
|
+
function WirespecEnumDefinitionEmitter$emit$lambda(it) {
|
|
521
|
+
return emitEnumEntry(it);
|
|
462
522
|
}
|
|
463
523
|
function WirespecEnumDefinitionEmitter() {
|
|
464
524
|
}
|
|
525
|
+
function emitEnumEntry(_this__u8e3s4) {
|
|
526
|
+
_init_properties_WirespecEnumDefinitionEmitter_kt__y5oa4o();
|
|
527
|
+
return get_entry().rc(_this__u8e3s4) && !get_methods().i1(_this__u8e3s4) ? _this__u8e3s4 : addBackticks(_this__u8e3s4);
|
|
528
|
+
}
|
|
529
|
+
var properties_initialized_WirespecEnumDefinitionEmitter_kt_wa4jx2;
|
|
530
|
+
function _init_properties_WirespecEnumDefinitionEmitter_kt__y5oa4o() {
|
|
531
|
+
if (!properties_initialized_WirespecEnumDefinitionEmitter_kt_wa4jx2) {
|
|
532
|
+
properties_initialized_WirespecEnumDefinitionEmitter_kt_wa4jx2 = true;
|
|
533
|
+
entry = Regex_init_$Create$('[A-Z][a-zA-Z0-9_]*|-?[0-9]+');
|
|
534
|
+
// Inline function 'kotlin.collections.map' call
|
|
535
|
+
var this_0 = get_entries();
|
|
536
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
537
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
538
|
+
var _iterator__ex2g4s = this_0.t();
|
|
539
|
+
while (_iterator__ex2g4s.u()) {
|
|
540
|
+
var item = _iterator__ex2g4s.v();
|
|
541
|
+
var tmp$ret$2 = item.d3_1;
|
|
542
|
+
destination.x(tmp$ret$2);
|
|
543
|
+
}
|
|
544
|
+
methods = toSet(destination);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
465
547
|
function Companion() {
|
|
466
548
|
Companion_instance = this;
|
|
467
|
-
this.
|
|
549
|
+
this.l22_1 = setOf(['type', 'enum', 'endpoint', 'channel', 'rpc', 'part']);
|
|
550
|
+
this.m22_1 = Regex_init_$Create$('[a-z][a-zA-Z0-9_\\-]*');
|
|
468
551
|
}
|
|
469
552
|
var Companion_instance;
|
|
470
553
|
function Companion_getInstance() {
|
|
@@ -474,10 +557,102 @@ function Companion_getInstance() {
|
|
|
474
557
|
}
|
|
475
558
|
function WirespecIdentifierEmitter() {
|
|
476
559
|
}
|
|
560
|
+
function get_KEY() {
|
|
561
|
+
_init_properties_WirespecMetaDataEmitter_kt__6x4knh();
|
|
562
|
+
return KEY;
|
|
563
|
+
}
|
|
564
|
+
var KEY;
|
|
565
|
+
function emit_14($this, $receiver) {
|
|
566
|
+
return $receiver.i19_1 === 'default' ? emit_15($this, $receiver.j19_1) : emitEntry($this, $receiver);
|
|
567
|
+
}
|
|
568
|
+
function emitEntry($this, $receiver) {
|
|
569
|
+
return emitKey($this, $receiver.i19_1) + ': ' + emit_15($this, $receiver.j19_1);
|
|
570
|
+
}
|
|
571
|
+
function emit_15($this, $receiver) {
|
|
572
|
+
var tmp;
|
|
573
|
+
if ($receiver instanceof Single) {
|
|
574
|
+
tmp = '"' + escapeQuotes($this, $receiver.m19_1) + '"';
|
|
575
|
+
} else {
|
|
576
|
+
if ($receiver instanceof Array_0) {
|
|
577
|
+
var tmp_0;
|
|
578
|
+
if ($receiver.l19_1.r()) {
|
|
579
|
+
tmp_0 = '[ ]';
|
|
580
|
+
} else {
|
|
581
|
+
tmp_0 = joinToString($receiver.l19_1, ', ', '[', ']', VOID, VOID, WirespecMetaDataEmitter$emit$lambda_0($this));
|
|
582
|
+
}
|
|
583
|
+
tmp = tmp_0;
|
|
584
|
+
} else {
|
|
585
|
+
if ($receiver instanceof Dict) {
|
|
586
|
+
tmp = joinToString($receiver.k19_1, ', ', '{ ', ' }', VOID, VOID, WirespecMetaDataEmitter$emit$lambda_1($this));
|
|
587
|
+
} else {
|
|
588
|
+
noWhenBranchMatchedException();
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
return tmp;
|
|
593
|
+
}
|
|
594
|
+
function emitKey($this, $receiver) {
|
|
595
|
+
return get_KEY().rc($receiver) ? $receiver : '"' + escapeQuotes($this, $receiver) + '"';
|
|
596
|
+
}
|
|
597
|
+
function escapeQuotes($this, $receiver) {
|
|
598
|
+
// Inline function 'kotlin.text.buildString' call
|
|
599
|
+
// Inline function 'kotlin.apply' call
|
|
600
|
+
var this_0 = StringBuilder_init_$Create$();
|
|
601
|
+
var index = 0;
|
|
602
|
+
while (index < $receiver.length) {
|
|
603
|
+
var char = charCodeAt($receiver, index);
|
|
604
|
+
if (char === _Char___init__impl__6a9atx(92)) {
|
|
605
|
+
var tmp0_safe_receiver = getOrNull($receiver, index + 1 | 0);
|
|
606
|
+
var tmp;
|
|
607
|
+
var tmp_0 = tmp0_safe_receiver;
|
|
608
|
+
if ((tmp_0 == null ? null : new Char(tmp_0)) == null) {
|
|
609
|
+
tmp = null;
|
|
610
|
+
} else {
|
|
611
|
+
var tmp_1 = tmp0_safe_receiver;
|
|
612
|
+
// Inline function 'kotlin.let' call
|
|
613
|
+
var it = (tmp_1 == null ? null : new Char(tmp_1)).k1_1;
|
|
614
|
+
tmp = '\\' + toString(it);
|
|
615
|
+
}
|
|
616
|
+
var tmp1_elvis_lhs = tmp;
|
|
617
|
+
// Inline function 'kotlin.also' call
|
|
618
|
+
this_0.q(tmp1_elvis_lhs == null ? '\\\\' : tmp1_elvis_lhs);
|
|
619
|
+
index = index + 1 | 0;
|
|
620
|
+
} else if (char === _Char___init__impl__6a9atx(34))
|
|
621
|
+
this_0.q('\\"');
|
|
622
|
+
else
|
|
623
|
+
this_0.s(char);
|
|
624
|
+
index = index + 1 | 0;
|
|
625
|
+
}
|
|
626
|
+
return this_0.toString();
|
|
627
|
+
}
|
|
628
|
+
function WirespecMetaDataEmitter$emit$lambda(this$0) {
|
|
629
|
+
return function (it) {
|
|
630
|
+
return emit_14(this$0, it);
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
function WirespecMetaDataEmitter$emit$lambda_0(this$0) {
|
|
634
|
+
return function (it) {
|
|
635
|
+
return emit_15(this$0, it);
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
function WirespecMetaDataEmitter$emit$lambda_1(this$0) {
|
|
639
|
+
return function (it) {
|
|
640
|
+
return emitEntry(this$0, it);
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
function WirespecMetaDataEmitter() {
|
|
644
|
+
}
|
|
645
|
+
var properties_initialized_WirespecMetaDataEmitter_kt_rbtd69;
|
|
646
|
+
function _init_properties_WirespecMetaDataEmitter_kt__6x4knh() {
|
|
647
|
+
if (!properties_initialized_WirespecMetaDataEmitter_kt_rbtd69) {
|
|
648
|
+
properties_initialized_WirespecMetaDataEmitter_kt_rbtd69 = true;
|
|
649
|
+
KEY = Regex_init_$Create$('(?!(?:type|enum|endpoint|channel|rpc|part)-)[a-z][a-zA-Z0-9_\\-]*|[A-Z][a-zA-Z0-9_]*');
|
|
650
|
+
}
|
|
651
|
+
}
|
|
477
652
|
function WirespecPartDefinitionEmitter() {
|
|
478
653
|
}
|
|
479
654
|
function emitDecimal($this, $receiver) {
|
|
480
|
-
return '(' + toBoundDecimal($this, $receiver.
|
|
655
|
+
return '(' + toBoundDecimal($this, $receiver.z18_1) + ', ' + toBoundDecimal($this, $receiver.a19_1) + ')';
|
|
481
656
|
}
|
|
482
657
|
function toBoundDecimal($this, $receiver) {
|
|
483
658
|
return $receiver == null ? '_' : contains($receiver, '.') ? $receiver : $receiver + '.0';
|
|
@@ -485,14 +660,14 @@ function toBoundDecimal($this, $receiver) {
|
|
|
485
660
|
function WirespecRefinedTypeDefinitionEmitter() {
|
|
486
661
|
}
|
|
487
662
|
function emitReturn($this, $receiver) {
|
|
488
|
-
var tmp = $this.
|
|
489
|
-
var tmp0_safe_receiver = $receiver.
|
|
663
|
+
var tmp = $this.xs($receiver.tq_1);
|
|
664
|
+
var tmp0_safe_receiver = $receiver.uq_1;
|
|
490
665
|
var tmp_0;
|
|
491
666
|
if (tmp0_safe_receiver == null) {
|
|
492
667
|
tmp_0 = null;
|
|
493
668
|
} else {
|
|
494
669
|
// Inline function 'kotlin.let' call
|
|
495
|
-
tmp_0 = ' ! ' + $this.
|
|
670
|
+
tmp_0 = ' ! ' + $this.xs(tmp0_safe_receiver);
|
|
496
671
|
}
|
|
497
672
|
// Inline function 'kotlin.text.orEmpty' call
|
|
498
673
|
var tmp0_elvis_lhs = tmp_0;
|
|
@@ -500,36 +675,37 @@ function emitReturn($this, $receiver) {
|
|
|
500
675
|
}
|
|
501
676
|
function WirespecRpcDefinitionEmitter() {
|
|
502
677
|
}
|
|
503
|
-
function
|
|
678
|
+
function emitDeclaration($this, $receiver) {
|
|
679
|
+
var tmp = $this.es($receiver.op_1);
|
|
680
|
+
var tmp_0 = $this.xs($receiver.pp_1);
|
|
681
|
+
var tmp0_safe_receiver = $receiver.qp_1;
|
|
682
|
+
var tmp_1;
|
|
683
|
+
if (tmp0_safe_receiver == null) {
|
|
684
|
+
tmp_1 = null;
|
|
685
|
+
} else {
|
|
686
|
+
// Inline function 'kotlin.let' call
|
|
687
|
+
tmp_1 = ' = ' + emit_16($this, tmp0_safe_receiver);
|
|
688
|
+
}
|
|
689
|
+
// Inline function 'kotlin.text.orEmpty' call
|
|
690
|
+
var tmp0_elvis_lhs = tmp_1;
|
|
691
|
+
return tmp + ': ' + tmp_0 + (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs);
|
|
692
|
+
}
|
|
693
|
+
function emit_16($this, $receiver) {
|
|
504
694
|
var tmp;
|
|
505
695
|
if ($receiver instanceof StringValue) {
|
|
506
|
-
tmp = '"' + escape($this, $receiver.
|
|
696
|
+
tmp = '"' + escape($this, $receiver.z19_1) + '"';
|
|
507
697
|
} else {
|
|
508
698
|
if ($receiver instanceof IntegerValue) {
|
|
509
|
-
tmp = $receiver.
|
|
699
|
+
tmp = $receiver.x19_1;
|
|
510
700
|
} else {
|
|
511
701
|
if ($receiver instanceof NumberValue) {
|
|
512
|
-
tmp = $receiver.
|
|
702
|
+
tmp = $receiver.w19_1;
|
|
513
703
|
} else {
|
|
514
704
|
if ($receiver instanceof BooleanValue) {
|
|
515
|
-
tmp = $receiver.
|
|
705
|
+
tmp = $receiver.y19_1.toString();
|
|
516
706
|
} else {
|
|
517
707
|
if ($receiver instanceof EnumValue) {
|
|
518
|
-
|
|
519
|
-
var this_0 = $receiver.l19_1;
|
|
520
|
-
var tmp_0;
|
|
521
|
-
// Inline function 'kotlin.text.isNotEmpty' call
|
|
522
|
-
if (charSequenceLength(this_0) > 0) {
|
|
523
|
-
// Inline function 'kotlin.text.uppercase' call
|
|
524
|
-
var this_1 = charCodeAt(this_0, 0);
|
|
525
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
526
|
-
// Inline function 'kotlin.js.unsafeCast' call
|
|
527
|
-
var tmp$ret$2 = toString(this_1).toUpperCase();
|
|
528
|
-
tmp_0 = toString_0(tmp$ret$2) + substring(this_0, 1);
|
|
529
|
-
} else {
|
|
530
|
-
tmp_0 = this_0;
|
|
531
|
-
}
|
|
532
|
-
tmp = tmp_0;
|
|
708
|
+
tmp = emitEnumEntry($receiver.v19_1);
|
|
533
709
|
} else {
|
|
534
710
|
if ($receiver instanceof NullValue) {
|
|
535
711
|
tmp = 'null';
|
|
@@ -546,35 +722,57 @@ function emit_12($this, $receiver) {
|
|
|
546
722
|
function escape($this, $receiver) {
|
|
547
723
|
return replace(replace(replace(replace(replace($receiver, '\\', '\\\\'), '"', '\\"'), '\n', '\\n'), '\r', '\\r'), '\t', '\\t');
|
|
548
724
|
}
|
|
725
|
+
function WirespecTypeDefinitionEmitter$emit$lambda$lambda(this$0) {
|
|
726
|
+
return function (it) {
|
|
727
|
+
return Spacer_instance.toString() + this$0.f22(it) + '\n';
|
|
728
|
+
};
|
|
729
|
+
}
|
|
549
730
|
function WirespecTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
731
|
+
return function (entry) {
|
|
732
|
+
var tmp;
|
|
733
|
+
if (entry instanceof Field) {
|
|
734
|
+
tmp = joinToString(entry.np_1, '', VOID, VOID, VOID, VOID, WirespecTypeDefinitionEmitter$emit$lambda$lambda(this$0)) + (Spacer_instance.toString() + emitDeclaration(this$0, entry));
|
|
735
|
+
} else {
|
|
736
|
+
if (entry instanceof Spread) {
|
|
737
|
+
tmp = Spacer_instance.toString() + this$0.e22(entry);
|
|
738
|
+
} else {
|
|
739
|
+
noWhenBranchMatchedException();
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
return tmp;
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
function WirespecTypeDefinitionEmitter$emit$lambda_0(this$0) {
|
|
550
746
|
return function (it) {
|
|
551
|
-
return
|
|
747
|
+
return this$0.f22(it) + ' ';
|
|
552
748
|
};
|
|
553
749
|
}
|
|
554
750
|
function WirespecTypeDefinitionEmitter() {
|
|
555
751
|
}
|
|
556
752
|
function WirespecUnionDefinitionEmitter$emit$lambda(this$0) {
|
|
557
753
|
return function (it) {
|
|
558
|
-
return this$0.
|
|
754
|
+
return this$0.xs(it);
|
|
559
755
|
};
|
|
560
756
|
}
|
|
561
757
|
function WirespecUnionDefinitionEmitter() {
|
|
562
758
|
}
|
|
563
759
|
//region block: post-declaration
|
|
564
|
-
protoOf(WirespecEmitter).
|
|
565
|
-
protoOf(WirespecEmitter).
|
|
566
|
-
protoOf(WirespecEmitter).
|
|
567
|
-
protoOf(WirespecEmitter).
|
|
568
|
-
protoOf(WirespecEmitter).
|
|
569
|
-
protoOf(WirespecEmitter).
|
|
570
|
-
protoOf(WirespecEmitter).
|
|
571
|
-
protoOf(WirespecEmitter).
|
|
572
|
-
protoOf(WirespecEmitter).
|
|
573
|
-
protoOf(WirespecEmitter).
|
|
574
|
-
protoOf(WirespecEmitter).
|
|
575
|
-
protoOf(WirespecEmitter).
|
|
576
|
-
protoOf(WirespecEmitter).
|
|
577
|
-
protoOf(WirespecEmitter).
|
|
760
|
+
protoOf(WirespecEmitter).us = emit_2;
|
|
761
|
+
protoOf(WirespecEmitter).vs = emit_3;
|
|
762
|
+
protoOf(WirespecEmitter).ws = emit_4;
|
|
763
|
+
protoOf(WirespecEmitter).xs = emit_6;
|
|
764
|
+
protoOf(WirespecEmitter).ss = emit_8;
|
|
765
|
+
protoOf(WirespecEmitter).ns = emit_12;
|
|
766
|
+
protoOf(WirespecEmitter).ts = emit_13;
|
|
767
|
+
protoOf(WirespecEmitter).is = emit_9;
|
|
768
|
+
protoOf(WirespecEmitter).es = emit;
|
|
769
|
+
protoOf(WirespecEmitter).hs = emit_7;
|
|
770
|
+
protoOf(WirespecEmitter).gs = emit_11;
|
|
771
|
+
protoOf(WirespecEmitter).fs = emit_10;
|
|
772
|
+
protoOf(WirespecEmitter).e22 = emit_5;
|
|
773
|
+
protoOf(WirespecEmitter).f22 = emit_0;
|
|
774
|
+
protoOf(WirespecEmitter).g22 = emit_1;
|
|
775
|
+
protoOf(WirespecEmitter).zs = emitValidator;
|
|
578
776
|
//endregion
|
|
579
777
|
//region block: exports
|
|
580
778
|
export {
|