@flock/wirespec 0.18.6 → 0.18.12
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 +11 -11
- package/arrow-arrow-core.mjs +141 -141
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1395 -1395
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +442 -442
- package/kotlin-kotlin-stdlib.mjs +1054 -946
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +20812 -6818
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1797 -1797
- package/kotlinx-io-kotlinx-io-core.mjs +405 -405
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1960 -1763
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1882 -1407
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1269 -1269
- package/package.json +3 -2
- package/wirespec-lsp.mjs +7 -0
- package/wirespec-src-compiler-core.mjs +1708 -1644
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +409 -409
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +326 -326
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +328 -328
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +370 -370
- package/wirespec-src-compiler-emitters-scala.mjs +154 -154
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +372 -372
- package/wirespec-src-compiler-emitters-wirespec.mjs +80 -80
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3193 -3193
- package/wirespec-src-compiler-lib.mjs +399 -399
- package/wirespec-src-converter-avro.mjs +507 -507
- package/wirespec-src-converter-openapi.mjs +1487 -1413
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +4928 -0
- package/wirespec-src-ide-lsp.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +175 -175
- package/wirespec-src-plugin-cli.mjs +102 -102
- package/wirespec-src-plugin-npm.d.mts +2 -0
- package/wirespec-src-plugin-npm.mjs +42 -37
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +32 -32
|
@@ -171,7 +171,7 @@ initMetadataForClass(RustIrEmitter, 'RustIrEmitter', RustIrEmitter, VOID, [IrEmi
|
|
|
171
171
|
initMetadataForObject(RustTransform, 'RustTransform');
|
|
172
172
|
//endregion
|
|
173
173
|
function _get_sanitizationConfig__sns434($this) {
|
|
174
|
-
var tmp0 = $this.
|
|
174
|
+
var tmp0 = $this.e1y_1;
|
|
175
175
|
var tmp = KProperty1;
|
|
176
176
|
// Inline function 'kotlin.getValue' call
|
|
177
177
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, RustIrEmitter$_get_sanitizationConfig_$ref_17ypni(), null);
|
|
@@ -188,7 +188,7 @@ function sanitize($this, _this__u8e3s4) {
|
|
|
188
188
|
var item = _iterator__ex2g4s.v();
|
|
189
189
|
var _unary__edvuaz = index;
|
|
190
190
|
index = _unary__edvuaz + 1 | 0;
|
|
191
|
-
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.
|
|
191
|
+
var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.sq(item) : item;
|
|
192
192
|
destination.x(tmp$ret$0);
|
|
193
193
|
}
|
|
194
194
|
// Inline function 'kotlin.text.filter' call
|
|
@@ -235,14 +235,14 @@ function sanitize($this, _this__u8e3s4) {
|
|
|
235
235
|
return toSnakeCase($this, tmp$ret$9);
|
|
236
236
|
}
|
|
237
237
|
function toSnakeCase($this, _this__u8e3s4) {
|
|
238
|
-
return Companion_getInstance().
|
|
238
|
+
return Companion_getInstance().k1h(_this__u8e3s4).d1m();
|
|
239
239
|
}
|
|
240
240
|
function toPascalCase($this, _this__u8e3s4) {
|
|
241
241
|
var tmp = split(_this__u8e3s4, ['_']);
|
|
242
242
|
return joinToString(tmp, '', VOID, VOID, VOID, VOID, RustIrEmitter$toPascalCase$lambda);
|
|
243
243
|
}
|
|
244
244
|
function sanitizeKeywords($this, _this__u8e3s4) {
|
|
245
|
-
return Companion_getInstance_0().
|
|
245
|
+
return Companion_getInstance_0().h1y_1.u1(_this__u8e3s4) ? 'r#' + _this__u8e3s4 : _this__u8e3s4;
|
|
246
246
|
}
|
|
247
247
|
function sanitizeEnum($this, _this__u8e3s4) {
|
|
248
248
|
// Inline function 'kotlin.let' call
|
|
@@ -267,7 +267,7 @@ function prependImports($this, _this__u8e3s4, imports) {
|
|
|
267
267
|
var tmp;
|
|
268
268
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
269
269
|
if (!imports.r()) {
|
|
270
|
-
tmp = _this__u8e3s4.
|
|
270
|
+
tmp = _this__u8e3s4.b1n(VOID, plus(imports, _this__u8e3s4.y1m_1));
|
|
271
271
|
} else {
|
|
272
272
|
tmp = _this__u8e3s4;
|
|
273
273
|
}
|
|
@@ -287,7 +287,7 @@ function buildClientParams($this, _this__u8e3s4) {
|
|
|
287
287
|
}
|
|
288
288
|
function Companion() {
|
|
289
289
|
Companion_instance_2 = this;
|
|
290
|
-
this.
|
|
290
|
+
this.h1y_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']);
|
|
291
291
|
}
|
|
292
292
|
var Companion_instance_2;
|
|
293
293
|
function Companion_getInstance_0() {
|
|
@@ -296,16 +296,16 @@ function Companion_getInstance_0() {
|
|
|
296
296
|
return Companion_instance_2;
|
|
297
297
|
}
|
|
298
298
|
function sam$kotlin_Comparator$0(function_0) {
|
|
299
|
-
this.
|
|
299
|
+
this.i1y_1 = function_0;
|
|
300
300
|
}
|
|
301
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
302
|
-
return this.
|
|
301
|
+
protoOf(sam$kotlin_Comparator$0).td = function (a, b) {
|
|
302
|
+
return this.i1y_1(a, b);
|
|
303
303
|
};
|
|
304
304
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
305
|
-
return this.
|
|
305
|
+
return this.td(a, b);
|
|
306
306
|
};
|
|
307
307
|
protoOf(sam$kotlin_Comparator$0).l3 = function () {
|
|
308
|
-
return this.
|
|
308
|
+
return this.i1y_1;
|
|
309
309
|
};
|
|
310
310
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
311
311
|
var tmp;
|
|
@@ -329,16 +329,16 @@ function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
|
329
329
|
return 'r#' + it;
|
|
330
330
|
}
|
|
331
331
|
function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
332
|
-
return Companion_getInstance().
|
|
332
|
+
return Companion_getInstance().k1h((new Name(name.l1h_1)).d1m());
|
|
333
333
|
}
|
|
334
334
|
function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
335
|
-
var value = name.
|
|
335
|
+
var value = name.x1h();
|
|
336
336
|
switch (value) {
|
|
337
337
|
case 'self':
|
|
338
338
|
case '&self':
|
|
339
339
|
return name;
|
|
340
340
|
default:
|
|
341
|
-
return Companion_getInstance().
|
|
341
|
+
return Companion_getInstance().k1h((new Name(name.l1h_1)).d1m());
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
@@ -348,9 +348,9 @@ function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
348
348
|
return function (stmt, tr) {
|
|
349
349
|
var tmp;
|
|
350
350
|
if (stmt instanceof ConstructorStatement) {
|
|
351
|
-
var tmp_0 = tr.
|
|
351
|
+
var tmp_0 = tr.u1t(stmt.u1m_1);
|
|
352
352
|
// Inline function 'kotlin.collections.map' call
|
|
353
|
-
var this_0 = stmt.
|
|
353
|
+
var this_0 = stmt.v1m_1;
|
|
354
354
|
// Inline function 'kotlin.collections.mapTo' call
|
|
355
355
|
var destination = ArrayList_init_$Create$(this_0.a1());
|
|
356
356
|
// Inline function 'kotlin.collections.iterator' call
|
|
@@ -361,7 +361,7 @@ function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
361
361
|
var k = item.k1();
|
|
362
362
|
// Inline function 'kotlin.collections.component2' call
|
|
363
363
|
var v = item.l1();
|
|
364
|
-
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.x1t(v));
|
|
365
365
|
destination.x(tmp$ret$3);
|
|
366
366
|
}
|
|
367
367
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -373,7 +373,7 @@ function RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
373
373
|
}
|
|
374
374
|
function RustIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
375
375
|
return function () {
|
|
376
|
-
var tmp0_reservedKeywords = minus(Companion_getInstance_0().
|
|
376
|
+
var tmp0_reservedKeywords = minus(Companion_getInstance_0().h1y_1, setOf(['self', 'Self']));
|
|
377
377
|
var tmp = RustIrEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
378
378
|
var tmp_0 = RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
379
379
|
var tmp_1 = RustIrEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -387,69 +387,69 @@ function RustIrEmitter$_get_sanitizationConfig_$ref_17ypni() {
|
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
function RustIrEmitter$emitShared$lambda($this$interface) {
|
|
390
|
-
$this$interface.
|
|
390
|
+
$this$interface.j1j(Custom_init_$Create$('Headers'));
|
|
391
391
|
return Unit_instance;
|
|
392
392
|
}
|
|
393
393
|
function RustIrEmitter$emitShared$lambda_0($this$interface) {
|
|
394
|
-
$this$interface.
|
|
394
|
+
$this$interface.j1j(Custom_init_$Create$('Headers'));
|
|
395
395
|
return Unit_instance;
|
|
396
396
|
}
|
|
397
397
|
function RustIrEmitter$emitShared$lambda_1($this$interface) {
|
|
398
|
-
$this$interface.
|
|
399
|
-
$this$interface.
|
|
400
|
-
$this$interface.
|
|
398
|
+
$this$interface.j1j(Custom_init_$Create$('Sized'));
|
|
399
|
+
$this$interface.g1i('label', VOID, VOID, RustIrEmitter$emitShared$lambda$lambda);
|
|
400
|
+
$this$interface.g1i('from_label', true, VOID, RustIrEmitter$emitShared$lambda$lambda_0);
|
|
401
401
|
return Unit_instance;
|
|
402
402
|
}
|
|
403
403
|
function RustIrEmitter$emitShared$lambda$lambda($this$function) {
|
|
404
|
-
$this$function.
|
|
405
|
-
$this$function.
|
|
404
|
+
$this$function.q1i('&self', Custom_init_$Create$(''));
|
|
405
|
+
$this$function.p1i(Custom_init_$Create$('&str'));
|
|
406
406
|
return Unit_instance;
|
|
407
407
|
}
|
|
408
408
|
function RustIrEmitter$emitShared$lambda$lambda_0($this$function) {
|
|
409
|
-
$this$function.
|
|
410
|
-
$this$function.
|
|
409
|
+
$this$function.q1i('s', Custom_init_$Create$('&str'));
|
|
410
|
+
$this$function.p1i(Custom_init_$Create$('Option<Self>'));
|
|
411
411
|
return Unit_instance;
|
|
412
412
|
}
|
|
413
413
|
function RustIrEmitter$emitShared$lambda_2($this$interface) {
|
|
414
|
-
$this$interface.
|
|
415
|
-
$this$interface.
|
|
416
|
-
$this$interface.
|
|
414
|
+
$this$interface.f1i($this$interface.y1h('T', []), []);
|
|
415
|
+
$this$interface.g1i('value', VOID, VOID, RustIrEmitter$emitShared$lambda$lambda_1);
|
|
416
|
+
$this$interface.g1i('validate', VOID, VOID, RustIrEmitter$emitShared$lambda$lambda_2);
|
|
417
417
|
return Unit_instance;
|
|
418
418
|
}
|
|
419
419
|
function RustIrEmitter$emitShared$lambda$lambda_1($this$function) {
|
|
420
|
-
$this$function.
|
|
421
|
-
$this$function.
|
|
420
|
+
$this$function.q1i('&self', Custom_init_$Create$(''));
|
|
421
|
+
$this$function.p1i(borrow($this$function.y1h('T', [])));
|
|
422
422
|
return Unit_instance;
|
|
423
423
|
}
|
|
424
424
|
function RustIrEmitter$emitShared$lambda$lambda_2($this$function) {
|
|
425
|
-
$this$function.
|
|
426
|
-
$this$function.
|
|
425
|
+
$this$function.q1i('&self', Custom_init_$Create$(''));
|
|
426
|
+
$this$function.p1i($this$function.x1i());
|
|
427
427
|
return Unit_instance;
|
|
428
428
|
}
|
|
429
429
|
function RustIrEmitter$emitShared$lambda_3($this$interface) {
|
|
430
|
-
$this$interface.
|
|
431
|
-
$this$interface.
|
|
432
|
-
$this$interface.
|
|
433
|
-
$this$interface.
|
|
434
|
-
$this$interface.
|
|
435
|
-
$this$interface.
|
|
430
|
+
$this$interface.f1i($this$interface.y1h('T', []), []);
|
|
431
|
+
$this$interface.r1i('path', borrowDyn($this$interface.y1h('Path', [])));
|
|
432
|
+
$this$interface.r1i('method', borrow($this$interface.y1h('Method', [])));
|
|
433
|
+
$this$interface.r1i('queries', borrowDyn($this$interface.y1h('Queries', [])));
|
|
434
|
+
$this$interface.r1i('headers', borrowDyn($this$interface.y1h('RequestHeaders', [])));
|
|
435
|
+
$this$interface.r1i('body', borrow($this$interface.y1h('T', [])));
|
|
436
436
|
return Unit_instance;
|
|
437
437
|
}
|
|
438
438
|
function RustIrEmitter$emitShared$lambda_4($this$interface) {
|
|
439
|
-
$this$interface.
|
|
440
|
-
$this$interface.
|
|
441
|
-
$this$interface.
|
|
442
|
-
$this$interface.
|
|
439
|
+
$this$interface.f1i($this$interface.y1h('T', []), []);
|
|
440
|
+
$this$interface.r1i('status', $this$interface.q1t());
|
|
441
|
+
$this$interface.r1i('headers', borrowDyn($this$interface.y1h('ResponseHeaders', [])));
|
|
442
|
+
$this$interface.r1i('body', borrow($this$interface.y1h('T', [])));
|
|
443
443
|
return Unit_instance;
|
|
444
444
|
}
|
|
445
445
|
function RustIrEmitter$emitShared$lambda_5($this$interface) {
|
|
446
|
-
$this$interface.
|
|
446
|
+
$this$interface.t1j('transport', VOID, VOID, RustIrEmitter$emitShared$lambda$lambda_3);
|
|
447
447
|
return Unit_instance;
|
|
448
448
|
}
|
|
449
449
|
function RustIrEmitter$emitShared$lambda$lambda_3($this$asyncFunction) {
|
|
450
|
-
$this$asyncFunction.
|
|
451
|
-
$this$asyncFunction.
|
|
452
|
-
$this$asyncFunction.
|
|
450
|
+
$this$asyncFunction.q1i('&self', Custom_init_$Create$(''));
|
|
451
|
+
$this$asyncFunction.q1i('request', borrow($this$asyncFunction.y1h('RawRequest', [])));
|
|
452
|
+
$this$asyncFunction.p1i($this$asyncFunction.y1h('RawResponse', []));
|
|
453
453
|
return Unit_instance;
|
|
454
454
|
}
|
|
455
455
|
function RustIrEmitter$emitShared$lambda_6($rustImports) {
|
|
@@ -457,7 +457,7 @@ function RustIrEmitter$emitShared$lambda_6($rustImports) {
|
|
|
457
457
|
var tmp;
|
|
458
458
|
if (element instanceof File) {
|
|
459
459
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
460
|
-
var tmp0 = element.
|
|
460
|
+
var tmp0 = element.y1m_1;
|
|
461
461
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
462
462
|
var destination = ArrayList_init_$Create$_0();
|
|
463
463
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -468,7 +468,7 @@ function RustIrEmitter$emitShared$lambda_6($rustImports) {
|
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
var namespace = first(destination);
|
|
471
|
-
tmp = element.
|
|
471
|
+
tmp = element.b1n(VOID, plus($rustImports, namespace.e1n_1));
|
|
472
472
|
} else {
|
|
473
473
|
tmp = element;
|
|
474
474
|
}
|
|
@@ -480,7 +480,7 @@ function RustIrEmitter$emitShared$lambda_7(element, transformer) {
|
|
|
480
480
|
var tmp;
|
|
481
481
|
if (element instanceof Enum) {
|
|
482
482
|
var tmp_0;
|
|
483
|
-
if (element.
|
|
483
|
+
if (element.c1o_1.equals(Companion_getInstance().k1h('Method'))) {
|
|
484
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}');
|
|
485
485
|
} else {
|
|
486
486
|
tmp_0 = element;
|
|
@@ -497,7 +497,7 @@ function RustIrEmitter$emitShared$lambda_8($dslTraits, $requestHeaders, $respons
|
|
|
497
497
|
var tmp;
|
|
498
498
|
if (element instanceof File) {
|
|
499
499
|
// Inline function 'kotlin.collections.flatMap' call
|
|
500
|
-
var tmp0 = element.
|
|
500
|
+
var tmp0 = element.y1m_1;
|
|
501
501
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
502
502
|
var destination = ArrayList_init_$Create$_0();
|
|
503
503
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -509,7 +509,7 @@ function RustIrEmitter$emitShared$lambda_8($dslTraits, $requestHeaders, $respons
|
|
|
509
509
|
tmp$ret$0 = listOf(element_0);
|
|
510
510
|
break $l$block;
|
|
511
511
|
}
|
|
512
|
-
var name = element_0.
|
|
512
|
+
var name = element_0.p1n_1.m1h();
|
|
513
513
|
var tmp_0;
|
|
514
514
|
// Inline function 'kotlin.collections.contains' call
|
|
515
515
|
// Inline function 'kotlin.collections.containsKey' call
|
|
@@ -543,7 +543,7 @@ function RustIrEmitter$emitShared$lambda_8($dslTraits, $requestHeaders, $respons
|
|
|
543
543
|
addAll(destination, list);
|
|
544
544
|
}
|
|
545
545
|
var newElements = plus_0(plus_0(destination, $client), $server);
|
|
546
|
-
tmp = element.
|
|
546
|
+
tmp = element.b1n(VOID, newElements);
|
|
547
547
|
} else {
|
|
548
548
|
tmp = element;
|
|
549
549
|
}
|
|
@@ -559,14 +559,14 @@ function RustIrEmitter$emitShared$lambda_9(element, transformer) {
|
|
|
559
559
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
560
560
|
var tmp_0 = scope;
|
|
561
561
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
562
|
-
var this_0 = scope.
|
|
562
|
+
var this_0 = scope.c1u_1;
|
|
563
563
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
564
564
|
// Inline function 'kotlin.apply' call
|
|
565
565
|
var this_1 = new TransformerBuilder();
|
|
566
|
-
this_1.
|
|
567
|
-
var tmp$ret$2 = this_1.
|
|
568
|
-
tmp_0.
|
|
569
|
-
var tmp_1 = scope.
|
|
566
|
+
this_1.h1h(RustIrEmitter$emitShared$lambda$lambda_4);
|
|
567
|
+
var tmp$ret$2 = this_1.i1h();
|
|
568
|
+
tmp_0.c1u_1 = transform(this_0, tmp$ret$2);
|
|
569
|
+
var tmp_1 = scope.c1u_1;
|
|
570
570
|
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
571
571
|
} else {
|
|
572
572
|
tmp = element;
|
|
@@ -577,7 +577,7 @@ function RustIrEmitter$emitShared$lambda_9(element, transformer) {
|
|
|
577
577
|
function RustIrEmitter$emitShared$lambda$lambda_4(element, transformer) {
|
|
578
578
|
var tmp;
|
|
579
579
|
if (element instanceof Function) {
|
|
580
|
-
var tmp0 = element.
|
|
580
|
+
var tmp0 = element.a1k_1;
|
|
581
581
|
var tmp$ret$0;
|
|
582
582
|
$l$block_0: {
|
|
583
583
|
// Inline function 'kotlin.collections.any' call
|
|
@@ -594,7 +594,7 @@ function RustIrEmitter$emitShared$lambda$lambda_4(element, transformer) {
|
|
|
594
594
|
var _iterator__ex2g4s = tmp0.t();
|
|
595
595
|
while (_iterator__ex2g4s.u()) {
|
|
596
596
|
var element_0 = _iterator__ex2g4s.v();
|
|
597
|
-
if (element_0.
|
|
597
|
+
if (element_0.z1o_1.x1h() === '&self' || element_0.z1o_1.x1h() === 'self') {
|
|
598
598
|
tmp$ret$0 = true;
|
|
599
599
|
break $l$block_0;
|
|
600
600
|
}
|
|
@@ -602,7 +602,7 @@ function RustIrEmitter$emitShared$lambda$lambda_4(element, transformer) {
|
|
|
602
602
|
tmp$ret$0 = false;
|
|
603
603
|
}
|
|
604
604
|
var hasSelf = tmp$ret$0;
|
|
605
|
-
tmp = hasSelf || element.
|
|
605
|
+
tmp = hasSelf || element.e1k_1 ? element : element.g1k(VOID, VOID, plus(listOf(get_rustSelfParam()), element.a1k_1));
|
|
606
606
|
} else {
|
|
607
607
|
tmp = element;
|
|
608
608
|
}
|
|
@@ -613,7 +613,7 @@ function RustIrEmitter$emitShared$lambda_10(group) {
|
|
|
613
613
|
return trimEnd(joinToString(group, '', VOID, VOID, VOID, VOID, RustIrEmitter$emitShared$lambda$lambda_5), charArrayOf([_Char___init__impl__6a9atx(10)]));
|
|
614
614
|
}
|
|
615
615
|
function RustIrEmitter$emitShared$lambda$lambda_5(it) {
|
|
616
|
-
return RustGenerator_instance.
|
|
616
|
+
return RustGenerator_instance.q1u(it);
|
|
617
617
|
}
|
|
618
618
|
function RustIrEmitter$emit$lambda(a, b) {
|
|
619
619
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
@@ -622,7 +622,7 @@ function RustIrEmitter$emit$lambda(a, b) {
|
|
|
622
622
|
return compareValues(tmp, tmp$ret$1);
|
|
623
623
|
}
|
|
624
624
|
function emit$emitMod(this$0, def) {
|
|
625
|
-
return 'pub mod ' + sanitize(this$0, def.
|
|
625
|
+
return 'pub mod ' + sanitize(this$0, def.ar()) + ';';
|
|
626
626
|
}
|
|
627
627
|
function RustIrEmitter$emit$lambda_0(this$0) {
|
|
628
628
|
return function (it) {
|
|
@@ -641,7 +641,7 @@ function RustIrEmitter$emit$lambda_2(this$0) {
|
|
|
641
641
|
}
|
|
642
642
|
function RustIrEmitter$emitClient$lambda(this$0) {
|
|
643
643
|
return function (endpoint) {
|
|
644
|
-
return 'pub mod ' + toSnakeCase(this$0, endpoint.
|
|
644
|
+
return 'pub mod ' + toSnakeCase(this$0, endpoint.ip_1.l1() + 'Client') + ';';
|
|
645
645
|
};
|
|
646
646
|
}
|
|
647
647
|
function RustIrEmitter$toPascalCase$lambda(s) {
|
|
@@ -661,39 +661,39 @@ function RustIrEmitter$toPascalCase$lambda(s) {
|
|
|
661
661
|
}
|
|
662
662
|
function RustIrEmitter$buildClientParams$lambda(this$0) {
|
|
663
663
|
return function (_destruct__k2r9zo) {
|
|
664
|
-
var name = _destruct__k2r9zo.
|
|
665
|
-
return sanitizeKeywords(this$0, name.
|
|
664
|
+
var name = _destruct__k2r9zo.qe();
|
|
665
|
+
return sanitizeKeywords(this$0, name.d1m());
|
|
666
666
|
};
|
|
667
667
|
}
|
|
668
668
|
function RustIrEmitter$buildClientParams$lambda_0(this$0) {
|
|
669
669
|
return function (_destruct__k2r9zo) {
|
|
670
|
-
var name = _destruct__k2r9zo.
|
|
671
|
-
var type = _destruct__k2r9zo.
|
|
672
|
-
var tmp = sanitizeKeywords(this$0, name.
|
|
670
|
+
var name = _destruct__k2r9zo.qe();
|
|
671
|
+
var type = _destruct__k2r9zo.re();
|
|
672
|
+
var tmp = sanitizeKeywords(this$0, name.d1m());
|
|
673
673
|
// Inline function 'kotlin.with' call
|
|
674
|
-
return tmp + ': ' + RustTransform_getInstance().
|
|
674
|
+
return tmp + ': ' + RustTransform_getInstance().p1y(type);
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
677
|
function RustIrEmitter(packageName, emitShared) {
|
|
678
678
|
Companion_getInstance_0();
|
|
679
|
-
packageName = packageName === VOID ? Companion_instance_0.
|
|
680
|
-
emitShared = emitShared === VOID ? Companion_instance_1.
|
|
681
|
-
this.
|
|
682
|
-
this.
|
|
683
|
-
this.
|
|
684
|
-
this.
|
|
679
|
+
packageName = packageName === VOID ? Companion_instance_0.qr('community.flock.wirespec.generated') : packageName;
|
|
680
|
+
emitShared = emitShared === VOID ? Companion_instance_1.ko() : emitShared;
|
|
681
|
+
this.a1y_1 = packageName;
|
|
682
|
+
this.b1y_1 = emitShared;
|
|
683
|
+
this.c1y_1 = RustGenerator_instance;
|
|
684
|
+
this.d1y_1 = FileExtension_Rust_getInstance();
|
|
685
685
|
var tmp = this;
|
|
686
|
-
tmp.
|
|
687
|
-
this.
|
|
688
|
-
this.
|
|
686
|
+
tmp.e1y_1 = lazy(RustIrEmitter$sanitizationConfig$delegate$lambda(this));
|
|
687
|
+
this.f1y_1 = listOf_0([import_0('super::super::wirespec', '*'), import_0('', 'regex')]);
|
|
688
|
+
this.g1y_1 = listOf_0([import_0('super::super::wirespec', '*'), import_0('', 'regex')]);
|
|
689
689
|
}
|
|
690
|
-
protoOf(RustIrEmitter).
|
|
691
|
-
return this.
|
|
690
|
+
protoOf(RustIrEmitter).p1u = function () {
|
|
691
|
+
return this.c1y_1;
|
|
692
692
|
};
|
|
693
|
-
protoOf(RustIrEmitter).
|
|
694
|
-
return this.
|
|
693
|
+
protoOf(RustIrEmitter).iq = function () {
|
|
694
|
+
return this.d1y_1;
|
|
695
695
|
};
|
|
696
|
-
protoOf(RustIrEmitter).
|
|
696
|
+
protoOf(RustIrEmitter).s1u = function () {
|
|
697
697
|
var rustImports = listOf_0([import_0('std::any', 'TypeId'), import_0('std::collections', 'HashMap')]);
|
|
698
698
|
var requestHeaders = interface_0('RequestHeaders', VOID, RustIrEmitter$emitShared$lambda);
|
|
699
699
|
var responseHeaders = interface_0('ResponseHeaders', VOID, RustIrEmitter$emitShared$lambda_0);
|
|
@@ -707,43 +707,43 @@ protoOf(RustIrEmitter).n1u = function () {
|
|
|
707
707
|
var transportationTrait = interface_0('Transportation', VOID, RustIrEmitter$emitShared$lambda_5);
|
|
708
708
|
var dslTraits = mapOf([to('Enum', enumTrait), to('Refined', refinedTrait), to('Request', requestTrait), to('Response', responseTrait), to('Transportation', transportationTrait)]);
|
|
709
709
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
710
|
-
var this_0 = convert(Companion_instance_0.
|
|
710
|
+
var this_0 = convert(Companion_instance_0.qr('shared'));
|
|
711
711
|
var scope = new TransformScope(this_0);
|
|
712
712
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
713
713
|
var tmp = scope;
|
|
714
714
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
715
|
-
var this_1 = scope.
|
|
715
|
+
var this_1 = scope.c1u_1;
|
|
716
716
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
717
717
|
// Inline function 'kotlin.apply' call
|
|
718
718
|
var this_2 = new TransformerBuilder();
|
|
719
|
-
this_2.
|
|
720
|
-
var tmp$ret$2 = this_2.
|
|
721
|
-
tmp.
|
|
719
|
+
this_2.h1h(RustIrEmitter$emitShared$lambda_6(rustImports));
|
|
720
|
+
var tmp$ret$2 = this_2.i1h();
|
|
721
|
+
tmp.c1u_1 = transform(this_1, tmp$ret$2);
|
|
722
722
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
723
723
|
var tmp_0 = scope;
|
|
724
724
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
725
|
-
var this_3 = scope.
|
|
725
|
+
var this_3 = scope.c1u_1;
|
|
726
726
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
727
727
|
// Inline function 'kotlin.apply' call
|
|
728
728
|
var this_4 = new TransformerBuilder();
|
|
729
|
-
this_4.
|
|
730
|
-
var tmp$ret$7 = this_4.
|
|
731
|
-
tmp_0.
|
|
729
|
+
this_4.h1h(RustIrEmitter$emitShared$lambda_7);
|
|
730
|
+
var tmp$ret$7 = this_4.i1h();
|
|
731
|
+
tmp_0.c1u_1 = transform(this_3, tmp$ret$7);
|
|
732
732
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
733
733
|
var tmp_1 = scope;
|
|
734
734
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
735
|
-
var this_5 = scope.
|
|
735
|
+
var this_5 = scope.c1u_1;
|
|
736
736
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
737
737
|
// Inline function 'kotlin.apply' call
|
|
738
738
|
var this_6 = new TransformerBuilder();
|
|
739
|
-
this_6.
|
|
740
|
-
var tmp$ret$12 = this_6.
|
|
741
|
-
tmp_1.
|
|
742
|
-
var tmp_2 = scope.
|
|
739
|
+
this_6.h1h(RustIrEmitter$emitShared$lambda_8(dslTraits, requestHeaders, responseHeaders, rawElementInterfaces, client, server));
|
|
740
|
+
var tmp$ret$12 = this_6.i1h();
|
|
741
|
+
tmp_1.c1u_1 = transform(this_5, tmp$ret$12);
|
|
742
|
+
var tmp_2 = scope.c1u_1;
|
|
743
743
|
// Inline function 'kotlin.let' call
|
|
744
744
|
var file = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
745
745
|
// Inline function 'kotlin.collections.flatMap' call
|
|
746
|
-
var tmp0 = file.
|
|
746
|
+
var tmp0 = file.y1m_1;
|
|
747
747
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
748
748
|
var destination = ArrayList_init_$Create$_0();
|
|
749
749
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -756,7 +756,7 @@ protoOf(RustIrEmitter).n1u = function () {
|
|
|
756
756
|
break $l$block;
|
|
757
757
|
}
|
|
758
758
|
var derive;
|
|
759
|
-
switch (element.
|
|
759
|
+
switch (element.i1n_1.m1h()) {
|
|
760
760
|
case 'RawRequest':
|
|
761
761
|
case 'RawResponse':
|
|
762
762
|
derive = '#[derive(Debug, Clone, PartialEq)]';
|
|
@@ -765,29 +765,29 @@ protoOf(RustIrEmitter).n1u = function () {
|
|
|
765
765
|
derive = '#[derive(Debug, Clone, Default, PartialEq)]';
|
|
766
766
|
break;
|
|
767
767
|
}
|
|
768
|
-
tmp$ret$17 = listOf(new File(element.
|
|
768
|
+
tmp$ret$17 = listOf(new File(element.i1n_1, listOf_0([new RawElement(derive), element])));
|
|
769
769
|
}
|
|
770
770
|
var list = tmp$ret$17;
|
|
771
771
|
addAll(destination, list);
|
|
772
772
|
}
|
|
773
|
-
var tmp0_0 = new File(file.
|
|
773
|
+
var tmp0_0 = new File(file.x1m_1, destination);
|
|
774
774
|
// Inline function 'kotlin.let' call
|
|
775
|
-
var wirespecFile = RustTransform_getInstance().
|
|
775
|
+
var wirespecFile = RustTransform_getInstance().q1y(tmp0_0);
|
|
776
776
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
777
777
|
var scope_0 = new TransformScope(wirespecFile);
|
|
778
778
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
779
779
|
var tmp_3 = scope_0;
|
|
780
780
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
781
|
-
var this_7 = scope_0.
|
|
781
|
+
var this_7 = scope_0.c1u_1;
|
|
782
782
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
783
783
|
// Inline function 'kotlin.apply' call
|
|
784
784
|
var this_8 = new TransformerBuilder();
|
|
785
|
-
this_8.
|
|
786
|
-
var tmp$ret$26 = this_8.
|
|
787
|
-
tmp_3.
|
|
788
|
-
var tmp_4 = scope_0.
|
|
785
|
+
this_8.h1h(RustIrEmitter$emitShared$lambda_9);
|
|
786
|
+
var tmp$ret$26 = this_8.i1h();
|
|
787
|
+
tmp_3.c1u_1 = transform(this_7, tmp$ret$26);
|
|
788
|
+
var tmp_4 = scope_0.c1u_1;
|
|
789
789
|
// Inline function 'kotlin.let' call
|
|
790
|
-
var tmp0_1 = (isInterface(tmp_4, Element) ? tmp_4 : THROW_CCE()).
|
|
790
|
+
var tmp0_1 = (isInterface(tmp_4, Element) ? tmp_4 : THROW_CCE()).y1m_1;
|
|
791
791
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
792
792
|
// Inline function 'kotlin.collections.fold' call
|
|
793
793
|
var accumulator = ArrayList_init_$Create$_0();
|
|
@@ -808,26 +808,26 @@ protoOf(RustIrEmitter).n1u = function () {
|
|
|
808
808
|
var groups = accumulator;
|
|
809
809
|
var source = joinToString(groups, '\n\n', VOID, VOID, VOID, VOID, RustIrEmitter$emitShared$lambda_10) + '\n';
|
|
810
810
|
var tmp_6;
|
|
811
|
-
if (this.
|
|
812
|
-
tmp_6 = new File(Companion_getInstance().
|
|
811
|
+
if (this.b1y_1.lo_1) {
|
|
812
|
+
tmp_6 = new File(Companion_getInstance().k1h(this.a1y_1.tr() + 'wirespec'), listOf(new RawElement(source)));
|
|
813
813
|
} else {
|
|
814
814
|
tmp_6 = null;
|
|
815
815
|
}
|
|
816
816
|
return tmp_6;
|
|
817
817
|
};
|
|
818
|
-
protoOf(RustIrEmitter).
|
|
818
|
+
protoOf(RustIrEmitter).r1u = function (module_0, logger) {
|
|
819
819
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
820
|
-
var this_0 = new NonEmptyList(module_0.
|
|
820
|
+
var this_0 = new NonEmptyList(module_0.hq_1);
|
|
821
821
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
822
822
|
var tmp = RustIrEmitter$emit$lambda;
|
|
823
823
|
var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
|
|
824
824
|
var tmp$ret$1 = sortedWith(this_0, tmp$ret$0);
|
|
825
825
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$1);
|
|
826
|
-
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).
|
|
826
|
+
var statements = ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).cm_1;
|
|
827
827
|
// Inline function 'kotlin.let' call
|
|
828
|
-
var files = emit.call(this, module_0.
|
|
828
|
+
var files = emit.call(this, module_0.av(VOID, statements), logger);
|
|
829
829
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
830
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
830
|
+
var tmp0 = new NonEmptyList(module_0.hq_1);
|
|
831
831
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
832
832
|
var destination = ArrayList_init_$Create$_0();
|
|
833
833
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -847,11 +847,11 @@ protoOf(RustIrEmitter).m1u = function (module_0, logger) {
|
|
|
847
847
|
tmp_1 = '';
|
|
848
848
|
}
|
|
849
849
|
var clientMod = tmp_1;
|
|
850
|
-
var modRs = new File(Companion_getInstance().
|
|
851
|
-
var modEndpoint = new File(Companion_getInstance().
|
|
852
|
-
var tmp_2 = Companion_getInstance().
|
|
850
|
+
var modRs = new File(Companion_getInstance().k1h(this.a1y_1.tr() + 'mod'), listOf(new RawElement('#![allow(warnings)]\npub mod model;\npub mod endpoint;' + clientMod + '\npub mod wirespec;')));
|
|
851
|
+
var modEndpoint = new File(Companion_getInstance().k1h(this.a1y_1.tr() + 'endpoint/' + 'mod'), listOf(new RawElement(endpointMods)));
|
|
852
|
+
var tmp_2 = Companion_getInstance().k1h(this.a1y_1.tr() + 'model/' + 'mod');
|
|
853
853
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
854
|
-
var tmp0_0 = new NonEmptyList(module_0.
|
|
854
|
+
var tmp0_0 = new NonEmptyList(module_0.hq_1);
|
|
855
855
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
856
856
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
857
857
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
@@ -863,23 +863,23 @@ protoOf(RustIrEmitter).m1u = function (module_0, logger) {
|
|
|
863
863
|
}
|
|
864
864
|
var tmp_3 = destination_0;
|
|
865
865
|
var modModel = new File(tmp_2, listOf(new RawElement(joinToString(tmp_3, '\n', VOID, VOID, VOID, VOID, RustIrEmitter$emit$lambda_1(this)))));
|
|
866
|
-
return this.
|
|
866
|
+
return this.b1y_1.lo_1 ? NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(files, modRs), modEndpoint), modModel) : NonEmptyList__plus_impl_xqmb9(files, modRs);
|
|
867
867
|
};
|
|
868
|
-
protoOf(RustIrEmitter).
|
|
869
|
-
var subPackageName = plus_1(this.
|
|
868
|
+
protoOf(RustIrEmitter).zq = function (definition, module_0, logger) {
|
|
869
|
+
var subPackageName = plus_1(this.a1y_1, definition);
|
|
870
870
|
var tmp;
|
|
871
871
|
if (definition instanceof Endpoint) {
|
|
872
|
-
tmp = this.
|
|
872
|
+
tmp = this.g1y_1;
|
|
873
873
|
} else {
|
|
874
|
-
tmp = this.
|
|
874
|
+
tmp = this.f1y_1;
|
|
875
875
|
}
|
|
876
876
|
var importHeader = tmp;
|
|
877
877
|
var tmp0 = emit_0.call(this, definition, module_0, logger);
|
|
878
878
|
// Inline function 'kotlin.let' call
|
|
879
|
-
var file = RustTransform_getInstance().
|
|
880
|
-
var tmp_0 = Companion_getInstance().
|
|
879
|
+
var file = RustTransform_getInstance().q1y(tmp0);
|
|
880
|
+
var tmp_0 = Companion_getInstance().k1h(subPackageName.tr() + toSnakeCase(this, file.x1m_1.m1h()));
|
|
881
881
|
// Inline function 'kotlin.collections.flatMap' call
|
|
882
|
-
var tmp0_0 = file.
|
|
882
|
+
var tmp0_0 = file.y1m_1;
|
|
883
883
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
884
884
|
var destination = ArrayList_init_$Create$_0();
|
|
885
885
|
var _iterator__ex2g4s = tmp0_0.t();
|
|
@@ -896,55 +896,55 @@ protoOf(RustIrEmitter).uq = function (definition, module_0, logger) {
|
|
|
896
896
|
}
|
|
897
897
|
return new File(tmp_0, plus(importHeader, destination));
|
|
898
898
|
};
|
|
899
|
-
protoOf(RustIrEmitter).
|
|
899
|
+
protoOf(RustIrEmitter).yp = function (type, module_0) {
|
|
900
900
|
var tmp = convertWithValidation(type, module_0);
|
|
901
901
|
// Inline function 'kotlin.collections.map' call
|
|
902
|
-
var this_0 = type.wo_1
|
|
902
|
+
var this_0 = type.ap_1.wo_1;
|
|
903
903
|
// Inline function 'kotlin.collections.mapTo' call
|
|
904
904
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
905
905
|
var _iterator__ex2g4s = this_0.t();
|
|
906
906
|
while (_iterator__ex2g4s.u()) {
|
|
907
907
|
var item = _iterator__ex2g4s.v();
|
|
908
|
-
var tmp$ret$0 = item.
|
|
908
|
+
var tmp$ret$0 = item.ep_1.l1();
|
|
909
909
|
destination.x(tmp$ret$0);
|
|
910
910
|
}
|
|
911
911
|
return prependImports(this, sanitizeNames(injectSelfReceiverToValidate(tmp, toSet(destination), '&self'), _get_sanitizationConfig__sns434(this)), buildModelImports(type));
|
|
912
912
|
};
|
|
913
|
-
protoOf(RustIrEmitter).
|
|
913
|
+
protoOf(RustIrEmitter).nr = function (enum_0, module_0) {
|
|
914
914
|
var tmp = convert_0(enum_0);
|
|
915
915
|
return sanitizeEnumEntries(tmp, RustIrEmitter$emit$lambda_2(this));
|
|
916
916
|
};
|
|
917
|
-
protoOf(RustIrEmitter).
|
|
917
|
+
protoOf(RustIrEmitter).dr = function (union) {
|
|
918
918
|
return convert_1(union);
|
|
919
919
|
};
|
|
920
|
-
protoOf(RustIrEmitter).
|
|
920
|
+
protoOf(RustIrEmitter).ir = function (refined) {
|
|
921
921
|
return replaceStructWithRefinedFunctions(convert_2(refined), refined);
|
|
922
922
|
};
|
|
923
|
-
protoOf(RustIrEmitter).
|
|
923
|
+
protoOf(RustIrEmitter).or = function (endpoint) {
|
|
924
924
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
925
925
|
var this_0 = stripResponseGenerics(stripHandlerExtends(convertSimpleRawExpressionsToVariableRefs(stripWirespecPrefix(flattenForRust(convert_3(endpoint))))));
|
|
926
926
|
var scope = new TransformScope(this_0);
|
|
927
|
-
scope.
|
|
928
|
-
var tmp = scope.
|
|
927
|
+
scope.h1u(fixResponseSwitchPatterns());
|
|
928
|
+
var tmp = scope.c1u_1;
|
|
929
929
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
930
930
|
var this_1 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
931
931
|
var scope_0 = new TransformScope(this_1);
|
|
932
|
-
scope_0.
|
|
933
|
-
var tmp_0 = scope_0.
|
|
932
|
+
scope_0.h1u(fixConstructorCalls());
|
|
933
|
+
var tmp_0 = scope_0.c1u_1;
|
|
934
934
|
var tmp$ret$3 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
935
935
|
return prependImports(this, sanitizeNames(injectApiStruct(injectResponseFromImpls(injectHandlerImplForClient(injectSelfToHandlerMethods(tmp$ret$3), endpoint)), endpoint), _get_sanitizationConfig__sns434(this)), buildEndpointImports(endpoint));
|
|
936
936
|
};
|
|
937
|
-
protoOf(RustIrEmitter).
|
|
937
|
+
protoOf(RustIrEmitter).cr = function (channel) {
|
|
938
938
|
return convert_4(channel);
|
|
939
939
|
};
|
|
940
|
-
protoOf(RustIrEmitter).
|
|
941
|
-
var endpointName = endpoint.
|
|
940
|
+
protoOf(RustIrEmitter).u1u = function (endpoint) {
|
|
941
|
+
var endpointName = endpoint.ip_1.l1();
|
|
942
942
|
var endpointModuleName = toSnakeCase(this, endpointName);
|
|
943
943
|
var clientName = endpointName + 'Client';
|
|
944
944
|
var methodName = toSnakeCase(this, endpointName);
|
|
945
945
|
var _destruct__k2r9zo = buildClientParams(this, endpoint);
|
|
946
|
-
var paramsStr = _destruct__k2r9zo.
|
|
947
|
-
var requestArgs = _destruct__k2r9zo.
|
|
946
|
+
var paramsStr = _destruct__k2r9zo.qe();
|
|
947
|
+
var requestArgs = _destruct__k2r9zo.re();
|
|
948
948
|
var requestConstruction = endpointModuleName + '::Request::new(' + requestArgs + ')';
|
|
949
949
|
// Inline function 'kotlin.collections.distinctBy' call
|
|
950
950
|
var this_0 = importReferences(endpoint);
|
|
@@ -953,7 +953,7 @@ protoOf(RustIrEmitter).p1u = function (endpoint) {
|
|
|
953
953
|
var _iterator__ex2g4s = this_0.t();
|
|
954
954
|
while (_iterator__ex2g4s.u()) {
|
|
955
955
|
var e = _iterator__ex2g4s.v();
|
|
956
|
-
var key = e.
|
|
956
|
+
var key = e.pu_1;
|
|
957
957
|
if (set.x(key)) {
|
|
958
958
|
list.x(e);
|
|
959
959
|
}
|
|
@@ -964,7 +964,7 @@ protoOf(RustIrEmitter).p1u = function (endpoint) {
|
|
|
964
964
|
var _iterator__ex2g4s_0 = list.t();
|
|
965
965
|
while (_iterator__ex2g4s_0.u()) {
|
|
966
966
|
var item = _iterator__ex2g4s_0.v();
|
|
967
|
-
var tmp$ret$2 = import_0('super::super::model::' + toSnakeCase(this, item.
|
|
967
|
+
var tmp$ret$2 = import_0('super::super::model::' + toSnakeCase(this, item.pu_1), item.pu_1);
|
|
968
968
|
destination.x(tmp$ret$2);
|
|
969
969
|
}
|
|
970
970
|
var modelImports = destination;
|
|
@@ -987,21 +987,21 @@ protoOf(RustIrEmitter).p1u = function (endpoint) {
|
|
|
987
987
|
this_1.x('}');
|
|
988
988
|
var tmp$ret$8 = this_1.o5();
|
|
989
989
|
var code = joinToString(tmp$ret$8, '\n');
|
|
990
|
-
var subPackageName = plus_2(this.
|
|
991
|
-
var tmp = Companion_getInstance().
|
|
990
|
+
var subPackageName = plus_2(this.a1y_1, 'client');
|
|
991
|
+
var tmp = Companion_getInstance().k1h(subPackageName.tr() + toSnakeCase(this, clientName));
|
|
992
992
|
// Inline function 'kotlin.collections.buildList' call
|
|
993
993
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
994
994
|
// Inline function 'kotlin.apply' call
|
|
995
995
|
var this_2 = ArrayList_init_$Create$_0();
|
|
996
996
|
this_2.x(import_0('super::super::wirespec', '*'));
|
|
997
997
|
this_2.x(import_0('super::super::endpoint', endpointModuleName));
|
|
998
|
-
this_2.
|
|
998
|
+
this_2.f1(modelImports);
|
|
999
999
|
this_2.x(new RawElement(code));
|
|
1000
1000
|
var tmp$ret$12 = this_2.o5();
|
|
1001
1001
|
return new File(tmp, tmp$ret$12);
|
|
1002
1002
|
};
|
|
1003
|
-
protoOf(RustIrEmitter).
|
|
1004
|
-
logger.
|
|
1003
|
+
protoOf(RustIrEmitter).t1u = function (endpoints, logger) {
|
|
1004
|
+
logger.xq('Emitting main Client for ' + endpoints.a1() + ' endpoints');
|
|
1005
1005
|
var modDeclarations = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, RustIrEmitter$emitClient$lambda(this));
|
|
1006
1006
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1007
1007
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
@@ -1018,7 +1018,7 @@ protoOf(RustIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1018
1018
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1019
1019
|
while (_iterator__ex2g4s_0.u()) {
|
|
1020
1020
|
var e = _iterator__ex2g4s_0.v();
|
|
1021
|
-
var key = e.
|
|
1021
|
+
var key = e.pu_1;
|
|
1022
1022
|
if (set.x(key)) {
|
|
1023
1023
|
list_0.x(e);
|
|
1024
1024
|
}
|
|
@@ -1045,7 +1045,7 @@ protoOf(RustIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1045
1045
|
var _iterator__ex2g4s_2 = endpoints.t();
|
|
1046
1046
|
while (_iterator__ex2g4s_2.u()) {
|
|
1047
1047
|
var element_1 = _iterator__ex2g4s_2.v();
|
|
1048
|
-
if (element_1.
|
|
1048
|
+
if (element_1.ip_1.l1() === element_0.pu_1) {
|
|
1049
1049
|
tmp$ret$5 = false;
|
|
1050
1050
|
break $l$block_0;
|
|
1051
1051
|
}
|
|
@@ -1062,7 +1062,7 @@ protoOf(RustIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1062
1062
|
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1063
1063
|
while (_iterator__ex2g4s_3.u()) {
|
|
1064
1064
|
var item = _iterator__ex2g4s_3.v();
|
|
1065
|
-
var tmp$ret$10 = import_0('super::model::' + toSnakeCase(this, item.
|
|
1065
|
+
var tmp$ret$10 = import_0('super::model::' + toSnakeCase(this, item.pu_1), item.pu_1);
|
|
1066
1066
|
destination_1.x(tmp$ret$10);
|
|
1067
1067
|
}
|
|
1068
1068
|
var modelImports = destination_1;
|
|
@@ -1072,9 +1072,9 @@ protoOf(RustIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1072
1072
|
var _iterator__ex2g4s_4 = endpoints.t();
|
|
1073
1073
|
while (_iterator__ex2g4s_4.u()) {
|
|
1074
1074
|
var element_2 = _iterator__ex2g4s_4.v();
|
|
1075
|
-
var endpointModuleName = toSnakeCase(this, element_2.
|
|
1076
|
-
var clientModuleName = toSnakeCase(this, element_2.
|
|
1077
|
-
var list_1 = listOf_0([import_0('super::endpoint', endpointModuleName), import_0(clientModuleName, element_2.
|
|
1075
|
+
var endpointModuleName = toSnakeCase(this, element_2.ip_1.l1());
|
|
1076
|
+
var clientModuleName = toSnakeCase(this, element_2.ip_1.l1() + 'Client');
|
|
1077
|
+
var list_1 = listOf_0([import_0('super::endpoint', endpointModuleName), import_0(clientModuleName, element_2.ip_1.l1() + 'Client')]);
|
|
1078
1078
|
addAll(destination_2, list_1);
|
|
1079
1079
|
}
|
|
1080
1080
|
var endpointAndClientImports = destination_2;
|
|
@@ -1084,28 +1084,28 @@ protoOf(RustIrEmitter).o1u = function (endpoints, logger) {
|
|
|
1084
1084
|
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1085
1085
|
while (_iterator__ex2g4s_5.u()) {
|
|
1086
1086
|
var element_3 = _iterator__ex2g4s_5.v();
|
|
1087
|
-
var endpointName = element_3.
|
|
1087
|
+
var endpointName = element_3.ip_1.l1();
|
|
1088
1088
|
var endpointModuleName_0 = toSnakeCase(this, endpointName);
|
|
1089
1089
|
var namespacePath = endpointModuleName_0 + '::' + endpointName;
|
|
1090
1090
|
var methodName = toSnakeCase(this, endpointName);
|
|
1091
1091
|
var _destruct__k2r9zo = buildClientParams(this, element_3);
|
|
1092
|
-
var paramsStr = _destruct__k2r9zo.
|
|
1093
|
-
var callArgs = _destruct__k2r9zo.
|
|
1092
|
+
var paramsStr = _destruct__k2r9zo.qe();
|
|
1093
|
+
var callArgs = _destruct__k2r9zo.re();
|
|
1094
1094
|
var delegateCall = endpointName + 'Client { serialization: &self.serialization, transportation: &self.transportation }\n' + (' .' + methodName + '(' + callArgs + ').await');
|
|
1095
1095
|
var list_2 = listOf_0(['impl<S: Serialization, T: Transportation> ' + namespacePath + '::Call for Client<S, T> {', ' async fn ' + methodName + '(&self' + paramsStr + ') -> ' + endpointModuleName_0 + '::Response {', ' ' + delegateCall, ' }', '}']);
|
|
1096
1096
|
addAll(destination_3, list_2);
|
|
1097
1097
|
}
|
|
1098
1098
|
var implBlocks = destination_3;
|
|
1099
1099
|
var code = joinToString(plus(listOf_0(['pub struct Client<S: Serialization, T: Transportation> {', ' pub serialization: S,', ' pub transportation: T,', '}']), implBlocks), '\n');
|
|
1100
|
-
var tmp_0 = Companion_getInstance().
|
|
1100
|
+
var tmp_0 = Companion_getInstance().k1h(this.a1y_1.tr() + 'client');
|
|
1101
1101
|
// Inline function 'kotlin.collections.buildList' call
|
|
1102
1102
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1103
1103
|
// Inline function 'kotlin.apply' call
|
|
1104
1104
|
var this_0 = ArrayList_init_$Create$_0();
|
|
1105
1105
|
this_0.x(new RawElement(modDeclarations));
|
|
1106
1106
|
this_0.x(import_0('super::wirespec', '*'));
|
|
1107
|
-
this_0.
|
|
1108
|
-
this_0.
|
|
1107
|
+
this_0.f1(modelImports);
|
|
1108
|
+
this_0.f1(endpointAndClientImports);
|
|
1109
1109
|
this_0.x(new RawElement(code));
|
|
1110
1110
|
var tmp$ret$22 = this_0.o5();
|
|
1111
1111
|
return new File(tmp_0, tmp$ret$22);
|
|
@@ -1125,8 +1125,8 @@ function fixResponseSwitchPatterns() {
|
|
|
1125
1125
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1126
1126
|
// Inline function 'kotlin.apply' call
|
|
1127
1127
|
var this_0 = new TransformerBuilder();
|
|
1128
|
-
this_0.
|
|
1129
|
-
return this_0.
|
|
1128
|
+
this_0.j1u(fixResponseSwitchPatterns$lambda);
|
|
1129
|
+
return this_0.i1h();
|
|
1130
1130
|
}
|
|
1131
1131
|
function buildModelImports(_this__u8e3s4) {
|
|
1132
1132
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
@@ -1137,7 +1137,7 @@ function buildModelImports(_this__u8e3s4) {
|
|
|
1137
1137
|
var _iterator__ex2g4s = this_0.t();
|
|
1138
1138
|
while (_iterator__ex2g4s.u()) {
|
|
1139
1139
|
var e = _iterator__ex2g4s.v();
|
|
1140
|
-
var key = e.
|
|
1140
|
+
var key = e.pu_1;
|
|
1141
1141
|
if (set.x(key)) {
|
|
1142
1142
|
list.x(e);
|
|
1143
1143
|
}
|
|
@@ -1148,7 +1148,7 @@ function buildModelImports(_this__u8e3s4) {
|
|
|
1148
1148
|
var _iterator__ex2g4s_0 = list.t();
|
|
1149
1149
|
while (_iterator__ex2g4s_0.u()) {
|
|
1150
1150
|
var item = _iterator__ex2g4s_0.v();
|
|
1151
|
-
var tmp$ret$2 = import_0('super::' + toRustSnakeCase(item.
|
|
1151
|
+
var tmp$ret$2 = import_0('super::' + toRustSnakeCase(item.pu_1), Companion_getInstance().k1h(item.pu_1).m1h());
|
|
1152
1152
|
destination.x(tmp$ret$2);
|
|
1153
1153
|
}
|
|
1154
1154
|
return destination;
|
|
@@ -1160,14 +1160,14 @@ function replaceStructWithRefinedFunctions(_this__u8e3s4, refined) {
|
|
|
1160
1160
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1161
1161
|
var tmp = scope;
|
|
1162
1162
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1163
|
-
var this_0 = scope.
|
|
1163
|
+
var this_0 = scope.c1u_1;
|
|
1164
1164
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1165
1165
|
// Inline function 'kotlin.apply' call
|
|
1166
1166
|
var this_1 = new TransformerBuilder();
|
|
1167
|
-
this_1.
|
|
1168
|
-
var tmp$ret$2 = this_1.
|
|
1169
|
-
tmp.
|
|
1170
|
-
var tmp_0 = scope.
|
|
1167
|
+
this_1.h1h(replaceStructWithRefinedFunctions$lambda(refined));
|
|
1168
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1169
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1170
|
+
var tmp_0 = scope.c1u_1;
|
|
1171
1171
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1172
1172
|
}
|
|
1173
1173
|
function injectApiStruct(_this__u8e3s4, endpoint) {
|
|
@@ -1177,14 +1177,14 @@ function injectApiStruct(_this__u8e3s4, endpoint) {
|
|
|
1177
1177
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1178
1178
|
var tmp = scope;
|
|
1179
1179
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1180
|
-
var this_0 = scope.
|
|
1180
|
+
var this_0 = scope.c1u_1;
|
|
1181
1181
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1182
1182
|
// Inline function 'kotlin.apply' call
|
|
1183
1183
|
var this_1 = new TransformerBuilder();
|
|
1184
|
-
this_1.
|
|
1185
|
-
var tmp$ret$2 = this_1.
|
|
1186
|
-
tmp.
|
|
1187
|
-
var tmp_0 = scope.
|
|
1184
|
+
this_1.h1h(injectApiStruct$lambda(endpoint));
|
|
1185
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1186
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1187
|
+
var tmp_0 = scope.c1u_1;
|
|
1188
1188
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1189
1189
|
}
|
|
1190
1190
|
function injectResponseFromImpls(_this__u8e3s4) {
|
|
@@ -1194,14 +1194,14 @@ function injectResponseFromImpls(_this__u8e3s4) {
|
|
|
1194
1194
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1195
1195
|
var tmp = scope;
|
|
1196
1196
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1197
|
-
var this_0 = scope.
|
|
1197
|
+
var this_0 = scope.c1u_1;
|
|
1198
1198
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1199
1199
|
// Inline function 'kotlin.apply' call
|
|
1200
1200
|
var this_1 = new TransformerBuilder();
|
|
1201
|
-
this_1.
|
|
1202
|
-
var tmp$ret$2 = this_1.
|
|
1203
|
-
tmp.
|
|
1204
|
-
var tmp_0 = scope.
|
|
1201
|
+
this_1.h1h(injectResponseFromImpls$lambda);
|
|
1202
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1203
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1204
|
+
var tmp_0 = scope.c1u_1;
|
|
1205
1205
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1206
1206
|
}
|
|
1207
1207
|
function injectHandlerImplForClient(_this__u8e3s4, endpoint) {
|
|
@@ -1211,14 +1211,14 @@ function injectHandlerImplForClient(_this__u8e3s4, endpoint) {
|
|
|
1211
1211
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1212
1212
|
var tmp = scope;
|
|
1213
1213
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1214
|
-
var this_0 = scope.
|
|
1214
|
+
var this_0 = scope.c1u_1;
|
|
1215
1215
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1216
1216
|
// Inline function 'kotlin.apply' call
|
|
1217
1217
|
var this_1 = new TransformerBuilder();
|
|
1218
|
-
this_1.
|
|
1219
|
-
var tmp$ret$2 = this_1.
|
|
1220
|
-
tmp.
|
|
1221
|
-
var tmp_0 = scope.
|
|
1218
|
+
this_1.h1h(injectHandlerImplForClient$lambda);
|
|
1219
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1220
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1221
|
+
var tmp_0 = scope.c1u_1;
|
|
1222
1222
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1223
1223
|
}
|
|
1224
1224
|
function injectSelfToHandlerMethods(_this__u8e3s4) {
|
|
@@ -1228,14 +1228,14 @@ function injectSelfToHandlerMethods(_this__u8e3s4) {
|
|
|
1228
1228
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1229
1229
|
var tmp = scope;
|
|
1230
1230
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1231
|
-
var this_0 = scope.
|
|
1231
|
+
var this_0 = scope.c1u_1;
|
|
1232
1232
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1233
1233
|
// Inline function 'kotlin.apply' call
|
|
1234
1234
|
var this_1 = new TransformerBuilder();
|
|
1235
|
-
this_1.
|
|
1236
|
-
var tmp$ret$2 = this_1.
|
|
1237
|
-
tmp.
|
|
1238
|
-
var tmp_0 = scope.
|
|
1235
|
+
this_1.h1h(injectSelfToHandlerMethods$lambda);
|
|
1236
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1237
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1238
|
+
var tmp_0 = scope.c1u_1;
|
|
1239
1239
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1240
1240
|
}
|
|
1241
1241
|
function stripResponseGenerics(_this__u8e3s4) {
|
|
@@ -1245,14 +1245,14 @@ function stripResponseGenerics(_this__u8e3s4) {
|
|
|
1245
1245
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matching' call
|
|
1246
1246
|
var tmp = scope;
|
|
1247
1247
|
// Inline function 'community.flock.wirespec.ir.core.transformMatching' call
|
|
1248
|
-
var this_0 = scope.
|
|
1248
|
+
var this_0 = scope.c1u_1;
|
|
1249
1249
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1250
1250
|
// Inline function 'kotlin.apply' call
|
|
1251
1251
|
var this_1 = new TransformerBuilder();
|
|
1252
|
-
this_1.
|
|
1253
|
-
var tmp$ret$2 = this_1.
|
|
1254
|
-
tmp.
|
|
1255
|
-
var tmp_0 = scope.
|
|
1252
|
+
this_1.i1u(stripResponseGenerics$lambda);
|
|
1253
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1254
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1255
|
+
var tmp_0 = scope.c1u_1;
|
|
1256
1256
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1257
1257
|
}
|
|
1258
1258
|
function stripHandlerExtends(_this__u8e3s4) {
|
|
@@ -1262,14 +1262,14 @@ function stripHandlerExtends(_this__u8e3s4) {
|
|
|
1262
1262
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1263
1263
|
var tmp = scope;
|
|
1264
1264
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1265
|
-
var this_0 = scope.
|
|
1265
|
+
var this_0 = scope.c1u_1;
|
|
1266
1266
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1267
1267
|
// Inline function 'kotlin.apply' call
|
|
1268
1268
|
var this_1 = new TransformerBuilder();
|
|
1269
|
-
this_1.
|
|
1270
|
-
var tmp$ret$2 = this_1.
|
|
1271
|
-
tmp.
|
|
1272
|
-
var tmp_0 = scope.
|
|
1269
|
+
this_1.h1h(stripHandlerExtends$lambda);
|
|
1270
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1271
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1272
|
+
var tmp_0 = scope.c1u_1;
|
|
1273
1273
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1274
1274
|
}
|
|
1275
1275
|
function convertSimpleRawExpressionsToVariableRefs(_this__u8e3s4) {
|
|
@@ -1277,8 +1277,8 @@ function convertSimpleRawExpressionsToVariableRefs(_this__u8e3s4) {
|
|
|
1277
1277
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
1278
1278
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1279
1279
|
var identifierPattern = Regex_init_$Create$('[a-zA-Z_][a-zA-Z0-9_]*');
|
|
1280
|
-
scope.
|
|
1281
|
-
var tmp = scope.
|
|
1280
|
+
scope.l1u(convertSimpleRawExpressionsToVariableRefs$lambda(identifierPattern));
|
|
1281
|
+
var tmp = scope.c1u_1;
|
|
1282
1282
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1283
1283
|
}
|
|
1284
1284
|
function stripWirespecPrefix(_this__u8e3s4) {
|
|
@@ -1288,21 +1288,21 @@ function stripWirespecPrefix(_this__u8e3s4) {
|
|
|
1288
1288
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matching' call
|
|
1289
1289
|
var tmp = scope;
|
|
1290
1290
|
// Inline function 'community.flock.wirespec.ir.core.transformMatching' call
|
|
1291
|
-
var this_0 = scope.
|
|
1291
|
+
var this_0 = scope.c1u_1;
|
|
1292
1292
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1293
1293
|
// Inline function 'kotlin.apply' call
|
|
1294
1294
|
var this_1 = new TransformerBuilder();
|
|
1295
|
-
this_1.
|
|
1296
|
-
var tmp$ret$2 = this_1.
|
|
1297
|
-
tmp.
|
|
1298
|
-
var tmp_0 = scope.
|
|
1295
|
+
this_1.i1u(stripWirespecPrefix$lambda);
|
|
1296
|
+
var tmp$ret$2 = this_1.i1h();
|
|
1297
|
+
tmp.c1u_1 = transform(this_0, tmp$ret$2);
|
|
1298
|
+
var tmp_0 = scope.c1u_1;
|
|
1299
1299
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1300
1300
|
}
|
|
1301
1301
|
function flattenForRust(_this__u8e3s4) {
|
|
1302
1302
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1303
1303
|
// Inline function 'community.flock.wirespec.ir.core.findElement' call
|
|
1304
1304
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1305
|
-
var tmp0 = _this__u8e3s4.
|
|
1305
|
+
var tmp0 = _this__u8e3s4.z1m();
|
|
1306
1306
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1307
1307
|
var destination = ArrayList_init_$Create$_0();
|
|
1308
1308
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1316,7 +1316,7 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1316
1316
|
var namespace = ensureNotNull(tmp$ret$2);
|
|
1317
1317
|
var flattened = flattenNestedStructs(namespace);
|
|
1318
1318
|
// Inline function 'kotlin.collections.filter' call
|
|
1319
|
-
var tmp0_0 = flattened.
|
|
1319
|
+
var tmp0_0 = flattened.e1n_1;
|
|
1320
1320
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1321
1321
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
1322
1322
|
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
@@ -1341,13 +1341,13 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1341
1341
|
var tmp_0;
|
|
1342
1342
|
var tmp_1;
|
|
1343
1343
|
if (item instanceof Union) {
|
|
1344
|
-
tmp_1 = item.
|
|
1344
|
+
tmp_1 = item.y1p_1.m1h() === 'Response';
|
|
1345
1345
|
} else {
|
|
1346
1346
|
tmp_1 = false;
|
|
1347
1347
|
}
|
|
1348
1348
|
if (tmp_1) {
|
|
1349
1349
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1350
|
-
var tmp0_1 = flattened.
|
|
1350
|
+
var tmp0_1 = flattened.e1n_1;
|
|
1351
1351
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1352
1352
|
var destination_2 = ArrayList_init_$Create$_0();
|
|
1353
1353
|
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
@@ -1363,7 +1363,7 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1363
1363
|
var _iterator__ex2g4s_3 = destination_2.t();
|
|
1364
1364
|
while (_iterator__ex2g4s_3.u()) {
|
|
1365
1365
|
var item_0 = _iterator__ex2g4s_3.v();
|
|
1366
|
-
var tmp$ret$8 = item_0.
|
|
1366
|
+
var tmp$ret$8 = item_0.i1n_1.m1h();
|
|
1367
1367
|
destination_3.x(tmp$ret$8);
|
|
1368
1368
|
}
|
|
1369
1369
|
// Inline function 'kotlin.collections.filter' call
|
|
@@ -1372,7 +1372,7 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1372
1372
|
var _iterator__ex2g4s_4 = destination_3.t();
|
|
1373
1373
|
while (_iterator__ex2g4s_4.u()) {
|
|
1374
1374
|
var element_2 = _iterator__ex2g4s_4.v();
|
|
1375
|
-
if (get_rustResponsePattern().
|
|
1375
|
+
if (get_rustResponsePattern().oc(element_2)) {
|
|
1376
1376
|
destination_4.x(element_2);
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
@@ -1386,10 +1386,10 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1386
1386
|
destination_5.x(tmp$ret$14);
|
|
1387
1387
|
}
|
|
1388
1388
|
var members = destination_5;
|
|
1389
|
-
tmp_0 = item.
|
|
1389
|
+
tmp_0 = item.d1q(VOID, VOID, members, emptyList());
|
|
1390
1390
|
} else {
|
|
1391
1391
|
if (item instanceof Union) {
|
|
1392
|
-
tmp_0 = item.
|
|
1392
|
+
tmp_0 = item.d1q(VOID, VOID, VOID, emptyList());
|
|
1393
1393
|
} else {
|
|
1394
1394
|
tmp_0 = item;
|
|
1395
1395
|
}
|
|
@@ -1399,7 +1399,7 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1399
1399
|
}
|
|
1400
1400
|
var moduleElements = destination_1;
|
|
1401
1401
|
// Inline function 'kotlin.collections.filterNot' call
|
|
1402
|
-
var tmp0_2 = flattened.
|
|
1402
|
+
var tmp0_2 = flattened.e1n_1;
|
|
1403
1403
|
// Inline function 'kotlin.collections.filterNotTo' call
|
|
1404
1404
|
var destination_6 = ArrayList_init_$Create$_0();
|
|
1405
1405
|
var _iterator__ex2g4s_6 = tmp0_2.t();
|
|
@@ -1416,15 +1416,15 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
1418
|
var classElements = destination_6;
|
|
1419
|
-
return new File(namespace.
|
|
1419
|
+
return new File(namespace.d1n_1, plus_0(moduleElements, new Namespace(namespace.d1n_1, classElements, namespace.f1n_1)));
|
|
1420
1420
|
}
|
|
1421
1421
|
function fixConstructorCalls() {
|
|
1422
1422
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1423
1423
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1424
1424
|
// Inline function 'kotlin.apply' call
|
|
1425
1425
|
var this_0 = new TransformerBuilder();
|
|
1426
|
-
this_0.
|
|
1427
|
-
return this_0.
|
|
1426
|
+
this_0.l1u(fixConstructorCalls$lambda);
|
|
1427
|
+
return this_0.i1h();
|
|
1428
1428
|
}
|
|
1429
1429
|
function buildEndpointImports(_this__u8e3s4) {
|
|
1430
1430
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
@@ -1435,7 +1435,7 @@ function buildEndpointImports(_this__u8e3s4) {
|
|
|
1435
1435
|
var _iterator__ex2g4s = this_0.t();
|
|
1436
1436
|
while (_iterator__ex2g4s.u()) {
|
|
1437
1437
|
var e = _iterator__ex2g4s.v();
|
|
1438
|
-
var key = e.
|
|
1438
|
+
var key = e.pu_1;
|
|
1439
1439
|
if (set.x(key)) {
|
|
1440
1440
|
list.x(e);
|
|
1441
1441
|
}
|
|
@@ -1446,24 +1446,24 @@ function buildEndpointImports(_this__u8e3s4) {
|
|
|
1446
1446
|
var _iterator__ex2g4s_0 = list.t();
|
|
1447
1447
|
while (_iterator__ex2g4s_0.u()) {
|
|
1448
1448
|
var item = _iterator__ex2g4s_0.v();
|
|
1449
|
-
var tmp$ret$2 = import_0('super::super::model::' + toRustSnakeCase(item.
|
|
1449
|
+
var tmp$ret$2 = import_0('super::super::model::' + toRustSnakeCase(item.pu_1), Companion_getInstance().k1h(item.pu_1).m1h());
|
|
1450
1450
|
destination.x(tmp$ret$2);
|
|
1451
1451
|
}
|
|
1452
1452
|
return destination;
|
|
1453
1453
|
}
|
|
1454
1454
|
function toRustSnakeCase(_this__u8e3s4) {
|
|
1455
1455
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1456
|
-
return Companion_getInstance().
|
|
1456
|
+
return Companion_getInstance().k1h(_this__u8e3s4).d1m();
|
|
1457
1457
|
}
|
|
1458
1458
|
function buildValidateFunction(refined) {
|
|
1459
1459
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1460
|
-
var constraintExpr = convertConstraint(refined.
|
|
1460
|
+
var constraintExpr = convertConstraint(refined.hr_1, new FieldCall(new VariableReference(Companion_getInstance().k1h('self')), Companion_getInstance().k1h('value')));
|
|
1461
1461
|
return function_0('validate', VOID, VOID, buildValidateFunction$lambda(constraintExpr));
|
|
1462
1462
|
}
|
|
1463
1463
|
function buildToStringFunction(refined) {
|
|
1464
1464
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1465
1465
|
var tmp;
|
|
1466
|
-
if (refined.
|
|
1466
|
+
if (refined.hr_1.tu_1 instanceof String_0) {
|
|
1467
1467
|
tmp = 'self.value.clone()';
|
|
1468
1468
|
} else {
|
|
1469
1469
|
tmp = 'format!("{}", self.value)';
|
|
@@ -1478,8 +1478,8 @@ function buildApiStruct(endpoint) {
|
|
|
1478
1478
|
function generateApiStructCode(_this__u8e3s4) {
|
|
1479
1479
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1480
1480
|
// Inline function 'kotlin.let' call
|
|
1481
|
-
var pathTemplate = '/' + joinToString(_this__u8e3s4.
|
|
1482
|
-
var methodName = _this__u8e3s4.
|
|
1481
|
+
var pathTemplate = '/' + joinToString(_this__u8e3s4.kp_1, '/', VOID, VOID, VOID, VOID, generateApiStructCode$lambda);
|
|
1482
|
+
var methodName = _this__u8e3s4.jp_1.a3_1;
|
|
1483
1483
|
return trimIndent('\n pub struct Api;\n impl Server for Api {\n type Req = Request;\n type Res = Response;\n fn path_template(&self) -> &\'static str { "' + pathTemplate + '" }\n fn method(&self) -> Method { Method::' + methodName + ' }\n }\n ');
|
|
1484
1484
|
}
|
|
1485
1485
|
function fixResponseSwitchPatterns$lambda(s, t) {
|
|
@@ -1488,56 +1488,56 @@ function fixResponseSwitchPatterns$lambda(s, t) {
|
|
|
1488
1488
|
if (!(s instanceof Switch)) {
|
|
1489
1489
|
tmp = true;
|
|
1490
1490
|
} else {
|
|
1491
|
-
var tmp0_safe_receiver = s.
|
|
1492
|
-
tmp = !((tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1491
|
+
var tmp0_safe_receiver = s.g1p_1;
|
|
1492
|
+
tmp = !((tmp0_safe_receiver == null ? null : tmp0_safe_receiver.x1l()) === 'r');
|
|
1493
1493
|
}
|
|
1494
1494
|
if (tmp)
|
|
1495
1495
|
return transformChildren(s, t);
|
|
1496
1496
|
// Inline function 'kotlin.collections.map' call
|
|
1497
|
-
var this_0 = s.
|
|
1497
|
+
var this_0 = s.e1p_1;
|
|
1498
1498
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1499
1499
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1500
1500
|
var _iterator__ex2g4s = this_0.t();
|
|
1501
1501
|
while (_iterator__ex2g4s.u()) {
|
|
1502
1502
|
var item = _iterator__ex2g4s.v();
|
|
1503
|
-
var tmp_0 = item.
|
|
1503
|
+
var tmp_0 = item.l1p_1;
|
|
1504
1504
|
var tmp0_safe_receiver_0 = tmp_0 instanceof Custom ? tmp_0 : null;
|
|
1505
|
-
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.
|
|
1506
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1505
|
+
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.v1h_1;
|
|
1506
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.m1h();
|
|
1507
1507
|
var tmp_1;
|
|
1508
|
-
if (!(typeName == null) && get_rustResponsePattern().
|
|
1509
|
-
var tmp_2 = new RawExpression('Response::' + typeName + '(' + ensureNotNull(s.
|
|
1508
|
+
if (!(typeName == null) && get_rustResponsePattern().oc(typeName)) {
|
|
1509
|
+
var tmp_2 = new RawExpression('Response::' + typeName + '(' + ensureNotNull(s.g1p_1).d1m() + ')');
|
|
1510
1510
|
// Inline function 'kotlin.collections.map' call
|
|
1511
|
-
var this_1 = item.
|
|
1511
|
+
var this_1 = item.k1p_1;
|
|
1512
1512
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1513
1513
|
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1514
1514
|
var _iterator__ex2g4s_0 = this_1.t();
|
|
1515
1515
|
while (_iterator__ex2g4s_0.u()) {
|
|
1516
1516
|
var item_0 = _iterator__ex2g4s_0.v();
|
|
1517
|
-
var tmp$ret$0 = t.
|
|
1517
|
+
var tmp$ret$0 = t.w1t(item_0);
|
|
1518
1518
|
destination_0.x(tmp$ret$0);
|
|
1519
1519
|
}
|
|
1520
1520
|
tmp_1 = new Case(tmp_2, destination_0, null);
|
|
1521
1521
|
} else {
|
|
1522
|
-
var tmp_3 = t.
|
|
1522
|
+
var tmp_3 = t.x1t(item.j1p_1);
|
|
1523
1523
|
// Inline function 'kotlin.collections.map' call
|
|
1524
|
-
var this_2 = item.
|
|
1524
|
+
var this_2 = item.k1p_1;
|
|
1525
1525
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1526
1526
|
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10));
|
|
1527
1527
|
var _iterator__ex2g4s_1 = this_2.t();
|
|
1528
1528
|
while (_iterator__ex2g4s_1.u()) {
|
|
1529
1529
|
var item_1 = _iterator__ex2g4s_1.v();
|
|
1530
|
-
var tmp$ret$3 = t.
|
|
1530
|
+
var tmp$ret$3 = t.w1t(item_1);
|
|
1531
1531
|
destination_1.x(tmp$ret$3);
|
|
1532
1532
|
}
|
|
1533
1533
|
var tmp_4 = destination_1;
|
|
1534
|
-
var tmp2_safe_receiver = item.
|
|
1534
|
+
var tmp2_safe_receiver = item.l1p_1;
|
|
1535
1535
|
var tmp_5;
|
|
1536
1536
|
if (tmp2_safe_receiver == null) {
|
|
1537
1537
|
tmp_5 = null;
|
|
1538
1538
|
} else {
|
|
1539
1539
|
// Inline function 'kotlin.let' call
|
|
1540
|
-
tmp_5 = t.
|
|
1540
|
+
tmp_5 = t.u1t(tmp2_safe_receiver);
|
|
1541
1541
|
}
|
|
1542
1542
|
tmp_1 = new Case(tmp_3, tmp_4, tmp_5);
|
|
1543
1543
|
}
|
|
@@ -1545,13 +1545,13 @@ function fixResponseSwitchPatterns$lambda(s, t) {
|
|
|
1545
1545
|
destination.x(tmp$ret$8);
|
|
1546
1546
|
}
|
|
1547
1547
|
var transformedCases = destination;
|
|
1548
|
-
return s.
|
|
1548
|
+
return s.i1p(t.x1t(s.d1p_1), transformedCases, null);
|
|
1549
1549
|
}
|
|
1550
1550
|
function replaceStructWithRefinedFunctions$lambda($refined) {
|
|
1551
1551
|
return function (element, transformer) {
|
|
1552
1552
|
var tmp;
|
|
1553
1553
|
if (element instanceof Struct) {
|
|
1554
|
-
tmp = element.
|
|
1554
|
+
tmp = element.o1n(VOID, VOID, VOID, VOID, listOf_0([buildValidateFunction($refined), buildToStringFunction($refined)]));
|
|
1555
1555
|
} else {
|
|
1556
1556
|
tmp = element;
|
|
1557
1557
|
}
|
|
@@ -1563,7 +1563,7 @@ function injectApiStruct$lambda($endpoint) {
|
|
|
1563
1563
|
return function (element, transformer) {
|
|
1564
1564
|
var tmp;
|
|
1565
1565
|
if (element instanceof Namespace) {
|
|
1566
|
-
tmp = element.
|
|
1566
|
+
tmp = element.h1n(VOID, plus(element.e1n_1, listOf(buildApiStruct($endpoint))));
|
|
1567
1567
|
} else {
|
|
1568
1568
|
tmp = element;
|
|
1569
1569
|
}
|
|
@@ -1576,7 +1576,7 @@ function injectResponseFromImpls$lambda(element, transformer) {
|
|
|
1576
1576
|
var tmp;
|
|
1577
1577
|
if (element instanceof File) {
|
|
1578
1578
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1579
|
-
var tmp0 = element.
|
|
1579
|
+
var tmp0 = element.y1m_1;
|
|
1580
1580
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1581
1581
|
var destination = ArrayList_init_$Create$_0();
|
|
1582
1582
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1586,26 +1586,26 @@ function injectResponseFromImpls$lambda(element, transformer) {
|
|
|
1586
1586
|
var tmp_1;
|
|
1587
1587
|
var tmp_2;
|
|
1588
1588
|
if (element_0 instanceof Union) {
|
|
1589
|
-
tmp_2 = element_0.
|
|
1589
|
+
tmp_2 = element_0.y1p_1.m1h() === 'Response';
|
|
1590
1590
|
} else {
|
|
1591
1591
|
tmp_2 = false;
|
|
1592
1592
|
}
|
|
1593
1593
|
if (tmp_2) {
|
|
1594
1594
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1595
|
-
tmp_1 = !element_0.
|
|
1595
|
+
tmp_1 = !element_0.a1q_1.r();
|
|
1596
1596
|
} else {
|
|
1597
1597
|
tmp_1 = false;
|
|
1598
1598
|
}
|
|
1599
1599
|
if (tmp_1) {
|
|
1600
1600
|
var tmp_3 = listOf(element_0);
|
|
1601
1601
|
// Inline function 'kotlin.collections.map' call
|
|
1602
|
-
var this_0 = element_0.
|
|
1602
|
+
var this_0 = element_0.a1q_1;
|
|
1603
1603
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1604
1604
|
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1605
1605
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
1606
1606
|
while (_iterator__ex2g4s_0.u()) {
|
|
1607
1607
|
var item = _iterator__ex2g4s_0.v();
|
|
1608
|
-
var memberName = item.
|
|
1608
|
+
var memberName = item.v1h_1.m1h();
|
|
1609
1609
|
var tmp$ret$1 = new RawElement('impl From<' + memberName + '> for Response { fn from(value: ' + memberName + ') -> Self { Response::' + memberName + '(value) } }\n');
|
|
1610
1610
|
destination_0.x(tmp$ret$1);
|
|
1611
1611
|
}
|
|
@@ -1616,7 +1616,7 @@ function injectResponseFromImpls$lambda(element, transformer) {
|
|
|
1616
1616
|
var list = tmp_0;
|
|
1617
1617
|
addAll(destination, list);
|
|
1618
1618
|
}
|
|
1619
|
-
tmp = element.
|
|
1619
|
+
tmp = element.b1n(VOID, destination);
|
|
1620
1620
|
} else {
|
|
1621
1621
|
tmp = element;
|
|
1622
1622
|
}
|
|
@@ -1630,7 +1630,7 @@ function injectHandlerImplForClient$lambda(element, transformer) {
|
|
|
1630
1630
|
var tmp$ret$4;
|
|
1631
1631
|
$l$block_1: {
|
|
1632
1632
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1633
|
-
var tmp0 = element.
|
|
1633
|
+
var tmp0 = element.e1n_1;
|
|
1634
1634
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1635
1635
|
var destination = ArrayList_init_$Create$_0();
|
|
1636
1636
|
var _iterator__ex2g4s = tmp0.t();
|
|
@@ -1646,7 +1646,7 @@ function injectHandlerImplForClient$lambda(element, transformer) {
|
|
|
1646
1646
|
var _iterator__ex2g4s_0 = destination.t();
|
|
1647
1647
|
while (_iterator__ex2g4s_0.u()) {
|
|
1648
1648
|
var element_1 = _iterator__ex2g4s_0.v();
|
|
1649
|
-
if (element_1.
|
|
1649
|
+
if (element_1.p1n_1.equals(Companion_getInstance().k1h('Handler'))) {
|
|
1650
1650
|
tmp$ret$3 = element_1;
|
|
1651
1651
|
break $l$block;
|
|
1652
1652
|
}
|
|
@@ -1663,7 +1663,7 @@ function injectHandlerImplForClient$lambda(element, transformer) {
|
|
|
1663
1663
|
}
|
|
1664
1664
|
var handler = tmp_0;
|
|
1665
1665
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1666
|
-
var tmp0_0 = handler.
|
|
1666
|
+
var tmp0_0 = handler.q1n_1;
|
|
1667
1667
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1668
1668
|
var destination_0 = ArrayList_init_$Create$_0();
|
|
1669
1669
|
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
@@ -1682,8 +1682,8 @@ function injectHandlerImplForClient$lambda(element, transformer) {
|
|
|
1682
1682
|
tmp_1 = tmp1_elvis_lhs;
|
|
1683
1683
|
}
|
|
1684
1684
|
var method = tmp_1;
|
|
1685
|
-
var methodName = method.
|
|
1686
|
-
tmp$ret$4 = element.
|
|
1685
|
+
var methodName = method.y1j_1.d1m();
|
|
1686
|
+
tmp$ret$4 = element.h1n(VOID, plus(element.e1n_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 ')))));
|
|
1687
1687
|
}
|
|
1688
1688
|
tmp = tmp$ret$4;
|
|
1689
1689
|
} else {
|
|
@@ -1698,7 +1698,7 @@ function injectSelfToHandlerMethods$lambda(element, transformer) {
|
|
|
1698
1698
|
if (element instanceof Interface) {
|
|
1699
1699
|
var tmp$ret$0;
|
|
1700
1700
|
$l$block: {
|
|
1701
|
-
if (!element.
|
|
1701
|
+
if (!element.p1n_1.equals(Companion_getInstance().k1h('Handler')) && !element.p1n_1.equals(Companion_getInstance().k1h('Call'))) {
|
|
1702
1702
|
tmp$ret$0 = element;
|
|
1703
1703
|
break $l$block;
|
|
1704
1704
|
}
|
|
@@ -1707,14 +1707,14 @@ function injectSelfToHandlerMethods$lambda(element, transformer) {
|
|
|
1707
1707
|
// Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
|
|
1708
1708
|
var tmp_0 = scope;
|
|
1709
1709
|
// Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
|
|
1710
|
-
var this_0 = scope.
|
|
1710
|
+
var this_0 = scope.c1u_1;
|
|
1711
1711
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
1712
1712
|
// Inline function 'kotlin.apply' call
|
|
1713
1713
|
var this_1 = new TransformerBuilder();
|
|
1714
|
-
this_1.
|
|
1715
|
-
var tmp$ret$3 = this_1.
|
|
1716
|
-
tmp_0.
|
|
1717
|
-
var tmp_1 = scope.
|
|
1714
|
+
this_1.h1h(injectSelfToHandlerMethods$lambda$lambda);
|
|
1715
|
+
var tmp$ret$3 = this_1.i1h();
|
|
1716
|
+
tmp_0.c1u_1 = transform(this_0, tmp$ret$3);
|
|
1717
|
+
var tmp_1 = scope.c1u_1;
|
|
1718
1718
|
tmp$ret$0 = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1719
1719
|
}
|
|
1720
1720
|
tmp = tmp$ret$0;
|
|
@@ -1728,7 +1728,7 @@ function injectSelfToHandlerMethods$lambda$lambda(element, transformer) {
|
|
|
1728
1728
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1729
1729
|
var tmp;
|
|
1730
1730
|
if (element instanceof Function) {
|
|
1731
|
-
tmp = element.
|
|
1731
|
+
tmp = element.g1k(Companion_getInstance().k1h(element.y1j_1.d1m()), VOID, plus(listOf(get_rustSelfParam()), element.a1k_1));
|
|
1732
1732
|
} else {
|
|
1733
1733
|
tmp = element;
|
|
1734
1734
|
}
|
|
@@ -1741,14 +1741,14 @@ function stripResponseGenerics$lambda(type, transformer) {
|
|
|
1741
1741
|
if (type instanceof Custom) {
|
|
1742
1742
|
var tmp_0;
|
|
1743
1743
|
var tmp_1;
|
|
1744
|
-
if (startsWith(type.
|
|
1744
|
+
if (startsWith(type.v1h_1.m1h(), 'Response')) {
|
|
1745
1745
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1746
|
-
tmp_1 = !type.
|
|
1746
|
+
tmp_1 = !type.w1h_1.r();
|
|
1747
1747
|
} else {
|
|
1748
1748
|
tmp_1 = false;
|
|
1749
1749
|
}
|
|
1750
1750
|
if (tmp_1) {
|
|
1751
|
-
tmp_0 = type.
|
|
1751
|
+
tmp_0 = type.s1m(VOID, emptyList());
|
|
1752
1752
|
} else {
|
|
1753
1753
|
tmp_0 = type;
|
|
1754
1754
|
}
|
|
@@ -1763,7 +1763,7 @@ function stripHandlerExtends$lambda(element, transformer) {
|
|
|
1763
1763
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1764
1764
|
var tmp;
|
|
1765
1765
|
if (element instanceof Interface) {
|
|
1766
|
-
tmp = element.
|
|
1766
|
+
tmp = element.p1n_1.equals(Companion_getInstance().k1h('Handler')) || element.p1n_1.equals(Companion_getInstance().k1h('Call')) ? element.w1n(VOID, VOID, emptyList()) : element;
|
|
1767
1767
|
} else {
|
|
1768
1768
|
tmp = element;
|
|
1769
1769
|
}
|
|
@@ -1776,17 +1776,17 @@ function convertSimpleRawExpressionsToVariableRefs$lambda($identifierPattern) {
|
|
|
1776
1776
|
var tmp_0;
|
|
1777
1777
|
var tmp_1;
|
|
1778
1778
|
if (s instanceof RawExpression) {
|
|
1779
|
-
tmp_1 = $identifierPattern.
|
|
1779
|
+
tmp_1 = $identifierPattern.oc(s.n1o_1);
|
|
1780
1780
|
} else {
|
|
1781
1781
|
tmp_1 = false;
|
|
1782
1782
|
}
|
|
1783
1783
|
if (tmp_1) {
|
|
1784
|
-
tmp_0 = !contains(s.
|
|
1784
|
+
tmp_0 = !contains(s.n1o_1, '.');
|
|
1785
1785
|
} else {
|
|
1786
1786
|
tmp_0 = false;
|
|
1787
1787
|
}
|
|
1788
1788
|
if (tmp_0) {
|
|
1789
|
-
tmp = new VariableReference(Companion_getInstance().
|
|
1789
|
+
tmp = new VariableReference(Companion_getInstance().k1h(s.n1o_1));
|
|
1790
1790
|
} else {
|
|
1791
1791
|
tmp = transformChildren(s, t);
|
|
1792
1792
|
}
|
|
@@ -1797,10 +1797,10 @@ function stripWirespecPrefix$lambda(type, transformer) {
|
|
|
1797
1797
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1798
1798
|
var tmp;
|
|
1799
1799
|
if (type instanceof Custom) {
|
|
1800
|
-
var pascalName = type.
|
|
1800
|
+
var pascalName = type.v1h_1.m1h();
|
|
1801
1801
|
var tmp_0;
|
|
1802
1802
|
if (startsWith(pascalName, 'Wirespec.')) {
|
|
1803
|
-
tmp_0 = type.
|
|
1803
|
+
tmp_0 = type.s1m(Companion_getInstance().k1h(removePrefix(pascalName, 'Wirespec.')));
|
|
1804
1804
|
} else {
|
|
1805
1805
|
tmp_0 = type;
|
|
1806
1806
|
}
|
|
@@ -1815,12 +1815,12 @@ function fixConstructorCalls$lambda(s, t) {
|
|
|
1815
1815
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1816
1816
|
if (!(s instanceof ConstructorStatement))
|
|
1817
1817
|
return transformChildren(s, t);
|
|
1818
|
-
var tmp = s.
|
|
1818
|
+
var tmp = s.u1m_1;
|
|
1819
1819
|
var tmp0_safe_receiver = tmp instanceof Custom ? tmp : null;
|
|
1820
|
-
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.
|
|
1821
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
1820
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.v1h_1;
|
|
1821
|
+
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.m1h();
|
|
1822
1822
|
// Inline function 'kotlin.collections.mapValues' call
|
|
1823
|
-
var this_0 = s.
|
|
1823
|
+
var this_0 = s.v1m_1;
|
|
1824
1824
|
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1825
1825
|
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.a1()));
|
|
1826
1826
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
@@ -1828,25 +1828,25 @@ function fixConstructorCalls$lambda(s, t) {
|
|
|
1828
1828
|
while (_iterator__ex2g4s.u()) {
|
|
1829
1829
|
var element = _iterator__ex2g4s.v();
|
|
1830
1830
|
var tmp_0 = element.k1();
|
|
1831
|
-
var tmp$ret$1 = t.
|
|
1832
|
-
destination.
|
|
1831
|
+
var tmp$ret$1 = t.x1t(element.l1());
|
|
1832
|
+
destination.s2(tmp_0, tmp$ret$1);
|
|
1833
1833
|
}
|
|
1834
1834
|
var transformedArgs = destination;
|
|
1835
|
-
return !(typeName == null) && get_rustResponsePattern().
|
|
1835
|
+
return !(typeName == null) && get_rustResponsePattern().oc(typeName) ? new FunctionCall(VOID, VOID, new Name(listOf('Response::' + typeName)), mapOf_0(to(Companion_getInstance().k1h('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);
|
|
1836
1836
|
}
|
|
1837
1837
|
function buildValidateFunction$lambda($constraintExpr) {
|
|
1838
1838
|
return function ($this$function) {
|
|
1839
|
-
$this$function.
|
|
1840
|
-
$this$function.
|
|
1841
|
-
$this$function.
|
|
1839
|
+
$this$function.q1i('&self', Custom_init_$Create$(''));
|
|
1840
|
+
$this$function.p1i(Boolean_instance);
|
|
1841
|
+
$this$function.o1k($constraintExpr);
|
|
1842
1842
|
return Unit_instance;
|
|
1843
1843
|
};
|
|
1844
1844
|
}
|
|
1845
1845
|
function buildToStringFunction$lambda($expr) {
|
|
1846
1846
|
return function ($this$function) {
|
|
1847
|
-
$this$function.
|
|
1848
|
-
$this$function.
|
|
1849
|
-
$this$function.
|
|
1847
|
+
$this$function.q1i('&self', Custom_init_$Create$(''));
|
|
1848
|
+
$this$function.p1i(String_instance);
|
|
1849
|
+
$this$function.o1k(new RawExpression($expr));
|
|
1850
1850
|
return Unit_instance;
|
|
1851
1851
|
};
|
|
1852
1852
|
}
|
|
@@ -1854,10 +1854,10 @@ function generateApiStructCode$lambda(segment) {
|
|
|
1854
1854
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1855
1855
|
var tmp;
|
|
1856
1856
|
if (segment instanceof Literal) {
|
|
1857
|
-
tmp = segment.
|
|
1857
|
+
tmp = segment.lq_1;
|
|
1858
1858
|
} else {
|
|
1859
1859
|
if (segment instanceof Param) {
|
|
1860
|
-
tmp = '{' + segment.
|
|
1860
|
+
tmp = '{' + segment.pp_1.l1() + '}';
|
|
1861
1861
|
} else {
|
|
1862
1862
|
noWhenBranchMatchedException();
|
|
1863
1863
|
}
|
|
@@ -1868,39 +1868,39 @@ var properties_initialized_RustIrTransformer_kt_hr6k9w;
|
|
|
1868
1868
|
function _init_properties_RustIrTransformer_kt__rrvmwq() {
|
|
1869
1869
|
if (!properties_initialized_RustIrTransformer_kt_hr6k9w) {
|
|
1870
1870
|
properties_initialized_RustIrTransformer_kt_hr6k9w = true;
|
|
1871
|
-
rustSelfParam = new Parameter(Companion_getInstance().
|
|
1871
|
+
rustSelfParam = new Parameter(Companion_getInstance().k1h('&self'), Custom_init_$Create$(''));
|
|
1872
1872
|
rustResponsePattern = Regex_init_$Create$('Response(\\d+|Default)');
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
1875
|
function borrowParamsOf($this, fn) {
|
|
1876
1876
|
// Inline function 'kotlin.collections.map' call
|
|
1877
|
-
var this_0 = fn.
|
|
1877
|
+
var this_0 = fn.a1k_1;
|
|
1878
1878
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1879
1879
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1880
1880
|
var _iterator__ex2g4s = this_0.t();
|
|
1881
1881
|
while (_iterator__ex2g4s.u()) {
|
|
1882
1882
|
var item = _iterator__ex2g4s.v();
|
|
1883
1883
|
var tmp;
|
|
1884
|
-
if (RustTransform_getInstance().
|
|
1884
|
+
if (RustTransform_getInstance().r1y(item.z1o_1)) {
|
|
1885
1885
|
tmp = item;
|
|
1886
1886
|
} else {
|
|
1887
|
-
tmp = item.
|
|
1887
|
+
tmp = item.c1p(VOID, applyBorrowRule(RustTransform_getInstance(), item.a1p_1));
|
|
1888
1888
|
}
|
|
1889
1889
|
var tmp$ret$0 = tmp;
|
|
1890
1890
|
destination.x(tmp$ret$0);
|
|
1891
1891
|
}
|
|
1892
|
-
return fn.
|
|
1892
|
+
return fn.g1k(VOID, VOID, destination);
|
|
1893
1893
|
}
|
|
1894
1894
|
function applyBorrowRule($this, type) {
|
|
1895
1895
|
var tmp;
|
|
1896
1896
|
if (type instanceof Nullable) {
|
|
1897
|
-
tmp = new Nullable(applyBorrowRule($this, type.
|
|
1897
|
+
tmp = new Nullable(applyBorrowRule($this, type.t1h_1));
|
|
1898
1898
|
} else {
|
|
1899
1899
|
if (equals(type, String_instance)) {
|
|
1900
1900
|
tmp = Custom_init_$Create$('&str');
|
|
1901
1901
|
} else {
|
|
1902
1902
|
if (type instanceof Custom) {
|
|
1903
|
-
tmp = $this.
|
|
1903
|
+
tmp = $this.t1y(type) ? type : $this.s1y(type) ? borrowImpl(type) : type;
|
|
1904
1904
|
} else {
|
|
1905
1905
|
tmp = type;
|
|
1906
1906
|
}
|
|
@@ -1912,15 +1912,15 @@ function toBorrowedRaw($this, _this__u8e3s4) {
|
|
|
1912
1912
|
return new RawExpression('&' + toRawCode($this, _this__u8e3s4));
|
|
1913
1913
|
}
|
|
1914
1914
|
function sanitizeKeywords_0($this, _this__u8e3s4) {
|
|
1915
|
-
return Companion_getInstance_0().
|
|
1915
|
+
return Companion_getInstance_0().h1y_1.u1(_this__u8e3s4) ? 'r#' + _this__u8e3s4 : _this__u8e3s4;
|
|
1916
1916
|
}
|
|
1917
1917
|
function toRawCode($this, _this__u8e3s4) {
|
|
1918
1918
|
var tmp;
|
|
1919
1919
|
if (_this__u8e3s4 instanceof VariableReference) {
|
|
1920
|
-
tmp = sanitizeKeywords_0($this, _this__u8e3s4.
|
|
1920
|
+
tmp = sanitizeKeywords_0($this, _this__u8e3s4.l1o_1.d1m());
|
|
1921
1921
|
} else {
|
|
1922
1922
|
if (_this__u8e3s4 instanceof FieldCall) {
|
|
1923
|
-
var tmp1_safe_receiver = _this__u8e3s4.
|
|
1923
|
+
var tmp1_safe_receiver = _this__u8e3s4.o1p_1;
|
|
1924
1924
|
var tmp_0;
|
|
1925
1925
|
if (tmp1_safe_receiver == null) {
|
|
1926
1926
|
tmp_0 = null;
|
|
@@ -1930,20 +1930,20 @@ function toRawCode($this, _this__u8e3s4) {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
var tmp2_elvis_lhs = tmp_0;
|
|
1932
1932
|
var recv = tmp2_elvis_lhs == null ? '' : tmp2_elvis_lhs;
|
|
1933
|
-
tmp = recv + sanitizeKeywords_0($this, _this__u8e3s4.
|
|
1933
|
+
tmp = recv + sanitizeKeywords_0($this, _this__u8e3s4.p1p_1.d1m());
|
|
1934
1934
|
} else {
|
|
1935
1935
|
if (_this__u8e3s4 instanceof ArrayIndexCall) {
|
|
1936
|
-
var tmp_1 = _this__u8e3s4.
|
|
1936
|
+
var tmp_1 = _this__u8e3s4.m1q_1;
|
|
1937
1937
|
var lit = tmp_1 instanceof Literal_0 ? tmp_1 : null;
|
|
1938
1938
|
var tmp_2;
|
|
1939
1939
|
var tmp_3;
|
|
1940
1940
|
if (!(lit == null)) {
|
|
1941
1941
|
var tmp_4;
|
|
1942
|
-
var tmp_5 = lit.
|
|
1942
|
+
var tmp_5 = lit.w1o_1;
|
|
1943
1943
|
if (tmp_5 instanceof Integer) {
|
|
1944
1944
|
tmp_4 = true;
|
|
1945
1945
|
} else {
|
|
1946
|
-
var tmp_6 = lit.
|
|
1946
|
+
var tmp_6 = lit.w1o_1;
|
|
1947
1947
|
tmp_4 = tmp_6 instanceof Number_0;
|
|
1948
1948
|
}
|
|
1949
1949
|
tmp_3 = tmp_4;
|
|
@@ -1951,31 +1951,31 @@ function toRawCode($this, _this__u8e3s4) {
|
|
|
1951
1951
|
tmp_3 = false;
|
|
1952
1952
|
}
|
|
1953
1953
|
if (tmp_3) {
|
|
1954
|
-
tmp_2 = toString_0(lit.
|
|
1954
|
+
tmp_2 = toString_0(lit.v1o_1);
|
|
1955
1955
|
} else {
|
|
1956
1956
|
var tmp_7;
|
|
1957
1957
|
if (!(lit == null)) {
|
|
1958
|
-
var tmp_8 = lit.
|
|
1958
|
+
var tmp_8 = lit.w1o_1;
|
|
1959
1959
|
tmp_7 = tmp_8 instanceof String_1;
|
|
1960
1960
|
} else {
|
|
1961
1961
|
tmp_7 = false;
|
|
1962
1962
|
}
|
|
1963
1963
|
if (tmp_7) {
|
|
1964
|
-
tmp_2 = '"' + toString_0(lit.
|
|
1964
|
+
tmp_2 = '"' + toString_0(lit.v1o_1) + '"';
|
|
1965
1965
|
} else {
|
|
1966
|
-
tmp_2 = toRawCode($this, _this__u8e3s4.
|
|
1966
|
+
tmp_2 = toRawCode($this, _this__u8e3s4.m1q_1);
|
|
1967
1967
|
}
|
|
1968
1968
|
}
|
|
1969
1969
|
var idx = tmp_2;
|
|
1970
|
-
tmp = toRawCode($this, _this__u8e3s4.
|
|
1970
|
+
tmp = toRawCode($this, _this__u8e3s4.l1q_1) + '[' + idx + ']';
|
|
1971
1971
|
} else {
|
|
1972
1972
|
if (_this__u8e3s4 instanceof ConstructorStatement) {
|
|
1973
|
-
var tmp_9 = _this__u8e3s4.
|
|
1973
|
+
var tmp_9 = _this__u8e3s4.u1m_1;
|
|
1974
1974
|
var tmp3_safe_receiver = tmp_9 instanceof Custom ? tmp_9 : null;
|
|
1975
|
-
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.
|
|
1976
|
-
var tmp5_elvis_lhs = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.
|
|
1977
|
-
var typeName = tmp5_elvis_lhs == null ? toString_0(_this__u8e3s4.
|
|
1978
|
-
var tmp_10 = _this__u8e3s4.
|
|
1975
|
+
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.v1h_1;
|
|
1976
|
+
var tmp5_elvis_lhs = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.m1h();
|
|
1977
|
+
var typeName = tmp5_elvis_lhs == null ? toString_0(_this__u8e3s4.u1m_1) : tmp5_elvis_lhs;
|
|
1978
|
+
var tmp_10 = _this__u8e3s4.v1m_1.j1();
|
|
1979
1979
|
var args = joinToString(tmp_10, ', ', VOID, VOID, VOID, VOID, RustTransform$toRawCode$lambda);
|
|
1980
1980
|
var tmp_11;
|
|
1981
1981
|
// Inline function 'kotlin.text.isEmpty' call
|
|
@@ -1988,23 +1988,23 @@ function toRawCode($this, _this__u8e3s4) {
|
|
|
1988
1988
|
} else {
|
|
1989
1989
|
if (_this__u8e3s4 instanceof Literal_0) {
|
|
1990
1990
|
var tmp_12;
|
|
1991
|
-
var tmp_13 = _this__u8e3s4.
|
|
1991
|
+
var tmp_13 = _this__u8e3s4.w1o_1;
|
|
1992
1992
|
if (tmp_13 instanceof String_1) {
|
|
1993
|
-
tmp_12 = 'String::from("' + toString_0(_this__u8e3s4.
|
|
1993
|
+
tmp_12 = 'String::from("' + toString_0(_this__u8e3s4.v1o_1) + '")';
|
|
1994
1994
|
} else {
|
|
1995
|
-
var tmp_14 = _this__u8e3s4.
|
|
1995
|
+
var tmp_14 = _this__u8e3s4.w1o_1;
|
|
1996
1996
|
if (tmp_14 instanceof Boolean_0) {
|
|
1997
|
-
tmp_12 = toString_0(_this__u8e3s4.
|
|
1997
|
+
tmp_12 = toString_0(_this__u8e3s4.v1o_1);
|
|
1998
1998
|
} else {
|
|
1999
|
-
var tmp_15 = _this__u8e3s4.
|
|
1999
|
+
var tmp_15 = _this__u8e3s4.w1o_1;
|
|
2000
2000
|
if (tmp_15 instanceof Integer) {
|
|
2001
|
-
tmp_12 = toString_0(_this__u8e3s4.
|
|
2001
|
+
tmp_12 = toString_0(_this__u8e3s4.v1o_1);
|
|
2002
2002
|
} else {
|
|
2003
|
-
var tmp_16 = _this__u8e3s4.
|
|
2003
|
+
var tmp_16 = _this__u8e3s4.w1o_1;
|
|
2004
2004
|
if (tmp_16 instanceof Number_0) {
|
|
2005
|
-
tmp_12 = toString_0(_this__u8e3s4.
|
|
2005
|
+
tmp_12 = toString_0(_this__u8e3s4.v1o_1);
|
|
2006
2006
|
} else {
|
|
2007
|
-
tmp_12 = toString_0(_this__u8e3s4.
|
|
2007
|
+
tmp_12 = toString_0(_this__u8e3s4.v1o_1);
|
|
2008
2008
|
}
|
|
2009
2009
|
}
|
|
2010
2010
|
}
|
|
@@ -2012,7 +2012,7 @@ function toRawCode($this, _this__u8e3s4) {
|
|
|
2012
2012
|
tmp = tmp_12;
|
|
2013
2013
|
} else {
|
|
2014
2014
|
if (_this__u8e3s4 instanceof RawExpression) {
|
|
2015
|
-
tmp = _this__u8e3s4.
|
|
2015
|
+
tmp = _this__u8e3s4.n1o_1;
|
|
2016
2016
|
} else {
|
|
2017
2017
|
var message = 'Unsupported expression type in toRawCode: ' + getKClassFromExpression(_this__u8e3s4).o();
|
|
2018
2018
|
throw IllegalStateException_init_$Create$(toString_0(message));
|
|
@@ -2057,11 +2057,11 @@ function RustTransform$borrow$lambda(element, tr) {
|
|
|
2057
2057
|
var tmp;
|
|
2058
2058
|
if (element instanceof Interface) {
|
|
2059
2059
|
var tmp_0;
|
|
2060
|
-
if (element.
|
|
2060
|
+
if (element.p1n_1.equals(Companion_getInstance().k1h('Call'))) {
|
|
2061
2061
|
tmp_0 = element;
|
|
2062
2062
|
} else {
|
|
2063
2063
|
// Inline function 'kotlin.collections.map' call
|
|
2064
|
-
var this_0 = element.
|
|
2064
|
+
var this_0 = element.q1n_1;
|
|
2065
2065
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2066
2066
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2067
2067
|
var _iterator__ex2g4s = this_0.t();
|
|
@@ -2077,7 +2077,7 @@ function RustTransform$borrow$lambda(element, tr) {
|
|
|
2077
2077
|
destination.x(tmp$ret$0);
|
|
2078
2078
|
}
|
|
2079
2079
|
var borrowed = destination;
|
|
2080
|
-
tmp_0 = transformChildren_0(element.
|
|
2080
|
+
tmp_0 = transformChildren_0(element.w1n(VOID, borrowed), tr);
|
|
2081
2081
|
}
|
|
2082
2082
|
tmp = tmp_0;
|
|
2083
2083
|
} else {
|
|
@@ -2093,13 +2093,13 @@ function RustTransform$serializationArgs$lambda(s, t) {
|
|
|
2093
2093
|
var tmp;
|
|
2094
2094
|
var tmp_0;
|
|
2095
2095
|
if (s instanceof FunctionCall) {
|
|
2096
|
-
tmp_0 = RustTransform_getInstance().
|
|
2096
|
+
tmp_0 = RustTransform_getInstance().m1y_1.u1(s.g1m_1.d1m());
|
|
2097
2097
|
} else {
|
|
2098
2098
|
tmp_0 = false;
|
|
2099
2099
|
}
|
|
2100
2100
|
if (tmp_0) {
|
|
2101
2101
|
// Inline function 'kotlin.collections.mapIndexed' call
|
|
2102
|
-
var this_0 = s.
|
|
2102
|
+
var this_0 = s.h1m_1.j1();
|
|
2103
2103
|
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
2104
2104
|
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2105
2105
|
var index = 0;
|
|
@@ -2113,13 +2113,13 @@ function RustTransform$serializationArgs$lambda(s, t) {
|
|
|
2113
2113
|
var key = item.k1();
|
|
2114
2114
|
// Inline function 'kotlin.collections.component2' call
|
|
2115
2115
|
var value = item.l1();
|
|
2116
|
-
var transformed = t.
|
|
2116
|
+
var transformed = t.x1t(value);
|
|
2117
2117
|
var tmp_1;
|
|
2118
2118
|
var tmp_2;
|
|
2119
2119
|
if (idx === 0) {
|
|
2120
2120
|
var tmp_3;
|
|
2121
2121
|
if (transformed instanceof VariableReference) {
|
|
2122
|
-
tmp_3 = transformed.
|
|
2122
|
+
tmp_3 = transformed.l1o_1.x1h() === 'it';
|
|
2123
2123
|
} else {
|
|
2124
2124
|
tmp_3 = false;
|
|
2125
2125
|
}
|
|
@@ -2136,17 +2136,17 @@ function RustTransform$serializationArgs$lambda(s, t) {
|
|
|
2136
2136
|
destination.x(tmp$ret$2);
|
|
2137
2137
|
}
|
|
2138
2138
|
var newArgs = toMap(destination);
|
|
2139
|
-
tmp = s.
|
|
2139
|
+
tmp = s.k1m(VOID, VOID, VOID, newArgs);
|
|
2140
2140
|
} else {
|
|
2141
2141
|
tmp = transformChildren(s, t);
|
|
2142
2142
|
}
|
|
2143
2143
|
return tmp;
|
|
2144
2144
|
}
|
|
2145
2145
|
function RustTransform$rustName$lambda(it) {
|
|
2146
|
-
return RustTransform_getInstance().
|
|
2146
|
+
return RustTransform_getInstance().p1y(it);
|
|
2147
2147
|
}
|
|
2148
2148
|
function RustTransform$toRawCode$lambda(it) {
|
|
2149
|
-
return it.k1().
|
|
2149
|
+
return it.k1().d1m() + ': ' + toRawCode(RustTransform_getInstance(), it.l1());
|
|
2150
2150
|
}
|
|
2151
2151
|
function RustTransform() {
|
|
2152
2152
|
RustTransform_instance = this;
|
|
@@ -2154,58 +2154,58 @@ function RustTransform() {
|
|
|
2154
2154
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2155
2155
|
// Inline function 'kotlin.apply' call
|
|
2156
2156
|
var this_0 = new TransformerBuilder();
|
|
2157
|
-
this_0.
|
|
2158
|
-
tmp.
|
|
2157
|
+
this_0.i1u(RustTransform$primitivesToCustom$lambda);
|
|
2158
|
+
tmp.j1y_1 = this_0.i1h();
|
|
2159
2159
|
var tmp_0 = this;
|
|
2160
2160
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2161
2161
|
// Inline function 'kotlin.apply' call
|
|
2162
2162
|
var this_1 = new TransformerBuilder();
|
|
2163
|
-
this_1.
|
|
2164
|
-
tmp_0.
|
|
2163
|
+
this_1.h1h(RustTransform$borrow$lambda);
|
|
2164
|
+
tmp_0.k1y_1 = this_1.i1h();
|
|
2165
2165
|
var tmp_1 = this;
|
|
2166
2166
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2167
2167
|
// Inline function 'kotlin.apply' call
|
|
2168
|
-
tmp_1.
|
|
2169
|
-
this.
|
|
2168
|
+
tmp_1.l1y_1 = (new TransformerBuilder()).i1h();
|
|
2169
|
+
this.m1y_1 = setOf(['serialize_path', 'serialize_param', 'serialize_body', 'deserialize_path', 'deserialize_param', 'deserialize_body']);
|
|
2170
2170
|
var tmp_2 = this;
|
|
2171
2171
|
// Inline function 'community.flock.wirespec.ir.core.transformer' call
|
|
2172
2172
|
// Inline function 'kotlin.apply' call
|
|
2173
2173
|
var this_2 = new TransformerBuilder();
|
|
2174
|
-
this_2.
|
|
2175
|
-
tmp_2.
|
|
2176
|
-
this.
|
|
2174
|
+
this_2.l1u(RustTransform$serializationArgs$lambda);
|
|
2175
|
+
tmp_2.n1y_1 = this_2.i1h();
|
|
2176
|
+
this.o1y_1 = setOf(['i32', 'i64', 'f32', 'f64', 'bool', 'u8', 'u16', 'u32', 'u64', 'usize', 'isize', '()']);
|
|
2177
2177
|
}
|
|
2178
|
-
protoOf(RustTransform).
|
|
2178
|
+
protoOf(RustTransform).q1y = function (element) {
|
|
2179
2179
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2180
2180
|
var scope = new TransformScope(element);
|
|
2181
|
-
scope.
|
|
2182
|
-
var tmp = scope.
|
|
2181
|
+
scope.h1u(RustTransform_getInstance().j1y_1);
|
|
2182
|
+
var tmp = scope.c1u_1;
|
|
2183
2183
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2184
2184
|
var this_0 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
2185
2185
|
var scope_0 = new TransformScope(this_0);
|
|
2186
|
-
scope_0.
|
|
2187
|
-
var tmp_0 = scope_0.
|
|
2186
|
+
scope_0.h1u(RustTransform_getInstance().k1y_1);
|
|
2187
|
+
var tmp_0 = scope_0.c1u_1;
|
|
2188
2188
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2189
2189
|
var this_1 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2190
2190
|
var scope_1 = new TransformScope(this_1);
|
|
2191
|
-
scope_1.
|
|
2192
|
-
var tmp_1 = scope_1.
|
|
2191
|
+
scope_1.h1u(RustTransform_getInstance().l1y_1);
|
|
2192
|
+
var tmp_1 = scope_1.c1u_1;
|
|
2193
2193
|
// Inline function 'community.flock.wirespec.ir.core.transform' call
|
|
2194
2194
|
var this_2 = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
2195
2195
|
var scope_2 = new TransformScope(this_2);
|
|
2196
|
-
scope_2.
|
|
2197
|
-
var tmp_2 = scope_2.
|
|
2196
|
+
scope_2.h1u(RustTransform_getInstance().n1y_1);
|
|
2197
|
+
var tmp_2 = scope_2.c1u_1;
|
|
2198
2198
|
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
2199
2199
|
};
|
|
2200
|
-
protoOf(RustTransform).
|
|
2200
|
+
protoOf(RustTransform).p1y = function (_this__u8e3s4) {
|
|
2201
2201
|
var tmp;
|
|
2202
2202
|
if (_this__u8e3s4 instanceof Custom) {
|
|
2203
|
-
var pascalName = _this__u8e3s4.
|
|
2203
|
+
var pascalName = _this__u8e3s4.v1h_1.m1h();
|
|
2204
2204
|
var tmp_0;
|
|
2205
|
-
if (_this__u8e3s4.
|
|
2205
|
+
if (_this__u8e3s4.w1h_1.r()) {
|
|
2206
2206
|
tmp_0 = pascalName;
|
|
2207
2207
|
} else {
|
|
2208
|
-
tmp_0 = pascalName + '<' + joinToString(_this__u8e3s4.
|
|
2208
|
+
tmp_0 = pascalName + '<' + joinToString(_this__u8e3s4.w1h_1, ', ', VOID, VOID, VOID, VOID, RustTransform$rustName$lambda) + '>';
|
|
2209
2209
|
}
|
|
2210
2210
|
tmp = tmp_0;
|
|
2211
2211
|
} else {
|
|
@@ -2213,13 +2213,13 @@ protoOf(RustTransform).k1y = function (_this__u8e3s4) {
|
|
|
2213
2213
|
tmp = 'String';
|
|
2214
2214
|
} else {
|
|
2215
2215
|
if (_this__u8e3s4 instanceof Nullable) {
|
|
2216
|
-
tmp = 'Option<' + this.
|
|
2216
|
+
tmp = 'Option<' + this.p1y(_this__u8e3s4.t1h_1) + '>';
|
|
2217
2217
|
} else {
|
|
2218
2218
|
if (_this__u8e3s4 instanceof Array_0) {
|
|
2219
|
-
tmp = 'Vec<' + this.
|
|
2219
|
+
tmp = 'Vec<' + this.p1y(_this__u8e3s4.u1h_1) + '>';
|
|
2220
2220
|
} else {
|
|
2221
2221
|
if (_this__u8e3s4 instanceof Dict) {
|
|
2222
|
-
tmp = 'std::collections::HashMap<' + this.
|
|
2222
|
+
tmp = 'std::collections::HashMap<' + this.p1y(_this__u8e3s4.o1m_1) + ', ' + this.p1y(_this__u8e3s4.p1m_1) + '>';
|
|
2223
2223
|
} else {
|
|
2224
2224
|
if (equals(_this__u8e3s4, Any_instance)) {
|
|
2225
2225
|
tmp = 'Box<dyn std::any::Any>';
|
|
@@ -2241,7 +2241,7 @@ protoOf(RustTransform).k1y = function (_this__u8e3s4) {
|
|
|
2241
2241
|
} else {
|
|
2242
2242
|
if (_this__u8e3s4 instanceof Integer) {
|
|
2243
2243
|
var tmp_1;
|
|
2244
|
-
switch (_this__u8e3s4.
|
|
2244
|
+
switch (_this__u8e3s4.l1m_1.b3_1) {
|
|
2245
2245
|
case 0:
|
|
2246
2246
|
tmp_1 = 'i32';
|
|
2247
2247
|
break;
|
|
@@ -2256,7 +2256,7 @@ protoOf(RustTransform).k1y = function (_this__u8e3s4) {
|
|
|
2256
2256
|
} else {
|
|
2257
2257
|
if (_this__u8e3s4 instanceof Number_0) {
|
|
2258
2258
|
var tmp_2;
|
|
2259
|
-
switch (_this__u8e3s4.
|
|
2259
|
+
switch (_this__u8e3s4.m1m_1.b3_1) {
|
|
2260
2260
|
case 0:
|
|
2261
2261
|
tmp_2 = 'f32';
|
|
2262
2262
|
break;
|
|
@@ -2293,24 +2293,24 @@ protoOf(RustTransform).k1y = function (_this__u8e3s4) {
|
|
|
2293
2293
|
}
|
|
2294
2294
|
return tmp;
|
|
2295
2295
|
};
|
|
2296
|
-
protoOf(RustTransform).
|
|
2296
|
+
protoOf(RustTransform).t1y = function (_this__u8e3s4) {
|
|
2297
2297
|
var tmp;
|
|
2298
2298
|
if (_this__u8e3s4 instanceof Custom) {
|
|
2299
2299
|
// Inline function 'kotlin.let' call
|
|
2300
|
-
var it = _this__u8e3s4.
|
|
2300
|
+
var it = _this__u8e3s4.v1h_1.m1h();
|
|
2301
2301
|
tmp = startsWith(it, '&') || startsWith(it, '&dyn ') || startsWith(it, '&impl ') || startsWith(it, '&mut ');
|
|
2302
2302
|
} else {
|
|
2303
2303
|
tmp = false;
|
|
2304
2304
|
}
|
|
2305
2305
|
return tmp;
|
|
2306
2306
|
};
|
|
2307
|
-
protoOf(RustTransform).
|
|
2307
|
+
protoOf(RustTransform).s1y = function (_this__u8e3s4) {
|
|
2308
2308
|
// Inline function 'kotlin.let' call
|
|
2309
|
-
var it = _this__u8e3s4.
|
|
2309
|
+
var it = _this__u8e3s4.v1h_1.m1h();
|
|
2310
2310
|
return it === 'Serializer' || it === 'Deserializer';
|
|
2311
2311
|
};
|
|
2312
|
-
protoOf(RustTransform).
|
|
2313
|
-
var v = _this__u8e3s4.
|
|
2312
|
+
protoOf(RustTransform).r1y = function (_this__u8e3s4) {
|
|
2313
|
+
var v = _this__u8e3s4.x1h();
|
|
2314
2314
|
switch (v) {
|
|
2315
2315
|
case 'self':
|
|
2316
2316
|
case '&self':
|
|
@@ -2326,16 +2326,16 @@ function RustTransform_getInstance() {
|
|
|
2326
2326
|
return RustTransform_instance;
|
|
2327
2327
|
}
|
|
2328
2328
|
function borrow(_this__u8e3s4) {
|
|
2329
|
-
return _this__u8e3s4.
|
|
2329
|
+
return _this__u8e3s4.s1m(new Name(listOf('&' + _this__u8e3s4.v1h_1.m1h())));
|
|
2330
2330
|
}
|
|
2331
2331
|
function borrowDyn(_this__u8e3s4) {
|
|
2332
|
-
return _this__u8e3s4.
|
|
2332
|
+
return _this__u8e3s4.s1m(new Name(listOf('&dyn ' + _this__u8e3s4.v1h_1.m1h())));
|
|
2333
2333
|
}
|
|
2334
2334
|
function borrowImpl(_this__u8e3s4) {
|
|
2335
|
-
return _this__u8e3s4.
|
|
2335
|
+
return _this__u8e3s4.s1m(new Name(listOf('&impl ' + _this__u8e3s4.v1h_1.m1h())));
|
|
2336
2336
|
}
|
|
2337
2337
|
//region block: post-declaration
|
|
2338
|
-
protoOf(RustIrEmitter).
|
|
2338
|
+
protoOf(RustIrEmitter).sn = emit_1;
|
|
2339
2339
|
//endregion
|
|
2340
2340
|
//region block: exports
|
|
2341
2341
|
export {
|