@flock/wirespec 0.21.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arrow-arrow-atomic.mjs +13 -13
- package/arrow-arrow-atomic.mjs.map +1 -1
- package/arrow-arrow-core.mjs +166 -167
- package/arrow-arrow-core.mjs.map +1 -1
- package/clikt-clikt-mordant.mjs +88 -88
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1545 -1547
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +463 -463
- package/colormath-root-colormath.mjs.map +1 -1
- package/kotlin-kotlin-stdlib.mjs +1199 -1318
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10323 -10296
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1811 -1815
- package/kotlin-rgxgen.mjs.map +1 -1
- package/kotlinx-io-kotlinx-io-core.mjs +454 -454
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1985 -1993
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1768 -1737
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1357 -1360
- package/mordant-mordant.mjs.map +1 -1
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +26678 -4523
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +373 -469
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +322 -377
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +345 -344
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +738 -736
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +357 -357
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +472 -459
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +214 -131
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +403 -336
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +713 -708
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-common.mjs +267 -0
- package/wirespec-src-converter-common.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +1156 -1086
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1720 -1634
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-plugin-arguments.mjs +274 -233
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +153 -128
- package/wirespec-src-plugin-cli.mjs.map +1 -1
- package/wirespec-src-plugin-npm.d.mts +23 -10
- package/wirespec-src-plugin-npm.mjs +79 -81
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +59 -51
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +0 -18912
- package/wirespec-src-compiler-ir.mjs.map +0 -1
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
|
|
4
4
|
VOID3gxj6tk5isa35 as VOID,
|
|
5
5
|
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
|
|
6
|
-
ArrayList_init_$Create$
|
|
7
|
-
|
|
6
|
+
ArrayList_init_$Create$2byt5m5yn22yy as ArrayList_init_$Create$,
|
|
7
|
+
Unit_instancev9v8hjid95df as Unit_instance,
|
|
8
8
|
joinToString1cxrrlmo0chqs as joinToString,
|
|
9
9
|
listOfvhqybd2zx248 as listOf,
|
|
10
10
|
noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
trimMarginhyd3fsmh8iev as trimMargin,
|
|
14
14
|
charSequenceLength3278n89t01tmv as charSequenceLength,
|
|
15
15
|
charCodeAt1yspne1d8erbm as charCodeAt,
|
|
16
|
-
|
|
16
|
+
toString22rbkbhdb5cl2 as toString,
|
|
17
17
|
toString1pkumu07cwy4m as toString_0,
|
|
18
18
|
substring3saq8ornu0luv as substring,
|
|
19
19
|
setOf45ia9pnfhe90 as setOf,
|
|
@@ -22,26 +22,35 @@ import {
|
|
|
22
22
|
isUpperCase16ivdixranflt as isUpperCase,
|
|
23
23
|
contains3ue2qo8xhmpf1 as contains,
|
|
24
24
|
equals2au1ep9vhcato as equals,
|
|
25
|
+
replace3le3ie7l9k8aq as replace,
|
|
25
26
|
} from './kotlin-kotlin-stdlib.mjs';
|
|
26
27
|
import {
|
|
27
28
|
LanguageEmitterxhzgykhux3qm as LanguageEmitter,
|
|
28
|
-
|
|
29
|
+
FileExtension_Wirespec_getInstance3awesett59616 as FileExtension_Wirespec_getInstance,
|
|
29
30
|
Emitted12h24rpo4uifw as Emitted,
|
|
30
31
|
Bound2mp7s0560derz as Bound,
|
|
31
|
-
|
|
32
|
+
_RegExp___get_value__impl__7o7618olm3t8d4plkj as _RegExp___get_value__impl__7o7618,
|
|
32
33
|
RegExpiyof7szm5zfu as RegExp_0,
|
|
33
|
-
|
|
34
|
+
Spacer_instance2xdqev5aku2zw as Spacer_instance,
|
|
34
35
|
fixStatus2l9jrn3538wpy as fixStatus,
|
|
35
36
|
Literal331hu9r04vptz as Literal,
|
|
36
37
|
Paramvfwnys2w6aj1 as Param,
|
|
37
38
|
addBackticks1di5q03fw4yhx as addBackticks,
|
|
38
39
|
FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
|
|
39
40
|
DefinitionIdentifiervfasqdb33qef as DefinitionIdentifier,
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
Bytes_instance1cqd1xiwjq94x as Bytes_instance,
|
|
42
|
+
Boolean_instance15wa4iqeayn6f as Boolean_instance,
|
|
42
43
|
String1czvr8pxnm6on as String_0,
|
|
43
44
|
Number1mui0heypwdhp as Number_0,
|
|
44
45
|
Integer39lqx4uc63u28 as Integer,
|
|
46
|
+
NullValue1yefsnnipmi9o as NullValue,
|
|
47
|
+
EnumValue2b3i6n6mki85b as EnumValue,
|
|
48
|
+
BooleanValue16k4clmclm2vt as BooleanValue,
|
|
49
|
+
NumberValuefyqx55jb6ctt as NumberValue,
|
|
50
|
+
IntegerValue3ck98dwr2y2gy as IntegerValue,
|
|
51
|
+
StringValue1xt3p65w95v1r as StringValue,
|
|
52
|
+
Spread2iwdfqumb33es as Spread,
|
|
53
|
+
Field2nwjpxu9j2svq as Field,
|
|
45
54
|
Bytes3eoc50vgt1uem as Bytes,
|
|
46
55
|
Boolean1fpfi8m5jt3fg as Boolean_0,
|
|
47
56
|
Primitive1i8my14jkp3nk as Primitive,
|
|
@@ -53,8 +62,8 @@ import {
|
|
|
53
62
|
} from './wirespec-src-compiler-core.mjs';
|
|
54
63
|
import {
|
|
55
64
|
NonEmptyList3ak25ihy2gcvs as NonEmptyList,
|
|
56
|
-
|
|
57
|
-
|
|
65
|
+
_NonEmptyList___get_all__impl__pmf5092xnz0i2teaa6d as _NonEmptyList___get_all__impl__pmf509,
|
|
66
|
+
_NonEmptyList___init__impl__fxd0xprpnd63likgzm as _NonEmptyList___init__impl__fxd0xp,
|
|
58
67
|
} from './arrow-arrow-core.mjs';
|
|
59
68
|
//region block: imports
|
|
60
69
|
//endregion
|
|
@@ -63,11 +72,11 @@ function emit(identifier) {
|
|
|
63
72
|
var tmp;
|
|
64
73
|
if (identifier instanceof DefinitionIdentifier) {
|
|
65
74
|
// Inline function 'kotlin.run' call
|
|
66
|
-
tmp = Companion_getInstance().
|
|
75
|
+
tmp = Companion_getInstance().m21_1.v1(identifier.m1()) ? addBackticks(identifier.m1()) : identifier.m1();
|
|
67
76
|
} else {
|
|
68
77
|
if (identifier instanceof FieldIdentifier) {
|
|
69
78
|
// Inline function 'kotlin.run' call
|
|
70
|
-
tmp = Companion_getInstance().
|
|
79
|
+
tmp = Companion_getInstance().m21_1.v1(identifier.m1()) || isUpperCase(first(identifier.m1())) ? addBackticks(identifier.m1()) : identifier.m1();
|
|
71
80
|
} else {
|
|
72
81
|
noWhenBranchMatchedException();
|
|
73
82
|
}
|
|
@@ -76,21 +85,46 @@ function emit(identifier) {
|
|
|
76
85
|
}
|
|
77
86
|
initMetadataForInterface(WirespecIdentifierEmitter, 'WirespecIdentifierEmitter');
|
|
78
87
|
function emit_0(type, module_0) {
|
|
79
|
-
return trimMargin('\n |type ' + this.
|
|
88
|
+
return trimMargin('\n |type ' + this.ur(type.cp_1) + ' {\n |' + this.ls(type.dp_1) + '\n |}\n |');
|
|
80
89
|
}
|
|
81
90
|
function emit_1(_this__u8e3s4) {
|
|
82
|
-
return joinToString(_this__u8e3s4.
|
|
91
|
+
return joinToString(_this__u8e3s4.k1b_1, ',\n', VOID, VOID, VOID, VOID, WirespecTypeDefinitionEmitter$emit$lambda(this));
|
|
83
92
|
}
|
|
84
93
|
function emit_2(_this__u8e3s4) {
|
|
85
|
-
|
|
94
|
+
var tmp = this.ur(_this__u8e3s4.gp_1);
|
|
95
|
+
var tmp_0 = this.ns(_this__u8e3s4.hp_1);
|
|
96
|
+
var tmp0_safe_receiver = _this__u8e3s4.ip_1;
|
|
97
|
+
var tmp_1;
|
|
98
|
+
if (tmp0_safe_receiver == null) {
|
|
99
|
+
tmp_1 = null;
|
|
100
|
+
} else {
|
|
101
|
+
// Inline function 'kotlin.let' call
|
|
102
|
+
tmp_1 = ' = ' + emit_12(this, tmp0_safe_receiver);
|
|
103
|
+
}
|
|
104
|
+
// Inline function 'kotlin.text.orEmpty' call
|
|
105
|
+
var tmp0_elvis_lhs = tmp_1;
|
|
106
|
+
return tmp + ': ' + tmp_0 + (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs);
|
|
86
107
|
}
|
|
87
108
|
function emit_3(_this__u8e3s4) {
|
|
109
|
+
var tmp;
|
|
110
|
+
if (_this__u8e3s4 instanceof Field) {
|
|
111
|
+
tmp = this.ms(_this__u8e3s4);
|
|
112
|
+
} else {
|
|
113
|
+
if (_this__u8e3s4 instanceof Spread) {
|
|
114
|
+
tmp = '...' + this.ns(_this__u8e3s4.g1c_1);
|
|
115
|
+
} else {
|
|
116
|
+
noWhenBranchMatchedException();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return tmp;
|
|
120
|
+
}
|
|
121
|
+
function emit_4(_this__u8e3s4) {
|
|
88
122
|
var tmp;
|
|
89
123
|
if (_this__u8e3s4 instanceof Dict) {
|
|
90
|
-
tmp = '{ ' + this.
|
|
124
|
+
tmp = '{ ' + this.ns(_this__u8e3s4.tp_1) + ' }';
|
|
91
125
|
} else {
|
|
92
126
|
if (_this__u8e3s4 instanceof Iterable) {
|
|
93
|
-
tmp = this.
|
|
127
|
+
tmp = this.ns(_this__u8e3s4.qp_1) + '[]';
|
|
94
128
|
} else {
|
|
95
129
|
if (_this__u8e3s4 instanceof Unit) {
|
|
96
130
|
tmp = 'Unit';
|
|
@@ -99,10 +133,10 @@ function emit_3(_this__u8e3s4) {
|
|
|
99
133
|
tmp = 'Any';
|
|
100
134
|
} else {
|
|
101
135
|
if (_this__u8e3s4 instanceof Custom) {
|
|
102
|
-
tmp = _this__u8e3s4.
|
|
136
|
+
tmp = _this__u8e3s4.h18_1;
|
|
103
137
|
} else {
|
|
104
138
|
if (_this__u8e3s4 instanceof Primitive) {
|
|
105
|
-
var t = _this__u8e3s4.
|
|
139
|
+
var t = _this__u8e3s4.j18_1;
|
|
106
140
|
var tmp_0;
|
|
107
141
|
if (t instanceof String_0) {
|
|
108
142
|
tmp_0 = 'String';
|
|
@@ -115,7 +149,7 @@ function emit_3(_this__u8e3s4) {
|
|
|
115
149
|
} else {
|
|
116
150
|
if (t instanceof Integer) {
|
|
117
151
|
var tmp_1;
|
|
118
|
-
switch (t.
|
|
152
|
+
switch (t.r18_1.c3_1) {
|
|
119
153
|
case 0:
|
|
120
154
|
tmp_1 = 'Integer32';
|
|
121
155
|
break;
|
|
@@ -130,7 +164,7 @@ function emit_3(_this__u8e3s4) {
|
|
|
130
164
|
} else {
|
|
131
165
|
if (t instanceof Number_0) {
|
|
132
166
|
var tmp_2;
|
|
133
|
-
switch (t.
|
|
167
|
+
switch (t.m18_1.c3_1) {
|
|
134
168
|
case 0:
|
|
135
169
|
tmp_2 = 'Number32';
|
|
136
170
|
break;
|
|
@@ -160,37 +194,51 @@ function emit_3(_this__u8e3s4) {
|
|
|
160
194
|
}
|
|
161
195
|
// Inline function 'kotlin.let' call
|
|
162
196
|
var it = tmp;
|
|
163
|
-
return _this__u8e3s4.
|
|
197
|
+
return _this__u8e3s4.et() ? it + '?' : it;
|
|
164
198
|
}
|
|
165
199
|
initMetadataForInterface(WirespecTypeDefinitionEmitter, 'WirespecTypeDefinitionEmitter', VOID, VOID, [WirespecIdentifierEmitter]);
|
|
166
|
-
function
|
|
167
|
-
return 'channel ' + this.
|
|
200
|
+
function emit_5(channel) {
|
|
201
|
+
return 'channel ' + this.ur(channel.nq_1) + ' -> ' + this.ns(channel.oq_1);
|
|
168
202
|
}
|
|
169
203
|
initMetadataForInterface(WirespecChannelDefinitionEmitter, 'WirespecChannelDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
170
|
-
function
|
|
171
|
-
return '
|
|
204
|
+
function emit_6(rpc) {
|
|
205
|
+
return rpc.iq_1.k1b_1.r() ? 'rpc ' + this.ur(rpc.hq_1) + ' {} -> ' + emitReturn(this, rpc) + '\n' : trimMargin('\n |rpc ' + this.ur(rpc.hq_1) + ' {\n |' + this.ls(rpc.iq_1) + '\n |} -> ' + emitReturn(this, rpc) + '\n |');
|
|
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);
|
|
210
|
+
var tmp_0 = Spacer_instance.toString();
|
|
211
|
+
return 'enum ' + tmp + ' {\n' + tmp_0 + joinToString(enum_0.hs_1, ', ', VOID, VOID, VOID, VOID, WirespecEnumDefinitionEmitter$emit$lambda(this)) + '\n}\n';
|
|
212
|
+
}
|
|
213
|
+
initMetadataForInterface(WirespecEnumDefinitionEmitter, 'WirespecEnumDefinitionEmitter', VOID, VOID, [WirespecIdentifierEmitter]);
|
|
214
|
+
function emit_8(part) {
|
|
215
|
+
return trimMargin('\n |part ' + this.ur(part.dq_1) + ' {\n |' + this.ls(part.eq_1) + '\n |}\n |');
|
|
216
|
+
}
|
|
217
|
+
initMetadataForInterface(WirespecPartDefinitionEmitter, 'WirespecPartDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
218
|
+
function emit_9(refined) {
|
|
219
|
+
return 'type ' + this.ur(refined.bs_1) + ' = ' + this.ns(refined.cs_1.c1d(VOID, false)) + this.ps(refined) + '\n';
|
|
172
220
|
}
|
|
173
221
|
function emitValidator(_this__u8e3s4) {
|
|
174
|
-
var type = _this__u8e3s4.
|
|
222
|
+
var type = _this__u8e3s4.cs_1.j18_1;
|
|
175
223
|
var tmp;
|
|
176
224
|
if (type instanceof Integer) {
|
|
177
|
-
var tmp0_safe_receiver = type.
|
|
178
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.
|
|
225
|
+
var tmp0_safe_receiver = type.s18_1;
|
|
226
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.os(tmp0_safe_receiver);
|
|
179
227
|
tmp = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
|
|
180
228
|
} else {
|
|
181
229
|
if (type instanceof Number_0) {
|
|
182
|
-
var tmp2_safe_receiver = type.
|
|
230
|
+
var tmp2_safe_receiver = type.n18_1;
|
|
183
231
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : emitDecimal(this, tmp2_safe_receiver);
|
|
184
232
|
tmp = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
|
|
185
233
|
} else {
|
|
186
234
|
if (type instanceof String_0) {
|
|
187
|
-
var tmp4_safe_receiver = type.
|
|
235
|
+
var tmp4_safe_receiver = type.u18_1;
|
|
188
236
|
var tmp_0;
|
|
189
237
|
var tmp_1 = tmp4_safe_receiver;
|
|
190
238
|
if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
|
|
191
239
|
tmp_0 = null;
|
|
192
240
|
} else {
|
|
193
|
-
tmp_0 = this.
|
|
241
|
+
tmp_0 = this.os(new RegExp_0(tmp4_safe_receiver));
|
|
194
242
|
}
|
|
195
243
|
var tmp5_elvis_lhs = tmp_0;
|
|
196
244
|
tmp = tmp5_elvis_lhs == null ? '' : tmp5_elvis_lhs;
|
|
@@ -210,49 +258,43 @@ function emitValidator(_this__u8e3s4) {
|
|
|
210
258
|
return tmp;
|
|
211
259
|
}
|
|
212
260
|
initMetadataForInterface(WirespecRefinedTypeDefinitionEmitter, 'WirespecRefinedTypeDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
213
|
-
function
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
initMetadataForInterface(WirespecRpcDefinitionEmitter, 'WirespecRpcDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
217
|
-
function emit_7(union) {
|
|
218
|
-
var tmp = this.nr(union.aq_1);
|
|
219
|
-
return 'type ' + tmp + ' = ' + joinToString(union.bq_1, ' | ', VOID, VOID, VOID, VOID, WirespecUnionDefinitionEmitter$emit$lambda(this)) + '\n';
|
|
261
|
+
function emit_10(union) {
|
|
262
|
+
var tmp = this.ur(union.rq_1);
|
|
263
|
+
return 'type ' + tmp + ' = ' + joinToString(union.sq_1, ' | ', VOID, VOID, VOID, VOID, WirespecUnionDefinitionEmitter$emit$lambda(this)) + '\n';
|
|
220
264
|
}
|
|
221
265
|
initMetadataForInterface(WirespecUnionDefinitionEmitter, 'WirespecUnionDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
222
|
-
function
|
|
223
|
-
var tmp = this.
|
|
224
|
-
var tmp_0 = endpoint.
|
|
225
|
-
var tmp_1 = emitRequest(this, endpoint.
|
|
226
|
-
var tmp_2 = emitPath(this, endpoint.
|
|
227
|
-
var tmp_3 = emitQuery(this, endpoint.
|
|
228
|
-
var tmp_4 = emitHeader(this, endpoint.
|
|
229
|
-
return trimMargin('\n |endpoint ' + tmp + ' ' + tmp_0 + tmp_1 + ' ' + tmp_2 + tmp_3 + tmp_4 + ' -> {\n |' + joinToString(endpoint.
|
|
266
|
+
function emit_11(endpoint) {
|
|
267
|
+
var tmp = this.ur(endpoint.vq_1);
|
|
268
|
+
var tmp_0 = endpoint.wq_1.toString();
|
|
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 ');
|
|
230
274
|
}
|
|
231
275
|
initMetadataForInterface(WirespecEndpointDefinitionEmitter, 'WirespecEndpointDefinitionEmitter', VOID, VOID, [WirespecTypeDefinitionEmitter]);
|
|
232
|
-
|
|
233
|
-
var tmp = this.nr(enum_0.yr_1);
|
|
234
|
-
var tmp_0 = Spacer_instance.toString();
|
|
235
|
-
return 'enum ' + tmp + ' {\n' + tmp_0 + joinToString(enum_0.zr_1, ', ', VOID, VOID, VOID, VOID, WirespecEnumDefinitionEmitter$emit$lambda(this)) + '\n}\n';
|
|
236
|
-
}
|
|
237
|
-
initMetadataForInterface(WirespecEnumDefinitionEmitter, 'WirespecEnumDefinitionEmitter', VOID, VOID, [WirespecIdentifierEmitter]);
|
|
238
|
-
initMetadataForClass(WirespecEmitter, 'WirespecEmitter', WirespecEmitter, LanguageEmitter, [LanguageEmitter, WirespecRefinedTypeDefinitionEmitter, WirespecTypeDefinitionEmitter, WirespecRpcDefinitionEmitter, WirespecUnionDefinitionEmitter, WirespecIdentifierEmitter, WirespecChannelDefinitionEmitter, WirespecEndpointDefinitionEmitter, WirespecEnumDefinitionEmitter]);
|
|
276
|
+
initMetadataForClass(WirespecEmitter, 'WirespecEmitter', WirespecEmitter, LanguageEmitter, [WirespecRpcDefinitionEmitter, WirespecEnumDefinitionEmitter, WirespecPartDefinitionEmitter, WirespecRefinedTypeDefinitionEmitter, WirespecUnionDefinitionEmitter, WirespecIdentifierEmitter, WirespecEndpointDefinitionEmitter, WirespecChannelDefinitionEmitter, WirespecTypeDefinitionEmitter]);
|
|
239
277
|
initMetadataForCompanion(Companion);
|
|
240
278
|
//endregion
|
|
241
279
|
function WirespecChannelDefinitionEmitter() {
|
|
242
280
|
}
|
|
243
281
|
function WirespecEmitter() {
|
|
244
282
|
LanguageEmitter.call(this);
|
|
245
|
-
this.
|
|
246
|
-
this.
|
|
247
|
-
this.
|
|
283
|
+
this.i21_1 = FileExtension_Wirespec_getInstance();
|
|
284
|
+
this.j21_1 = true;
|
|
285
|
+
this.k21_1 = null;
|
|
286
|
+
this.l21_1 = '\n';
|
|
248
287
|
}
|
|
249
|
-
protoOf(WirespecEmitter).
|
|
250
|
-
return this.
|
|
288
|
+
protoOf(WirespecEmitter).op = function () {
|
|
289
|
+
return this.i21_1;
|
|
290
|
+
};
|
|
291
|
+
protoOf(WirespecEmitter).np = function () {
|
|
292
|
+
return this.j21_1;
|
|
251
293
|
};
|
|
252
|
-
protoOf(WirespecEmitter).
|
|
294
|
+
protoOf(WirespecEmitter).mo = function (ast, logger) {
|
|
253
295
|
// Inline function 'kotlin.let' call
|
|
254
|
-
var e = protoOf(LanguageEmitter).
|
|
255
|
-
var tmp = 'wirespec.' + this.
|
|
296
|
+
var e = protoOf(LanguageEmitter).mo.call(this, ast, logger);
|
|
297
|
+
var tmp = 'wirespec.' + this.op().nr_1;
|
|
256
298
|
// Inline function 'arrow.core.NonEmptyList.map' call
|
|
257
299
|
// Inline function 'kotlin.collections.map' call
|
|
258
300
|
var this_0 = _NonEmptyList___get_all__impl__pmf509(e);
|
|
@@ -261,23 +303,23 @@ protoOf(WirespecEmitter).no = function (ast, logger) {
|
|
|
261
303
|
var _iterator__ex2g4s = this_0.t();
|
|
262
304
|
while (_iterator__ex2g4s.u()) {
|
|
263
305
|
var item = _iterator__ex2g4s.v();
|
|
264
|
-
var tmp$ret$
|
|
265
|
-
destination.x(tmp$ret$
|
|
306
|
+
var tmp$ret$5 = item.aq_1;
|
|
307
|
+
destination.x(tmp$ret$5);
|
|
266
308
|
}
|
|
267
|
-
var tmp$ret$
|
|
309
|
+
var tmp$ret$2 = _NonEmptyList___init__impl__fxd0xp(destination);
|
|
268
310
|
// Inline function 'arrow.core.nel' call
|
|
269
|
-
var this_1 = new Emitted(tmp, joinToString(new NonEmptyList(tmp$ret$
|
|
311
|
+
var this_1 = new Emitted(tmp, joinToString(new NonEmptyList(tmp$ret$2), '\n'));
|
|
270
312
|
return _NonEmptyList___init__impl__fxd0xp(listOf(this_1));
|
|
271
313
|
};
|
|
272
|
-
protoOf(WirespecEmitter).
|
|
314
|
+
protoOf(WirespecEmitter).os = function (_this__u8e3s4) {
|
|
273
315
|
var tmp;
|
|
274
316
|
if (_this__u8e3s4 instanceof RegExp_0) {
|
|
275
|
-
tmp = '(' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.
|
|
317
|
+
tmp = '(' + _RegExp___get_value__impl__7o7618(_this__u8e3s4.k19_1) + ')';
|
|
276
318
|
} else {
|
|
277
319
|
if (_this__u8e3s4 instanceof Bound) {
|
|
278
|
-
var tmp1_elvis_lhs = _this__u8e3s4.
|
|
320
|
+
var tmp1_elvis_lhs = _this__u8e3s4.p18_1;
|
|
279
321
|
var tmp_0 = tmp1_elvis_lhs == null ? '_' : tmp1_elvis_lhs;
|
|
280
|
-
var tmp2_elvis_lhs = _this__u8e3s4.
|
|
322
|
+
var tmp2_elvis_lhs = _this__u8e3s4.q18_1;
|
|
281
323
|
tmp = '(' + tmp_0 + ', ' + (tmp2_elvis_lhs == null ? '_' : tmp2_elvis_lhs) + ')';
|
|
282
324
|
} else {
|
|
283
325
|
noWhenBranchMatchedException();
|
|
@@ -285,14 +327,14 @@ protoOf(WirespecEmitter).gs = function (_this__u8e3s4) {
|
|
|
285
327
|
}
|
|
286
328
|
return tmp;
|
|
287
329
|
};
|
|
288
|
-
function emitPath($this,
|
|
289
|
-
return '/' + joinToString(
|
|
290
|
-
}
|
|
291
|
-
function emitRequest($this,
|
|
292
|
-
var tmp0_safe_receiver = firstOrNull(
|
|
293
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
294
|
-
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
295
|
-
var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : $this.
|
|
330
|
+
function emitPath($this, $receiver) {
|
|
331
|
+
return '/' + joinToString($receiver, '/', VOID, VOID, VOID, VOID, WirespecEndpointDefinitionEmitter$emitPath$lambda($this));
|
|
332
|
+
}
|
|
333
|
+
function emitRequest($this, $receiver) {
|
|
334
|
+
var tmp0_safe_receiver = firstOrNull($receiver);
|
|
335
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.er_1;
|
|
336
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.gr_1;
|
|
337
|
+
var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : $this.ns(tmp2_safe_receiver);
|
|
296
338
|
var tmp;
|
|
297
339
|
if (tmp3_safe_receiver == null) {
|
|
298
340
|
tmp = null;
|
|
@@ -304,12 +346,12 @@ function emitRequest($this, _this__u8e3s4) {
|
|
|
304
346
|
var tmp0_elvis_lhs = tmp;
|
|
305
347
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
306
348
|
}
|
|
307
|
-
function emitQuery($this,
|
|
349
|
+
function emitQuery($this, $receiver) {
|
|
308
350
|
// Inline function 'kotlin.takeIf' call
|
|
309
351
|
var tmp;
|
|
310
352
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
311
|
-
if (
|
|
312
|
-
tmp =
|
|
353
|
+
if (!$receiver.r()) {
|
|
354
|
+
tmp = $receiver;
|
|
313
355
|
} else {
|
|
314
356
|
tmp = null;
|
|
315
357
|
}
|
|
@@ -332,12 +374,12 @@ function emitQuery($this, _this__u8e3s4) {
|
|
|
332
374
|
var tmp0_elvis_lhs = tmp_1;
|
|
333
375
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
334
376
|
}
|
|
335
|
-
function emitHeader($this,
|
|
377
|
+
function emitHeader($this, $receiver) {
|
|
336
378
|
// Inline function 'kotlin.takeIf' call
|
|
337
379
|
var tmp;
|
|
338
380
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
339
|
-
if (
|
|
340
|
-
tmp =
|
|
381
|
+
if (!$receiver.r()) {
|
|
382
|
+
tmp = $receiver;
|
|
341
383
|
} else {
|
|
342
384
|
tmp = null;
|
|
343
385
|
}
|
|
@@ -363,30 +405,21 @@ function emitHeader($this, _this__u8e3s4) {
|
|
|
363
405
|
function WirespecEndpointDefinitionEmitter$emit$lambda(this$0) {
|
|
364
406
|
return function (it) {
|
|
365
407
|
var tmp = Spacer_instance.toString();
|
|
366
|
-
var tmp_0 = fixStatus(it.
|
|
367
|
-
var tmp0_safe_receiver = it.
|
|
368
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
369
|
-
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : this$0.
|
|
370
|
-
|
|
371
|
-
var tmp_2;
|
|
372
|
-
var tmp3_safe_receiver = it.yq_1;
|
|
373
|
-
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.vq_1;
|
|
374
|
-
if ((tmp4_safe_receiver == null ? null : tmp4_safe_receiver.dv()) === true) {
|
|
375
|
-
tmp_2 = '?';
|
|
376
|
-
} else {
|
|
377
|
-
tmp_2 = '';
|
|
378
|
-
}
|
|
379
|
-
return tmp + tmp_0 + ' -> ' + tmp_1 + tmp_2 + emitHeader(this$0, it.xq_1);
|
|
408
|
+
var tmp_0 = fixStatus(it.hr_1);
|
|
409
|
+
var tmp0_safe_receiver = it.jr_1;
|
|
410
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gr_1;
|
|
411
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : this$0.ns(tmp1_safe_receiver);
|
|
412
|
+
return tmp + tmp_0 + ' -> ' + (tmp2_elvis_lhs == null ? 'Unit' : tmp2_elvis_lhs) + emitHeader(this$0, it.ir_1);
|
|
380
413
|
};
|
|
381
414
|
}
|
|
382
415
|
function WirespecEndpointDefinitionEmitter$emitPath$lambda(this$0) {
|
|
383
416
|
return function (it) {
|
|
384
417
|
var tmp;
|
|
385
418
|
if (it instanceof Param) {
|
|
386
|
-
tmp = '{' + it.
|
|
419
|
+
tmp = '{' + it.cr_1.m1() + ': ' + this$0.ns(it.dr_1) + '}';
|
|
387
420
|
} else {
|
|
388
421
|
if (it instanceof Literal) {
|
|
389
|
-
tmp = it.
|
|
422
|
+
tmp = it.q19_1;
|
|
390
423
|
} else {
|
|
391
424
|
noWhenBranchMatchedException();
|
|
392
425
|
}
|
|
@@ -396,29 +429,29 @@ function WirespecEndpointDefinitionEmitter$emitPath$lambda(this$0) {
|
|
|
396
429
|
}
|
|
397
430
|
function WirespecEndpointDefinitionEmitter$emitQuery$lambda(this$0) {
|
|
398
431
|
return function (it) {
|
|
399
|
-
return this$0.
|
|
432
|
+
return this$0.h21(it);
|
|
400
433
|
};
|
|
401
434
|
}
|
|
402
435
|
function WirespecEndpointDefinitionEmitter$emitHeader$lambda(this$0) {
|
|
403
436
|
return function (it) {
|
|
404
|
-
return this$0.
|
|
437
|
+
return this$0.h21(it);
|
|
405
438
|
};
|
|
406
439
|
}
|
|
407
440
|
function WirespecEndpointDefinitionEmitter() {
|
|
408
441
|
}
|
|
409
|
-
function capitalize($this,
|
|
442
|
+
function capitalize($this, $receiver) {
|
|
410
443
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
411
444
|
var tmp;
|
|
412
445
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
413
|
-
if (charSequenceLength(
|
|
446
|
+
if (charSequenceLength($receiver) > 0) {
|
|
414
447
|
// Inline function 'kotlin.text.uppercase' call
|
|
415
|
-
var this_0 = charCodeAt(
|
|
448
|
+
var this_0 = charCodeAt($receiver, 0);
|
|
416
449
|
// Inline function 'kotlin.js.asDynamic' call
|
|
417
450
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
418
|
-
var tmp$ret$
|
|
419
|
-
tmp = toString_0(tmp$ret$
|
|
451
|
+
var tmp$ret$2 = toString(this_0).toUpperCase();
|
|
452
|
+
tmp = toString_0(tmp$ret$2) + substring($receiver, 1);
|
|
420
453
|
} else {
|
|
421
|
-
tmp =
|
|
454
|
+
tmp = $receiver;
|
|
422
455
|
}
|
|
423
456
|
return tmp;
|
|
424
457
|
}
|
|
@@ -431,7 +464,7 @@ function WirespecEnumDefinitionEmitter() {
|
|
|
431
464
|
}
|
|
432
465
|
function Companion() {
|
|
433
466
|
Companion_instance = this;
|
|
434
|
-
this.
|
|
467
|
+
this.m21_1 = setOf(['type', 'enum', 'endpoint', 'part']);
|
|
435
468
|
}
|
|
436
469
|
var Companion_instance;
|
|
437
470
|
function Companion_getInstance() {
|
|
@@ -441,23 +474,25 @@ function Companion_getInstance() {
|
|
|
441
474
|
}
|
|
442
475
|
function WirespecIdentifierEmitter() {
|
|
443
476
|
}
|
|
444
|
-
function
|
|
445
|
-
|
|
477
|
+
function WirespecPartDefinitionEmitter() {
|
|
478
|
+
}
|
|
479
|
+
function emitDecimal($this, $receiver) {
|
|
480
|
+
return '(' + toBoundDecimal($this, $receiver.p18_1) + ', ' + toBoundDecimal($this, $receiver.q18_1) + ')';
|
|
446
481
|
}
|
|
447
|
-
function toBoundDecimal($this,
|
|
448
|
-
return
|
|
482
|
+
function toBoundDecimal($this, $receiver) {
|
|
483
|
+
return $receiver == null ? '_' : contains($receiver, '.') ? $receiver : $receiver + '.0';
|
|
449
484
|
}
|
|
450
485
|
function WirespecRefinedTypeDefinitionEmitter() {
|
|
451
486
|
}
|
|
452
|
-
function emitReturn($this,
|
|
453
|
-
var tmp = $this.
|
|
454
|
-
var tmp0_safe_receiver =
|
|
487
|
+
function emitReturn($this, $receiver) {
|
|
488
|
+
var tmp = $this.ns($receiver.jq_1);
|
|
489
|
+
var tmp0_safe_receiver = $receiver.kq_1;
|
|
455
490
|
var tmp_0;
|
|
456
491
|
if (tmp0_safe_receiver == null) {
|
|
457
492
|
tmp_0 = null;
|
|
458
493
|
} else {
|
|
459
494
|
// Inline function 'kotlin.let' call
|
|
460
|
-
tmp_0 = ' ! ' + $this.
|
|
495
|
+
tmp_0 = ' ! ' + $this.ns(tmp0_safe_receiver);
|
|
461
496
|
}
|
|
462
497
|
// Inline function 'kotlin.text.orEmpty' call
|
|
463
498
|
var tmp0_elvis_lhs = tmp_0;
|
|
@@ -465,33 +500,81 @@ function emitReturn($this, _this__u8e3s4) {
|
|
|
465
500
|
}
|
|
466
501
|
function WirespecRpcDefinitionEmitter() {
|
|
467
502
|
}
|
|
503
|
+
function emit_12($this, $receiver) {
|
|
504
|
+
var tmp;
|
|
505
|
+
if ($receiver instanceof StringValue) {
|
|
506
|
+
tmp = '"' + escape($this, $receiver.p19_1) + '"';
|
|
507
|
+
} else {
|
|
508
|
+
if ($receiver instanceof IntegerValue) {
|
|
509
|
+
tmp = $receiver.n19_1;
|
|
510
|
+
} else {
|
|
511
|
+
if ($receiver instanceof NumberValue) {
|
|
512
|
+
tmp = $receiver.m19_1;
|
|
513
|
+
} else {
|
|
514
|
+
if ($receiver instanceof BooleanValue) {
|
|
515
|
+
tmp = $receiver.o19_1.toString();
|
|
516
|
+
} else {
|
|
517
|
+
if ($receiver instanceof EnumValue) {
|
|
518
|
+
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
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;
|
|
533
|
+
} else {
|
|
534
|
+
if ($receiver instanceof NullValue) {
|
|
535
|
+
tmp = 'null';
|
|
536
|
+
} else {
|
|
537
|
+
noWhenBranchMatchedException();
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return tmp;
|
|
545
|
+
}
|
|
546
|
+
function escape($this, $receiver) {
|
|
547
|
+
return replace(replace(replace(replace(replace($receiver, '\\', '\\\\'), '"', '\\"'), '\n', '\\n'), '\r', '\\r'), '\t', '\\t');
|
|
548
|
+
}
|
|
468
549
|
function WirespecTypeDefinitionEmitter$emit$lambda(this$0) {
|
|
469
550
|
return function (it) {
|
|
470
|
-
return Spacer_instance.toString() + this$0.
|
|
551
|
+
return Spacer_instance.toString() + this$0.h21(it);
|
|
471
552
|
};
|
|
472
553
|
}
|
|
473
554
|
function WirespecTypeDefinitionEmitter() {
|
|
474
555
|
}
|
|
475
556
|
function WirespecUnionDefinitionEmitter$emit$lambda(this$0) {
|
|
476
557
|
return function (it) {
|
|
477
|
-
return this$0.
|
|
558
|
+
return this$0.ns(it);
|
|
478
559
|
};
|
|
479
560
|
}
|
|
480
561
|
function WirespecUnionDefinitionEmitter() {
|
|
481
562
|
}
|
|
482
563
|
//region block: post-declaration
|
|
483
|
-
protoOf(WirespecEmitter).
|
|
484
|
-
protoOf(WirespecEmitter).
|
|
485
|
-
protoOf(WirespecEmitter).
|
|
486
|
-
protoOf(WirespecEmitter).
|
|
487
|
-
protoOf(WirespecEmitter).
|
|
488
|
-
protoOf(WirespecEmitter).
|
|
489
|
-
protoOf(WirespecEmitter).
|
|
490
|
-
protoOf(WirespecEmitter).
|
|
491
|
-
protoOf(WirespecEmitter).
|
|
492
|
-
protoOf(WirespecEmitter).
|
|
493
|
-
protoOf(WirespecEmitter).
|
|
494
|
-
protoOf(WirespecEmitter).
|
|
564
|
+
protoOf(WirespecEmitter).ks = emit_0;
|
|
565
|
+
protoOf(WirespecEmitter).ls = emit_1;
|
|
566
|
+
protoOf(WirespecEmitter).ms = emit_2;
|
|
567
|
+
protoOf(WirespecEmitter).ns = emit_4;
|
|
568
|
+
protoOf(WirespecEmitter).is = emit_7;
|
|
569
|
+
protoOf(WirespecEmitter).ds = emit_9;
|
|
570
|
+
protoOf(WirespecEmitter).js = emit_11;
|
|
571
|
+
protoOf(WirespecEmitter).yr = emit_10;
|
|
572
|
+
protoOf(WirespecEmitter).ur = emit;
|
|
573
|
+
protoOf(WirespecEmitter).xr = emit_5;
|
|
574
|
+
protoOf(WirespecEmitter).wr = emit_6;
|
|
575
|
+
protoOf(WirespecEmitter).vr = emit_8;
|
|
576
|
+
protoOf(WirespecEmitter).h21 = emit_3;
|
|
577
|
+
protoOf(WirespecEmitter).ps = emitValidator;
|
|
495
578
|
//endregion
|
|
496
579
|
//region block: exports
|
|
497
580
|
export {
|