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