@flock/wirespec 0.18.4 → 0.18.6
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/clikt-clikt-mordant.mjs +39 -39
- package/colormath-root-colormath.mjs +406 -406
- package/kotlin-kotlin-stdlib.mjs +5 -5
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +4585 -4585
- package/kotlin-rgxgen.mjs +1757 -1757
- package/kotlinx-io-kotlinx-io-core.mjs +397 -397
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1616 -1616
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1271 -1271
- package/mordant-mordant.mjs +1097 -1097
- package/package.json +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +189 -188
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +166 -166
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +218 -217
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +303 -292
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +111 -110
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +149 -146
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +25 -25
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +2974 -2934
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +475 -475
- package/wirespec-src-converter-openapi.mjs +365 -365
- package/wirespec-src-plugin-arguments.mjs +115 -115
- package/wirespec-src-plugin-cli.mjs +84 -84
- package/wirespec-src-plugin-npm.mjs +20 -20
- package/wirespec-src-tools-generator.mjs +2 -2
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
sanitizeFieldName1ptgy1kxy8u2m as sanitizeFieldName,
|
|
94
94
|
ConstructorStatement1x4n4sr59iy4n as ConstructorStatement,
|
|
95
95
|
SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
|
|
96
|
-
|
|
96
|
+
Custom_init_$Create$2enn7oyj71j1t as Custom_init_$Create$,
|
|
97
97
|
Namespace345pal554qu3j as Namespace,
|
|
98
98
|
File3dimy4iqmuock as File,
|
|
99
99
|
transformChildrend9p91tpcqdkx as transformChildren_0,
|
|
@@ -132,6 +132,7 @@ import {
|
|
|
132
132
|
convertConstraintkgpvomct0x0s as convertConstraint,
|
|
133
133
|
function12vu2kapzno4w as function_0,
|
|
134
134
|
Switch3a1zi3na98deu as Switch,
|
|
135
|
+
Custom2si7lto3wompr as Custom,
|
|
135
136
|
Case2i7oahw4alz6h as Case,
|
|
136
137
|
RawExpression2bo7ldfrptjia as RawExpression,
|
|
137
138
|
transformChildren2m3cpkz6zusq1 as transformChildren_1,
|
|
@@ -170,7 +171,7 @@ initMetadataForClass(RustIrEmitter, 'RustIrEmitter', RustIrEmitter, VOID, [IrEmi
|
|
|
170
171
|
initMetadataForObject(RustTransform, 'RustTransform');
|
|
171
172
|
//endregion
|
|
172
173
|
function _get_sanitizationConfig__sns434($this) {
|
|
173
|
-
var tmp0 = $this.
|
|
174
|
+
var tmp0 = $this.z1x_1;
|
|
174
175
|
var tmp = KProperty1;
|
|
175
176
|
// Inline function 'kotlin.getValue' call
|
|
176
177
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, RustIrEmitter$_get_sanitizationConfig_$ref_17ypni(), null);
|
|
@@ -234,14 +235,14 @@ function sanitize($this, _this__u8e3s4) {
|
|
|
234
235
|
return toSnakeCase($this, tmp$ret$9);
|
|
235
236
|
}
|
|
236
237
|
function toSnakeCase($this, _this__u8e3s4) {
|
|
237
|
-
return Companion_getInstance().
|
|
238
|
+
return Companion_getInstance().f1h(_this__u8e3s4).y1l();
|
|
238
239
|
}
|
|
239
240
|
function toPascalCase($this, _this__u8e3s4) {
|
|
240
241
|
var tmp = split(_this__u8e3s4, ['_']);
|
|
241
242
|
return joinToString(tmp, '', VOID, VOID, VOID, VOID, RustIrEmitter$toPascalCase$lambda);
|
|
242
243
|
}
|
|
243
244
|
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
244
|
-
return Companion_getInstance_0().
|
|
245
|
+
return Companion_getInstance_0().c1y_1.u1(_this__u8e3s4) ? 'r#' + _this__u8e3s4 : _this__u8e3s4;
|
|
245
246
|
}
|
|
246
247
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
247
248
|
// Inline function 'kotlin.let' call
|
|
@@ -266,7 +267,7 @@ function prependImports($this, _this__u8e3s4, imports) {
|
|
|
266
267
|
var tmp;
|
|
267
268
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
268
269
|
if (!imports.r()) {
|
|
269
|
-
tmp = _this__u8e3s4.
|
|
270
|
+
tmp = _this__u8e3s4.w1m(VOID, plus(imports, _this__u8e3s4.t1m_1));
|
|
270
271
|
} else {
|
|
271
272
|
tmp = _this__u8e3s4;
|
|
272
273
|
}
|
|
@@ -286,7 +287,7 @@ function buildClientParams($this, _this__u8e3s4) {
|
|
|
286
287
|
}
|
|
287
288
|
function Companion() {
|
|
288
289
|
Companion_instance_2 = this;
|
|
289
|
-
this.
|
|
290
|
+
this.c1y_1 = setOf(['as', 'break', 'const', 'continue', 'crate', 'else', 'enum', 'extern', 'false', 'fn', 'for', 'if', 'impl', 'in', 'let', 'loop', 'match', 'mod', 'move', 'mut', 'pub', 'ref', 'return', 'self', 'Self', 'static', 'struct', 'super', 'trait', 'true', 'type', 'unsafe', 'use', 'where', 'while', 'async', 'await', 'dyn', 'abstract', 'become', 'box', 'do', 'final', 'macro', 'override', 'priv', 'typeof', 'unsized', 'virtual', 'yield', 'try']);
|
|
290
291
|
}
|
|
291
292
|
var Companion_instance_2;
|
|
292
293
|
function Companion_getInstance_0() {
|
|
@@ -295,16 +296,16 @@ function Companion_getInstance_0() {
|
|
|
295
296
|
return Companion_instance_2;
|
|
296
297
|
}
|
|
297
298
|
function sam$kotlin_Comparator$0(function_0) {
|
|
298
|
-
this.
|
|
299
|
+
this.d1y_1 = function_0;
|
|
299
300
|
}
|
|
300
301
|
protoOf(sam$kotlin_Comparator$0).qd = function (a, b) {
|
|
301
|
-
return this.
|
|
302
|
+
return this.d1y_1(a, b);
|
|
302
303
|
};
|
|
303
304
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
304
305
|
return this.qd(a, b);
|
|
305
306
|
};
|
|
306
307
|
protoOf(sam$kotlin_Comparator$0).l3 = function () {
|
|
307
|
-
return this.
|
|
308
|
+
return this.d1y_1;
|
|
308
309
|
};
|
|
309
310
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
310
311
|
var tmp;
|
|
@@ -328,16 +329,16 @@ function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
328
329
|
return 'r#' + it;
|
|
329
330
|
}
|
|
330
331
|
function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
331
|
-
return Companion_getInstance().
|
|
332
|
+
return Companion_getInstance().f1h((new Name(name.g1h_1)).y1l());
|
|
332
333
|
}
|
|
333
334
|
function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
334
|
-
var value = name.
|
|
335
|
+
var value = name.s1h();
|
|
335
336
|
switch (value) {
|
|
336
337
|
case 'self':
|
|
337
338
|
case '&self':
|
|
338
339
|
return name;
|
|
339
340
|
default:
|
|
340
|
-
return Companion_getInstance().
|
|
341
|
+
return Companion_getInstance().f1h((new Name(name.g1h_1)).y1l());
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
344
|
function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
@@ -347,9 +348,9 @@ function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
347
348
|
return function (stmt, tr) {
|
|
348
349
|
var tmp;
|
|
349
350
|
if (stmt instanceof ConstructorStatement) {
|
|
350
|
-
var tmp_0 = tr.
|
|
351
|
+
var tmp_0 = tr.p1t(stmt.p1m_1);
|
|
351
352
|
// Inline function 'kotlin.collections.map' call
|
|
352
|
-
var this_0 = stmt.
|
|
353
|
+
var this_0 = stmt.q1m_1;
|
|
353
354
|
// Inline function 'kotlin.collections.mapTo' call
|
|
354
355
|
var destination = ArrayList_init_$Create$(this_0.a1());
|
|
355
356
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -360,7 +361,7 @@ function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
360
361
|
var k = item.k1();
|
|
361
362
|
// Inline function 'kotlin.collections.component2' call
|
|
362
363
|
var v = item.l1();
|
|
363
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
364
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.s1t(v));
|
|
364
365
|
destination.x(tmp$ret$3);
|
|
365
366
|
}
|
|
366
367
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -372,7 +373,7 @@ function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
372
373
|
}
|
|
373
374
|
function RustIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
374
375
|
return function () {
|
|
375
|
-
var tmp0_reservedKeywords = minus(Companion_getInstance_0().
|
|
376
|
+
var tmp0_reservedKeywords = minus(Companion_getInstance_0().c1y_1, setOf(['self', 'Self']));
|
|
376
377
|
var tmp = RustIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
377
378
|
var tmp_0 = RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
378
379
|
var tmp_1 = RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -386,69 +387,69 @@ function RustIrEmitter$_get_sanitizationConfig_$ref_17ypni() {
|
|
|
386
387
|
};
|
|
387
388
|
}
|
|
388
389
|
function RustIrEmitter$emitShared$lambda($this$interface) {
|
|
389
|
-
$this$interface.
|
|
390
|
+
$this$interface.e1j(Custom_init_$Create$('Headers'));
|
|
390
391
|
return Unit_instance;
|
|
391
392
|
}
|
|
392
393
|
function RustIrEmitter$emitShared$lambda_0($this$interface) {
|
|
393
|
-
$this$interface.
|
|
394
|
+
$this$interface.e1j(Custom_init_$Create$('Headers'));
|
|
394
395
|
return Unit_instance;
|
|
395
396
|
}
|
|
396
397
|
function RustIrEmitter$emitShared$lambda_1($this$interface) {
|
|
397
|
-
$this$interface.
|
|
398
|
-
$this$interface.
|
|
399
|
-
$this$interface.
|
|
398
|
+
$this$interface.e1j(Custom_init_$Create$('Sized'));
|
|
399
|
+
$this$interface.b1i('label', VOID, VOID, RustIrEmitter$emitShared$lambda$lambda);
|
|
400
|
+
$this$interface.b1i('from_label', true, VOID, RustIrEmitter$emitShared$lambda$lambda_0);
|
|
400
401
|
return Unit_instance;
|
|
401
402
|
}
|
|
402
403
|
function RustIrEmitter$emitShared$lambda$lambda($this$function) {
|
|
403
|
-
$this$function.
|
|
404
|
-
$this$function.
|
|
404
|
+
$this$function.l1i('&self', Custom_init_$Create$(''));
|
|
405
|
+
$this$function.k1i(Custom_init_$Create$('&str'));
|
|
405
406
|
return Unit_instance;
|
|
406
407
|
}
|
|
407
408
|
function RustIrEmitter$emitShared$lambda$lambda_0($this$function) {
|
|
408
|
-
$this$function.
|
|
409
|
-
$this$function.
|
|
409
|
+
$this$function.l1i('s', Custom_init_$Create$('&str'));
|
|
410
|
+
$this$function.k1i(Custom_init_$Create$('Option<Self>'));
|
|
410
411
|
return Unit_instance;
|
|
411
412
|
}
|
|
412
413
|
function RustIrEmitter$emitShared$lambda_2($this$interface) {
|
|
413
|
-
$this$interface.
|
|
414
|
-
$this$interface.
|
|
415
|
-
$this$interface.
|
|
414
|
+
$this$interface.a1i($this$interface.t1h('T', []), []);
|
|
415
|
+
$this$interface.b1i('value', VOID, VOID, RustIrEmitter$emitShared$lambda$lambda_1);
|
|
416
|
+
$this$interface.b1i('validate', VOID, VOID, RustIrEmitter$emitShared$lambda$lambda_2);
|
|
416
417
|
return Unit_instance;
|
|
417
418
|
}
|
|
418
419
|
function RustIrEmitter$emitShared$lambda$lambda_1($this$function) {
|
|
419
|
-
$this$function.
|
|
420
|
-
$this$function.
|
|
420
|
+
$this$function.l1i('&self', Custom_init_$Create$(''));
|
|
421
|
+
$this$function.k1i(borrow($this$function.t1h('T', [])));
|
|
421
422
|
return Unit_instance;
|
|
422
423
|
}
|
|
423
424
|
function RustIrEmitter$emitShared$lambda$lambda_2($this$function) {
|
|
424
|
-
$this$function.
|
|
425
|
-
$this$function.
|
|
425
|
+
$this$function.l1i('&self', Custom_init_$Create$(''));
|
|
426
|
+
$this$function.k1i($this$function.s1i());
|
|
426
427
|
return Unit_instance;
|
|
427
428
|
}
|
|
428
429
|
function RustIrEmitter$emitShared$lambda_3($this$interface) {
|
|
429
|
-
$this$interface.
|
|
430
|
-
$this$interface.
|
|
431
|
-
$this$interface.
|
|
432
|
-
$this$interface.
|
|
433
|
-
$this$interface.
|
|
434
|
-
$this$interface.
|
|
430
|
+
$this$interface.a1i($this$interface.t1h('T', []), []);
|
|
431
|
+
$this$interface.m1i('path', borrowDyn($this$interface.t1h('Path', [])));
|
|
432
|
+
$this$interface.m1i('method', borrow($this$interface.t1h('Method', [])));
|
|
433
|
+
$this$interface.m1i('queries', borrowDyn($this$interface.t1h('Queries', [])));
|
|
434
|
+
$this$interface.m1i('headers', borrowDyn($this$interface.t1h('RequestHeaders', [])));
|
|
435
|
+
$this$interface.m1i('body', borrow($this$interface.t1h('T', [])));
|
|
435
436
|
return Unit_instance;
|
|
436
437
|
}
|
|
437
438
|
function RustIrEmitter$emitShared$lambda_4($this$interface) {
|
|
438
|
-
$this$interface.
|
|
439
|
-
$this$interface.
|
|
440
|
-
$this$interface.
|
|
441
|
-
$this$interface.
|
|
439
|
+
$this$interface.a1i($this$interface.t1h('T', []), []);
|
|
440
|
+
$this$interface.m1i('status', $this$interface.l1t());
|
|
441
|
+
$this$interface.m1i('headers', borrowDyn($this$interface.t1h('ResponseHeaders', [])));
|
|
442
|
+
$this$interface.m1i('body', borrow($this$interface.t1h('T', [])));
|
|
442
443
|
return Unit_instance;
|
|
443
444
|
}
|
|
444
445
|
function RustIrEmitter$emitShared$lambda_5($this$interface) {
|
|
445
|
-
$this$interface.
|
|
446
|
+
$this$interface.o1j('transport', VOID, VOID, RustIrEmitter$emitShared$lambda$lambda_3);
|
|
446
447
|
return Unit_instance;
|
|
447
448
|
}
|
|
448
449
|
function RustIrEmitter$emitShared$lambda$lambda_3($this$asyncFunction) {
|
|
449
|
-
$this$asyncFunction.
|
|
450
|
-
$this$asyncFunction.
|
|
451
|
-
$this$asyncFunction.
|
|
450
|
+
$this$asyncFunction.l1i('&self', Custom_init_$Create$(''));
|
|
451
|
+
$this$asyncFunction.l1i('request', borrow($this$asyncFunction.t1h('RawRequest', [])));
|
|
452
|
+
$this$asyncFunction.k1i($this$asyncFunction.t1h('RawResponse', []));
|
|
452
453
|
return Unit_instance;
|
|
453
454
|
}
|
|
454
455
|
function RustIrEmitter$emitShared$lambda_6($rustImports) {
|
|
@@ -456,7 +457,7 @@ function RustIrEmitter$emitShared$lambda_6($rustImports) {
|
|
|
456
457
|
var tmp;
|
|
457
458
|
if (element instanceof File) {
|
|
458
459
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
459
|
-
var tmp0 = element.
|
|
460
|
+
var tmp0 = element.t1m_1;
|
|
460
461
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
461
462
|
var destination = ArrayList_init_$Create$_0();
|
|
462
463
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -467,7 +468,7 @@ function RustIrEmitter$emitShared$lambda_6($rustImports) {
|
|
|
467
468
|
}
|
|
468
469
|
}
|
|
469
470
|
var namespace = first(destination);
|
|
470
|
-
tmp = element.
|
|
471
|
+
tmp = element.w1m(VOID, plus($rustImports, namespace.z1m_1));
|
|
471
472
|
} else {
|
|
472
473
|
tmp = element;
|
|
473
474
|
}
|
|
@@ -479,7 +480,7 @@ function RustIrEmitter$emitShared$lambda_7(element, transformer) {
|
|
|
479
480
|
var tmp;
|
|
480
481
|
if (element instanceof Enum) {
|
|
481
482
|
var tmp_0;
|
|
482
|
-
if (element.
|
|
483
|
+
if (element.x1n_1.equals(Companion_getInstance().f1h('Method'))) {
|
|
483
484
|
tmp_0 = new RawElement('#[derive(Debug, Clone, Default, PartialEq)]\npub enum Method {\n #[default]\n GET,\n PUT,\n POST,\n DELETE,\n OPTIONS,\n HEAD,\n PATCH,\n TRACE,\n}');
|
|
484
485
|
} else {
|
|
485
486
|
tmp_0 = element;
|
|
@@ -496,7 +497,7 @@ function RustIrEmitter$emitShared$lambda_8($dslTraits, $requestHeaders, $respons
|
|
|
496
497
|
var tmp;
|
|
497
498
|
if (element instanceof File) {
|
|
498
499
|
// Inline function 'kotlin.collections.flatMap' call
|
|
499
|
-
var tmp0 = element.
|
|
500
|
+
var tmp0 = element.t1m_1;
|
|
500
501
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
501
502
|
var destination = ArrayList_init_$Create$_0();
|
|
502
503
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -508,7 +509,7 @@ function RustIrEmitter$emitShared$lambda_8($dslTraits, $requestHeaders, $respons
|
|
|
508
509
|
tmp$ret$0 = listOf(element_0);
|
|
509
510
|
break $l$block;
|
|
510
511
|
}
|
|
511
|
-
var name = element_0.
|
|
512
|
+
var name = element_0.k1n_1.h1h();
|
|
512
513
|
var tmp_0;
|
|
513
514
|
// Inline function 'kotlin.collections.contains' call
|
|
514
515
|
// Inline function 'kotlin.collections.containsKey' call
|
|
@@ -542,7 +543,7 @@ function RustIrEmitter$emitShared$lambda_8($dslTraits, $requestHeaders, $respons
|
|
|
542
543
|
addAll(destination, list);
|
|
543
544
|
}
|
|
544
545
|
var newElements = plus_0(plus_0(destination, $client), $server);
|
|
545
|
-
tmp = element.
|
|
546
|
+
tmp = element.w1m(VOID, newElements);
|
|
546
547
|
} else {
|
|
547
548
|
tmp = element;
|
|
548
549
|
}
|
|
@@ -558,14 +559,14 @@ function RustIrEmitter$emitShared$lambda_9(element, transformer) {
|
|
|
558
559
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
559
560
|
var tmp_0 = scope;
|
|
560
561
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
561
|
-
var this_0 = scope.
|
|
562
|
+
var this_0 = scope.x1t_1;
|
|
562
563
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
563
564
|
// Inline function 'kotlin.apply' call
|
|
564
565
|
var this_1 = new TransformerBuilder();
|
|
565
566
|
this_1.c1h(RustIrEmitter$emitShared$lambda$lambda_4);
|
|
566
567
|
var tmp$ret$2 = this_1.d1h();
|
|
567
|
-
tmp_0.
|
|
568
|
-
var tmp_1 = scope.
|
|
568
|
+
tmp_0.x1t_1 = transform(this_0, tmp$ret$2);
|
|
569
|
+
var tmp_1 = scope.x1t_1;
|
|
569
570
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
570
571
|
} else {
|
|
571
572
|
tmp = element;
|
|
@@ -576,7 +577,7 @@ function RustIrEmitter$emitShared$lambda_9(element, transformer) {
|
|
|
576
577
|
function RustIrEmitter$emitShared$lambda$lambda_4(element, transformer) {
|
|
577
578
|
var tmp;
|
|
578
579
|
if (element instanceof Function) {
|
|
579
|
-
var tmp0 = element.
|
|
580
|
+
var tmp0 = element.v1j_1;
|
|
580
581
|
var tmp$ret$0;
|
|
581
582
|
$l$block_0: {
|
|
582
583
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -593,7 +594,7 @@ function RustIrEmitter$emitShared$lambda$lambda_4(element, transformer) {
|
|
|
593
594
|
var _iterator__ex2g4s = tmp0.t();
|
|
594
595
|
while (_iterator__ex2g4s.u()) {
|
|
595
596
|
var element_0 = _iterator__ex2g4s.v();
|
|
596
|
-
if (element_0.
|
|
597
|
+
if (element_0.u1o_1.s1h() === '&self' || element_0.u1o_1.s1h() === 'self') {
|
|
597
598
|
tmp$ret$0 = true;
|
|
598
599
|
break $l$block_0;
|
|
599
600
|
}
|
|
@@ -601,7 +602,7 @@ function RustIrEmitter$emitShared$lambda$lambda_4(element, transformer) {
|
|
|
601
602
|
tmp$ret$0 = false;
|
|
602
603
|
}
|
|
603
604
|
var hasSelf = tmp$ret$0;
|
|
604
|
-
tmp = hasSelf || element.
|
|
605
|
+
tmp = hasSelf || element.z1j_1 ? element : element.b1k(VOID, VOID, plus(listOf(get_rustSelfParam()), element.v1j_1));
|
|
605
606
|
} else {
|
|
606
607
|
tmp = element;
|
|
607
608
|
}
|
|
@@ -612,7 +613,7 @@ function RustIrEmitter$emitShared$lambda_10(group) {
|
|
|
612
613
|
return trimEnd(joinToString(group, '', VOID, VOID, VOID, VOID, RustIrEmitter$emitShared$lambda$lambda_5), charArrayOf([_Char___init__impl__6a9atx(10)]));
|
|
613
614
|
}
|
|
614
615
|
function RustIrEmitter$emitShared$lambda$lambda_5(it) {
|
|
615
|
-
return RustGenerator_instance.
|
|
616
|
+
return RustGenerator_instance.l1u(it);
|
|
616
617
|
}
|
|
617
618
|
function RustIrEmitter$emit$lambda(a, b) {
|
|
618
619
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
@@ -661,38 +662,38 @@ function RustIrEmitter$toPascalCase$lambda(s) {
|
|
|
661
662
|
function RustIrEmitter$buildClientParams$lambda(this$0) {
|
|
662
663
|
return function (_destruct__k2r9zo) {
|
|
663
664
|
var name = _destruct__k2r9zo.ne();
|
|
664
|
-
return sanitizeKeywords(this$0, name.
|
|
665
|
+
return sanitizeKeywords(this$0, name.y1l());
|
|
665
666
|
};
|
|
666
667
|
}
|
|
667
668
|
function RustIrEmitter$buildClientParams$lambda_0(this$0) {
|
|
668
669
|
return function (_destruct__k2r9zo) {
|
|
669
670
|
var name = _destruct__k2r9zo.ne();
|
|
670
671
|
var type = _destruct__k2r9zo.oe();
|
|
671
|
-
var tmp = sanitizeKeywords(this$0, name.
|
|
672
|
+
var tmp = sanitizeKeywords(this$0, name.y1l());
|
|
672
673
|
// Inline function 'kotlin.with' call
|
|
673
|
-
return tmp + ': ' + RustTransform_getInstance().
|
|
674
|
+
return tmp + ': ' + RustTransform_getInstance().k1y(type);
|
|
674
675
|
};
|
|
675
676
|
}
|
|
676
677
|
function RustIrEmitter(packageName, emitShared) {
|
|
677
678
|
Companion_getInstance_0();
|
|
678
679
|
packageName = packageName === VOID ? Companion_instance_0.lr('community.flock.wirespec.generated') : packageName;
|
|
679
680
|
emitShared = emitShared === VOID ? Companion_instance_1.go() : emitShared;
|
|
680
|
-
this.
|
|
681
|
-
this.
|
|
682
|
-
this.
|
|
683
|
-
this.
|
|
681
|
+
this.v1x_1 = packageName;
|
|
682
|
+
this.w1x_1 = emitShared;
|
|
683
|
+
this.x1x_1 = RustGenerator_instance;
|
|
684
|
+
this.y1x_1 = FileExtension_Rust_getInstance();
|
|
684
685
|
var tmp = this;
|
|
685
|
-
tmp.
|
|
686
|
-
this.z1x_1 = listOf_0([import_0('super::super::wirespec', '*'), import_0('', 'regex')]);
|
|
686
|
+
tmp.z1x_1 = lazy(RustIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
687
687
|
this.a1y_1 = listOf_0([import_0('super::super::wirespec', '*'), import_0('', 'regex')]);
|
|
688
|
+
this.b1y_1 = listOf_0([import_0('super::super::wirespec', '*'), import_0('', 'regex')]);
|
|
688
689
|
}
|
|
689
|
-
protoOf(RustIrEmitter).
|
|
690
|
-
return this.
|
|
690
|
+
protoOf(RustIrEmitter).k1u = function () {
|
|
691
|
+
return this.x1x_1;
|
|
691
692
|
};
|
|
692
693
|
protoOf(RustIrEmitter).eq = function () {
|
|
693
|
-
return this.
|
|
694
|
+
return this.y1x_1;
|
|
694
695
|
};
|
|
695
|
-
protoOf(RustIrEmitter).
|
|
696
|
+
protoOf(RustIrEmitter).n1u = function () {
|
|
696
697
|
var rustImports = listOf_0([import_0('std::any', 'TypeId'), import_0('std::collections', 'HashMap')]);
|
|
697
698
|
var requestHeaders = interface_0('RequestHeaders', VOID, RustIrEmitter$emitShared$lambda);
|
|
698
699
|
var responseHeaders = interface_0('ResponseHeaders', VOID, RustIrEmitter$emitShared$lambda_0);
|
|
@@ -711,38 +712,38 @@ protoOf(RustIrEmitter).m1u = function () {
|
|
|
711
712
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
712
713
|
var tmp = scope;
|
|
713
714
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
714
|
-
var this_1 = scope.
|
|
715
|
+
var this_1 = scope.x1t_1;
|
|
715
716
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
716
717
|
// Inline function 'kotlin.apply' call
|
|
717
718
|
var this_2 = new TransformerBuilder();
|
|
718
719
|
this_2.c1h(RustIrEmitter$emitShared$lambda_6(rustImports));
|
|
719
720
|
var tmp$ret$2 = this_2.d1h();
|
|
720
|
-
tmp.
|
|
721
|
+
tmp.x1t_1 = transform(this_1, tmp$ret$2);
|
|
721
722
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
722
723
|
var tmp_0 = scope;
|
|
723
724
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
724
|
-
var this_3 = scope.
|
|
725
|
+
var this_3 = scope.x1t_1;
|
|
725
726
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
726
727
|
// Inline function 'kotlin.apply' call
|
|
727
728
|
var this_4 = new TransformerBuilder();
|
|
728
729
|
this_4.c1h(RustIrEmitter$emitShared$lambda_7);
|
|
729
730
|
var tmp$ret$7 = this_4.d1h();
|
|
730
|
-
tmp_0.
|
|
731
|
+
tmp_0.x1t_1 = transform(this_3, tmp$ret$7);
|
|
731
732
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
732
733
|
var tmp_1 = scope;
|
|
733
734
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
734
|
-
var this_5 = scope.
|
|
735
|
+
var this_5 = scope.x1t_1;
|
|
735
736
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
736
737
|
// Inline function 'kotlin.apply' call
|
|
737
738
|
var this_6 = new TransformerBuilder();
|
|
738
739
|
this_6.c1h(RustIrEmitter$emitShared$lambda_8(dslTraits, requestHeaders, responseHeaders, rawElementInterfaces, client, server));
|
|
739
740
|
var tmp$ret$12 = this_6.d1h();
|
|
740
|
-
tmp_1.
|
|
741
|
-
var tmp_2 = scope.
|
|
741
|
+
tmp_1.x1t_1 = transform(this_5, tmp$ret$12);
|
|
742
|
+
var tmp_2 = scope.x1t_1;
|
|
742
743
|
// Inline function 'kotlin.let' call
|
|
743
744
|
var file = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
744
745
|
// Inline function 'kotlin.collections.flatMap' call
|
|
745
|
-
var tmp0 = file.
|
|
746
|
+
var tmp0 = file.t1m_1;
|
|
746
747
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
747
748
|
var destination = ArrayList_init_$Create$_0();
|
|
748
749
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -755,7 +756,7 @@ protoOf(RustIrEmitter).m1u = function () {
|
|
|
755
756
|
break $l$block;
|
|
756
757
|
}
|
|
757
758
|
var derive;
|
|
758
|
-
switch (element.
|
|
759
|
+
switch (element.d1n_1.h1h()) {
|
|
759
760
|
case 'RawRequest':
|
|
760
761
|
case 'RawResponse':
|
|
761
762
|
derive = '#[derive(Debug, Clone, PartialEq)]';
|
|
@@ -764,29 +765,29 @@ protoOf(RustIrEmitter).m1u = function () {
|
|
|
764
765
|
derive = '#[derive(Debug, Clone, Default, PartialEq)]';
|
|
765
766
|
break;
|
|
766
767
|
}
|
|
767
|
-
tmp$ret$17 = listOf(new File(element.
|
|
768
|
+
tmp$ret$17 = listOf(new File(element.d1n_1, listOf_0([new RawElement(derive), element])));
|
|
768
769
|
}
|
|
769
770
|
var list = tmp$ret$17;
|
|
770
771
|
addAll(destination, list);
|
|
771
772
|
}
|
|
772
|
-
var tmp0_0 = new File(file.
|
|
773
|
+
var tmp0_0 = new File(file.s1m_1, destination);
|
|
773
774
|
// Inline function 'kotlin.let' call
|
|
774
|
-
var wirespecFile = RustTransform_getInstance().
|
|
775
|
+
var wirespecFile = RustTransform_getInstance().l1y(tmp0_0);
|
|
775
776
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
776
777
|
var scope_0 = new TransformScope(wirespecFile);
|
|
777
778
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
778
779
|
var tmp_3 = scope_0;
|
|
779
780
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
780
|
-
var this_7 = scope_0.
|
|
781
|
+
var this_7 = scope_0.x1t_1;
|
|
781
782
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
782
783
|
// Inline function 'kotlin.apply' call
|
|
783
784
|
var this_8 = new TransformerBuilder();
|
|
784
785
|
this_8.c1h(RustIrEmitter$emitShared$lambda_9);
|
|
785
786
|
var tmp$ret$26 = this_8.d1h();
|
|
786
|
-
tmp_3.
|
|
787
|
-
var tmp_4 = scope_0.
|
|
787
|
+
tmp_3.x1t_1 = transform(this_7, tmp$ret$26);
|
|
788
|
+
var tmp_4 = scope_0.x1t_1;
|
|
788
789
|
// Inline function 'kotlin.let' call
|
|
789
|
-
var tmp0_1 = (isInterface(tmp_4, Element) ? tmp_4 : THROW_CCE()).
|
|
790
|
+
var tmp0_1 = (isInterface(tmp_4, Element) ? tmp_4 : THROW_CCE()).t1m_1;
|
|
790
791
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
791
792
|
// Inline function 'kotlin.collections.fold' call
|
|
792
793
|
var accumulator = ArrayList_init_$Create$_0();
|
|
@@ -807,14 +808,14 @@ protoOf(RustIrEmitter).m1u = function () {
|
|
|
807
808
|
var groups = accumulator;
|
|
808
809
|
var source = joinToString(groups, '\n\n', VOID, VOID, VOID, VOID, RustIrEmitter$emitShared$lambda_10) + '\n';
|
|
809
810
|
var tmp_6;
|
|
810
|
-
if (this.
|
|
811
|
-
tmp_6 = new File(Companion_getInstance().
|
|
811
|
+
if (this.w1x_1.ho_1) {
|
|
812
|
+
tmp_6 = new File(Companion_getInstance().f1h(this.v1x_1.or() + 'wirespec'), listOf(new RawElement(source)));
|
|
812
813
|
} else {
|
|
813
814
|
tmp_6 = null;
|
|
814
815
|
}
|
|
815
816
|
return tmp_6;
|
|
816
817
|
};
|
|
817
|
-
protoOf(RustIrEmitter).
|
|
818
|
+
protoOf(RustIrEmitter).m1u = function (module_0, logger) {
|
|
818
819
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
819
820
|
var this_0 = new NonEmptyList(module_0.dq_1);
|
|
820
821
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
@@ -846,9 +847,9 @@ protoOf(RustIrEmitter).l1u = function (module_0, logger) {
|
|
|
846
847
|
tmp_1 = '';
|
|
847
848
|
}
|
|
848
849
|
var clientMod = tmp_1;
|
|
849
|
-
var modRs = new File(Companion_getInstance().
|
|
850
|
-
var modEndpoint = new File(Companion_getInstance().
|
|
851
|
-
var tmp_2 = Companion_getInstance().
|
|
850
|
+
var modRs = new File(Companion_getInstance().f1h(this.v1x_1.or() + 'mod'), listOf(new RawElement('#![allow(warnings)]\npub mod model;\npub mod endpoint;' + clientMod + '\npub mod wirespec;')));
|
|
851
|
+
var modEndpoint = new File(Companion_getInstance().f1h(this.v1x_1.or() + 'endpoint/' + 'mod'), listOf(new RawElement(endpointMods)));
|
|
852
|
+
var tmp_2 = Companion_getInstance().f1h(this.v1x_1.or() + 'model/' + 'mod');
|
|
852
853
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
853
854
|
var tmp0_0 = new NonEmptyList(module_0.dq_1);
|
|
854
855
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
@@ -862,23 +863,23 @@ protoOf(RustIrEmitter).l1u = function (module_0, logger) {
|
|
|
862
863
|
}
|
|
863
864
|
var tmp_3 = destination_0;
|
|
864
865
|
var modModel = new File(tmp_2, listOf(new RawElement(joinToString(tmp_3, '\n', VOID, VOID, VOID, VOID, RustIrEmitter$emit$lambda_1(this)))));
|
|
865
|
-
return this.
|
|
866
|
+
return this.w1x_1.ho_1 ? NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(files, modRs), modEndpoint), modModel) : NonEmptyList__plus_impl_xqmb9(files, modRs);
|
|
866
867
|
};
|
|
867
868
|
protoOf(RustIrEmitter).uq = function (definition, module_0, logger) {
|
|
868
|
-
var subPackageName = plus_1(this.
|
|
869
|
+
var subPackageName = plus_1(this.v1x_1, definition);
|
|
869
870
|
var tmp;
|
|
870
871
|
if (definition instanceof Endpoint) {
|
|
871
|
-
tmp = this.
|
|
872
|
+
tmp = this.b1y_1;
|
|
872
873
|
} else {
|
|
873
|
-
tmp = this.
|
|
874
|
+
tmp = this.a1y_1;
|
|
874
875
|
}
|
|
875
876
|
var importHeader = tmp;
|
|
876
877
|
var tmp0 = emit_0.call(this, definition, module_0, logger);
|
|
877
878
|
// Inline function 'kotlin.let' call
|
|
878
|
-
var file = RustTransform_getInstance().
|
|
879
|
-
var tmp_0 = Companion_getInstance().
|
|
879
|
+
var file = RustTransform_getInstance().l1y(tmp0);
|
|
880
|
+
var tmp_0 = Companion_getInstance().f1h(subPackageName.or() + toSnakeCase(this, file.s1m_1.h1h()));
|
|
880
881
|
// Inline function 'kotlin.collections.flatMap' call
|
|
881
|
-
var tmp0_0 = file.
|
|
882
|
+
var tmp0_0 = file.t1m_1;
|
|
882
883
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
883
884
|
var destination = ArrayList_init_$Create$_0();
|
|
884
885
|
var _iterator__ex2g4s = tmp0_0.t();
|
|
@@ -923,20 +924,20 @@ protoOf(RustIrEmitter).jr = function (endpoint) {
|
|
|
923
924
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
924
925
|
var this_0 = stripResponseGenerics(stripHandlerExtends(convertSimpleRawExpressionsToVariableRefs(stripWirespecPrefix(flattenForRust(convert_3(endpoint))))));
|
|
925
926
|
var scope = new TransformScope(this_0);
|
|
926
|
-
scope.
|
|
927
|
-
var tmp = scope.
|
|
927
|
+
scope.c1u(fixResponseSwitchPatterns());
|
|
928
|
+
var tmp = scope.x1t_1;
|
|
928
929
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
929
930
|
var this_1 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
930
931
|
var scope_0 = new TransformScope(this_1);
|
|
931
|
-
scope_0.
|
|
932
|
-
var tmp_0 = scope_0.
|
|
932
|
+
scope_0.c1u(fixConstructorCalls());
|
|
933
|
+
var tmp_0 = scope_0.x1t_1;
|
|
933
934
|
var tmp$ret$3 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
934
935
|
return prependImports(this, sanitizeNames(injectApiStruct(injectResponseFromImpls(injectHandlerImplForClient(injectSelfToHandlerMethods(tmp$ret$3), endpoint)), endpoint), _get_sanitizationConfig__sns434(this)), buildEndpointImports(endpoint));
|
|
935
936
|
};
|
|
936
937
|
protoOf(RustIrEmitter).xq = function (channel) {
|
|
937
938
|
return convert_4(channel);
|
|
938
939
|
};
|
|
939
|
-
protoOf(RustIrEmitter).
|
|
940
|
+
protoOf(RustIrEmitter).p1u = function (endpoint) {
|
|
940
941
|
var endpointName = endpoint.ep_1.l1();
|
|
941
942
|
var endpointModuleName = toSnakeCase(this, endpointName);
|
|
942
943
|
var clientName = endpointName + 'Client';
|
|
@@ -986,8 +987,8 @@ protoOf(RustIrEmitter).o1u = function (endpoint) {
|
|
|
986
987
|
this_1.x('}');
|
|
987
988
|
var tmp$ret$8 = this_1.o5();
|
|
988
989
|
var code = joinToString(tmp$ret$8, '\n');
|
|
989
|
-
var subPackageName = plus_2(this.
|
|
990
|
-
var tmp = Companion_getInstance().
|
|
990
|
+
var subPackageName = plus_2(this.v1x_1, 'client');
|
|
991
|
+
var tmp = Companion_getInstance().f1h(subPackageName.or() + toSnakeCase(this, clientName));
|
|
991
992
|
// Inline function 'kotlin.collections.buildList' call
|
|
992
993
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
993
994
|
// Inline function 'kotlin.apply' call
|
|
@@ -999,7 +1000,7 @@ protoOf(RustIrEmitter).o1u = function (endpoint) {
|
|
|
999
1000
|
var tmp$ret$12 = this_2.o5();
|
|
1000
1001
|
return new File(tmp, tmp$ret$12);
|
|
1001
1002
|
};
|
|
1002
|
-
protoOf(RustIrEmitter).
|
|
1003
|
+
protoOf(RustIrEmitter).o1u = function (endpoints, logger) {
|
|
1003
1004
|
logger.sq('Emitting main Client for ' + endpoints.a1() + ' endpoints');
|
|
1004
1005
|
var modDeclarations = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, RustIrEmitter$emitClient$lambda(this));
|
|
1005
1006
|
// Inline function 'kotlin.collections.flatMap' call
|
|
@@ -1096,7 +1097,7 @@ protoOf(RustIrEmitter).n1u = function (endpoints, logger) {
|
|
|
1096
1097
|
}
|
|
1097
1098
|
var implBlocks = destination_3;
|
|
1098
1099
|
var code = joinToString(plus(listOf_0(['pub struct Client<S: Serialization, T: Transportation> {', ' pub serialization: S,', ' pub transportation: T,', '}']), implBlocks), '\n');
|
|
1099
|
-
var tmp_0 = Companion_getInstance().
|
|
1100
|
+
var tmp_0 = Companion_getInstance().f1h(this.v1x_1.or() + 'client');
|
|
1100
1101
|
// Inline function 'kotlin.collections.buildList' call
|
|
1101
1102
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1102
1103
|
// Inline function 'kotlin.apply' call
|
|
@@ -1124,7 +1125,7 @@ function fixResponseSwitchPatterns() {
|
|
|
1124
1125
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1125
1126
|
// Inline function 'kotlin.apply' call
|
|
1126
1127
|
var this_0 = new TransformerBuilder();
|
|
1127
|
-
this_0.
|
|
1128
|
+
this_0.e1u(fixResponseSwitchPatterns$lambda);
|
|
1128
1129
|
return this_0.d1h();
|
|
1129
1130
|
}
|
|
1130
1131
|
function buildModelImports(_this__u8e3s4) {
|
|
@@ -1147,7 +1148,7 @@ function buildModelImports(_this__u8e3s4) {
|
|
|
1147
1148
|
var _iterator__ex2g4s_0 = list.t();
|
|
1148
1149
|
while (_iterator__ex2g4s_0.u()) {
|
|
1149
1150
|
var item = _iterator__ex2g4s_0.v();
|
|
1150
|
-
var tmp$ret$2 = import_0('super::' + toRustSnakeCase(item.ku_1), item.ku_1);
|
|
1151
|
+
var tmp$ret$2 = import_0('super::' + toRustSnakeCase(item.ku_1), Companion_getInstance().f1h(item.ku_1).h1h());
|
|
1151
1152
|
destination.x(tmp$ret$2);
|
|
1152
1153
|
}
|
|
1153
1154
|
return destination;
|
|
@@ -1159,14 +1160,14 @@ function replaceStructWithRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1159
1160
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1160
1161
|
var tmp = scope;
|
|
1161
1162
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1162
|
-
var this_0 = scope.
|
|
1163
|
+
var this_0 = scope.x1t_1;
|
|
1163
1164
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1164
1165
|
// Inline function 'kotlin.apply' call
|
|
1165
1166
|
var this_1 = new TransformerBuilder();
|
|
1166
1167
|
this_1.c1h(replaceStructWithRefinedFunctions$lambda(refined));
|
|
1167
1168
|
var tmp$ret$2 = this_1.d1h();
|
|
1168
|
-
tmp.
|
|
1169
|
-
var tmp_0 = scope.
|
|
1169
|
+
tmp.x1t_1 = transform(this_0, tmp$ret$2);
|
|
1170
|
+
var tmp_0 = scope.x1t_1;
|
|
1170
1171
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1171
1172
|
}
|
|
1172
1173
|
function injectApiStruct(_this__u8e3s4, endpoint) {
|
|
@@ -1176,14 +1177,14 @@ function injectApiStruct(_this__u8e3s4, endpoint) {
|
|
|
1176
1177
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1177
1178
|
var tmp = scope;
|
|
1178
1179
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1179
|
-
var this_0 = scope.
|
|
1180
|
+
var this_0 = scope.x1t_1;
|
|
1180
1181
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1181
1182
|
// Inline function 'kotlin.apply' call
|
|
1182
1183
|
var this_1 = new TransformerBuilder();
|
|
1183
1184
|
this_1.c1h(injectApiStruct$lambda(endpoint));
|
|
1184
1185
|
var tmp$ret$2 = this_1.d1h();
|
|
1185
|
-
tmp.
|
|
1186
|
-
var tmp_0 = scope.
|
|
1186
|
+
tmp.x1t_1 = transform(this_0, tmp$ret$2);
|
|
1187
|
+
var tmp_0 = scope.x1t_1;
|
|
1187
1188
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1188
1189
|
}
|
|
1189
1190
|
function injectResponseFromImpls(_this__u8e3s4) {
|
|
@@ -1193,14 +1194,14 @@ function injectResponseFromImpls(_this__u8e3s4) {
|
|
|
1193
1194
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1194
1195
|
var tmp = scope;
|
|
1195
1196
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1196
|
-
var this_0 = scope.
|
|
1197
|
+
var this_0 = scope.x1t_1;
|
|
1197
1198
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1198
1199
|
// Inline function 'kotlin.apply' call
|
|
1199
1200
|
var this_1 = new TransformerBuilder();
|
|
1200
1201
|
this_1.c1h(injectResponseFromImpls$lambda);
|
|
1201
1202
|
var tmp$ret$2 = this_1.d1h();
|
|
1202
|
-
tmp.
|
|
1203
|
-
var tmp_0 = scope.
|
|
1203
|
+
tmp.x1t_1 = transform(this_0, tmp$ret$2);
|
|
1204
|
+
var tmp_0 = scope.x1t_1;
|
|
1204
1205
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1205
1206
|
}
|
|
1206
1207
|
function injectHandlerImplForClient(_this__u8e3s4, endpoint) {
|
|
@@ -1210,14 +1211,14 @@ function injectHandlerImplForClient(_this__u8e3s4, endpoint) {
|
|
|
1210
1211
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1211
1212
|
var tmp = scope;
|
|
1212
1213
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1213
|
-
var this_0 = scope.
|
|
1214
|
+
var this_0 = scope.x1t_1;
|
|
1214
1215
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1215
1216
|
// Inline function 'kotlin.apply' call
|
|
1216
1217
|
var this_1 = new TransformerBuilder();
|
|
1217
1218
|
this_1.c1h(injectHandlerImplForClient$lambda);
|
|
1218
1219
|
var tmp$ret$2 = this_1.d1h();
|
|
1219
|
-
tmp.
|
|
1220
|
-
var tmp_0 = scope.
|
|
1220
|
+
tmp.x1t_1 = transform(this_0, tmp$ret$2);
|
|
1221
|
+
var tmp_0 = scope.x1t_1;
|
|
1221
1222
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1222
1223
|
}
|
|
1223
1224
|
function injectSelfToHandlerMethods(_this__u8e3s4) {
|
|
@@ -1227,14 +1228,14 @@ function injectSelfToHandlerMethods(_this__u8e3s4) {
|
|
|
1227
1228
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1228
1229
|
var tmp = scope;
|
|
1229
1230
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1230
|
-
var this_0 = scope.
|
|
1231
|
+
var this_0 = scope.x1t_1;
|
|
1231
1232
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1232
1233
|
// Inline function 'kotlin.apply' call
|
|
1233
1234
|
var this_1 = new TransformerBuilder();
|
|
1234
1235
|
this_1.c1h(injectSelfToHandlerMethods$lambda);
|
|
1235
1236
|
var tmp$ret$2 = this_1.d1h();
|
|
1236
|
-
tmp.
|
|
1237
|
-
var tmp_0 = scope.
|
|
1237
|
+
tmp.x1t_1 = transform(this_0, tmp$ret$2);
|
|
1238
|
+
var tmp_0 = scope.x1t_1;
|
|
1238
1239
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1239
1240
|
}
|
|
1240
1241
|
function stripResponseGenerics(_this__u8e3s4) {
|
|
@@ -1244,14 +1245,14 @@ function stripResponseGenerics(_this__u8e3s4) {
|
|
|
1244
1245
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matching' call
|
|
1245
1246
|
var tmp = scope;
|
|
1246
1247
|
// Inline function 'community.flock.wirespec.ir.core.transformMatching' call
|
|
1247
|
-
var this_0 = scope.
|
|
1248
|
+
var this_0 = scope.x1t_1;
|
|
1248
1249
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1249
1250
|
// Inline function 'kotlin.apply' call
|
|
1250
1251
|
var this_1 = new TransformerBuilder();
|
|
1251
|
-
this_1.
|
|
1252
|
+
this_1.d1u(stripResponseGenerics$lambda);
|
|
1252
1253
|
var tmp$ret$2 = this_1.d1h();
|
|
1253
|
-
tmp.
|
|
1254
|
-
var tmp_0 = scope.
|
|
1254
|
+
tmp.x1t_1 = transform(this_0, tmp$ret$2);
|
|
1255
|
+
var tmp_0 = scope.x1t_1;
|
|
1255
1256
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1256
1257
|
}
|
|
1257
1258
|
function stripHandlerExtends(_this__u8e3s4) {
|
|
@@ -1261,14 +1262,14 @@ function stripHandlerExtends(_this__u8e3s4) {
|
|
|
1261
1262
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1262
1263
|
var tmp = scope;
|
|
1263
1264
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1264
|
-
var this_0 = scope.
|
|
1265
|
+
var this_0 = scope.x1t_1;
|
|
1265
1266
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1266
1267
|
// Inline function 'kotlin.apply' call
|
|
1267
1268
|
var this_1 = new TransformerBuilder();
|
|
1268
1269
|
this_1.c1h(stripHandlerExtends$lambda);
|
|
1269
1270
|
var tmp$ret$2 = this_1.d1h();
|
|
1270
|
-
tmp.
|
|
1271
|
-
var tmp_0 = scope.
|
|
1271
|
+
tmp.x1t_1 = transform(this_0, tmp$ret$2);
|
|
1272
|
+
var tmp_0 = scope.x1t_1;
|
|
1272
1273
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1273
1274
|
}
|
|
1274
1275
|
function convertSimpleRawExpressionsToVariableRefs(_this__u8e3s4) {
|
|
@@ -1276,8 +1277,8 @@ function convertSimpleRawExpressionsToVariableRefs(_this__u8e3s4) {
|
|
|
1276
1277
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1277
1278
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1278
1279
|
var identifierPattern = Regex_init_$Create$('[a-zA-Z_][a-zA-Z0-9_]*');
|
|
1279
|
-
scope.
|
|
1280
|
-
var tmp = scope.
|
|
1280
|
+
scope.g1u(convertSimpleRawExpressionsToVariableRefs$lambda(identifierPattern));
|
|
1281
|
+
var tmp = scope.x1t_1;
|
|
1281
1282
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1282
1283
|
}
|
|
1283
1284
|
function stripWirespecPrefix(_this__u8e3s4) {
|
|
@@ -1287,21 +1288,21 @@ function stripWirespecPrefix(_this__u8e3s4) {
|
|
|
1287
1288
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matching' call
|
|
1288
1289
|
var tmp = scope;
|
|
1289
1290
|
// Inline function 'community.flock.wirespec.ir.core.transformMatching' call
|
|
1290
|
-
var this_0 = scope.
|
|
1291
|
+
var this_0 = scope.x1t_1;
|
|
1291
1292
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1292
1293
|
// Inline function 'kotlin.apply' call
|
|
1293
1294
|
var this_1 = new TransformerBuilder();
|
|
1294
|
-
this_1.
|
|
1295
|
+
this_1.d1u(stripWirespecPrefix$lambda);
|
|
1295
1296
|
var tmp$ret$2 = this_1.d1h();
|
|
1296
|
-
tmp.
|
|
1297
|
-
var tmp_0 = scope.
|
|
1297
|
+
tmp.x1t_1 = transform(this_0, tmp$ret$2);
|
|
1298
|
+
var tmp_0 = scope.x1t_1;
|
|
1298
1299
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1299
1300
|
}
|
|
1300
1301
|
function flattenForRust(_this__u8e3s4) {
|
|
1301
1302
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1302
1303
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1303
1304
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1304
|
-
var tmp0 = _this__u8e3s4.
|
|
1305
|
+
var tmp0 = _this__u8e3s4.u1m();
|
|
1305
1306
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1306
1307
|
var destination = ArrayList_init_$Create$_0();
|
|
1307
1308
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1315,7 +1316,7 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1315
1316
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1316
1317
|
var flattened = flattenNestedStructs(namespace);
|
|
1317
1318
|
// Inline function 'kotlin.collections.filter' call
|
|
1318
|
-
var tmp0_0 = flattened.
|
|
1319
|
+
var tmp0_0 = flattened.z1m_1;
|
|
1319
1320
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1320
1321
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
1321
1322
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
@@ -1340,13 +1341,13 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1340
1341
|
var tmp_0;
|
|
1341
1342
|
var tmp_1;
|
|
1342
1343
|
if (item instanceof Union) {
|
|
1343
|
-
tmp_1 = item.
|
|
1344
|
+
tmp_1 = item.t1p_1.h1h() === 'Response';
|
|
1344
1345
|
} else {
|
|
1345
1346
|
tmp_1 = false;
|
|
1346
1347
|
}
|
|
1347
1348
|
if (tmp_1) {
|
|
1348
1349
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1349
|
-
var tmp0_1 = flattened.
|
|
1350
|
+
var tmp0_1 = flattened.z1m_1;
|
|
1350
1351
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1351
1352
|
var destination_2 = ArrayList_init_$Create$_0();
|
|
1352
1353
|
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
@@ -1362,7 +1363,7 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1362
1363
|
var _iterator__ex2g4s_3 = destination_2.t();
|
|
1363
1364
|
while (_iterator__ex2g4s_3.u()) {
|
|
1364
1365
|
var item_0 = _iterator__ex2g4s_3.v();
|
|
1365
|
-
var tmp$ret$8 = item_0.
|
|
1366
|
+
var tmp$ret$8 = item_0.d1n_1.h1h();
|
|
1366
1367
|
destination_3.x(tmp$ret$8);
|
|
1367
1368
|
}
|
|
1368
1369
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -1381,14 +1382,14 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1381
1382
|
var _iterator__ex2g4s_5 = destination_4.t();
|
|
1382
1383
|
while (_iterator__ex2g4s_5.u()) {
|
|
1383
1384
|
var item_1 = _iterator__ex2g4s_5.v();
|
|
1384
|
-
var tmp$ret$14 =
|
|
1385
|
+
var tmp$ret$14 = Custom_init_$Create$(item_1);
|
|
1385
1386
|
destination_5.x(tmp$ret$14);
|
|
1386
1387
|
}
|
|
1387
1388
|
var members = destination_5;
|
|
1388
|
-
tmp_0 = item.
|
|
1389
|
+
tmp_0 = item.y1p(VOID, VOID, members, emptyList());
|
|
1389
1390
|
} else {
|
|
1390
1391
|
if (item instanceof Union) {
|
|
1391
|
-
tmp_0 = item.
|
|
1392
|
+
tmp_0 = item.y1p(VOID, VOID, VOID, emptyList());
|
|
1392
1393
|
} else {
|
|
1393
1394
|
tmp_0 = item;
|
|
1394
1395
|
}
|
|
@@ -1398,7 +1399,7 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1398
1399
|
}
|
|
1399
1400
|
var moduleElements = destination_1;
|
|
1400
1401
|
// Inline function 'kotlin.collections.filterNot' call
|
|
1401
|
-
var tmp0_2 = flattened.
|
|
1402
|
+
var tmp0_2 = flattened.z1m_1;
|
|
1402
1403
|
// Inline function 'kotlin.collections.filterNotTo' call
|
|
1403
1404
|
var destination_6 = ArrayList_init_$Create$_0();
|
|
1404
1405
|
var _iterator__ex2g4s_6 = tmp0_2.t();
|
|
@@ -1415,14 +1416,14 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1415
1416
|
}
|
|
1416
1417
|
}
|
|
1417
1418
|
var classElements = destination_6;
|
|
1418
|
-
return new File(namespace.
|
|
1419
|
+
return new File(namespace.y1m_1, plus_0(moduleElements, new Namespace(namespace.y1m_1, classElements, namespace.a1n_1)));
|
|
1419
1420
|
}
|
|
1420
1421
|
function fixConstructorCalls() {
|
|
1421
1422
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1422
1423
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1423
1424
|
// Inline function 'kotlin.apply' call
|
|
1424
1425
|
var this_0 = new TransformerBuilder();
|
|
1425
|
-
this_0.
|
|
1426
|
+
this_0.g1u(fixConstructorCalls$lambda);
|
|
1426
1427
|
return this_0.d1h();
|
|
1427
1428
|
}
|
|
1428
1429
|
function buildEndpointImports(_this__u8e3s4) {
|
|
@@ -1445,18 +1446,18 @@ function buildEndpointImports(_this__u8e3s4) {
|
|
|
1445
1446
|
var _iterator__ex2g4s_0 = list.t();
|
|
1446
1447
|
while (_iterator__ex2g4s_0.u()) {
|
|
1447
1448
|
var item = _iterator__ex2g4s_0.v();
|
|
1448
|
-
var tmp$ret$2 = import_0('super::super::model::' + toRustSnakeCase(item.ku_1), item.ku_1);
|
|
1449
|
+
var tmp$ret$2 = import_0('super::super::model::' + toRustSnakeCase(item.ku_1), Companion_getInstance().f1h(item.ku_1).h1h());
|
|
1449
1450
|
destination.x(tmp$ret$2);
|
|
1450
1451
|
}
|
|
1451
1452
|
return destination;
|
|
1452
1453
|
}
|
|
1453
1454
|
function toRustSnakeCase(_this__u8e3s4) {
|
|
1454
1455
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1455
|
-
return Companion_getInstance().
|
|
1456
|
+
return Companion_getInstance().f1h(_this__u8e3s4).y1l();
|
|
1456
1457
|
}
|
|
1457
1458
|
function buildValidateFunction(refined) {
|
|
1458
1459
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1459
|
-
var constraintExpr = convertConstraint(refined.cr_1, new FieldCall(new VariableReference(Companion_getInstance().
|
|
1460
|
+
var constraintExpr = convertConstraint(refined.cr_1, new FieldCall(new VariableReference(Companion_getInstance().f1h('self')), Companion_getInstance().f1h('value')));
|
|
1460
1461
|
return function_0('validate', VOID, VOID, buildValidateFunction$lambda(constraintExpr));
|
|
1461
1462
|
}
|
|
1462
1463
|
function buildToStringFunction(refined) {
|
|
@@ -1487,55 +1488,56 @@ function fixResponseSwitchPatterns$lambda(s, t) {
|
|
|
1487
1488
|
if (!(s instanceof Switch)) {
|
|
1488
1489
|
tmp = true;
|
|
1489
1490
|
} else {
|
|
1490
|
-
var tmp0_safe_receiver = s.
|
|
1491
|
-
tmp = !((tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1491
|
+
var tmp0_safe_receiver = s.b1p_1;
|
|
1492
|
+
tmp = !((tmp0_safe_receiver == null ? null : tmp0_safe_receiver.s1l()) === 'r');
|
|
1492
1493
|
}
|
|
1493
1494
|
if (tmp)
|
|
1494
1495
|
return transformChildren(s, t);
|
|
1495
1496
|
// Inline function 'kotlin.collections.map' call
|
|
1496
|
-
var this_0 = s.
|
|
1497
|
+
var this_0 = s.z1o_1;
|
|
1497
1498
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1498
1499
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1499
1500
|
var _iterator__ex2g4s = this_0.t();
|
|
1500
1501
|
while (_iterator__ex2g4s.u()) {
|
|
1501
1502
|
var item = _iterator__ex2g4s.v();
|
|
1502
|
-
var tmp_0 = item.
|
|
1503
|
+
var tmp_0 = item.g1p_1;
|
|
1503
1504
|
var tmp0_safe_receiver_0 = tmp_0 instanceof Custom ? tmp_0 : null;
|
|
1504
|
-
var
|
|
1505
|
+
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.q1h_1;
|
|
1506
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.h1h();
|
|
1505
1507
|
var tmp_1;
|
|
1506
1508
|
if (!(typeName == null) && get_rustResponsePattern().nc(typeName)) {
|
|
1507
|
-
var tmp_2 = new RawExpression('Response::' + typeName + '(' + ensureNotNull(s.
|
|
1509
|
+
var tmp_2 = new RawExpression('Response::' + typeName + '(' + ensureNotNull(s.b1p_1).y1l() + ')');
|
|
1508
1510
|
// Inline function 'kotlin.collections.map' call
|
|
1509
|
-
var this_1 = item.
|
|
1511
|
+
var this_1 = item.f1p_1;
|
|
1510
1512
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1511
1513
|
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1512
1514
|
var _iterator__ex2g4s_0 = this_1.t();
|
|
1513
1515
|
while (_iterator__ex2g4s_0.u()) {
|
|
1514
1516
|
var item_0 = _iterator__ex2g4s_0.v();
|
|
1515
|
-
var tmp$ret$0 = t.
|
|
1517
|
+
var tmp$ret$0 = t.r1t(item_0);
|
|
1516
1518
|
destination_0.x(tmp$ret$0);
|
|
1517
1519
|
}
|
|
1518
1520
|
tmp_1 = new Case(tmp_2, destination_0, null);
|
|
1519
1521
|
} else {
|
|
1520
|
-
var tmp_3 = t.
|
|
1522
|
+
var tmp_3 = t.s1t(item.e1p_1);
|
|
1521
1523
|
// Inline function 'kotlin.collections.map' call
|
|
1522
|
-
var this_2 = item.
|
|
1524
|
+
var this_2 = item.f1p_1;
|
|
1523
1525
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1524
1526
|
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10));
|
|
1525
1527
|
var _iterator__ex2g4s_1 = this_2.t();
|
|
1526
1528
|
while (_iterator__ex2g4s_1.u()) {
|
|
1527
1529
|
var item_1 = _iterator__ex2g4s_1.v();
|
|
1528
|
-
var tmp$ret$3 = t.
|
|
1530
|
+
var tmp$ret$3 = t.r1t(item_1);
|
|
1529
1531
|
destination_1.x(tmp$ret$3);
|
|
1530
1532
|
}
|
|
1531
1533
|
var tmp_4 = destination_1;
|
|
1532
|
-
var
|
|
1534
|
+
var tmp2_safe_receiver = item.g1p_1;
|
|
1533
1535
|
var tmp_5;
|
|
1534
|
-
if (
|
|
1536
|
+
if (tmp2_safe_receiver == null) {
|
|
1535
1537
|
tmp_5 = null;
|
|
1536
1538
|
} else {
|
|
1537
1539
|
// Inline function 'kotlin.let' call
|
|
1538
|
-
tmp_5 = t.
|
|
1540
|
+
tmp_5 = t.p1t(tmp2_safe_receiver);
|
|
1539
1541
|
}
|
|
1540
1542
|
tmp_1 = new Case(tmp_3, tmp_4, tmp_5);
|
|
1541
1543
|
}
|
|
@@ -1543,13 +1545,13 @@ function fixResponseSwitchPatterns$lambda(s, t) {
|
|
|
1543
1545
|
destination.x(tmp$ret$8);
|
|
1544
1546
|
}
|
|
1545
1547
|
var transformedCases = destination;
|
|
1546
|
-
return s.
|
|
1548
|
+
return s.d1p(t.s1t(s.y1o_1), transformedCases, null);
|
|
1547
1549
|
}
|
|
1548
1550
|
function replaceStructWithRefinedFunctions$lambda($refined) {
|
|
1549
1551
|
return function (element, transformer) {
|
|
1550
1552
|
var tmp;
|
|
1551
1553
|
if (element instanceof Struct) {
|
|
1552
|
-
tmp = element.
|
|
1554
|
+
tmp = element.j1n(VOID, VOID, VOID, VOID, listOf_0([buildValidateFunction($refined), buildToStringFunction($refined)]));
|
|
1553
1555
|
} else {
|
|
1554
1556
|
tmp = element;
|
|
1555
1557
|
}
|
|
@@ -1561,7 +1563,7 @@ function injectApiStruct$lambda($endpoint) {
|
|
|
1561
1563
|
return function (element, transformer) {
|
|
1562
1564
|
var tmp;
|
|
1563
1565
|
if (element instanceof Namespace) {
|
|
1564
|
-
tmp = element.
|
|
1566
|
+
tmp = element.c1n(VOID, plus(element.z1m_1, listOf(buildApiStruct($endpoint))));
|
|
1565
1567
|
} else {
|
|
1566
1568
|
tmp = element;
|
|
1567
1569
|
}
|
|
@@ -1574,7 +1576,7 @@ function injectResponseFromImpls$lambda(element, transformer) {
|
|
|
1574
1576
|
var tmp;
|
|
1575
1577
|
if (element instanceof File) {
|
|
1576
1578
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1577
|
-
var tmp0 = element.
|
|
1579
|
+
var tmp0 = element.t1m_1;
|
|
1578
1580
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1579
1581
|
var destination = ArrayList_init_$Create$_0();
|
|
1580
1582
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1584,26 +1586,27 @@ function injectResponseFromImpls$lambda(element, transformer) {
|
|
|
1584
1586
|
var tmp_1;
|
|
1585
1587
|
var tmp_2;
|
|
1586
1588
|
if (element_0 instanceof Union) {
|
|
1587
|
-
tmp_2 = element_0.
|
|
1589
|
+
tmp_2 = element_0.t1p_1.h1h() === 'Response';
|
|
1588
1590
|
} else {
|
|
1589
1591
|
tmp_2 = false;
|
|
1590
1592
|
}
|
|
1591
1593
|
if (tmp_2) {
|
|
1592
1594
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1593
|
-
tmp_1 = !element_0.
|
|
1595
|
+
tmp_1 = !element_0.v1p_1.r();
|
|
1594
1596
|
} else {
|
|
1595
1597
|
tmp_1 = false;
|
|
1596
1598
|
}
|
|
1597
1599
|
if (tmp_1) {
|
|
1598
1600
|
var tmp_3 = listOf(element_0);
|
|
1599
1601
|
// Inline function 'kotlin.collections.map' call
|
|
1600
|
-
var this_0 = element_0.
|
|
1602
|
+
var this_0 = element_0.v1p_1;
|
|
1601
1603
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1602
1604
|
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1603
1605
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
1604
1606
|
while (_iterator__ex2g4s_0.u()) {
|
|
1605
1607
|
var item = _iterator__ex2g4s_0.v();
|
|
1606
|
-
var
|
|
1608
|
+
var memberName = item.q1h_1.h1h();
|
|
1609
|
+
var tmp$ret$1 = new RawElement('impl From<' + memberName + '> for Response { fn from(value: ' + memberName + ') -> Self { Response::' + memberName + '(value) } }\n');
|
|
1607
1610
|
destination_0.x(tmp$ret$1);
|
|
1608
1611
|
}
|
|
1609
1612
|
tmp_0 = plus(tmp_3, destination_0);
|
|
@@ -1613,7 +1616,7 @@ function injectResponseFromImpls$lambda(element, transformer) {
|
|
|
1613
1616
|
var list = tmp_0;
|
|
1614
1617
|
addAll(destination, list);
|
|
1615
1618
|
}
|
|
1616
|
-
tmp = element.
|
|
1619
|
+
tmp = element.w1m(VOID, destination);
|
|
1617
1620
|
} else {
|
|
1618
1621
|
tmp = element;
|
|
1619
1622
|
}
|
|
@@ -1627,7 +1630,7 @@ function injectHandlerImplForClient$lambda(element, transformer) {
|
|
|
1627
1630
|
var tmp$ret$4;
|
|
1628
1631
|
$l$block_1: {
|
|
1629
1632
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1630
|
-
var tmp0 = element.
|
|
1633
|
+
var tmp0 = element.z1m_1;
|
|
1631
1634
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1632
1635
|
var destination = ArrayList_init_$Create$_0();
|
|
1633
1636
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1643,7 +1646,7 @@ function injectHandlerImplForClient$lambda(element, transformer) {
|
|
|
1643
1646
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1644
1647
|
while (_iterator__ex2g4s_0.u()) {
|
|
1645
1648
|
var element_1 = _iterator__ex2g4s_0.v();
|
|
1646
|
-
if (element_1.
|
|
1649
|
+
if (element_1.k1n_1.equals(Companion_getInstance().f1h('Handler'))) {
|
|
1647
1650
|
tmp$ret$3 = element_1;
|
|
1648
1651
|
break $l$block;
|
|
1649
1652
|
}
|
|
@@ -1660,7 +1663,7 @@ function injectHandlerImplForClient$lambda(element, transformer) {
|
|
|
1660
1663
|
}
|
|
1661
1664
|
var handler = tmp_0;
|
|
1662
1665
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1663
|
-
var tmp0_0 = handler.
|
|
1666
|
+
var tmp0_0 = handler.l1n_1;
|
|
1664
1667
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1665
1668
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
1666
1669
|
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
@@ -1679,8 +1682,8 @@ function injectHandlerImplForClient$lambda(element, transformer) {
|
|
|
1679
1682
|
tmp_1 = tmp1_elvis_lhs;
|
|
1680
1683
|
}
|
|
1681
1684
|
var method = tmp_1;
|
|
1682
|
-
var methodName = method.
|
|
1683
|
-
tmp$ret$4 = element.
|
|
1685
|
+
var methodName = method.t1j_1.y1l();
|
|
1686
|
+
tmp$ret$4 = element.c1n(VOID, plus(element.z1m_1, listOf(new RawElement(trimIndent('\n impl<C: Client> Handler for C {\n async fn ' + methodName + '(&self, request: Request) -> Response {\n let raw = to_raw_request(self.serialization(), request);\n let resp = self.transport().transport(&raw).await;\n from_raw_response(self.serialization(), resp)\n }\n }\n ')))));
|
|
1684
1687
|
}
|
|
1685
1688
|
tmp = tmp$ret$4;
|
|
1686
1689
|
} else {
|
|
@@ -1695,7 +1698,7 @@ function injectSelfToHandlerMethods$lambda(element, transformer) {
|
|
|
1695
1698
|
if (element instanceof Interface) {
|
|
1696
1699
|
var tmp$ret$0;
|
|
1697
1700
|
$l$block: {
|
|
1698
|
-
if (!element.
|
|
1701
|
+
if (!element.k1n_1.equals(Companion_getInstance().f1h('Handler')) && !element.k1n_1.equals(Companion_getInstance().f1h('Call'))) {
|
|
1699
1702
|
tmp$ret$0 = element;
|
|
1700
1703
|
break $l$block;
|
|
1701
1704
|
}
|
|
@@ -1704,14 +1707,14 @@ function injectSelfToHandlerMethods$lambda(element, transformer) {
|
|
|
1704
1707
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1705
1708
|
var tmp_0 = scope;
|
|
1706
1709
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1707
|
-
var this_0 = scope.
|
|
1710
|
+
var this_0 = scope.x1t_1;
|
|
1708
1711
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1709
1712
|
// Inline function 'kotlin.apply' call
|
|
1710
1713
|
var this_1 = new TransformerBuilder();
|
|
1711
1714
|
this_1.c1h(injectSelfToHandlerMethods$lambda$lambda);
|
|
1712
1715
|
var tmp$ret$3 = this_1.d1h();
|
|
1713
|
-
tmp_0.
|
|
1714
|
-
var tmp_1 = scope.
|
|
1716
|
+
tmp_0.x1t_1 = transform(this_0, tmp$ret$3);
|
|
1717
|
+
var tmp_1 = scope.x1t_1;
|
|
1715
1718
|
tmp$ret$0 = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1716
1719
|
}
|
|
1717
1720
|
tmp = tmp$ret$0;
|
|
@@ -1725,7 +1728,7 @@ function injectSelfToHandlerMethods$lambda$lambda(element, transformer) {
|
|
|
1725
1728
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1726
1729
|
var tmp;
|
|
1727
1730
|
if (element instanceof Function) {
|
|
1728
|
-
tmp = element.
|
|
1731
|
+
tmp = element.b1k(Companion_getInstance().f1h(element.t1j_1.y1l()), VOID, plus(listOf(get_rustSelfParam()), element.v1j_1));
|
|
1729
1732
|
} else {
|
|
1730
1733
|
tmp = element;
|
|
1731
1734
|
}
|
|
@@ -1738,14 +1741,14 @@ function stripResponseGenerics$lambda(type, transformer) {
|
|
|
1738
1741
|
if (type instanceof Custom) {
|
|
1739
1742
|
var tmp_0;
|
|
1740
1743
|
var tmp_1;
|
|
1741
|
-
if (startsWith(type.
|
|
1744
|
+
if (startsWith(type.q1h_1.h1h(), 'Response')) {
|
|
1742
1745
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1743
|
-
tmp_1 = !type.
|
|
1746
|
+
tmp_1 = !type.r1h_1.r();
|
|
1744
1747
|
} else {
|
|
1745
1748
|
tmp_1 = false;
|
|
1746
1749
|
}
|
|
1747
1750
|
if (tmp_1) {
|
|
1748
|
-
tmp_0 = type.
|
|
1751
|
+
tmp_0 = type.n1m(VOID, emptyList());
|
|
1749
1752
|
} else {
|
|
1750
1753
|
tmp_0 = type;
|
|
1751
1754
|
}
|
|
@@ -1760,7 +1763,7 @@ function stripHandlerExtends$lambda(element, transformer) {
|
|
|
1760
1763
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1761
1764
|
var tmp;
|
|
1762
1765
|
if (element instanceof Interface) {
|
|
1763
|
-
tmp = element.
|
|
1766
|
+
tmp = element.k1n_1.equals(Companion_getInstance().f1h('Handler')) || element.k1n_1.equals(Companion_getInstance().f1h('Call')) ? element.r1n(VOID, VOID, emptyList()) : element;
|
|
1764
1767
|
} else {
|
|
1765
1768
|
tmp = element;
|
|
1766
1769
|
}
|
|
@@ -1773,17 +1776,17 @@ function convertSimpleRawExpressionsToVariableRefs$lambda($identifierPattern) {
|
|
|
1773
1776
|
var tmp_0;
|
|
1774
1777
|
var tmp_1;
|
|
1775
1778
|
if (s instanceof RawExpression) {
|
|
1776
|
-
tmp_1 = $identifierPattern.nc(s.
|
|
1779
|
+
tmp_1 = $identifierPattern.nc(s.i1o_1);
|
|
1777
1780
|
} else {
|
|
1778
1781
|
tmp_1 = false;
|
|
1779
1782
|
}
|
|
1780
1783
|
if (tmp_1) {
|
|
1781
|
-
tmp_0 = !contains(s.
|
|
1784
|
+
tmp_0 = !contains(s.i1o_1, '.');
|
|
1782
1785
|
} else {
|
|
1783
1786
|
tmp_0 = false;
|
|
1784
1787
|
}
|
|
1785
1788
|
if (tmp_0) {
|
|
1786
|
-
tmp = new VariableReference(Companion_getInstance().
|
|
1789
|
+
tmp = new VariableReference(Companion_getInstance().f1h(s.i1o_1));
|
|
1787
1790
|
} else {
|
|
1788
1791
|
tmp = transformChildren(s, t);
|
|
1789
1792
|
}
|
|
@@ -1794,9 +1797,10 @@ function stripWirespecPrefix$lambda(type, transformer) {
|
|
|
1794
1797
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1795
1798
|
var tmp;
|
|
1796
1799
|
if (type instanceof Custom) {
|
|
1800
|
+
var pascalName = type.q1h_1.h1h();
|
|
1797
1801
|
var tmp_0;
|
|
1798
|
-
if (startsWith(
|
|
1799
|
-
tmp_0 = type.
|
|
1802
|
+
if (startsWith(pascalName, 'Wirespec.')) {
|
|
1803
|
+
tmp_0 = type.n1m(Companion_getInstance().f1h(removePrefix(pascalName, 'Wirespec.')));
|
|
1800
1804
|
} else {
|
|
1801
1805
|
tmp_0 = type;
|
|
1802
1806
|
}
|
|
@@ -1811,11 +1815,12 @@ function fixConstructorCalls$lambda(s, t) {
|
|
|
1811
1815
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1812
1816
|
if (!(s instanceof ConstructorStatement))
|
|
1813
1817
|
return transformChildren(s, t);
|
|
1814
|
-
var tmp = s.
|
|
1818
|
+
var tmp = s.p1m_1;
|
|
1815
1819
|
var tmp0_safe_receiver = tmp instanceof Custom ? tmp : null;
|
|
1816
|
-
var
|
|
1820
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.q1h_1;
|
|
1821
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.h1h();
|
|
1817
1822
|
// Inline function 'kotlin.collections.mapValues' call
|
|
1818
|
-
var this_0 = s.
|
|
1823
|
+
var this_0 = s.q1m_1;
|
|
1819
1824
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1820
1825
|
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.a1()));
|
|
1821
1826
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
@@ -1823,25 +1828,25 @@ function fixConstructorCalls$lambda(s, t) {
|
|
|
1823
1828
|
while (_iterator__ex2g4s.u()) {
|
|
1824
1829
|
var element = _iterator__ex2g4s.v();
|
|
1825
1830
|
var tmp_0 = element.k1();
|
|
1826
|
-
var tmp$ret$1 = t.
|
|
1831
|
+
var tmp$ret$1 = t.s1t(element.l1());
|
|
1827
1832
|
destination.w2(tmp_0, tmp$ret$1);
|
|
1828
1833
|
}
|
|
1829
1834
|
var transformedArgs = destination;
|
|
1830
|
-
return !(typeName == null) && get_rustResponsePattern().nc(typeName) ? new FunctionCall(VOID, VOID, new Name(listOf('Response::' + typeName)), mapOf_0(to(Companion_getInstance().
|
|
1835
|
+
return !(typeName == null) && get_rustResponsePattern().nc(typeName) ? new FunctionCall(VOID, VOID, new Name(listOf('Response::' + typeName)), mapOf_0(to(Companion_getInstance().f1h('inner'), new FunctionCall(VOID, VOID, new Name(listOf(typeName + '::new')), transformedArgs)))) : typeName === 'Request' ? new FunctionCall(VOID, VOID, new Name(listOf('Request::new')), transformedArgs) : transformChildren(s, t);
|
|
1831
1836
|
}
|
|
1832
1837
|
function buildValidateFunction$lambda($constraintExpr) {
|
|
1833
1838
|
return function ($this$function) {
|
|
1834
|
-
$this$function.
|
|
1835
|
-
$this$function.
|
|
1836
|
-
$this$function.
|
|
1839
|
+
$this$function.l1i('&self', Custom_init_$Create$(''));
|
|
1840
|
+
$this$function.k1i(Boolean_instance);
|
|
1841
|
+
$this$function.j1k($constraintExpr);
|
|
1837
1842
|
return Unit_instance;
|
|
1838
1843
|
};
|
|
1839
1844
|
}
|
|
1840
1845
|
function buildToStringFunction$lambda($expr) {
|
|
1841
1846
|
return function ($this$function) {
|
|
1842
|
-
$this$function.
|
|
1843
|
-
$this$function.
|
|
1844
|
-
$this$function.
|
|
1847
|
+
$this$function.l1i('&self', Custom_init_$Create$(''));
|
|
1848
|
+
$this$function.k1i(String_instance);
|
|
1849
|
+
$this$function.j1k(new RawExpression($expr));
|
|
1845
1850
|
return Unit_instance;
|
|
1846
1851
|
};
|
|
1847
1852
|
}
|
|
@@ -1863,39 +1868,39 @@ var properties_initialized_RustIrTransformer_kt_hr6k9w;
|
|
|
1863
1868
|
function _init_properties_RustIrTransformer_kt__rrvmwq() {
|
|
1864
1869
|
if (!properties_initialized_RustIrTransformer_kt_hr6k9w) {
|
|
1865
1870
|
properties_initialized_RustIrTransformer_kt_hr6k9w = true;
|
|
1866
|
-
rustSelfParam = new Parameter(Companion_getInstance().
|
|
1871
|
+
rustSelfParam = new Parameter(Companion_getInstance().f1h('&self'), Custom_init_$Create$(''));
|
|
1867
1872
|
rustResponsePattern = Regex_init_$Create$('Response(\\d+|Default)');
|
|
1868
1873
|
}
|
|
1869
1874
|
}
|
|
1870
1875
|
function borrowParamsOf($this, fn) {
|
|
1871
1876
|
// Inline function 'kotlin.collections.map' call
|
|
1872
|
-
var this_0 = fn.
|
|
1877
|
+
var this_0 = fn.v1j_1;
|
|
1873
1878
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1874
1879
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1875
1880
|
var _iterator__ex2g4s = this_0.t();
|
|
1876
1881
|
while (_iterator__ex2g4s.u()) {
|
|
1877
1882
|
var item = _iterator__ex2g4s.v();
|
|
1878
1883
|
var tmp;
|
|
1879
|
-
if (RustTransform_getInstance().
|
|
1884
|
+
if (RustTransform_getInstance().m1y(item.u1o_1)) {
|
|
1880
1885
|
tmp = item;
|
|
1881
1886
|
} else {
|
|
1882
|
-
tmp = item.
|
|
1887
|
+
tmp = item.x1o(VOID, applyBorrowRule(RustTransform_getInstance(), item.v1o_1));
|
|
1883
1888
|
}
|
|
1884
1889
|
var tmp$ret$0 = tmp;
|
|
1885
1890
|
destination.x(tmp$ret$0);
|
|
1886
1891
|
}
|
|
1887
|
-
return fn.
|
|
1892
|
+
return fn.b1k(VOID, VOID, destination);
|
|
1888
1893
|
}
|
|
1889
1894
|
function applyBorrowRule($this, type) {
|
|
1890
1895
|
var tmp;
|
|
1891
1896
|
if (type instanceof Nullable) {
|
|
1892
|
-
tmp = new Nullable(applyBorrowRule($this, type.
|
|
1897
|
+
tmp = new Nullable(applyBorrowRule($this, type.o1h_1));
|
|
1893
1898
|
} else {
|
|
1894
1899
|
if (equals(type, String_instance)) {
|
|
1895
|
-
tmp =
|
|
1900
|
+
tmp = Custom_init_$Create$('&str');
|
|
1896
1901
|
} else {
|
|
1897
1902
|
if (type instanceof Custom) {
|
|
1898
|
-
tmp = $this.
|
|
1903
|
+
tmp = $this.o1y(type) ? type : $this.n1y(type) ? borrowImpl(type) : type;
|
|
1899
1904
|
} else {
|
|
1900
1905
|
tmp = type;
|
|
1901
1906
|
}
|
|
@@ -1907,15 +1912,15 @@ function toBorrowedRaw($this, _this__u8e3s4) {
|
|
|
1907
1912
|
return new RawExpression('&' + toRawCode($this, _this__u8e3s4));
|
|
1908
1913
|
}
|
|
1909
1914
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1910
|
-
return Companion_getInstance_0().
|
|
1915
|
+
return Companion_getInstance_0().c1y_1.u1(_this__u8e3s4) ? 'r#' + _this__u8e3s4 : _this__u8e3s4;
|
|
1911
1916
|
}
|
|
1912
1917
|
function toRawCode($this, _this__u8e3s4) {
|
|
1913
1918
|
var tmp;
|
|
1914
1919
|
if (_this__u8e3s4 instanceof VariableReference) {
|
|
1915
|
-
tmp = sanitizeKeywords_0($this, _this__u8e3s4.
|
|
1920
|
+
tmp = sanitizeKeywords_0($this, _this__u8e3s4.g1o_1.y1l());
|
|
1916
1921
|
} else {
|
|
1917
1922
|
if (_this__u8e3s4 instanceof FieldCall) {
|
|
1918
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
1923
|
+
var tmp1_safe_receiver = _this__u8e3s4.j1p_1;
|
|
1919
1924
|
var tmp_0;
|
|
1920
1925
|
if (tmp1_safe_receiver == null) {
|
|
1921
1926
|
tmp_0 = null;
|
|
@@ -1925,20 +1930,20 @@ function toRawCode($this, _this__u8e3s4) {
|
|
|
1925
1930
|
}
|
|
1926
1931
|
var tmp2_elvis_lhs = tmp_0;
|
|
1927
1932
|
var recv = tmp2_elvis_lhs == null ? '' : tmp2_elvis_lhs;
|
|
1928
|
-
tmp = recv + sanitizeKeywords_0($this, _this__u8e3s4.
|
|
1933
|
+
tmp = recv + sanitizeKeywords_0($this, _this__u8e3s4.k1p_1.y1l());
|
|
1929
1934
|
} else {
|
|
1930
1935
|
if (_this__u8e3s4 instanceof ArrayIndexCall) {
|
|
1931
|
-
var tmp_1 = _this__u8e3s4.
|
|
1936
|
+
var tmp_1 = _this__u8e3s4.h1q_1;
|
|
1932
1937
|
var lit = tmp_1 instanceof Literal_0 ? tmp_1 : null;
|
|
1933
1938
|
var tmp_2;
|
|
1934
1939
|
var tmp_3;
|
|
1935
1940
|
if (!(lit == null)) {
|
|
1936
1941
|
var tmp_4;
|
|
1937
|
-
var tmp_5 = lit.
|
|
1942
|
+
var tmp_5 = lit.r1o_1;
|
|
1938
1943
|
if (tmp_5 instanceof Integer) {
|
|
1939
1944
|
tmp_4 = true;
|
|
1940
1945
|
} else {
|
|
1941
|
-
var tmp_6 = lit.
|
|
1946
|
+
var tmp_6 = lit.r1o_1;
|
|
1942
1947
|
tmp_4 = tmp_6 instanceof Number_0;
|
|
1943
1948
|
}
|
|
1944
1949
|
tmp_3 = tmp_4;
|
|
@@ -1946,30 +1951,31 @@ function toRawCode($this, _this__u8e3s4) {
|
|
|
1946
1951
|
tmp_3 = false;
|
|
1947
1952
|
}
|
|
1948
1953
|
if (tmp_3) {
|
|
1949
|
-
tmp_2 = toString_0(lit.
|
|
1954
|
+
tmp_2 = toString_0(lit.q1o_1);
|
|
1950
1955
|
} else {
|
|
1951
1956
|
var tmp_7;
|
|
1952
1957
|
if (!(lit == null)) {
|
|
1953
|
-
var tmp_8 = lit.
|
|
1958
|
+
var tmp_8 = lit.r1o_1;
|
|
1954
1959
|
tmp_7 = tmp_8 instanceof String_1;
|
|
1955
1960
|
} else {
|
|
1956
1961
|
tmp_7 = false;
|
|
1957
1962
|
}
|
|
1958
1963
|
if (tmp_7) {
|
|
1959
|
-
tmp_2 = '"' + toString_0(lit.
|
|
1964
|
+
tmp_2 = '"' + toString_0(lit.q1o_1) + '"';
|
|
1960
1965
|
} else {
|
|
1961
|
-
tmp_2 = toRawCode($this, _this__u8e3s4.
|
|
1966
|
+
tmp_2 = toRawCode($this, _this__u8e3s4.h1q_1);
|
|
1962
1967
|
}
|
|
1963
1968
|
}
|
|
1964
1969
|
var idx = tmp_2;
|
|
1965
|
-
tmp = toRawCode($this, _this__u8e3s4.
|
|
1970
|
+
tmp = toRawCode($this, _this__u8e3s4.g1q_1) + '[' + idx + ']';
|
|
1966
1971
|
} else {
|
|
1967
1972
|
if (_this__u8e3s4 instanceof ConstructorStatement) {
|
|
1968
|
-
var tmp_9 = _this__u8e3s4.
|
|
1973
|
+
var tmp_9 = _this__u8e3s4.p1m_1;
|
|
1969
1974
|
var tmp3_safe_receiver = tmp_9 instanceof Custom ? tmp_9 : null;
|
|
1970
|
-
var
|
|
1971
|
-
var
|
|
1972
|
-
var
|
|
1975
|
+
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.q1h_1;
|
|
1976
|
+
var tmp5_elvis_lhs = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.h1h();
|
|
1977
|
+
var typeName = tmp5_elvis_lhs == null ? toString_0(_this__u8e3s4.p1m_1) : tmp5_elvis_lhs;
|
|
1978
|
+
var tmp_10 = _this__u8e3s4.q1m_1.j1();
|
|
1973
1979
|
var args = joinToString(tmp_10, ', ', VOID, VOID, VOID, VOID, RustTransform$toRawCode$lambda);
|
|
1974
1980
|
var tmp_11;
|
|
1975
1981
|
// Inline function 'kotlin.text.isEmpty' call
|
|
@@ -1982,23 +1988,23 @@ function toRawCode($this, _this__u8e3s4) {
|
|
|
1982
1988
|
} else {
|
|
1983
1989
|
if (_this__u8e3s4 instanceof Literal_0) {
|
|
1984
1990
|
var tmp_12;
|
|
1985
|
-
var tmp_13 = _this__u8e3s4.
|
|
1991
|
+
var tmp_13 = _this__u8e3s4.r1o_1;
|
|
1986
1992
|
if (tmp_13 instanceof String_1) {
|
|
1987
|
-
tmp_12 = 'String::from("' + toString_0(_this__u8e3s4.
|
|
1993
|
+
tmp_12 = 'String::from("' + toString_0(_this__u8e3s4.q1o_1) + '")';
|
|
1988
1994
|
} else {
|
|
1989
|
-
var tmp_14 = _this__u8e3s4.
|
|
1995
|
+
var tmp_14 = _this__u8e3s4.r1o_1;
|
|
1990
1996
|
if (tmp_14 instanceof Boolean_0) {
|
|
1991
|
-
tmp_12 = toString_0(_this__u8e3s4.
|
|
1997
|
+
tmp_12 = toString_0(_this__u8e3s4.q1o_1);
|
|
1992
1998
|
} else {
|
|
1993
|
-
var tmp_15 = _this__u8e3s4.
|
|
1999
|
+
var tmp_15 = _this__u8e3s4.r1o_1;
|
|
1994
2000
|
if (tmp_15 instanceof Integer) {
|
|
1995
|
-
tmp_12 = toString_0(_this__u8e3s4.
|
|
2001
|
+
tmp_12 = toString_0(_this__u8e3s4.q1o_1);
|
|
1996
2002
|
} else {
|
|
1997
|
-
var tmp_16 = _this__u8e3s4.
|
|
2003
|
+
var tmp_16 = _this__u8e3s4.r1o_1;
|
|
1998
2004
|
if (tmp_16 instanceof Number_0) {
|
|
1999
|
-
tmp_12 = toString_0(_this__u8e3s4.
|
|
2005
|
+
tmp_12 = toString_0(_this__u8e3s4.q1o_1);
|
|
2000
2006
|
} else {
|
|
2001
|
-
tmp_12 = toString_0(_this__u8e3s4.
|
|
2007
|
+
tmp_12 = toString_0(_this__u8e3s4.q1o_1);
|
|
2002
2008
|
}
|
|
2003
2009
|
}
|
|
2004
2010
|
}
|
|
@@ -2006,7 +2012,7 @@ function toRawCode($this, _this__u8e3s4) {
|
|
|
2006
2012
|
tmp = tmp_12;
|
|
2007
2013
|
} else {
|
|
2008
2014
|
if (_this__u8e3s4 instanceof RawExpression) {
|
|
2009
|
-
tmp = _this__u8e3s4.
|
|
2015
|
+
tmp = _this__u8e3s4.i1o_1;
|
|
2010
2016
|
} else {
|
|
2011
2017
|
var message = 'Unsupported expression type in toRawCode: ' + getKClassFromExpression(_this__u8e3s4).o();
|
|
2012
2018
|
throw IllegalStateException_init_$Create$(toString_0(message));
|
|
@@ -2021,22 +2027,22 @@ function toRawCode($this, _this__u8e3s4) {
|
|
|
2021
2027
|
function RustTransform$primitivesToCustom$lambda(t, tr) {
|
|
2022
2028
|
var tmp;
|
|
2023
2029
|
if (equals(t, Any_instance)) {
|
|
2024
|
-
tmp =
|
|
2030
|
+
tmp = Custom_init_$Create$('Box<dyn std::any::Any>');
|
|
2025
2031
|
} else {
|
|
2026
2032
|
if (equals(t, Bytes_instance)) {
|
|
2027
|
-
tmp =
|
|
2033
|
+
tmp = Custom_init_$Create$('Vec<u8>');
|
|
2028
2034
|
} else {
|
|
2029
2035
|
if (equals(t, Reflect_instance)) {
|
|
2030
|
-
tmp =
|
|
2036
|
+
tmp = Custom_init_$Create$('std::any::TypeId');
|
|
2031
2037
|
} else {
|
|
2032
2038
|
if (equals(t, Wildcard_instance)) {
|
|
2033
|
-
tmp =
|
|
2039
|
+
tmp = Custom_init_$Create$('_');
|
|
2034
2040
|
} else {
|
|
2035
2041
|
if (t instanceof IntegerLiteral) {
|
|
2036
|
-
tmp =
|
|
2042
|
+
tmp = Custom_init_$Create$('i32');
|
|
2037
2043
|
} else {
|
|
2038
2044
|
if (t instanceof StringLiteral) {
|
|
2039
|
-
tmp =
|
|
2045
|
+
tmp = Custom_init_$Create$('String');
|
|
2040
2046
|
} else {
|
|
2041
2047
|
tmp = transformChildren_1(t, tr);
|
|
2042
2048
|
}
|
|
@@ -2051,11 +2057,11 @@ function RustTransform$borrow$lambda(element, tr) {
|
|
|
2051
2057
|
var tmp;
|
|
2052
2058
|
if (element instanceof Interface) {
|
|
2053
2059
|
var tmp_0;
|
|
2054
|
-
if (element.
|
|
2060
|
+
if (element.k1n_1.equals(Companion_getInstance().f1h('Call'))) {
|
|
2055
2061
|
tmp_0 = element;
|
|
2056
2062
|
} else {
|
|
2057
2063
|
// Inline function 'kotlin.collections.map' call
|
|
2058
|
-
var this_0 = element.
|
|
2064
|
+
var this_0 = element.l1n_1;
|
|
2059
2065
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2060
2066
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2061
2067
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -2071,7 +2077,7 @@ function RustTransform$borrow$lambda(element, tr) {
|
|
|
2071
2077
|
destination.x(tmp$ret$0);
|
|
2072
2078
|
}
|
|
2073
2079
|
var borrowed = destination;
|
|
2074
|
-
tmp_0 = transformChildren_0(element.
|
|
2080
|
+
tmp_0 = transformChildren_0(element.r1n(VOID, borrowed), tr);
|
|
2075
2081
|
}
|
|
2076
2082
|
tmp = tmp_0;
|
|
2077
2083
|
} else {
|
|
@@ -2087,13 +2093,13 @@ function RustTransform$serializationArgs$lambda(s, t) {
|
|
|
2087
2093
|
var tmp;
|
|
2088
2094
|
var tmp_0;
|
|
2089
2095
|
if (s instanceof FunctionCall) {
|
|
2090
|
-
tmp_0 = RustTransform_getInstance().
|
|
2096
|
+
tmp_0 = RustTransform_getInstance().h1y_1.u1(s.b1m_1.y1l());
|
|
2091
2097
|
} else {
|
|
2092
2098
|
tmp_0 = false;
|
|
2093
2099
|
}
|
|
2094
2100
|
if (tmp_0) {
|
|
2095
2101
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
2096
|
-
var this_0 = s.
|
|
2102
|
+
var this_0 = s.c1m_1.j1();
|
|
2097
2103
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
2098
2104
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2099
2105
|
var index = 0;
|
|
@@ -2107,13 +2113,13 @@ function RustTransform$serializationArgs$lambda(s, t) {
|
|
|
2107
2113
|
var key = item.k1();
|
|
2108
2114
|
// Inline function 'kotlin.collections.component2' call
|
|
2109
2115
|
var value = item.l1();
|
|
2110
|
-
var transformed = t.
|
|
2116
|
+
var transformed = t.s1t(value);
|
|
2111
2117
|
var tmp_1;
|
|
2112
2118
|
var tmp_2;
|
|
2113
2119
|
if (idx === 0) {
|
|
2114
2120
|
var tmp_3;
|
|
2115
2121
|
if (transformed instanceof VariableReference) {
|
|
2116
|
-
tmp_3 = transformed.
|
|
2122
|
+
tmp_3 = transformed.g1o_1.s1h() === 'it';
|
|
2117
2123
|
} else {
|
|
2118
2124
|
tmp_3 = false;
|
|
2119
2125
|
}
|
|
@@ -2130,17 +2136,17 @@ function RustTransform$serializationArgs$lambda(s, t) {
|
|
|
2130
2136
|
destination.x(tmp$ret$2);
|
|
2131
2137
|
}
|
|
2132
2138
|
var newArgs = toMap(destination);
|
|
2133
|
-
tmp = s.
|
|
2139
|
+
tmp = s.f1m(VOID, VOID, VOID, newArgs);
|
|
2134
2140
|
} else {
|
|
2135
2141
|
tmp = transformChildren(s, t);
|
|
2136
2142
|
}
|
|
2137
2143
|
return tmp;
|
|
2138
2144
|
}
|
|
2139
2145
|
function RustTransform$rustName$lambda(it) {
|
|
2140
|
-
return RustTransform_getInstance().
|
|
2146
|
+
return RustTransform_getInstance().k1y(it);
|
|
2141
2147
|
}
|
|
2142
2148
|
function RustTransform$toRawCode$lambda(it) {
|
|
2143
|
-
return it.k1().
|
|
2149
|
+
return it.k1().y1l() + ': ' + toRawCode(RustTransform_getInstance(), it.l1());
|
|
2144
2150
|
}
|
|
2145
2151
|
function RustTransform() {
|
|
2146
2152
|
RustTransform_instance = this;
|
|
@@ -2148,57 +2154,58 @@ function RustTransform() {
|
|
|
2148
2154
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2149
2155
|
// Inline function 'kotlin.apply' call
|
|
2150
2156
|
var this_0 = new TransformerBuilder();
|
|
2151
|
-
this_0.
|
|
2152
|
-
tmp.
|
|
2157
|
+
this_0.d1u(RustTransform$primitivesToCustom$lambda);
|
|
2158
|
+
tmp.e1y_1 = this_0.d1h();
|
|
2153
2159
|
var tmp_0 = this;
|
|
2154
2160
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2155
2161
|
// Inline function 'kotlin.apply' call
|
|
2156
2162
|
var this_1 = new TransformerBuilder();
|
|
2157
2163
|
this_1.c1h(RustTransform$borrow$lambda);
|
|
2158
|
-
tmp_0.
|
|
2164
|
+
tmp_0.f1y_1 = this_1.d1h();
|
|
2159
2165
|
var tmp_1 = this;
|
|
2160
2166
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2161
2167
|
// Inline function 'kotlin.apply' call
|
|
2162
|
-
tmp_1.
|
|
2163
|
-
this.
|
|
2168
|
+
tmp_1.g1y_1 = (new TransformerBuilder()).d1h();
|
|
2169
|
+
this.h1y_1 = setOf(['serialize_path', 'serialize_param', 'serialize_body', 'deserialize_path', 'deserialize_param', 'deserialize_body']);
|
|
2164
2170
|
var tmp_2 = this;
|
|
2165
2171
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2166
2172
|
// Inline function 'kotlin.apply' call
|
|
2167
2173
|
var this_2 = new TransformerBuilder();
|
|
2168
|
-
this_2.
|
|
2169
|
-
tmp_2.
|
|
2170
|
-
this.
|
|
2174
|
+
this_2.g1u(RustTransform$serializationArgs$lambda);
|
|
2175
|
+
tmp_2.i1y_1 = this_2.d1h();
|
|
2176
|
+
this.j1y_1 = setOf(['i32', 'i64', 'f32', 'f64', 'bool', 'u8', 'u16', 'u32', 'u64', 'usize', 'isize', '()']);
|
|
2171
2177
|
}
|
|
2172
|
-
protoOf(RustTransform).
|
|
2178
|
+
protoOf(RustTransform).l1y = function (element) {
|
|
2173
2179
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2174
2180
|
var scope = new TransformScope(element);
|
|
2175
|
-
scope.
|
|
2176
|
-
var tmp = scope.
|
|
2181
|
+
scope.c1u(RustTransform_getInstance().e1y_1);
|
|
2182
|
+
var tmp = scope.x1t_1;
|
|
2177
2183
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2178
2184
|
var this_0 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
2179
2185
|
var scope_0 = new TransformScope(this_0);
|
|
2180
|
-
scope_0.
|
|
2181
|
-
var tmp_0 = scope_0.
|
|
2186
|
+
scope_0.c1u(RustTransform_getInstance().f1y_1);
|
|
2187
|
+
var tmp_0 = scope_0.x1t_1;
|
|
2182
2188
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2183
2189
|
var this_1 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2184
2190
|
var scope_1 = new TransformScope(this_1);
|
|
2185
|
-
scope_1.
|
|
2186
|
-
var tmp_1 = scope_1.
|
|
2191
|
+
scope_1.c1u(RustTransform_getInstance().g1y_1);
|
|
2192
|
+
var tmp_1 = scope_1.x1t_1;
|
|
2187
2193
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2188
2194
|
var this_2 = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
2189
2195
|
var scope_2 = new TransformScope(this_2);
|
|
2190
|
-
scope_2.
|
|
2191
|
-
var tmp_2 = scope_2.
|
|
2196
|
+
scope_2.c1u(RustTransform_getInstance().i1y_1);
|
|
2197
|
+
var tmp_2 = scope_2.x1t_1;
|
|
2192
2198
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
2193
2199
|
};
|
|
2194
|
-
protoOf(RustTransform).
|
|
2200
|
+
protoOf(RustTransform).k1y = function (_this__u8e3s4) {
|
|
2195
2201
|
var tmp;
|
|
2196
2202
|
if (_this__u8e3s4 instanceof Custom) {
|
|
2203
|
+
var pascalName = _this__u8e3s4.q1h_1.h1h();
|
|
2197
2204
|
var tmp_0;
|
|
2198
|
-
if (_this__u8e3s4.
|
|
2199
|
-
tmp_0 =
|
|
2205
|
+
if (_this__u8e3s4.r1h_1.r()) {
|
|
2206
|
+
tmp_0 = pascalName;
|
|
2200
2207
|
} else {
|
|
2201
|
-
tmp_0 =
|
|
2208
|
+
tmp_0 = pascalName + '<' + joinToString(_this__u8e3s4.r1h_1, ', ', VOID, VOID, VOID, VOID, RustTransform$rustName$lambda) + '>';
|
|
2202
2209
|
}
|
|
2203
2210
|
tmp = tmp_0;
|
|
2204
2211
|
} else {
|
|
@@ -2206,13 +2213,13 @@ protoOf(RustTransform).j1y = function (_this__u8e3s4) {
|
|
|
2206
2213
|
tmp = 'String';
|
|
2207
2214
|
} else {
|
|
2208
2215
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
2209
|
-
tmp = 'Option<' + this.
|
|
2216
|
+
tmp = 'Option<' + this.k1y(_this__u8e3s4.o1h_1) + '>';
|
|
2210
2217
|
} else {
|
|
2211
2218
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
2212
|
-
tmp = 'Vec<' + this.
|
|
2219
|
+
tmp = 'Vec<' + this.k1y(_this__u8e3s4.p1h_1) + '>';
|
|
2213
2220
|
} else {
|
|
2214
2221
|
if (_this__u8e3s4 instanceof Dict) {
|
|
2215
|
-
tmp = 'std::collections::HashMap<' + this.
|
|
2222
|
+
tmp = 'std::collections::HashMap<' + this.k1y(_this__u8e3s4.j1m_1) + ', ' + this.k1y(_this__u8e3s4.k1m_1) + '>';
|
|
2216
2223
|
} else {
|
|
2217
2224
|
if (equals(_this__u8e3s4, Any_instance)) {
|
|
2218
2225
|
tmp = 'Box<dyn std::any::Any>';
|
|
@@ -2234,7 +2241,7 @@ protoOf(RustTransform).j1y = function (_this__u8e3s4) {
|
|
|
2234
2241
|
} else {
|
|
2235
2242
|
if (_this__u8e3s4 instanceof Integer) {
|
|
2236
2243
|
var tmp_1;
|
|
2237
|
-
switch (_this__u8e3s4.
|
|
2244
|
+
switch (_this__u8e3s4.g1m_1.b3_1) {
|
|
2238
2245
|
case 0:
|
|
2239
2246
|
tmp_1 = 'i32';
|
|
2240
2247
|
break;
|
|
@@ -2249,7 +2256,7 @@ protoOf(RustTransform).j1y = function (_this__u8e3s4) {
|
|
|
2249
2256
|
} else {
|
|
2250
2257
|
if (_this__u8e3s4 instanceof Number_0) {
|
|
2251
2258
|
var tmp_2;
|
|
2252
|
-
switch (_this__u8e3s4.
|
|
2259
|
+
switch (_this__u8e3s4.h1m_1.b3_1) {
|
|
2253
2260
|
case 0:
|
|
2254
2261
|
tmp_2 = 'f32';
|
|
2255
2262
|
break;
|
|
@@ -2286,20 +2293,24 @@ protoOf(RustTransform).j1y = function (_this__u8e3s4) {
|
|
|
2286
2293
|
}
|
|
2287
2294
|
return tmp;
|
|
2288
2295
|
};
|
|
2289
|
-
protoOf(RustTransform).
|
|
2296
|
+
protoOf(RustTransform).o1y = function (_this__u8e3s4) {
|
|
2290
2297
|
var tmp;
|
|
2291
2298
|
if (_this__u8e3s4 instanceof Custom) {
|
|
2292
|
-
|
|
2299
|
+
// Inline function 'kotlin.let' call
|
|
2300
|
+
var it = _this__u8e3s4.q1h_1.h1h();
|
|
2301
|
+
tmp = startsWith(it, '&') || startsWith(it, '&dyn ') || startsWith(it, '&impl ') || startsWith(it, '&mut ');
|
|
2293
2302
|
} else {
|
|
2294
2303
|
tmp = false;
|
|
2295
2304
|
}
|
|
2296
2305
|
return tmp;
|
|
2297
2306
|
};
|
|
2298
|
-
protoOf(RustTransform).
|
|
2299
|
-
|
|
2307
|
+
protoOf(RustTransform).n1y = function (_this__u8e3s4) {
|
|
2308
|
+
// Inline function 'kotlin.let' call
|
|
2309
|
+
var it = _this__u8e3s4.q1h_1.h1h();
|
|
2310
|
+
return it === 'Serializer' || it === 'Deserializer';
|
|
2300
2311
|
};
|
|
2301
|
-
protoOf(RustTransform).
|
|
2302
|
-
var v = _this__u8e3s4.
|
|
2312
|
+
protoOf(RustTransform).m1y = function (_this__u8e3s4) {
|
|
2313
|
+
var v = _this__u8e3s4.s1h();
|
|
2303
2314
|
switch (v) {
|
|
2304
2315
|
case 'self':
|
|
2305
2316
|
case '&self':
|
|
@@ -2315,13 +2326,13 @@ function RustTransform_getInstance() {
|
|
|
2315
2326
|
return RustTransform_instance;
|
|
2316
2327
|
}
|
|
2317
2328
|
function borrow(_this__u8e3s4) {
|
|
2318
|
-
return _this__u8e3s4.
|
|
2329
|
+
return _this__u8e3s4.n1m(new Name(listOf('&' + _this__u8e3s4.q1h_1.h1h())));
|
|
2319
2330
|
}
|
|
2320
2331
|
function borrowDyn(_this__u8e3s4) {
|
|
2321
|
-
return _this__u8e3s4.
|
|
2332
|
+
return _this__u8e3s4.n1m(new Name(listOf('&dyn ' + _this__u8e3s4.q1h_1.h1h())));
|
|
2322
2333
|
}
|
|
2323
2334
|
function borrowImpl(_this__u8e3s4) {
|
|
2324
|
-
return _this__u8e3s4.
|
|
2335
|
+
return _this__u8e3s4.n1m(new Name(listOf('&impl ' + _this__u8e3s4.q1h_1.h1h())));
|
|
2325
2336
|
}
|
|
2326
2337
|
//region block: post-declaration
|
|
2327
2338
|
protoOf(RustIrEmitter).on = emit_1;
|