@flock/wirespec 0.22.6 → 0.22.8
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 +150 -150
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt.mjs +1488 -1488
- package/colormath-root-colormath.mjs +441 -441
- package/kotlin-kotlin-stdlib.mjs +1626 -1604
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10134 -10134
- package/kotlin-rgxgen.mjs +1802 -1802
- package/kotlinx-io-kotlinx-io-core.mjs +414 -414
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1816 -1816
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1570 -1570
- package/mordant-mordant.mjs +1280 -1280
- package/package.json +1 -1
- package/wirespec-src-compiler-core.mjs +6797 -6957
- package/wirespec-src-compiler-core.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-java.mjs +177 -177
- package/wirespec-src-compiler-emitters-kotlin.mjs +132 -132
- package/wirespec-src-compiler-emitters-python.mjs +166 -166
- package/wirespec-src-compiler-emitters-rust.mjs +1501 -2116
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +165 -165
- package/wirespec-src-compiler-emitters-typescript.mjs +214 -214
- package/wirespec-src-compiler-emitters-wirespec.mjs +178 -198
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +282 -282
- package/wirespec-src-converter-asyncapi.mjs +849 -767
- package/wirespec-src-converter-asyncapi.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +596 -595
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-common.mjs +18 -18
- package/wirespec-src-converter-graphql.mjs +1064 -1064
- package/wirespec-src-converter-openapi.mjs +774 -662
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1375 -1375
- package/wirespec-src-plugin-arguments.mjs +200 -190
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +112 -112
- package/wirespec-src-plugin-extensions.mjs +1034 -998
- package/wirespec-src-plugin-extensions.mjs.map +1 -1
- package/wirespec-src-plugin-npm.mjs +54 -54
- package/wirespec-src-tools-generator.mjs +32 -32
|
@@ -1,95 +1,82 @@
|
|
|
1
1
|
import {
|
|
2
2
|
KProperty1ca4yb4wlo496 as KProperty1,
|
|
3
3
|
getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
|
|
4
|
-
|
|
5
|
-
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
|
|
6
|
-
ArrayList_init_$Create$2byt5m5yn22yy as ArrayList_init_$Create$,
|
|
7
|
-
checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
|
|
4
|
+
ArrayList_init_$Create$37gc04va6yfo2 as ArrayList_init_$Create$,
|
|
8
5
|
Unit_instancev9v8hjid95df as Unit_instance,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
13
|
-
isLetterOrDigit2kuxd9e198haf as isLetterOrDigit,
|
|
14
|
-
_Char___init__impl__6a9atx2gndcvjvc5pke as _Char___init__impl__6a9atx,
|
|
15
|
-
firstOrNulltrxqttxfxqju as firstOrNull,
|
|
16
|
-
isDigit3mimrri4wkzop as isDigit,
|
|
17
|
-
Char19o2r8palgjof as Char,
|
|
18
|
-
VOID3gxj6tk5isa35 as VOID,
|
|
19
|
-
plus310ted5e4i90h as plus,
|
|
6
|
+
firstOrNull1982767dljvdy as firstOrNull,
|
|
7
|
+
ensureNotNull1e947j3ixpazm as ensureNotNull,
|
|
8
|
+
listOfvhqybd2zx248 as listOf,
|
|
20
9
|
Collection1k04j3hzsbod0 as Collection,
|
|
21
10
|
isInterface3d6p8outrmvmk as isInterface,
|
|
22
|
-
|
|
11
|
+
listOfNotNull2woi2boe01ub4 as listOfNotNull,
|
|
12
|
+
addAll1k27qatfgp3k5 as addAll,
|
|
13
|
+
plus310ted5e4i90h as plus,
|
|
14
|
+
VOID3gxj6tk5isa35 as VOID,
|
|
15
|
+
joinToString1cxrrlmo0chqs as joinToString,
|
|
16
|
+
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
|
|
17
|
+
ArrayList_init_$Create$2byt5m5yn22yy as ArrayList_init_$Create$_0,
|
|
23
18
|
to2cs3ny02qtbcb as to,
|
|
24
19
|
protoOf180f3jzyo7rfj as protoOf,
|
|
25
20
|
initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
|
|
21
|
+
equals2au1ep9vhcato as equals,
|
|
26
22
|
FunctionAdapter3lcrrz3moet5b as FunctionAdapter,
|
|
27
23
|
Comparator2b3maoeh98xtg as Comparator,
|
|
28
24
|
hashCodeq5arwsb9dgti as hashCode,
|
|
29
25
|
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
|
|
26
|
+
firstOrNulltrxqttxfxqju as firstOrNull_0,
|
|
27
|
+
isDigit3mimrri4wkzop as isDigit,
|
|
28
|
+
Char19o2r8palgjof as Char,
|
|
30
29
|
toMap1vec9topfei08 as toMap,
|
|
31
30
|
setOf45ia9pnfhe90 as setOf,
|
|
32
31
|
minus165a8u1e0x1lu as minus,
|
|
33
|
-
ArrayList_init_$Create$37gc04va6yfo2 as ArrayList_init_$Create$_0,
|
|
34
|
-
first58ocm7j58k3q as first,
|
|
35
|
-
listOfvhqybd2zx248 as listOf,
|
|
36
|
-
THROW_CCE2g6jy02ryeudk as THROW_CCE,
|
|
37
|
-
KtMap140uvy3s5zad8 as KtMap,
|
|
38
|
-
ensureNotNull1e947j3ixpazm as ensureNotNull,
|
|
39
|
-
addAll1k27qatfgp3k5 as addAll,
|
|
40
|
-
plus20p0vtfmu0596 as plus_0,
|
|
41
|
-
charArrayOf27f4r3dozbrk1 as charArrayOf,
|
|
42
|
-
trimEndvvzjdhan75g as trimEnd,
|
|
43
32
|
compareValues1n2ayl87ihzfk as compareValues,
|
|
33
|
+
endsWith3cq61xxngobwh as endsWith,
|
|
34
|
+
trimIndent1qytc1wvt8suh as trimIndent,
|
|
35
|
+
lazy2hsh8ze7j6ikd as lazy,
|
|
36
|
+
sortedWith2csnbbb21k0lg as sortedWith,
|
|
37
|
+
noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
|
|
38
|
+
LinkedHashSet_init_$Create$t7gzf3ihb6pk as LinkedHashSet_init_$Create$,
|
|
39
|
+
THROW_CCE2g6jy02ryeudk as THROW_CCE,
|
|
44
40
|
startsWith26w8qjqapeeq6 as startsWith,
|
|
41
|
+
_Char___init__impl__6a9atx2gndcvjvc5pke as _Char___init__impl__6a9atx,
|
|
45
42
|
substringBefore3n7kj60w69hju as substringBefore,
|
|
46
|
-
|
|
43
|
+
distinct10qe1scfdvu5k as distinct,
|
|
44
|
+
Paire9pteg33gng7 as Pair,
|
|
45
|
+
listOf1jh22dvmctj1r as listOf_0,
|
|
46
|
+
plus20p0vtfmu0596 as plus_0,
|
|
47
|
+
split2bvyvnrlcifjv as split,
|
|
48
|
+
checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
|
|
49
|
+
StringBuilder_init_$Create$3ds9zx2kx9u4d as StringBuilder_init_$Create$,
|
|
50
|
+
charSequenceLength3278n89t01tmv as charSequenceLength,
|
|
51
|
+
charSequenceGet1vxk1y5n17t1z as charSequenceGet,
|
|
52
|
+
isLetterOrDigit2kuxd9e198haf as isLetterOrDigit,
|
|
53
|
+
HashSet_init_$Create$2w31ptb4ree5i as HashSet_init_$Create$,
|
|
47
54
|
charCodeAt1yspne1d8erbm as charCodeAt,
|
|
48
55
|
uppercaseChar6lahngw3wvwg as uppercaseChar,
|
|
49
56
|
substring3saq8ornu0luv as substring,
|
|
50
57
|
toString22rbkbhdb5cl2 as toString,
|
|
51
|
-
lazy2hsh8ze7j6ikd as lazy,
|
|
52
|
-
listOf1jh22dvmctj1r as listOf_0,
|
|
53
58
|
mapOf1xd03cq9cnmy8 as mapOf,
|
|
54
|
-
emptyList1g2z5xcrvp2zy as emptyList,
|
|
55
|
-
lastOrNull1aq5oz189qoe1 as lastOrNull,
|
|
56
|
-
firstOrNull1982767dljvdy as firstOrNull_0,
|
|
57
|
-
mutableListOf6oorvk2mtdmp as mutableListOf,
|
|
58
|
-
last1vo29oleiqj36 as last,
|
|
59
|
-
sortedWith2csnbbb21k0lg as sortedWith,
|
|
60
|
-
asSequence2phdjljfh9jhx as asSequence,
|
|
61
|
-
filterNot56uwv8hfomaa as filterNot,
|
|
62
|
-
mapsbvh18eqox7a as map,
|
|
63
|
-
distinct17vua5ffe1cfv as distinct,
|
|
64
|
-
toListx6x8nvfmvvht as toList,
|
|
65
|
-
LinkedHashSet_init_$Create$t7gzf3ihb6pk as LinkedHashSet_init_$Create$,
|
|
66
|
-
distinct10qe1scfdvu5k as distinct_0,
|
|
67
|
-
HashSet_init_$Create$2w31ptb4ree5i as HashSet_init_$Create$,
|
|
68
|
-
Regex_init_$Create$17zqsmfd15n8x as Regex_init_$Create$,
|
|
69
|
-
trimIndent1qytc1wvt8suh as trimIndent,
|
|
70
|
-
contains3ue2qo8xhmpf1 as contains,
|
|
71
|
-
removePrefix279df90bhrqqg as removePrefix,
|
|
72
59
|
mapCapacity1h45rc3eh9p2l as mapCapacity,
|
|
73
60
|
LinkedHashMap_init_$Create$1gzy1x4a46gd4 as LinkedHashMap_init_$Create$,
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
Regex_init_$Create$17zqsmfd15n8x as Regex_init_$Create$,
|
|
62
|
+
emptyList1g2z5xcrvp2zy as emptyList,
|
|
76
63
|
getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression,
|
|
77
64
|
toString1pkumu07cwy4m as toString_0,
|
|
78
65
|
IllegalStateException_init_$Create$1h4bcfod21ri0 as IllegalStateException_init_$Create$,
|
|
79
|
-
|
|
66
|
+
removePrefix279df90bhrqqg as removePrefix,
|
|
67
|
+
mapOf2zpbbmyqk8xpf as mapOf_0,
|
|
80
68
|
} from './kotlin-kotlin-stdlib.mjs';
|
|
81
69
|
import {
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
Companion_instance21vwhhqsaytqt as Companion_instance,
|
|
71
|
+
convert37y165c07dvpq as convert,
|
|
72
|
+
Namespacex2gpe17ntoag as Namespace,
|
|
84
73
|
Companion_getInstance34fvro4h6bumb as Companion_getInstance,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Reflect_instance2hvndzkpwulla as Reflect_instance,
|
|
92
|
-
Any_instance2d4twy8sq7tlx as Any_instance,
|
|
74
|
+
Enumoqsp4e7al89r as Enum,
|
|
75
|
+
fieldList2mdp34yzu6ln6 as fieldList,
|
|
76
|
+
Structakfq94wrq695 as Struct,
|
|
77
|
+
Interface2g99rmjjt5ne as Interface,
|
|
78
|
+
File12q75sqvz964e as File,
|
|
79
|
+
RawElement3huqlgf21e29z as RawElement,
|
|
93
80
|
requestParameters17h8t6jwwzr7s as requestParameters,
|
|
94
81
|
RustGenerator_getInstancezg1a9dx9j7v4 as RustGenerator_getInstance,
|
|
95
82
|
Name1ijtblv1phm3y as Name,
|
|
@@ -97,35 +84,19 @@ import {
|
|
|
97
84
|
sanitizeFieldName333wgwu6tt90n as sanitizeFieldName,
|
|
98
85
|
ConstructorStatement1edouznvc71xv as ConstructorStatement,
|
|
99
86
|
SanitizationConfigunh0ok3qg1q3 as SanitizationConfig,
|
|
100
|
-
Custom_init_$Create$kfegfgqdjj1p as Custom_init_$Create$,
|
|
101
|
-
Namespacex2gpe17ntoag as Namespace,
|
|
102
|
-
File12q75sqvz964e as File,
|
|
103
|
-
transformChildren14suh59vxsgt as transformChildren_0,
|
|
104
|
-
RawElement3huqlgf21e29z as RawElement,
|
|
105
|
-
Enumoqsp4e7al89r as Enum,
|
|
106
|
-
Interface2g99rmjjt5ne as Interface,
|
|
107
|
-
TransformScope3fhztkr2eyk36 as TransformScope,
|
|
108
|
-
TransformerBuilder26pbjl5nmg6wa as TransformerBuilder,
|
|
109
|
-
transformhd96z3w1u5uc as transform,
|
|
110
|
-
Element3p1xrn21d2w4b as Element,
|
|
111
|
-
Function1wme41sk2huri as Function_0,
|
|
112
87
|
sortKey2zu9zi2nc4wzk as sortKey,
|
|
113
88
|
RawExpressionfqemfbo6j6cq as RawExpression,
|
|
114
|
-
transformChildren21ucrga4lv4sn as
|
|
115
|
-
|
|
116
|
-
Companion_instance2oq66qbk0c5g8 as Companion_instance_1,
|
|
89
|
+
transformChildren21ucrga4lv4sn as transformChildren_0,
|
|
90
|
+
Companion_instance2oq66qbk0c5g8 as Companion_instance_0,
|
|
117
91
|
FileExtension_Rust_getInstancelfr0mas05dph as FileExtension_Rust_getInstance,
|
|
118
|
-
import3bym2b49e642p as import_0,
|
|
119
|
-
interface44jdw6t56okg as interface_0,
|
|
120
|
-
convert37y165c07dvpq as convert,
|
|
121
|
-
Structakfq94wrq695 as Struct,
|
|
122
|
-
fieldList2mdp34yzu6ln6 as fieldList,
|
|
123
|
-
Import5xihcpubhtyd as Import,
|
|
124
92
|
emit3e40nagyc4qho as emit,
|
|
125
93
|
Endpoint1jsq06yr3xdhp as Endpoint,
|
|
126
94
|
Model1nx3had6rojzt as Model,
|
|
127
|
-
plus3lrm73de10b42 as plus_1,
|
|
128
95
|
emit1w04jgbmswnni as emit_0,
|
|
96
|
+
plus3lrm73de10b42 as plus_1,
|
|
97
|
+
Channel2fhxi4a4pwb64 as Channel,
|
|
98
|
+
Part2m6fm5anwg79b as Part,
|
|
99
|
+
Rpc1w89psy5tk702 as Rpc,
|
|
129
100
|
convertToGenerator115obo0n49kco as convertToGenerator,
|
|
130
101
|
Unionccsavx6nrdr2 as Union,
|
|
131
102
|
convertToGenerator1x32vg5qdleq8 as convertToGenerator_0,
|
|
@@ -135,9 +106,13 @@ import {
|
|
|
135
106
|
convertToGenerator1arvbkvdv4bro as convertToGenerator_2,
|
|
136
107
|
Type12n1gx16iqtcu as Type,
|
|
137
108
|
sanitizeNames1v55mz1p84psg as sanitizeNames,
|
|
109
|
+
TransformScope3fhztkr2eyk36 as TransformScope,
|
|
110
|
+
Element3p1xrn21d2w4b as Element,
|
|
138
111
|
collectCustomTypeNames2atsrip288ol4 as collectCustomTypeNames,
|
|
139
112
|
plus14o24vdaiongg as plus_2,
|
|
113
|
+
import3bym2b49e642p as import_0,
|
|
140
114
|
convert23o50n5glj7h5 as convert_0,
|
|
115
|
+
importReferencesy4xv7r53sjjs as importReferences,
|
|
141
116
|
convert1ke01d6gmcvu7 as convert_1,
|
|
142
117
|
sanitizeEnumEntries28cw6g8cmlq5s as sanitizeEnumEntries,
|
|
143
118
|
convert29zpebhuxz599 as convert_2,
|
|
@@ -145,37 +120,50 @@ import {
|
|
|
145
120
|
convert333pgxr2q05n as convert_4,
|
|
146
121
|
convert86y6uioox2cl as convert_5,
|
|
147
122
|
convert1o5h4ulxoqycg as convert_6,
|
|
148
|
-
importReferencesy4xv7r53sjjs as importReferences,
|
|
149
123
|
get_extensions1p1y8uybwv35q as get_extensions,
|
|
150
124
|
emit2s9bv7yrx5jcs as emit_1,
|
|
151
125
|
beforeGenerate2eu511tof5fa4 as beforeGenerate,
|
|
152
126
|
get_supportsDefaults2j8lo8mbv0egf as get_supportsDefaults,
|
|
153
127
|
IrEmitter2jy94gp21kviv as IrEmitter,
|
|
128
|
+
Function6mdi096lkwmv as Function,
|
|
129
|
+
Any_instance2d4twy8sq7tlx as Any_instance,
|
|
130
|
+
Number2bo3d41wdfzde as Number_0,
|
|
131
|
+
Integer3hago8kqppnkb as Integer,
|
|
132
|
+
String_instance2j5u8j0qc6lge as String_instance,
|
|
133
|
+
Boolean_instance2uah59h3vb1ch as Boolean_instance,
|
|
134
|
+
Bytes_instance1wj5048pbkky0 as Bytes_instance,
|
|
135
|
+
StringLiteral3ok9p8g9pwd8t as StringLiteral,
|
|
136
|
+
IntegerLiteral2ol3gjjph591c as IntegerLiteral,
|
|
137
|
+
Reflect_instance2hvndzkpwulla as Reflect_instance,
|
|
138
|
+
Unit_instance25jwel3twibm6 as Unit_instance_0,
|
|
139
|
+
Wildcard_instance1x48vpete4k7w as Wildcard_instance,
|
|
140
|
+
Dict27tp4weviyg4b as Dict,
|
|
141
|
+
Array2vay9bq78aua1 as Array_0,
|
|
142
|
+
Nullable3he31tqc4yy1q as Nullable,
|
|
143
|
+
Custom1ct1lu66hij6o as Custom,
|
|
144
|
+
Companion_instance27ueeez2qu1l as Companion_instance_1,
|
|
145
|
+
TransformerBuilder26pbjl5nmg6wa as TransformerBuilder,
|
|
146
|
+
Function1wme41sk2huri as Function_0,
|
|
147
|
+
transformhd96z3w1u5uc as transform,
|
|
154
148
|
Uniontffpdks00nyc as Union_0,
|
|
155
|
-
|
|
149
|
+
Custom_init_$Create$kfegfgqdjj1p as Custom_init_$Create$,
|
|
150
|
+
String3gpv4dw3d0slq as String_0,
|
|
151
|
+
Literal1ddgfbf7tp4wt as Literal,
|
|
152
|
+
ArrayIndexCallza9minnmbuvj as ArrayIndexCall,
|
|
156
153
|
FieldCall2nusnrnm7uuow as FieldCall,
|
|
157
|
-
|
|
158
|
-
function3tnfxyozkc8k as function_0,
|
|
159
|
-
String1czvr8pxnm6on as String_0,
|
|
160
|
-
Switch1xeta53lgnle5 as Switch,
|
|
154
|
+
VariableReferencesji1q1tq3ygo as VariableReference,
|
|
161
155
|
Case35feeoz93frh9 as Case,
|
|
162
|
-
|
|
156
|
+
transformChildren2vo7pa38trabm as transformChildren_1,
|
|
157
|
+
function3tnfxyozkc8k as function_0,
|
|
158
|
+
transformChildren14suh59vxsgt as transformChildren_2,
|
|
163
159
|
FunctionCall1a3g4e6bcljl6 as FunctionCall,
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
Switch1xeta53lgnle5 as Switch,
|
|
161
|
+
transformChildrenfid5m1x7z1ur as transformChildren_3,
|
|
162
|
+
convertConstraint1tall9wrxeg5k as convertConstraint,
|
|
163
|
+
String1czvr8pxnm6on as String_1,
|
|
166
164
|
Paramvfwnys2w6aj1 as Param,
|
|
167
|
-
Literal331hu9r04vptz as
|
|
165
|
+
Literal331hu9r04vptz as Literal_0,
|
|
168
166
|
Parameter37d5p43ul6u79 as Parameter,
|
|
169
|
-
Number2bo3d41wdfzde as Number_0,
|
|
170
|
-
Integer3hago8kqppnkb as Integer,
|
|
171
|
-
Booleanz31i2i22ldw9 as Boolean_0,
|
|
172
|
-
String3gpv4dw3d0slq as String_1,
|
|
173
|
-
Literal1ddgfbf7tp4wt as Literal_0,
|
|
174
|
-
ArrayIndexCallza9minnmbuvj as ArrayIndexCall,
|
|
175
|
-
StringLiteral3ok9p8g9pwd8t as StringLiteral,
|
|
176
|
-
IntegerLiteral2ol3gjjph591c as IntegerLiteral,
|
|
177
|
-
Bytes_instance1wj5048pbkky0 as Bytes_instance,
|
|
178
|
-
Unit_instance25jwel3twibm6 as Unit_instance_0,
|
|
179
167
|
} from './wirespec-src-compiler-core.mjs';
|
|
180
168
|
import {
|
|
181
169
|
NonEmptyList3ak25ihy2gcvs as NonEmptyList,
|
|
@@ -188,291 +176,211 @@ import {
|
|
|
188
176
|
initMetadataForCompanion(Companion);
|
|
189
177
|
initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
190
178
|
initMetadataForClass(RustEmitter, 'RustEmitter', RustEmitter, VOID, [IrEmitter]);
|
|
191
|
-
initMetadataForObject(RustTransform, 'RustTransform');
|
|
192
179
|
//endregion
|
|
180
|
+
function get_wirespecImports() {
|
|
181
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
182
|
+
return wirespecImports;
|
|
183
|
+
}
|
|
184
|
+
var wirespecImports;
|
|
185
|
+
function get_sharedImports() {
|
|
186
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
187
|
+
return sharedImports;
|
|
188
|
+
}
|
|
189
|
+
var sharedImports;
|
|
190
|
+
function get_sharedDerive() {
|
|
191
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
192
|
+
return sharedDerive;
|
|
193
|
+
}
|
|
194
|
+
var sharedDerive;
|
|
195
|
+
function get_sharedMethod() {
|
|
196
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
197
|
+
return sharedMethod;
|
|
198
|
+
}
|
|
199
|
+
var sharedMethod;
|
|
200
|
+
function get_sharedTraits() {
|
|
201
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
202
|
+
return sharedTraits;
|
|
203
|
+
}
|
|
204
|
+
var sharedTraits;
|
|
205
|
+
function get_sharedClientAndServer() {
|
|
206
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
207
|
+
return sharedClientAndServer;
|
|
208
|
+
}
|
|
209
|
+
var sharedClientAndServer;
|
|
193
210
|
function _get_sanitizationConfig__sns434($this) {
|
|
194
|
-
var tmp0 = $this.
|
|
211
|
+
var tmp0 = $this.q38_1;
|
|
195
212
|
var tmp = KProperty1;
|
|
196
213
|
// Inline function 'kotlin.getValue' call
|
|
197
214
|
getPropertyCallableRef('sanitizationConfig', 1, tmp, RustEmitter$_get_sanitizationConfig_$ref_1dtj2x(), null);
|
|
198
215
|
return tmp0.o1();
|
|
199
216
|
}
|
|
200
|
-
function
|
|
201
|
-
// Inline function '
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
var
|
|
217
|
+
function sharedFile($this) {
|
|
218
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.findElement' call
|
|
219
|
+
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
220
|
+
var tmp0 = convert(Companion_instance.at('shared')).hv();
|
|
221
|
+
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
222
|
+
var destination = ArrayList_init_$Create$();
|
|
223
|
+
var _iterator__ex2g4s = tmp0.t();
|
|
224
|
+
while (_iterator__ex2g4s.u()) {
|
|
225
|
+
var element = _iterator__ex2g4s.v();
|
|
226
|
+
if (element instanceof Namespace) {
|
|
227
|
+
destination.x(element);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
var tmp$ret$0 = firstOrNull(destination);
|
|
231
|
+
// Inline function 'kotlin.collections.flatMap' call
|
|
232
|
+
var tmp0_0 = ensureNotNull(tmp$ret$0).mv_1;
|
|
233
|
+
// Inline function 'kotlin.collections.flatMapTo' call
|
|
234
|
+
var destination_0 = ArrayList_init_$Create$();
|
|
235
|
+
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
236
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
237
|
+
var element_0 = _iterator__ex2g4s_0.v();
|
|
238
|
+
var tmp;
|
|
239
|
+
var tmp_0;
|
|
240
|
+
if (element_0 instanceof Enum) {
|
|
241
|
+
tmp_0 = element_0.ww_1.equals(Companion_getInstance().au('Method'));
|
|
242
|
+
} else {
|
|
243
|
+
tmp_0 = false;
|
|
244
|
+
}
|
|
245
|
+
if (tmp_0) {
|
|
246
|
+
tmp = listOf(get_sharedMethod());
|
|
247
|
+
} else {
|
|
248
|
+
if (element_0 instanceof Interface) {
|
|
249
|
+
var tmp1_elvis_lhs = get_sharedTraits().t2(element_0.rv_1.du());
|
|
250
|
+
tmp = listOf(tmp1_elvis_lhs == null ? withSelfReceivers(element_0) : tmp1_elvis_lhs);
|
|
251
|
+
} else {
|
|
252
|
+
if (element_0 instanceof Struct) {
|
|
253
|
+
// Inline function 'kotlin.takeIf' call
|
|
254
|
+
var this_0 = get_sharedDerive();
|
|
255
|
+
var tmp_1;
|
|
256
|
+
var tmp0_1 = fieldList(element_0);
|
|
257
|
+
var tmp$ret$8;
|
|
258
|
+
$l$block_0: {
|
|
259
|
+
// Inline function 'kotlin.collections.all' call
|
|
260
|
+
var tmp_2;
|
|
261
|
+
if (isInterface(tmp0_1, Collection)) {
|
|
262
|
+
tmp_2 = tmp0_1.r();
|
|
263
|
+
} else {
|
|
264
|
+
tmp_2 = false;
|
|
265
|
+
}
|
|
266
|
+
if (tmp_2) {
|
|
267
|
+
tmp$ret$8 = true;
|
|
268
|
+
break $l$block_0;
|
|
269
|
+
}
|
|
270
|
+
var _iterator__ex2g4s_1 = tmp0_1.t();
|
|
271
|
+
while (_iterator__ex2g4s_1.u()) {
|
|
272
|
+
var element_1 = _iterator__ex2g4s_1.v();
|
|
273
|
+
if (!isDerivable(element_1.bw_1)) {
|
|
274
|
+
tmp$ret$8 = false;
|
|
275
|
+
break $l$block_0;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
tmp$ret$8 = true;
|
|
279
|
+
}
|
|
280
|
+
if (tmp$ret$8) {
|
|
281
|
+
tmp_1 = this_0;
|
|
282
|
+
} else {
|
|
283
|
+
tmp_1 = null;
|
|
284
|
+
}
|
|
285
|
+
var tmp$ret$6 = tmp_1;
|
|
286
|
+
tmp = listOfNotNull([tmp$ret$6, element_0]);
|
|
287
|
+
} else {
|
|
288
|
+
tmp = listOf(element_0);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
var list = tmp;
|
|
293
|
+
addAll(destination_0, list);
|
|
294
|
+
}
|
|
295
|
+
// Inline function 'kotlin.let' call
|
|
296
|
+
return new File(Companion_getInstance().au('Wirespec'), plus(plus(get_sharedImports(), destination_0), get_sharedClientAndServer()));
|
|
297
|
+
}
|
|
298
|
+
function modFile($this, directory, definitions) {
|
|
299
|
+
var tmp = Companion_getInstance().au($this.m38_1.dt() + directory + 'mod');
|
|
300
|
+
return new File(tmp, listOf(new RawElement(joinToString(definitions, '\n', VOID, VOID, VOID, VOID, RustEmitter$modFile$lambda))));
|
|
301
|
+
}
|
|
302
|
+
function _get_clientName__yc59yj($this, $receiver) {
|
|
303
|
+
return $receiver.gr_1.o1() + 'Client';
|
|
304
|
+
}
|
|
305
|
+
function clientParameters($this, $receiver) {
|
|
306
|
+
// Inline function 'kotlin.collections.map' call
|
|
307
|
+
var this_0 = requestParameters($receiver);
|
|
308
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
309
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
206
310
|
var _iterator__ex2g4s = this_0.t();
|
|
207
311
|
while (_iterator__ex2g4s.u()) {
|
|
208
312
|
var item = _iterator__ex2g4s.v();
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
var tmp$ret$2 =
|
|
313
|
+
var name = item.af();
|
|
314
|
+
var type = item.bf();
|
|
315
|
+
var tmp$ret$2 = to(sanitizeKeywords(name.eu()), rustName(type));
|
|
212
316
|
destination.x(tmp$ret$2);
|
|
213
317
|
}
|
|
214
|
-
// Inline function 'kotlin.text.filter' call
|
|
215
|
-
var tmp0 = joinToString(destination, '');
|
|
216
|
-
// Inline function 'kotlin.text.filterTo' call
|
|
217
|
-
var destination_0 = StringBuilder_init_$Create$();
|
|
218
|
-
var inductionVariable = 0;
|
|
219
|
-
var last = charSequenceLength(tmp0);
|
|
220
|
-
if (inductionVariable < last)
|
|
221
|
-
do {
|
|
222
|
-
var index_0 = inductionVariable;
|
|
223
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
224
|
-
var element = charSequenceGet(tmp0, index_0);
|
|
225
|
-
if (isLetterOrDigit(element) || element === _Char___init__impl__6a9atx(95)) {
|
|
226
|
-
destination_0.s(element);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
while (inductionVariable < last);
|
|
230
318
|
// Inline function 'kotlin.let' call
|
|
231
|
-
var
|
|
319
|
+
var tmp = joinToString(destination, '', VOID, VOID, VOID, VOID, RustEmitter$clientParameters$lambda);
|
|
320
|
+
return to(tmp, joinToString(destination, ', ', VOID, VOID, VOID, VOID, RustEmitter$clientParameters$lambda_0));
|
|
321
|
+
}
|
|
322
|
+
function Companion() {
|
|
323
|
+
Companion_instance_2 = this;
|
|
324
|
+
this.r38_1 = RustGenerator_getInstance();
|
|
325
|
+
}
|
|
326
|
+
protoOf(Companion).n37 = function () {
|
|
327
|
+
return this.r38_1.r1c_1;
|
|
328
|
+
};
|
|
329
|
+
var Companion_instance_2;
|
|
330
|
+
function Companion_getInstance_0() {
|
|
331
|
+
if (Companion_instance_2 == null)
|
|
332
|
+
new Companion();
|
|
333
|
+
return Companion_instance_2;
|
|
334
|
+
}
|
|
335
|
+
function sam$kotlin_Comparator$0(function_0) {
|
|
336
|
+
this.s38_1 = function_0;
|
|
337
|
+
}
|
|
338
|
+
protoOf(sam$kotlin_Comparator$0).zd = function (a, b) {
|
|
339
|
+
return this.s38_1(a, b);
|
|
340
|
+
};
|
|
341
|
+
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
342
|
+
return this.zd(a, b);
|
|
343
|
+
};
|
|
344
|
+
protoOf(sam$kotlin_Comparator$0).p3 = function () {
|
|
345
|
+
return this.s38_1;
|
|
346
|
+
};
|
|
347
|
+
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
348
|
+
var tmp;
|
|
349
|
+
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
350
|
+
var tmp_0;
|
|
351
|
+
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
352
|
+
tmp_0 = equals(this.p3(), other.p3());
|
|
353
|
+
} else {
|
|
354
|
+
tmp_0 = false;
|
|
355
|
+
}
|
|
356
|
+
tmp = tmp_0;
|
|
357
|
+
} else {
|
|
358
|
+
tmp = false;
|
|
359
|
+
}
|
|
360
|
+
return tmp;
|
|
361
|
+
};
|
|
362
|
+
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
363
|
+
return hashCode(this.p3());
|
|
364
|
+
};
|
|
365
|
+
function RustEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
366
|
+
return 'r#' + it;
|
|
367
|
+
}
|
|
368
|
+
function RustEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
369
|
+
return Companion_getInstance().au((new Name(name.yt_1)).eu());
|
|
370
|
+
}
|
|
371
|
+
function RustEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
372
|
+
var value = name.bu();
|
|
373
|
+
switch (value) {
|
|
374
|
+
case 'self':
|
|
375
|
+
case '&self':
|
|
376
|
+
return name;
|
|
377
|
+
default:
|
|
378
|
+
return Companion_getInstance().au((new Name(name.yt_1)).eu());
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function RustEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
232
382
|
var tmp;
|
|
233
|
-
var tmp0_safe_receiver =
|
|
234
|
-
var tmp_0;
|
|
235
|
-
var tmp_1 = tmp0_safe_receiver;
|
|
236
|
-
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
237
|
-
tmp_0 = null;
|
|
238
|
-
} else {
|
|
239
|
-
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
240
|
-
}
|
|
241
|
-
if (tmp_0 === true) {
|
|
242
|
-
tmp = '_' + it;
|
|
243
|
-
} else {
|
|
244
|
-
tmp = it;
|
|
245
|
-
}
|
|
246
|
-
// Inline function 'kotlin.let' call
|
|
247
|
-
var it_0 = tmp;
|
|
248
|
-
var tmp_2;
|
|
249
|
-
if ($receiver instanceof FieldIdentifier) {
|
|
250
|
-
tmp_2 = sanitizeKeywords($this, it_0);
|
|
251
|
-
} else {
|
|
252
|
-
tmp_2 = it_0;
|
|
253
|
-
}
|
|
254
|
-
var tmp$ret$8 = tmp_2;
|
|
255
|
-
return toSnakeCase($this, tmp$ret$8);
|
|
256
|
-
}
|
|
257
|
-
function toSnakeCase($this, $receiver) {
|
|
258
|
-
return Companion_getInstance().wt($receiver).au();
|
|
259
|
-
}
|
|
260
|
-
function toPascalCase($this, $receiver) {
|
|
261
|
-
var tmp = split($receiver, ['_']);
|
|
262
|
-
return joinToString(tmp, '', VOID, VOID, VOID, VOID, RustEmitter$toPascalCase$lambda);
|
|
263
|
-
}
|
|
264
|
-
function sanitizeKeywords($this, $receiver) {
|
|
265
|
-
return Companion_getInstance_0().i37().i1($receiver) ? 'r#' + $receiver : $receiver;
|
|
266
|
-
}
|
|
267
|
-
function sanitizeEnum($this, $receiver) {
|
|
268
|
-
// Inline function 'kotlin.let' call
|
|
269
|
-
var it = toPascalCase($this, joinToString(split($receiver, ['-', ', ', '.', ' ', '//']), '_'));
|
|
270
|
-
var tmp;
|
|
271
|
-
var tmp0_safe_receiver = firstOrNull(it);
|
|
272
|
-
var tmp_0;
|
|
273
|
-
var tmp_1 = tmp0_safe_receiver;
|
|
274
|
-
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
275
|
-
tmp_0 = null;
|
|
276
|
-
} else {
|
|
277
|
-
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
278
|
-
}
|
|
279
|
-
if (tmp_0 === true) {
|
|
280
|
-
tmp = '_' + it;
|
|
281
|
-
} else {
|
|
282
|
-
tmp = it;
|
|
283
|
-
}
|
|
284
|
-
return tmp;
|
|
285
|
-
}
|
|
286
|
-
function prependImports($this, $receiver, imports) {
|
|
287
|
-
var tmp;
|
|
288
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
289
|
-
if (!imports.r()) {
|
|
290
|
-
tmp = $receiver.fv(VOID, plus(imports, $receiver.cv_1));
|
|
291
|
-
} else {
|
|
292
|
-
tmp = $receiver;
|
|
293
|
-
}
|
|
294
|
-
return tmp;
|
|
295
|
-
}
|
|
296
|
-
function containsWildcard($this, type) {
|
|
297
|
-
var tmp;
|
|
298
|
-
if (equals(type, Wildcard_instance)) {
|
|
299
|
-
tmp = true;
|
|
300
|
-
} else {
|
|
301
|
-
if (type instanceof Custom) {
|
|
302
|
-
var tmp0 = type.ou_1;
|
|
303
|
-
var tmp$ret$0;
|
|
304
|
-
$l$block_0: {
|
|
305
|
-
// Inline function 'kotlin.collections.any' call
|
|
306
|
-
var tmp_0;
|
|
307
|
-
if (isInterface(tmp0, Collection)) {
|
|
308
|
-
tmp_0 = tmp0.r();
|
|
309
|
-
} else {
|
|
310
|
-
tmp_0 = false;
|
|
311
|
-
}
|
|
312
|
-
if (tmp_0) {
|
|
313
|
-
tmp$ret$0 = false;
|
|
314
|
-
break $l$block_0;
|
|
315
|
-
}
|
|
316
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
317
|
-
while (_iterator__ex2g4s.u()) {
|
|
318
|
-
var element = _iterator__ex2g4s.v();
|
|
319
|
-
if (containsWildcard($this, element)) {
|
|
320
|
-
tmp$ret$0 = true;
|
|
321
|
-
break $l$block_0;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
tmp$ret$0 = false;
|
|
325
|
-
}
|
|
326
|
-
tmp = tmp$ret$0;
|
|
327
|
-
} else {
|
|
328
|
-
if (type instanceof Nullable) {
|
|
329
|
-
tmp = containsWildcard($this, type.ru_1);
|
|
330
|
-
} else {
|
|
331
|
-
if (type instanceof Array_0) {
|
|
332
|
-
tmp = containsWildcard($this, type.iu_1);
|
|
333
|
-
} else {
|
|
334
|
-
if (type instanceof Dict) {
|
|
335
|
-
tmp = containsWildcard($this, type.ku_1) || containsWildcard($this, type.lu_1);
|
|
336
|
-
} else {
|
|
337
|
-
tmp = false;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
return tmp;
|
|
344
|
-
}
|
|
345
|
-
function containsUnderiveable($this, type) {
|
|
346
|
-
var tmp;
|
|
347
|
-
if (equals(type, Any_instance)) {
|
|
348
|
-
tmp = true;
|
|
349
|
-
} else {
|
|
350
|
-
if (equals(type, Reflect_instance)) {
|
|
351
|
-
tmp = true;
|
|
352
|
-
} else {
|
|
353
|
-
if (type instanceof Function) {
|
|
354
|
-
tmp = true;
|
|
355
|
-
} else {
|
|
356
|
-
if (type instanceof Custom) {
|
|
357
|
-
var tmp0 = type.ou_1;
|
|
358
|
-
var tmp$ret$0;
|
|
359
|
-
$l$block_0: {
|
|
360
|
-
// Inline function 'kotlin.collections.any' call
|
|
361
|
-
var tmp_0;
|
|
362
|
-
if (isInterface(tmp0, Collection)) {
|
|
363
|
-
tmp_0 = tmp0.r();
|
|
364
|
-
} else {
|
|
365
|
-
tmp_0 = false;
|
|
366
|
-
}
|
|
367
|
-
if (tmp_0) {
|
|
368
|
-
tmp$ret$0 = false;
|
|
369
|
-
break $l$block_0;
|
|
370
|
-
}
|
|
371
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
372
|
-
while (_iterator__ex2g4s.u()) {
|
|
373
|
-
var element = _iterator__ex2g4s.v();
|
|
374
|
-
if (containsUnderiveable($this, element)) {
|
|
375
|
-
tmp$ret$0 = true;
|
|
376
|
-
break $l$block_0;
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
tmp$ret$0 = false;
|
|
380
|
-
}
|
|
381
|
-
tmp = tmp$ret$0;
|
|
382
|
-
} else {
|
|
383
|
-
if (type instanceof Nullable) {
|
|
384
|
-
tmp = containsUnderiveable($this, type.ru_1);
|
|
385
|
-
} else {
|
|
386
|
-
if (type instanceof Array_0) {
|
|
387
|
-
tmp = containsUnderiveable($this, type.iu_1);
|
|
388
|
-
} else {
|
|
389
|
-
if (type instanceof Dict) {
|
|
390
|
-
tmp = containsUnderiveable($this, type.ku_1) || containsUnderiveable($this, type.lu_1);
|
|
391
|
-
} else {
|
|
392
|
-
tmp = false;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
return tmp;
|
|
401
|
-
}
|
|
402
|
-
function buildClientParams($this, $receiver) {
|
|
403
|
-
var params = requestParameters($receiver);
|
|
404
|
-
var argsStr = joinToString(params, ', ', VOID, VOID, VOID, VOID, RustEmitter$buildClientParams$lambda($this));
|
|
405
|
-
var tmp;
|
|
406
|
-
if (params.r()) {
|
|
407
|
-
tmp = '';
|
|
408
|
-
} else {
|
|
409
|
-
tmp = ', ' + joinToString(params, ', ', VOID, VOID, VOID, VOID, RustEmitter$buildClientParams$lambda_0($this));
|
|
410
|
-
}
|
|
411
|
-
var paramsStr = tmp;
|
|
412
|
-
return to(paramsStr, argsStr);
|
|
413
|
-
}
|
|
414
|
-
function Companion() {
|
|
415
|
-
Companion_instance_2 = this;
|
|
416
|
-
this.o38_1 = RustGenerator_getInstance();
|
|
417
|
-
}
|
|
418
|
-
protoOf(Companion).i37 = function () {
|
|
419
|
-
return this.o38_1.n1c_1;
|
|
420
|
-
};
|
|
421
|
-
var Companion_instance_2;
|
|
422
|
-
function Companion_getInstance_0() {
|
|
423
|
-
if (Companion_instance_2 == null)
|
|
424
|
-
new Companion();
|
|
425
|
-
return Companion_instance_2;
|
|
426
|
-
}
|
|
427
|
-
function sam$kotlin_Comparator$0(function_0) {
|
|
428
|
-
this.p38_1 = function_0;
|
|
429
|
-
}
|
|
430
|
-
protoOf(sam$kotlin_Comparator$0).yd = function (a, b) {
|
|
431
|
-
return this.p38_1(a, b);
|
|
432
|
-
};
|
|
433
|
-
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
434
|
-
return this.yd(a, b);
|
|
435
|
-
};
|
|
436
|
-
protoOf(sam$kotlin_Comparator$0).o3 = function () {
|
|
437
|
-
return this.p38_1;
|
|
438
|
-
};
|
|
439
|
-
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
440
|
-
var tmp;
|
|
441
|
-
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
442
|
-
var tmp_0;
|
|
443
|
-
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
444
|
-
tmp_0 = equals(this.o3(), other.o3());
|
|
445
|
-
} else {
|
|
446
|
-
tmp_0 = false;
|
|
447
|
-
}
|
|
448
|
-
tmp = tmp_0;
|
|
449
|
-
} else {
|
|
450
|
-
tmp = false;
|
|
451
|
-
}
|
|
452
|
-
return tmp;
|
|
453
|
-
};
|
|
454
|
-
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
455
|
-
return hashCode(this.o3());
|
|
456
|
-
};
|
|
457
|
-
function RustEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
|
|
458
|
-
return 'r#' + it;
|
|
459
|
-
}
|
|
460
|
-
function RustEmitter$sanitizationConfig$delegate$lambda$lambda_0(name) {
|
|
461
|
-
return Companion_getInstance().wt((new Name(name.ut_1)).au());
|
|
462
|
-
}
|
|
463
|
-
function RustEmitter$sanitizationConfig$delegate$lambda$lambda_1(name) {
|
|
464
|
-
var value = name.xt();
|
|
465
|
-
switch (value) {
|
|
466
|
-
case 'self':
|
|
467
|
-
case '&self':
|
|
468
|
-
return name;
|
|
469
|
-
default:
|
|
470
|
-
return Companion_getInstance().wt((new Name(name.ut_1)).au());
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
function RustEmitter$sanitizationConfig$delegate$lambda$lambda_2(it) {
|
|
474
|
-
var tmp;
|
|
475
|
-
var tmp0_safe_receiver = firstOrNull(it);
|
|
383
|
+
var tmp0_safe_receiver = firstOrNull_0(it);
|
|
476
384
|
var tmp_0;
|
|
477
385
|
var tmp_1 = tmp0_safe_receiver;
|
|
478
386
|
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
@@ -491,11 +399,11 @@ function RustEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
491
399
|
return function (stmt, tr) {
|
|
492
400
|
var tmp;
|
|
493
401
|
if (stmt instanceof ConstructorStatement) {
|
|
494
|
-
var tmp_0 = tr.
|
|
402
|
+
var tmp_0 = tr.w18(stmt.gu_1);
|
|
495
403
|
// Inline function 'kotlin.collections.map' call
|
|
496
|
-
var this_0 = stmt.
|
|
404
|
+
var this_0 = stmt.hu_1;
|
|
497
405
|
// Inline function 'kotlin.collections.mapTo' call
|
|
498
|
-
var destination = ArrayList_init_$Create$(this_0.c1());
|
|
406
|
+
var destination = ArrayList_init_$Create$_0(this_0.c1());
|
|
499
407
|
// Inline function 'kotlin.collections.iterator' call
|
|
500
408
|
var _iterator__ex2g4s = this_0.m1().t();
|
|
501
409
|
while (_iterator__ex2g4s.u()) {
|
|
@@ -504,7 +412,7 @@ function RustEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
504
412
|
var k = item.n1();
|
|
505
413
|
// Inline function 'kotlin.collections.component2' call
|
|
506
414
|
var v = item.o1();
|
|
507
|
-
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.
|
|
415
|
+
var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), k), tr.z18(v));
|
|
508
416
|
destination.x(tmp$ret$3);
|
|
509
417
|
}
|
|
510
418
|
tmp = new ConstructorStatement(tmp_0, toMap(destination));
|
|
@@ -516,7 +424,7 @@ function RustEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
|
|
|
516
424
|
}
|
|
517
425
|
function RustEmitter$sanitizationConfig$delegate$lambda(this$0) {
|
|
518
426
|
return function () {
|
|
519
|
-
var tmp0_reservedKeywords = minus(Companion_getInstance_0().
|
|
427
|
+
var tmp0_reservedKeywords = minus(Companion_getInstance_0().n37(), setOf(['self', 'Self']));
|
|
520
428
|
var tmp = RustEmitter$sanitizationConfig$delegate$lambda$lambda;
|
|
521
429
|
var tmp_0 = RustEmitter$sanitizationConfig$delegate$lambda$lambda_0;
|
|
522
430
|
var tmp_1 = RustEmitter$sanitizationConfig$delegate$lambda$lambda_1;
|
|
@@ -529,543 +437,95 @@ function RustEmitter$_get_sanitizationConfig_$ref_1dtj2x() {
|
|
|
529
437
|
return _get_sanitizationConfig__sns434(p0);
|
|
530
438
|
};
|
|
531
439
|
}
|
|
532
|
-
function RustEmitter$emitShared$lambda($this$interface) {
|
|
533
|
-
$this$interface.k17(Custom_init_$Create$('Headers'));
|
|
534
|
-
return Unit_instance;
|
|
535
|
-
}
|
|
536
|
-
function RustEmitter$emitShared$lambda_0($this$interface) {
|
|
537
|
-
$this$interface.k17(Custom_init_$Create$('Headers'));
|
|
538
|
-
return Unit_instance;
|
|
539
|
-
}
|
|
540
|
-
function RustEmitter$emitShared$lambda_1($this$interface) {
|
|
541
|
-
$this$interface.k17(Custom_init_$Create$('Sized'));
|
|
542
|
-
$this$interface.g16('label', VOID, VOID, RustEmitter$emitShared$lambda$lambda);
|
|
543
|
-
$this$interface.g16('from_label', true, VOID, RustEmitter$emitShared$lambda$lambda_0);
|
|
544
|
-
return Unit_instance;
|
|
545
|
-
}
|
|
546
|
-
function RustEmitter$emitShared$lambda$lambda($this$function) {
|
|
547
|
-
$this$function.w13('&self', Custom_init_$Create$(''));
|
|
548
|
-
$this$function.t13(Custom_init_$Create$('&str'));
|
|
549
|
-
return Unit_instance;
|
|
550
|
-
}
|
|
551
|
-
function RustEmitter$emitShared$lambda$lambda_0($this$function) {
|
|
552
|
-
$this$function.w13('s', Custom_init_$Create$('&str'));
|
|
553
|
-
$this$function.t13(Custom_init_$Create$('Option<Self>'));
|
|
554
|
-
return Unit_instance;
|
|
555
|
-
}
|
|
556
|
-
function RustEmitter$emitShared$lambda_2($this$interface) {
|
|
557
|
-
$this$interface.s13($this$interface.a15('T', []), []);
|
|
558
|
-
$this$interface.g16('value', VOID, VOID, RustEmitter$emitShared$lambda$lambda_1);
|
|
559
|
-
$this$interface.g16('validate', VOID, VOID, RustEmitter$emitShared$lambda$lambda_2);
|
|
560
|
-
return Unit_instance;
|
|
561
|
-
}
|
|
562
|
-
function RustEmitter$emitShared$lambda$lambda_1($this$function) {
|
|
563
|
-
$this$function.w13('&self', Custom_init_$Create$(''));
|
|
564
|
-
$this$function.t13(borrow($this$function.a15('T', [])));
|
|
565
|
-
return Unit_instance;
|
|
566
|
-
}
|
|
567
|
-
function RustEmitter$emitShared$lambda$lambda_2($this$function) {
|
|
568
|
-
$this$function.w13('&self', Custom_init_$Create$(''));
|
|
569
|
-
$this$function.t13($this$function.u14());
|
|
570
|
-
return Unit_instance;
|
|
571
|
-
}
|
|
572
|
-
function RustEmitter$emitShared$lambda_3($this$interface) {
|
|
573
|
-
$this$interface.s13($this$interface.a15('T', []), []);
|
|
574
|
-
$this$interface.l17('path', borrowDyn($this$interface.a15('Path', [])));
|
|
575
|
-
$this$interface.l17('method', borrow($this$interface.a15('Method', [])));
|
|
576
|
-
$this$interface.l17('queries', borrowDyn($this$interface.a15('Queries', [])));
|
|
577
|
-
$this$interface.l17('headers', borrowDyn($this$interface.a15('RequestHeaders', [])));
|
|
578
|
-
$this$interface.l17('body', borrow($this$interface.a15('T', [])));
|
|
579
|
-
return Unit_instance;
|
|
580
|
-
}
|
|
581
|
-
function RustEmitter$emitShared$lambda_4($this$interface) {
|
|
582
|
-
$this$interface.s13($this$interface.a15('T', []), []);
|
|
583
|
-
$this$interface.l17('status', $this$interface.y16());
|
|
584
|
-
$this$interface.l17('headers', borrowDyn($this$interface.a15('ResponseHeaders', [])));
|
|
585
|
-
$this$interface.l17('body', borrow($this$interface.a15('T', [])));
|
|
586
|
-
return Unit_instance;
|
|
587
|
-
}
|
|
588
|
-
function RustEmitter$emitShared$lambda_5($this$interface) {
|
|
589
|
-
$this$interface.k16('transport', VOID, VOID, RustEmitter$emitShared$lambda$lambda_3);
|
|
590
|
-
return Unit_instance;
|
|
591
|
-
}
|
|
592
|
-
function RustEmitter$emitShared$lambda$lambda_3($this$asyncFunction) {
|
|
593
|
-
$this$asyncFunction.w13('&self', Custom_init_$Create$(''));
|
|
594
|
-
$this$asyncFunction.w13('request', borrow($this$asyncFunction.a15('RawRequest', [])));
|
|
595
|
-
$this$asyncFunction.t13($this$asyncFunction.a15('RawResponse', []));
|
|
596
|
-
return Unit_instance;
|
|
597
|
-
}
|
|
598
|
-
function RustEmitter$emitShared$lambda_6($rustImports) {
|
|
599
|
-
return function (element, transformer) {
|
|
600
|
-
var tmp;
|
|
601
|
-
if (element instanceof File) {
|
|
602
|
-
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
603
|
-
var tmp0 = element.cv_1;
|
|
604
|
-
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
605
|
-
var destination = ArrayList_init_$Create$_0();
|
|
606
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
607
|
-
while (_iterator__ex2g4s.u()) {
|
|
608
|
-
var element_0 = _iterator__ex2g4s.v();
|
|
609
|
-
if (element_0 instanceof Namespace) {
|
|
610
|
-
destination.x(element_0);
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
var namespace = first(destination);
|
|
614
|
-
tmp = element.fv(VOID, plus($rustImports, namespace.iv_1));
|
|
615
|
-
} else {
|
|
616
|
-
tmp = element;
|
|
617
|
-
}
|
|
618
|
-
var transformed = tmp;
|
|
619
|
-
return transformChildren_0(transformed, transformer);
|
|
620
|
-
};
|
|
621
|
-
}
|
|
622
|
-
function RustEmitter$emitShared$lambda_7(element, transformer) {
|
|
623
|
-
var tmp;
|
|
624
|
-
if (element instanceof Enum) {
|
|
625
|
-
var tmp_0;
|
|
626
|
-
if (element.sw_1.equals(Companion_getInstance().wt('Method'))) {
|
|
627
|
-
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}');
|
|
628
|
-
} else {
|
|
629
|
-
tmp_0 = element;
|
|
630
|
-
}
|
|
631
|
-
tmp = tmp_0;
|
|
632
|
-
} else {
|
|
633
|
-
tmp = element;
|
|
634
|
-
}
|
|
635
|
-
var transformed = tmp;
|
|
636
|
-
return transformChildren_0(transformed, transformer);
|
|
637
|
-
}
|
|
638
|
-
function RustEmitter$emitShared$lambda_8($dslTraits, $requestHeaders, $responseHeaders, $rawElementInterfaces, $client, $server) {
|
|
639
|
-
return function (element, transformer) {
|
|
640
|
-
var tmp;
|
|
641
|
-
if (element instanceof File) {
|
|
642
|
-
// Inline function 'kotlin.collections.flatMap' call
|
|
643
|
-
var tmp0 = element.cv_1;
|
|
644
|
-
// Inline function 'kotlin.collections.flatMapTo' call
|
|
645
|
-
var destination = ArrayList_init_$Create$_0();
|
|
646
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
647
|
-
while (_iterator__ex2g4s.u()) {
|
|
648
|
-
var element_0 = _iterator__ex2g4s.v();
|
|
649
|
-
var tmp$ret$3;
|
|
650
|
-
$l$block: {
|
|
651
|
-
if (!(element_0 instanceof Interface)) {
|
|
652
|
-
tmp$ret$3 = listOf(element_0);
|
|
653
|
-
break $l$block;
|
|
654
|
-
}
|
|
655
|
-
var name = element_0.nv_1.zt();
|
|
656
|
-
var tmp_0;
|
|
657
|
-
// Inline function 'kotlin.collections.contains' call
|
|
658
|
-
// Inline function 'kotlin.collections.containsKey' call
|
|
659
|
-
var this_0 = $dslTraits;
|
|
660
|
-
if ((isInterface(this_0, KtMap) ? this_0 : THROW_CCE()).q2(name)) {
|
|
661
|
-
// Inline function 'kotlin.collections.buildList' call
|
|
662
|
-
// Inline function 'kotlin.collections.buildListInternal' call
|
|
663
|
-
// Inline function 'kotlin.apply' call
|
|
664
|
-
var this_1 = ArrayList_init_$Create$_0();
|
|
665
|
-
this_1.x(ensureNotNull($dslTraits.s2(name)));
|
|
666
|
-
if (name === 'Request') {
|
|
667
|
-
this_1.x($requestHeaders);
|
|
668
|
-
}
|
|
669
|
-
if (name === 'Response') {
|
|
670
|
-
this_1.x($responseHeaders);
|
|
671
|
-
}
|
|
672
|
-
tmp_0 = this_1.q5();
|
|
673
|
-
} else {
|
|
674
|
-
// Inline function 'kotlin.collections.contains' call
|
|
675
|
-
// Inline function 'kotlin.collections.containsKey' call
|
|
676
|
-
var this_2 = $rawElementInterfaces;
|
|
677
|
-
if ((isInterface(this_2, KtMap) ? this_2 : THROW_CCE()).q2(name)) {
|
|
678
|
-
tmp_0 = listOf(ensureNotNull($rawElementInterfaces.s2(name)));
|
|
679
|
-
} else {
|
|
680
|
-
tmp_0 = listOf(element_0);
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
tmp$ret$3 = tmp_0;
|
|
684
|
-
}
|
|
685
|
-
var list = tmp$ret$3;
|
|
686
|
-
addAll(destination, list);
|
|
687
|
-
}
|
|
688
|
-
var newElements = plus_0(plus_0(destination, $client), $server);
|
|
689
|
-
tmp = element.fv(VOID, newElements);
|
|
690
|
-
} else {
|
|
691
|
-
tmp = element;
|
|
692
|
-
}
|
|
693
|
-
var transformed = tmp;
|
|
694
|
-
return transformChildren_0(transformed, transformer);
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
function RustEmitter$emitShared$lambda_9(element, transformer) {
|
|
698
|
-
var tmp;
|
|
699
|
-
if (element instanceof Interface) {
|
|
700
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
701
|
-
var scope = new TransformScope(element);
|
|
702
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
703
|
-
var tmp_0 = scope;
|
|
704
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
705
|
-
var this_0 = scope.a19_1;
|
|
706
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
707
|
-
// Inline function 'kotlin.apply' call
|
|
708
|
-
var this_1 = new TransformerBuilder();
|
|
709
|
-
this_1.u19(RustEmitter$emitShared$lambda$lambda_4);
|
|
710
|
-
var tmp$ret$5 = this_1.p19();
|
|
711
|
-
tmp_0.a19_1 = transform(this_0, tmp$ret$5);
|
|
712
|
-
var tmp_1 = scope.a19_1;
|
|
713
|
-
tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
714
|
-
} else {
|
|
715
|
-
tmp = element;
|
|
716
|
-
}
|
|
717
|
-
var transformed = tmp;
|
|
718
|
-
return transformChildren_0(transformed, transformer);
|
|
719
|
-
}
|
|
720
|
-
function RustEmitter$emitShared$lambda$lambda_4(element, transformer) {
|
|
721
|
-
var tmp;
|
|
722
|
-
if (element instanceof Function_0) {
|
|
723
|
-
var tmp0 = element.px_1;
|
|
724
|
-
var tmp$ret$1;
|
|
725
|
-
$l$block_0: {
|
|
726
|
-
// Inline function 'kotlin.collections.any' call
|
|
727
|
-
var tmp_0;
|
|
728
|
-
if (isInterface(tmp0, Collection)) {
|
|
729
|
-
tmp_0 = tmp0.r();
|
|
730
|
-
} else {
|
|
731
|
-
tmp_0 = false;
|
|
732
|
-
}
|
|
733
|
-
if (tmp_0) {
|
|
734
|
-
tmp$ret$1 = false;
|
|
735
|
-
break $l$block_0;
|
|
736
|
-
}
|
|
737
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
738
|
-
while (_iterator__ex2g4s.u()) {
|
|
739
|
-
var element_0 = _iterator__ex2g4s.v();
|
|
740
|
-
if (element_0.kz_1.xt() === '&self' || element_0.kz_1.xt() === 'self') {
|
|
741
|
-
tmp$ret$1 = true;
|
|
742
|
-
break $l$block_0;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
tmp$ret$1 = false;
|
|
746
|
-
}
|
|
747
|
-
var hasSelf = tmp$ret$1;
|
|
748
|
-
tmp = hasSelf || element.tx_1 ? element : element.zx(VOID, VOID, plus(listOf(get_rustSelfParam()), element.px_1));
|
|
749
|
-
} else {
|
|
750
|
-
tmp = element;
|
|
751
|
-
}
|
|
752
|
-
var transformed = tmp;
|
|
753
|
-
return transformChildren_0(transformed, transformer);
|
|
754
|
-
}
|
|
755
|
-
function RustEmitter$emitShared$lambda_10(group) {
|
|
756
|
-
return trimEnd(joinToString(group, '', VOID, VOID, VOID, VOID, RustEmitter$emitShared$lambda$lambda_5), charArrayOf([_Char___init__impl__6a9atx(10)]));
|
|
757
|
-
}
|
|
758
|
-
function RustEmitter$emitShared$lambda$lambda_5(it) {
|
|
759
|
-
return RustGenerator_getInstance().i1b(it);
|
|
760
|
-
}
|
|
761
440
|
function RustEmitter$emit$lambda(a, b) {
|
|
762
441
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
763
442
|
var tmp = sortKey(a);
|
|
764
443
|
var tmp$ret$2 = sortKey(b);
|
|
765
444
|
return compareValues(tmp, tmp$ret$2);
|
|
766
445
|
}
|
|
767
|
-
function
|
|
768
|
-
return 'pub mod ' +
|
|
769
|
-
}
|
|
770
|
-
function RustEmitter$emit$lambda_0(this$0) {
|
|
771
|
-
return function (it) {
|
|
772
|
-
return emit$emitMod(this$0, it);
|
|
773
|
-
};
|
|
774
|
-
}
|
|
775
|
-
function RustEmitter$emit$lambda_1(this$0) {
|
|
776
|
-
return function (it) {
|
|
777
|
-
return emit$emitMod(this$0, it);
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
|
-
function RustEmitter$emitGenerator$lambda(it) {
|
|
781
|
-
return startsWith(it, 'Wirespec.') || it === 'Wirespec';
|
|
782
|
-
}
|
|
783
|
-
function RustEmitter$emitGenerator$lambda_0($generatorOwnName) {
|
|
784
|
-
return function (it) {
|
|
785
|
-
return it === $generatorOwnName;
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
function RustEmitter$emitGenerator$lambda_1(it) {
|
|
789
|
-
return substringBefore(it, _Char___init__impl__6a9atx(60));
|
|
446
|
+
function RustEmitter$modFile$lambda(it) {
|
|
447
|
+
return 'pub mod ' + moduleName(it.es()) + ';';
|
|
790
448
|
}
|
|
791
|
-
function RustEmitter$emitGenerator$
|
|
449
|
+
function RustEmitter$emitGenerator$lambda($$this$buildSet) {
|
|
792
450
|
return function (expr, t) {
|
|
793
451
|
var tmp;
|
|
794
452
|
var tmp_0;
|
|
795
|
-
var tmp_1;
|
|
796
453
|
if (expr instanceof RawExpression) {
|
|
797
|
-
|
|
798
|
-
} else {
|
|
799
|
-
tmp_1 = false;
|
|
800
|
-
}
|
|
801
|
-
if (tmp_1) {
|
|
802
|
-
tmp_0 = !(expr.cy_1 === $generatorOwnName);
|
|
454
|
+
tmp_0 = endsWith(expr.gy_1, 'Generator');
|
|
803
455
|
} else {
|
|
804
456
|
tmp_0 = false;
|
|
805
457
|
}
|
|
806
458
|
if (tmp_0) {
|
|
807
|
-
$
|
|
459
|
+
$$this$buildSet.x(expr.gy_1);
|
|
808
460
|
tmp = Unit_instance;
|
|
809
461
|
}
|
|
810
|
-
return
|
|
462
|
+
return transformChildren_0(expr, t);
|
|
811
463
|
};
|
|
812
464
|
}
|
|
813
|
-
function RustEmitter$emit$
|
|
465
|
+
function RustEmitter$emit$lambda_0(it) {
|
|
466
|
+
return sanitizeKeywords(sanitizeEnum(it));
|
|
467
|
+
}
|
|
468
|
+
function RustEmitter$emitClient$lambda(this$0) {
|
|
814
469
|
return function (it) {
|
|
815
|
-
return
|
|
470
|
+
return 'pub mod ' + toSnakeCase(_get_clientName__yc59yj(this$0, it)) + ';';
|
|
816
471
|
};
|
|
817
472
|
}
|
|
818
|
-
function RustEmitter$emitClient$
|
|
473
|
+
function RustEmitter$emitClient$lambda_0(this$0) {
|
|
819
474
|
return function (endpoint) {
|
|
820
|
-
|
|
475
|
+
var module_0 = toSnakeCase(endpoint.gr_1.o1());
|
|
476
|
+
var _destruct__k2r9zo = clientParameters(this$0, endpoint);
|
|
477
|
+
var params = _destruct__k2r9zo.af();
|
|
478
|
+
var args = _destruct__k2r9zo.bf();
|
|
479
|
+
return trimIndent('\n impl<S: Serialization, T: Transportation> ' + module_0 + '::' + endpoint.gr_1.o1() + '::Call for Client<S, T> {\n async fn ' + module_0 + '(&self' + params + ') -> ' + module_0 + '::Response {\n ' + _get_clientName__yc59yj(this$0, endpoint) + ' { serialization: &self.serialization, transportation: &self.transportation }\n .' + module_0 + '(' + args + ').await\n }\n }\n ');
|
|
821
480
|
};
|
|
822
481
|
}
|
|
823
|
-
function RustEmitter$
|
|
824
|
-
|
|
825
|
-
var
|
|
826
|
-
|
|
827
|
-
if (charSequenceLength(s) > 0) {
|
|
828
|
-
var it = charCodeAt(s, 0);
|
|
829
|
-
var tmp0 = uppercaseChar(it);
|
|
830
|
-
// Inline function 'kotlin.text.plus' call
|
|
831
|
-
var other = substring(s, 1);
|
|
832
|
-
tmp = toString(tmp0) + other;
|
|
833
|
-
} else {
|
|
834
|
-
tmp = s;
|
|
835
|
-
}
|
|
836
|
-
return tmp;
|
|
837
|
-
}
|
|
838
|
-
function RustEmitter$buildClientParams$lambda(this$0) {
|
|
839
|
-
return function (_destruct__k2r9zo) {
|
|
840
|
-
var name = _destruct__k2r9zo.ze();
|
|
841
|
-
return sanitizeKeywords(this$0, name.au());
|
|
842
|
-
};
|
|
482
|
+
function RustEmitter$clientParameters$lambda(_destruct__k2r9zo) {
|
|
483
|
+
var name = _destruct__k2r9zo.af();
|
|
484
|
+
var type = _destruct__k2r9zo.bf();
|
|
485
|
+
return ', ' + name + ': ' + type;
|
|
843
486
|
}
|
|
844
|
-
function RustEmitter$
|
|
845
|
-
return
|
|
846
|
-
var name = _destruct__k2r9zo.ze();
|
|
847
|
-
var type = _destruct__k2r9zo.af();
|
|
848
|
-
var tmp = sanitizeKeywords(this$0, name.au());
|
|
849
|
-
// Inline function 'kotlin.with' call
|
|
850
|
-
return tmp + ': ' + RustTransform_getInstance().v38(type);
|
|
851
|
-
};
|
|
487
|
+
function RustEmitter$clientParameters$lambda_0(it) {
|
|
488
|
+
return it.gf_1;
|
|
852
489
|
}
|
|
853
490
|
function RustEmitter(packageName, emitShared) {
|
|
854
491
|
Companion_getInstance_0();
|
|
855
|
-
packageName = packageName === VOID ?
|
|
856
|
-
emitShared = emitShared === VOID ?
|
|
857
|
-
this.
|
|
858
|
-
this.
|
|
859
|
-
this.
|
|
860
|
-
this.
|
|
492
|
+
packageName = packageName === VOID ? Companion_instance.at('community.flock.wirespec.generated') : packageName;
|
|
493
|
+
emitShared = emitShared === VOID ? Companion_instance_0.gq() : emitShared;
|
|
494
|
+
this.m38_1 = packageName;
|
|
495
|
+
this.n38_1 = emitShared;
|
|
496
|
+
this.o38_1 = RustGenerator_getInstance();
|
|
497
|
+
this.p38_1 = FileExtension_Rust_getInstance();
|
|
861
498
|
var tmp = this;
|
|
862
|
-
tmp.
|
|
863
|
-
this.m38_1 = listOf_0([import_0('super::super::wirespec', '*'), import_0('', 'regex')]);
|
|
864
|
-
this.n38_1 = listOf_0([import_0('super::super::wirespec', '*'), import_0('', 'regex')]);
|
|
499
|
+
tmp.q38_1 = lazy(RustEmitter$sanitizationConfig$delegate$lambda(this));
|
|
865
500
|
}
|
|
866
|
-
protoOf(RustEmitter).
|
|
867
|
-
return this.
|
|
501
|
+
protoOf(RustEmitter).l1b = function () {
|
|
502
|
+
return this.o38_1;
|
|
868
503
|
};
|
|
869
|
-
protoOf(RustEmitter).
|
|
870
|
-
return this.
|
|
504
|
+
protoOf(RustEmitter).xp = function () {
|
|
505
|
+
return this.p38_1;
|
|
871
506
|
};
|
|
872
|
-
protoOf(RustEmitter).
|
|
873
|
-
var
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
var client = new RawElement('pub trait Client {\n type Transport: Transportation;\n type Ser: Serialization;\n fn transport(&self) -> &Self::Transport;\n fn serialization(&self) -> &Self::Ser;\n}');
|
|
877
|
-
var server = new RawElement("pub trait Server {\n type Req;\n type Res;\n fn path_template(&self) -> &'static str;\n fn method(&self) -> Method;\n}");
|
|
878
|
-
var enumTrait = interface_0('Enum', VOID, RustEmitter$emitShared$lambda_1);
|
|
879
|
-
var refinedTrait = interface_0('Refined', VOID, RustEmitter$emitShared$lambda_2);
|
|
880
|
-
var requestTrait = interface_0('Request', VOID, RustEmitter$emitShared$lambda_3);
|
|
881
|
-
var responseTrait = interface_0('Response', VOID, RustEmitter$emitShared$lambda_4);
|
|
882
|
-
var rawElementInterfaces = mapOf([to('BodySerializer', new RawElement("pub trait BodySerializer {\n fn serialize_body<T: 'static>(&self, t: &T, r#type: TypeId) -> Vec<u8>;\n}")), to('BodyDeserializer', new RawElement("pub trait BodyDeserializer {\n fn deserialize_body<T: 'static>(&self, raw: &[u8], r#type: TypeId) -> T;\n}")), to('PathSerializer', new RawElement('pub trait PathSerializer {\n fn serialize_path<T: std::fmt::Display>(&self, t: &T, r#type: TypeId) -> String;\n}')), to('PathDeserializer', new RawElement('pub trait PathDeserializer {\n fn deserialize_path<T: std::str::FromStr>(&self, raw: &str, r#type: TypeId) -> T where T::Err: std::fmt::Debug;\n}')), to('ParamSerializer', new RawElement("pub trait ParamSerializer {\n fn serialize_param<T: 'static>(&self, value: &T, r#type: TypeId) -> Vec<String>;\n}")), to('ParamDeserializer', new RawElement("pub trait ParamDeserializer {\n fn deserialize_param<T: 'static>(&self, values: &[String], r#type: TypeId) -> T;\n}"))]);
|
|
883
|
-
var transportationTrait = interface_0('Transportation', VOID, RustEmitter$emitShared$lambda_5);
|
|
884
|
-
var dslTraits = mapOf([to('Enum', enumTrait), to('Refined', refinedTrait), to('Request', requestTrait), to('Response', responseTrait), to('Transportation', transportationTrait)]);
|
|
885
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
886
|
-
var this_0 = convert(Companion_instance_0.at('shared'));
|
|
887
|
-
var scope = new TransformScope(this_0);
|
|
888
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
889
|
-
var tmp = scope;
|
|
890
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
891
|
-
var this_1 = scope.a19_1;
|
|
892
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
893
|
-
// Inline function 'kotlin.apply' call
|
|
894
|
-
var this_2 = new TransformerBuilder();
|
|
895
|
-
this_2.u19(RustEmitter$emitShared$lambda_6(rustImports));
|
|
896
|
-
var tmp$ret$4 = this_2.p19();
|
|
897
|
-
tmp.a19_1 = transform(this_1, tmp$ret$4);
|
|
898
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
899
|
-
var tmp_0 = scope;
|
|
900
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
901
|
-
var this_3 = scope.a19_1;
|
|
902
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
903
|
-
// Inline function 'kotlin.apply' call
|
|
904
|
-
var this_4 = new TransformerBuilder();
|
|
905
|
-
this_4.u19(RustEmitter$emitShared$lambda_7);
|
|
906
|
-
var tmp$ret$9 = this_4.p19();
|
|
907
|
-
tmp_0.a19_1 = transform(this_3, tmp$ret$9);
|
|
908
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
909
|
-
var tmp_1 = scope;
|
|
910
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
911
|
-
var this_5 = scope.a19_1;
|
|
912
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
913
|
-
// Inline function 'kotlin.apply' call
|
|
914
|
-
var this_6 = new TransformerBuilder();
|
|
915
|
-
this_6.u19(RustEmitter$emitShared$lambda_8(dslTraits, requestHeaders, responseHeaders, rawElementInterfaces, client, server));
|
|
916
|
-
var tmp$ret$14 = this_6.p19();
|
|
917
|
-
tmp_1.a19_1 = transform(this_5, tmp$ret$14);
|
|
918
|
-
var tmp_2 = scope.a19_1;
|
|
919
|
-
// Inline function 'kotlin.let' call
|
|
920
|
-
var file = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
921
|
-
// Inline function 'kotlin.collections.flatMap' call
|
|
922
|
-
var tmp0 = file.cv_1;
|
|
923
|
-
// Inline function 'kotlin.collections.flatMapTo' call
|
|
924
|
-
var destination = ArrayList_init_$Create$_0();
|
|
925
|
-
var _iterator__ex2g4s = tmp0.t();
|
|
926
|
-
while (_iterator__ex2g4s.u()) {
|
|
927
|
-
var element = _iterator__ex2g4s.v();
|
|
928
|
-
var tmp$ret$21;
|
|
929
|
-
$l$block: {
|
|
930
|
-
if (!(element instanceof Struct)) {
|
|
931
|
-
tmp$ret$21 = listOf(element);
|
|
932
|
-
break $l$block;
|
|
933
|
-
}
|
|
934
|
-
var structFields = fieldList(element);
|
|
935
|
-
var tmp_3;
|
|
936
|
-
var tmp$ret$22;
|
|
937
|
-
$l$block_1: {
|
|
938
|
-
// Inline function 'kotlin.collections.any' call
|
|
939
|
-
var tmp_4;
|
|
940
|
-
if (isInterface(structFields, Collection)) {
|
|
941
|
-
tmp_4 = structFields.r();
|
|
942
|
-
} else {
|
|
943
|
-
tmp_4 = false;
|
|
944
|
-
}
|
|
945
|
-
if (tmp_4) {
|
|
946
|
-
tmp$ret$22 = false;
|
|
947
|
-
break $l$block_1;
|
|
948
|
-
}
|
|
949
|
-
var _iterator__ex2g4s_0 = structFields.t();
|
|
950
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
951
|
-
var element_0 = _iterator__ex2g4s_0.v();
|
|
952
|
-
if (containsUnderiveable(this, element_0.xv_1)) {
|
|
953
|
-
tmp$ret$22 = true;
|
|
954
|
-
break $l$block_1;
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
tmp$ret$22 = false;
|
|
958
|
-
}
|
|
959
|
-
if (tmp$ret$22) {
|
|
960
|
-
tmp_3 = '';
|
|
961
|
-
} else {
|
|
962
|
-
var tmp$ret$24;
|
|
963
|
-
$l$block_3: {
|
|
964
|
-
// Inline function 'kotlin.collections.any' call
|
|
965
|
-
var tmp_5;
|
|
966
|
-
if (isInterface(structFields, Collection)) {
|
|
967
|
-
tmp_5 = structFields.r();
|
|
968
|
-
} else {
|
|
969
|
-
tmp_5 = false;
|
|
970
|
-
}
|
|
971
|
-
if (tmp_5) {
|
|
972
|
-
tmp$ret$24 = false;
|
|
973
|
-
break $l$block_3;
|
|
974
|
-
}
|
|
975
|
-
var _iterator__ex2g4s_1 = structFields.t();
|
|
976
|
-
while (_iterator__ex2g4s_1.u()) {
|
|
977
|
-
var element_1 = _iterator__ex2g4s_1.v();
|
|
978
|
-
if (containsWildcard(this, element_1.xv_1)) {
|
|
979
|
-
tmp$ret$24 = true;
|
|
980
|
-
break $l$block_3;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
tmp$ret$24 = false;
|
|
984
|
-
}
|
|
985
|
-
if (tmp$ret$24) {
|
|
986
|
-
tmp_3 = '#[derive(Debug, Default)]';
|
|
987
|
-
} else {
|
|
988
|
-
if (setOf(['RawRequest', 'RawResponse']).i1(element.bx_1.zt())) {
|
|
989
|
-
tmp_3 = '#[derive(Debug, Clone, PartialEq)]';
|
|
990
|
-
} else {
|
|
991
|
-
tmp_3 = '#[derive(Debug, Clone, Default, PartialEq)]';
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
var derive = tmp_3;
|
|
996
|
-
var tmp_6;
|
|
997
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
998
|
-
if (charSequenceLength(derive) === 0) {
|
|
999
|
-
tmp_6 = emptyList();
|
|
1000
|
-
} else {
|
|
1001
|
-
tmp_6 = listOf(new RawElement(derive));
|
|
1002
|
-
}
|
|
1003
|
-
var prefix = tmp_6;
|
|
1004
|
-
tmp$ret$21 = listOf(new File(element.bx_1, plus_0(prefix, element)));
|
|
1005
|
-
}
|
|
1006
|
-
var list = tmp$ret$21;
|
|
1007
|
-
addAll(destination, list);
|
|
1008
|
-
}
|
|
1009
|
-
var tmp0_0 = new File(file.bv_1, destination);
|
|
1010
|
-
// Inline function 'kotlin.let' call
|
|
1011
|
-
var wirespecFile = RustTransform_getInstance().w38(tmp0_0);
|
|
1012
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1013
|
-
var scope_0 = new TransformScope(wirespecFile);
|
|
1014
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
1015
|
-
var tmp_7 = scope_0;
|
|
1016
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
1017
|
-
var this_7 = scope_0.a19_1;
|
|
1018
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1019
|
-
// Inline function 'kotlin.apply' call
|
|
1020
|
-
var this_8 = new TransformerBuilder();
|
|
1021
|
-
this_8.u19(RustEmitter$emitShared$lambda_9);
|
|
1022
|
-
var tmp$ret$33 = this_8.p19();
|
|
1023
|
-
tmp_7.a19_1 = transform(this_7, tmp$ret$33);
|
|
1024
|
-
var tmp_8 = scope_0.a19_1;
|
|
1025
|
-
// Inline function 'kotlin.let' call
|
|
1026
|
-
var tmp0_1 = (isInterface(tmp_8, Element) ? tmp_8 : THROW_CCE()).cv_1;
|
|
1027
|
-
// Inline function 'kotlin.collections.mutableListOf' call
|
|
1028
|
-
// Inline function 'kotlin.collections.fold' call
|
|
1029
|
-
var accumulator = ArrayList_init_$Create$_0();
|
|
1030
|
-
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
1031
|
-
while (_iterator__ex2g4s_2.u()) {
|
|
1032
|
-
var element_2 = _iterator__ex2g4s_2.v();
|
|
1033
|
-
var acc = accumulator;
|
|
1034
|
-
var isImport = element_2 instanceof Import;
|
|
1035
|
-
var tmp0_safe_receiver = lastOrNull(acc);
|
|
1036
|
-
var tmp_9 = tmp0_safe_receiver == null ? null : firstOrNull_0(tmp0_safe_receiver);
|
|
1037
|
-
var lastGroupIsImports = tmp_9 instanceof Import;
|
|
1038
|
-
if (isImport && lastGroupIsImports)
|
|
1039
|
-
last(acc).x(element_2);
|
|
1040
|
-
else
|
|
1041
|
-
acc.x(mutableListOf([element_2]));
|
|
1042
|
-
accumulator = acc;
|
|
1043
|
-
}
|
|
1044
|
-
var groups = accumulator;
|
|
1045
|
-
var source = joinToString(groups, '\n\n', VOID, VOID, VOID, VOID, RustEmitter$emitShared$lambda_10) + '\n';
|
|
1046
|
-
var tmp_10;
|
|
1047
|
-
if (this.i38_1.gq_1) {
|
|
1048
|
-
tmp_10 = new File(Companion_getInstance().wt(this.h38_1.dt() + 'wirespec'), listOf(new RawElement(source)));
|
|
507
|
+
protoOf(RustEmitter).g1b = function () {
|
|
508
|
+
var tmp;
|
|
509
|
+
if (this.n38_1.hq_1) {
|
|
510
|
+
tmp = new File(Companion_getInstance().au(this.m38_1.dt() + 'wirespec'), listOf(new RawElement(this.l1b().m1b(sharedFile(this)))));
|
|
1049
511
|
} else {
|
|
1050
|
-
|
|
512
|
+
tmp = null;
|
|
1051
513
|
}
|
|
1052
|
-
return
|
|
514
|
+
return tmp;
|
|
1053
515
|
};
|
|
1054
|
-
protoOf(RustEmitter).
|
|
516
|
+
protoOf(RustEmitter).f1b = function (module_0, logger) {
|
|
1055
517
|
// Inline function 'kotlin.collections.sortedBy' call
|
|
1056
|
-
var this_0 = new NonEmptyList(module_0.
|
|
518
|
+
var this_0 = new NonEmptyList(module_0.hp_1);
|
|
1057
519
|
// Inline function 'kotlin.comparisons.compareBy' call
|
|
1058
520
|
var tmp = RustEmitter$emit$lambda;
|
|
1059
521
|
var tmp$ret$1 = new sam$kotlin_Comparator$0(tmp);
|
|
1060
522
|
var tmp$ret$0 = sortedWith(this_0, tmp$ret$1);
|
|
1061
523
|
var tmp_0 = toNonEmptyListOrNull(tmp$ret$0);
|
|
1062
|
-
var
|
|
1063
|
-
// Inline function 'kotlin.let' call
|
|
1064
|
-
var files = emit.call(this, module_0.tp(VOID, statements), logger);
|
|
524
|
+
var files = emit.call(this, module_0.up(VOID, ensureNotNull(tmp_0 == null ? null : new NonEmptyList(tmp_0)).en_1), logger);
|
|
1065
525
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1066
|
-
var tmp0 = new NonEmptyList(module_0.
|
|
526
|
+
var tmp0 = new NonEmptyList(module_0.hp_1);
|
|
1067
527
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1068
|
-
var destination = ArrayList_init_$Create$
|
|
528
|
+
var destination = ArrayList_init_$Create$();
|
|
1069
529
|
var _iterator__ex2g4s = tmp0.t();
|
|
1070
530
|
while (_iterator__ex2g4s.u()) {
|
|
1071
531
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1074,7 +534,6 @@ protoOf(RustEmitter).b1b = function (module_0, logger) {
|
|
|
1074
534
|
}
|
|
1075
535
|
}
|
|
1076
536
|
var endpoints = destination;
|
|
1077
|
-
var endpointMods = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, RustEmitter$emit$lambda_0(this));
|
|
1078
537
|
var tmp_1;
|
|
1079
538
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1080
539
|
if (!endpoints.r()) {
|
|
@@ -1083,56 +542,32 @@ protoOf(RustEmitter).b1b = function (module_0, logger) {
|
|
|
1083
542
|
tmp_1 = '';
|
|
1084
543
|
}
|
|
1085
544
|
var clientMod = tmp_1;
|
|
1086
|
-
var modRs = new File(Companion_getInstance().
|
|
1087
|
-
var
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
545
|
+
var modRs = new File(Companion_getInstance().au(this.m38_1.dt() + 'mod'), listOf(new RawElement('#![allow(warnings)]\npub mod model;\npub mod endpoint;' + clientMod + '\npub mod wirespec;')));
|
|
546
|
+
var tmp_2;
|
|
547
|
+
if (this.n38_1.hq_1) {
|
|
548
|
+
var tmp_3 = NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(files, modRs), modFile(this, 'endpoint/', endpoints));
|
|
549
|
+
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
550
|
+
var tmp0_0 = new NonEmptyList(module_0.hp_1);
|
|
551
|
+
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
552
|
+
var destination_0 = ArrayList_init_$Create$();
|
|
553
|
+
var _iterator__ex2g4s_0 = tmp0_0.t();
|
|
554
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
555
|
+
var element_0 = _iterator__ex2g4s_0.v();
|
|
556
|
+
if (!(element_0 == null) ? isInterface(element_0, Model) : false) {
|
|
557
|
+
destination_0.x(element_0);
|
|
558
|
+
}
|
|
1098
559
|
}
|
|
1099
|
-
|
|
1100
|
-
var tmp_3 = destination_0;
|
|
1101
|
-
var modModel = new File(tmp_2, listOf(new RawElement(joinToString(tmp_3, '\n', VOID, VOID, VOID, VOID, RustEmitter$emit$lambda_1(this)))));
|
|
1102
|
-
return this.i38_1.gq_1 ? NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(NonEmptyList__plus_impl_xqmb9(files, modRs), modEndpoint), modModel) : NonEmptyList__plus_impl_xqmb9(files, modRs);
|
|
1103
|
-
};
|
|
1104
|
-
protoOf(RustEmitter).cs = function (definition, module_0, logger) {
|
|
1105
|
-
var subPackageName = plus_1(this.h38_1, definition);
|
|
1106
|
-
var tmp;
|
|
1107
|
-
if (definition instanceof Endpoint) {
|
|
1108
|
-
tmp = this.n38_1;
|
|
560
|
+
tmp_2 = NonEmptyList__plus_impl_xqmb9(tmp_3, modFile(this, 'model/', destination_0));
|
|
1109
561
|
} else {
|
|
1110
|
-
|
|
1111
|
-
}
|
|
1112
|
-
var importHeader = tmp;
|
|
1113
|
-
var tmp0 = emit_0.call(this, definition, module_0, logger);
|
|
1114
|
-
// Inline function 'kotlin.let' call
|
|
1115
|
-
var file = RustTransform_getInstance().w38(tmp0);
|
|
1116
|
-
var tmp_0 = Companion_getInstance().wt(subPackageName.dt() + toSnakeCase(this, file.bv_1.zt()));
|
|
1117
|
-
// Inline function 'kotlin.collections.flatMap' call
|
|
1118
|
-
var tmp0_0 = file.cv_1;
|
|
1119
|
-
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1120
|
-
var destination = ArrayList_init_$Create$_0();
|
|
1121
|
-
var _iterator__ex2g4s = tmp0_0.t();
|
|
1122
|
-
while (_iterator__ex2g4s.u()) {
|
|
1123
|
-
var element = _iterator__ex2g4s.v();
|
|
1124
|
-
var tmp_1;
|
|
1125
|
-
if (element instanceof Struct) {
|
|
1126
|
-
tmp_1 = listOf_0([new RawElement('#[derive(Debug, Clone, Default, PartialEq)]'), element]);
|
|
1127
|
-
} else {
|
|
1128
|
-
tmp_1 = listOf(element);
|
|
1129
|
-
}
|
|
1130
|
-
var list = tmp_1;
|
|
1131
|
-
addAll(destination, list);
|
|
562
|
+
tmp_2 = NonEmptyList__plus_impl_xqmb9(files, modRs);
|
|
1132
563
|
}
|
|
1133
|
-
return
|
|
564
|
+
return tmp_2;
|
|
1134
565
|
};
|
|
1135
|
-
protoOf(RustEmitter).
|
|
566
|
+
protoOf(RustEmitter).ds = function (definition, module_0, logger) {
|
|
567
|
+
var file = applyBorrowRules(emit_0.call(this, definition, module_0, logger));
|
|
568
|
+
return new File(Companion_getInstance().au(plus_1(this.m38_1, definition).dt() + toSnakeCase(file.fv_1.du())), plus(get_wirespecImports(), withStructDerives(file.gv_1)));
|
|
569
|
+
};
|
|
570
|
+
protoOf(RustEmitter).o1b = function (definition, module_0) {
|
|
1136
571
|
var tmp;
|
|
1137
572
|
if (definition instanceof Type) {
|
|
1138
573
|
tmp = convertToGenerator_2(definition, module_0);
|
|
@@ -1146,250 +581,197 @@ protoOf(RustEmitter).k1b = function (definition, module_0) {
|
|
|
1146
581
|
if (definition instanceof Union) {
|
|
1147
582
|
tmp = convertToGenerator(definition);
|
|
1148
583
|
} else {
|
|
1149
|
-
|
|
584
|
+
var tmp_0;
|
|
585
|
+
var tmp_1;
|
|
586
|
+
if (definition instanceof Endpoint) {
|
|
587
|
+
tmp_1 = true;
|
|
588
|
+
} else {
|
|
589
|
+
tmp_1 = definition instanceof Channel;
|
|
590
|
+
}
|
|
591
|
+
if (tmp_1) {
|
|
592
|
+
tmp_0 = true;
|
|
593
|
+
} else {
|
|
594
|
+
var tmp_2;
|
|
595
|
+
if (definition instanceof Rpc) {
|
|
596
|
+
tmp_2 = true;
|
|
597
|
+
} else {
|
|
598
|
+
tmp_2 = definition instanceof Part;
|
|
599
|
+
}
|
|
600
|
+
tmp_0 = tmp_2;
|
|
601
|
+
}
|
|
602
|
+
if (tmp_0) {
|
|
603
|
+
tmp = null;
|
|
604
|
+
} else {
|
|
605
|
+
noWhenBranchMatchedException();
|
|
606
|
+
}
|
|
1150
607
|
}
|
|
1151
608
|
}
|
|
1152
609
|
}
|
|
1153
610
|
}
|
|
1154
|
-
var
|
|
1155
|
-
var
|
|
1156
|
-
var
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
var
|
|
1173
|
-
|
|
1174
|
-
|
|
611
|
+
var tmp1_safe_receiver = tmp;
|
|
612
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : sanitizeNames(tmp1_safe_receiver, _get_sanitizationConfig__sns434(this));
|
|
613
|
+
var tmp_3;
|
|
614
|
+
if (tmp2_safe_receiver == null) {
|
|
615
|
+
tmp_3 = null;
|
|
616
|
+
} else {
|
|
617
|
+
// Inline function 'kotlin.let' call
|
|
618
|
+
// Inline function 'kotlin.collections.buildSet' call
|
|
619
|
+
// Inline function 'kotlin.collections.buildSetInternal' call
|
|
620
|
+
// Inline function 'kotlin.apply' call
|
|
621
|
+
var this_0 = LinkedHashSet_init_$Create$();
|
|
622
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
623
|
+
var scope = new TransformScope(tmp2_safe_receiver);
|
|
624
|
+
scope.v19(RustEmitter$emitGenerator$lambda(this_0));
|
|
625
|
+
var tmp_4 = scope.e19_1;
|
|
626
|
+
isInterface(tmp_4, Element) || THROW_CCE();
|
|
627
|
+
var generatorReferences = this_0.r5();
|
|
628
|
+
// Inline function 'kotlin.collections.filterNot' call
|
|
629
|
+
var tmp0 = collectCustomTypeNames(tmp2_safe_receiver);
|
|
630
|
+
// Inline function 'kotlin.collections.filterNotTo' call
|
|
631
|
+
var destination = ArrayList_init_$Create$();
|
|
632
|
+
var _iterator__ex2g4s = tmp0.t();
|
|
633
|
+
while (_iterator__ex2g4s.u()) {
|
|
634
|
+
var element = _iterator__ex2g4s.v();
|
|
635
|
+
if (!(startsWith(element, 'Wirespec.') || element === 'Wirespec')) {
|
|
636
|
+
destination.x(element);
|
|
637
|
+
}
|
|
1175
638
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
var tmp$ret$8 = import_0('super::' + toSnakeCase(this, item), item);
|
|
1185
|
-
destination_0.x(tmp$ret$8);
|
|
1186
|
-
}
|
|
1187
|
-
var generatorImports = destination_0;
|
|
1188
|
-
// Inline function 'kotlin.collections.filterNot' call
|
|
1189
|
-
// Inline function 'kotlin.collections.filterNotTo' call
|
|
1190
|
-
var destination_1 = ArrayList_init_$Create$_0();
|
|
1191
|
-
var _iterator__ex2g4s_1 = customNames.t();
|
|
1192
|
-
while (_iterator__ex2g4s_1.u()) {
|
|
1193
|
-
var element_0 = _iterator__ex2g4s_1.v();
|
|
1194
|
-
if (!endsWith(element_0, 'Generator')) {
|
|
1195
|
-
destination_1.x(element_0);
|
|
639
|
+
// Inline function 'kotlin.collections.map' call
|
|
640
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
641
|
+
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
|
|
642
|
+
var _iterator__ex2g4s_0 = destination.t();
|
|
643
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
644
|
+
var item = _iterator__ex2g4s_0.v();
|
|
645
|
+
var tmp$ret$13 = substringBefore(item, _Char___init__impl__6a9atx(60));
|
|
646
|
+
destination_0.x(tmp$ret$13);
|
|
1196
647
|
}
|
|
648
|
+
// Inline function 'kotlin.collections.filterNot' call
|
|
649
|
+
var tmp0_0 = distinct(plus(destination_0, generatorReferences));
|
|
650
|
+
// Inline function 'kotlin.collections.filterNotTo' call
|
|
651
|
+
var destination_1 = ArrayList_init_$Create$();
|
|
652
|
+
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
653
|
+
while (_iterator__ex2g4s_1.u()) {
|
|
654
|
+
var element_0 = _iterator__ex2g4s_1.v();
|
|
655
|
+
if (!(element_0 === definition.es().o1() + 'Generator')) {
|
|
656
|
+
destination_1.x(element_0);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
// Inline function 'kotlin.collections.partition' call
|
|
660
|
+
var first = ArrayList_init_$Create$();
|
|
661
|
+
var second = ArrayList_init_$Create$();
|
|
662
|
+
var _iterator__ex2g4s_2 = destination_1.t();
|
|
663
|
+
while (_iterator__ex2g4s_2.u()) {
|
|
664
|
+
var element_1 = _iterator__ex2g4s_2.v();
|
|
665
|
+
if (endsWith(element_1, 'Generator')) {
|
|
666
|
+
first.x(element_1);
|
|
667
|
+
} else {
|
|
668
|
+
second.x(element_1);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
var _destruct__k2r9zo = new Pair(first, second);
|
|
672
|
+
var generators = _destruct__k2r9zo.af();
|
|
673
|
+
var types = _destruct__k2r9zo.bf();
|
|
674
|
+
var tmp_5 = Companion_getInstance().au(plus_2(this.m38_1, 'generator').dt() + toSnakeCase(tmp2_safe_receiver.fv_1.du()));
|
|
675
|
+
var tmp_6 = get_wirespecImports();
|
|
676
|
+
// Inline function 'kotlin.collections.map' call
|
|
677
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
678
|
+
var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(types, 10));
|
|
679
|
+
var _iterator__ex2g4s_3 = types.t();
|
|
680
|
+
while (_iterator__ex2g4s_3.u()) {
|
|
681
|
+
var item_0 = _iterator__ex2g4s_3.v();
|
|
682
|
+
var tmp$ret$21 = import_0('super::super::model::' + toSnakeCase(item_0), item_0);
|
|
683
|
+
destination_2.x(tmp$ret$21);
|
|
684
|
+
}
|
|
685
|
+
var tmp_7 = plus(tmp_6, destination_2);
|
|
686
|
+
// Inline function 'kotlin.collections.map' call
|
|
687
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
688
|
+
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(generators, 10));
|
|
689
|
+
var _iterator__ex2g4s_4 = generators.t();
|
|
690
|
+
while (_iterator__ex2g4s_4.u()) {
|
|
691
|
+
var item_1 = _iterator__ex2g4s_4.v();
|
|
692
|
+
var tmp$ret$24 = import_0('super::' + toSnakeCase(item_1), item_1);
|
|
693
|
+
destination_3.x(tmp$ret$24);
|
|
694
|
+
}
|
|
695
|
+
tmp_3 = new File(tmp_5, plus(plus(tmp_7, destination_3), tmp2_safe_receiver.gv_1));
|
|
1197
696
|
}
|
|
1198
|
-
|
|
1199
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1200
|
-
var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_1, 10));
|
|
1201
|
-
var _iterator__ex2g4s_2 = destination_1.t();
|
|
1202
|
-
while (_iterator__ex2g4s_2.u()) {
|
|
1203
|
-
var item_0 = _iterator__ex2g4s_2.v();
|
|
1204
|
-
var tmp$ret$14 = import_0('super::super::model::' + toSnakeCase(this, item_0), item_0);
|
|
1205
|
-
destination_2.x(tmp$ret$14);
|
|
1206
|
-
}
|
|
1207
|
-
var typeImports = destination_2;
|
|
1208
|
-
var subPackageName = plus_2(this.h38_1, 'generator');
|
|
1209
|
-
return new File(Companion_getInstance().wt(subPackageName.dt() + toSnakeCase(this, generatorFile.bv_1.zt())), plus(plus(plus(this.m38_1, typeImports), generatorImports), generatorFile.cv_1));
|
|
697
|
+
return tmp_3;
|
|
1210
698
|
};
|
|
1211
|
-
protoOf(RustEmitter).
|
|
1212
|
-
return
|
|
699
|
+
protoOf(RustEmitter).vs = function (type, module_0) {
|
|
700
|
+
return withImports(sanitizeNames(convert_0(type), _get_sanitizationConfig__sns434(this)), toImports(importReferences(type), 'super::'));
|
|
1213
701
|
};
|
|
1214
|
-
protoOf(RustEmitter).
|
|
702
|
+
protoOf(RustEmitter).ts = function (enum_0, module_0) {
|
|
1215
703
|
var tmp = convert_1(enum_0);
|
|
1216
|
-
return sanitizeEnumEntries(tmp, RustEmitter$emit$
|
|
704
|
+
return sanitizeEnumEntries(tmp, RustEmitter$emit$lambda_0);
|
|
1217
705
|
};
|
|
1218
|
-
protoOf(RustEmitter).
|
|
706
|
+
protoOf(RustEmitter).js = function (union) {
|
|
1219
707
|
return convert_2(union);
|
|
1220
708
|
};
|
|
1221
|
-
protoOf(RustEmitter).
|
|
709
|
+
protoOf(RustEmitter).os = function (refined) {
|
|
1222
710
|
return replaceStructWithRefinedFunctions(convert_3(refined), refined);
|
|
1223
711
|
};
|
|
1224
|
-
protoOf(RustEmitter).
|
|
712
|
+
protoOf(RustEmitter).us = function (endpoint) {
|
|
1225
713
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1226
|
-
var this_0 = stripResponseGenerics(
|
|
714
|
+
var this_0 = stripResponseGenerics(rustHandlerTraits(convertSimpleRawExpressionsToVariableRefs(stripWirespecPrefix(flattenForRust(convert_4(endpoint))))));
|
|
1227
715
|
var scope = new TransformScope(this_0);
|
|
1228
|
-
scope.
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
var
|
|
1232
|
-
|
|
1233
|
-
scope_0.f19(fixConstructorCalls());
|
|
1234
|
-
var tmp_0 = scope_0.a19_1;
|
|
1235
|
-
var tmp$ret$2 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1236
|
-
return prependImports(this, sanitizeNames(injectApiStruct(injectResponseFromImpls(injectHandlerImplForClient(injectSelfToHandlerMethods(tmp$ret$2))), endpoint), _get_sanitizationConfig__sns434(this)), buildEndpointImports(endpoint));
|
|
716
|
+
scope.j19(fixResponseSwitchPatterns());
|
|
717
|
+
scope.j19(fixConstructorCalls());
|
|
718
|
+
var tmp = scope.e19_1;
|
|
719
|
+
var tmp$ret$0 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
720
|
+
return withImports(sanitizeNames(injectApiStruct(injectResponseFromImpls(injectHandlerImplForClient(tmp$ret$0)), endpoint), _get_sanitizationConfig__sns434(this)), toImports(importReferences(endpoint), 'super::super::model::'));
|
|
1237
721
|
};
|
|
1238
|
-
protoOf(RustEmitter).
|
|
722
|
+
protoOf(RustEmitter).is = function (channel) {
|
|
1239
723
|
return convert_5(channel);
|
|
1240
724
|
};
|
|
1241
|
-
protoOf(RustEmitter).
|
|
725
|
+
protoOf(RustEmitter).hs = function (rpc) {
|
|
1242
726
|
// Inline function 'kotlin.let' call
|
|
1243
727
|
var file = convert_6(rpc);
|
|
1244
|
-
|
|
1245
|
-
var this_0 = importReferences(rpc);
|
|
1246
|
-
var set = HashSet_init_$Create$();
|
|
1247
|
-
var list = ArrayList_init_$Create$_0();
|
|
1248
|
-
var _iterator__ex2g4s = this_0.t();
|
|
1249
|
-
while (_iterator__ex2g4s.u()) {
|
|
1250
|
-
var e = _iterator__ex2g4s.v();
|
|
1251
|
-
var key = e.x19_1;
|
|
1252
|
-
if (set.x(key)) {
|
|
1253
|
-
list.x(e);
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
728
|
+
var tmp = toImports(importReferences(rpc), 'super::super::model::');
|
|
1256
729
|
// Inline function 'kotlin.collections.map' call
|
|
730
|
+
var this_0 = file.gv_1;
|
|
1257
731
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1258
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(
|
|
1259
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
1260
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
1261
|
-
var item = _iterator__ex2g4s_0.v();
|
|
1262
|
-
var tmp$ret$6 = import_0('super::super::model::' + toSnakeCase(this, item.x19_1), Companion_getInstance().wt(item.x19_1).zt());
|
|
1263
|
-
destination.x(tmp$ret$6);
|
|
1264
|
-
}
|
|
1265
|
-
var rpcImports = destination;
|
|
1266
|
-
// Inline function 'kotlin.collections.map' call
|
|
1267
|
-
var this_1 = file.cv_1;
|
|
1268
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1269
|
-
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1270
|
-
var _iterator__ex2g4s_1 = this_1.t();
|
|
1271
|
-
while (_iterator__ex2g4s_1.u()) {
|
|
1272
|
-
var item_0 = _iterator__ex2g4s_1.v();
|
|
1273
|
-
var tmp;
|
|
1274
|
-
if (item_0 instanceof Namespace) {
|
|
1275
|
-
// Inline function 'kotlin.collections.flatMap' call
|
|
1276
|
-
var tmp0 = item_0.iv_1;
|
|
1277
|
-
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1278
|
-
var destination_1 = ArrayList_init_$Create$_0();
|
|
1279
|
-
var _iterator__ex2g4s_2 = tmp0.t();
|
|
1280
|
-
while (_iterator__ex2g4s_2.u()) {
|
|
1281
|
-
var element = _iterator__ex2g4s_2.v();
|
|
1282
|
-
var tmp_0;
|
|
1283
|
-
if (element instanceof Struct) {
|
|
1284
|
-
tmp_0 = listOf_0([new RawElement('#[derive(Debug, Clone, Default, PartialEq)]'), element]);
|
|
1285
|
-
} else {
|
|
1286
|
-
tmp_0 = listOf(element);
|
|
1287
|
-
}
|
|
1288
|
-
var list_0 = tmp_0;
|
|
1289
|
-
addAll(destination_1, list_0);
|
|
1290
|
-
}
|
|
1291
|
-
tmp = item_0.mv(VOID, destination_1);
|
|
1292
|
-
} else {
|
|
1293
|
-
tmp = item_0;
|
|
1294
|
-
}
|
|
1295
|
-
var tmp$ret$9 = tmp;
|
|
1296
|
-
destination_0.x(tmp$ret$9);
|
|
1297
|
-
}
|
|
1298
|
-
return file.fv(VOID, plus(rpcImports, destination_0));
|
|
1299
|
-
};
|
|
1300
|
-
protoOf(RustEmitter).j1b = function (endpoint) {
|
|
1301
|
-
var endpointName = endpoint.fr_1.o1();
|
|
1302
|
-
var endpointModuleName = toSnakeCase(this, endpointName);
|
|
1303
|
-
var clientName = endpointName + 'Client';
|
|
1304
|
-
var methodName = toSnakeCase(this, endpointName);
|
|
1305
|
-
var _destruct__k2r9zo = buildClientParams(this, endpoint);
|
|
1306
|
-
var paramsStr = _destruct__k2r9zo.ze();
|
|
1307
|
-
var requestArgs = _destruct__k2r9zo.af();
|
|
1308
|
-
var requestConstruction = endpointModuleName + '::Request::new(' + requestArgs + ')';
|
|
1309
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
1310
|
-
var this_0 = importReferences(endpoint);
|
|
1311
|
-
var set = HashSet_init_$Create$();
|
|
1312
|
-
var list = ArrayList_init_$Create$_0();
|
|
732
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1313
733
|
var _iterator__ex2g4s = this_0.t();
|
|
1314
734
|
while (_iterator__ex2g4s.u()) {
|
|
1315
|
-
var
|
|
1316
|
-
var
|
|
1317
|
-
if (
|
|
1318
|
-
|
|
735
|
+
var item = _iterator__ex2g4s.v();
|
|
736
|
+
var tmp_0;
|
|
737
|
+
if (item instanceof Namespace) {
|
|
738
|
+
tmp_0 = item.qv(VOID, withStructDerives(item.mv_1));
|
|
739
|
+
} else {
|
|
740
|
+
tmp_0 = item;
|
|
1319
741
|
}
|
|
1320
|
-
|
|
1321
|
-
// Inline function 'kotlin.collections.map' call
|
|
1322
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1323
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1324
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
1325
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
1326
|
-
var item = _iterator__ex2g4s_0.v();
|
|
1327
|
-
var tmp$ret$4 = import_0('super::super::model::' + toSnakeCase(this, item.x19_1), item.x19_1);
|
|
742
|
+
var tmp$ret$4 = tmp_0;
|
|
1328
743
|
destination.x(tmp$ret$4);
|
|
1329
744
|
}
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
var
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
this_1.x("impl<'a, S: Serialization, T: Transportation> " + namespacePath + '::Call for ' + clientName + "<'a, S, T> {");
|
|
1341
|
-
this_1.x(' async fn ' + methodName + '(&self' + paramsStr + ') -> ' + endpointModuleName + '::Response {');
|
|
1342
|
-
this_1.x(' let request = ' + requestConstruction + ';');
|
|
1343
|
-
this_1.x(' let raw_request = ' + namespacePath + '::to_raw_request(self.serialization, request);');
|
|
1344
|
-
this_1.x(' let raw_response = self.transportation.transport(&raw_request).await;');
|
|
1345
|
-
this_1.x(' ' + namespacePath + '::from_raw_response(self.serialization, raw_response)');
|
|
1346
|
-
this_1.x(' }');
|
|
1347
|
-
this_1.x('}');
|
|
1348
|
-
var tmp$ret$5 = this_1.q5();
|
|
1349
|
-
var code = joinToString(tmp$ret$5, '\n');
|
|
1350
|
-
var subPackageName = plus_2(this.h38_1, 'client');
|
|
1351
|
-
var tmp = Companion_getInstance().wt(subPackageName.dt() + toSnakeCase(this, clientName));
|
|
1352
|
-
// Inline function 'kotlin.collections.buildList' call
|
|
1353
|
-
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1354
|
-
// Inline function 'kotlin.apply' call
|
|
1355
|
-
var this_2 = ArrayList_init_$Create$_0();
|
|
1356
|
-
this_2.x(import_0('super::super::wirespec', '*'));
|
|
1357
|
-
this_2.x(import_0('super::super::endpoint', endpointModuleName));
|
|
1358
|
-
this_2.g1(modelImports);
|
|
1359
|
-
this_2.x(new RawElement(code));
|
|
1360
|
-
var tmp$ret$9 = this_2.q5();
|
|
1361
|
-
return new File(tmp, tmp$ret$9);
|
|
745
|
+
return file.jv(VOID, plus(tmp, destination));
|
|
746
|
+
};
|
|
747
|
+
protoOf(RustEmitter).n1b = function (endpoint) {
|
|
748
|
+
var module_0 = toSnakeCase(endpoint.gr_1.o1());
|
|
749
|
+
var namespace = module_0 + '::' + endpoint.gr_1.o1();
|
|
750
|
+
var _destruct__k2r9zo = clientParameters(this, endpoint);
|
|
751
|
+
var params = _destruct__k2r9zo.af();
|
|
752
|
+
var args = _destruct__k2r9zo.bf();
|
|
753
|
+
var code = trimIndent('\n pub struct ' + _get_clientName__yc59yj(this, endpoint) + "<'a, S: Serialization, T: Transportation> {\n pub serialization: &'a S,\n pub transportation: &'a T,\n }\n impl<'a, S: Serialization, T: Transportation> " + namespace + '::Call for ' + _get_clientName__yc59yj(this, endpoint) + "<'a, S, T> {\n async fn " + module_0 + '(&self' + params + ') -> ' + module_0 + '::Response {\n let request = ' + module_0 + '::Request::new(' + args + ');\n let raw_request = ' + namespace + '::to_raw_request(self.serialization, request);\n let raw_response = self.transportation.transport(&raw_request).await;\n ' + namespace + '::from_raw_response(self.serialization, raw_response)\n }\n }\n ');
|
|
754
|
+
return new File(Companion_getInstance().au(plus_2(this.m38_1, 'client').dt() + toSnakeCase(_get_clientName__yc59yj(this, endpoint))), plus_0(plus(listOf_0([import_0('super::super::wirespec', '*'), import_0('super::super::endpoint', module_0)]), toImports(importReferences(endpoint), 'super::super::model::')), new RawElement(code)));
|
|
1362
755
|
};
|
|
1363
|
-
protoOf(RustEmitter).
|
|
1364
|
-
logger.
|
|
756
|
+
protoOf(RustEmitter).h1b = function (endpoints, logger) {
|
|
757
|
+
logger.bs('Emitting main Client for ' + endpoints.c1() + ' endpoints');
|
|
1365
758
|
var modDeclarations = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, RustEmitter$emitClient$lambda(this));
|
|
1366
759
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1367
760
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1368
|
-
var destination = ArrayList_init_$Create$
|
|
761
|
+
var destination = ArrayList_init_$Create$();
|
|
1369
762
|
var _iterator__ex2g4s = endpoints.t();
|
|
1370
763
|
while (_iterator__ex2g4s.u()) {
|
|
1371
764
|
var element = _iterator__ex2g4s.v();
|
|
1372
765
|
var list = importReferences(element);
|
|
1373
766
|
addAll(destination, list);
|
|
1374
767
|
}
|
|
1375
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
1376
|
-
var set = HashSet_init_$Create$();
|
|
1377
|
-
var list_0 = ArrayList_init_$Create$_0();
|
|
1378
|
-
var _iterator__ex2g4s_0 = destination.t();
|
|
1379
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
1380
|
-
var e = _iterator__ex2g4s_0.v();
|
|
1381
|
-
var key = e.x19_1;
|
|
1382
|
-
if (set.x(key)) {
|
|
1383
|
-
list_0.x(e);
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
768
|
// Inline function 'kotlin.collections.filter' call
|
|
1387
769
|
// Inline function 'kotlin.collections.filterTo' call
|
|
1388
|
-
var destination_0 = ArrayList_init_$Create$
|
|
1389
|
-
var
|
|
1390
|
-
while (
|
|
1391
|
-
var element_0 =
|
|
1392
|
-
var tmp$ret$
|
|
770
|
+
var destination_0 = ArrayList_init_$Create$();
|
|
771
|
+
var _iterator__ex2g4s_0 = destination.t();
|
|
772
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
773
|
+
var element_0 = _iterator__ex2g4s_0.v();
|
|
774
|
+
var tmp$ret$6;
|
|
1393
775
|
$l$block_0: {
|
|
1394
776
|
// Inline function 'kotlin.collections.none' call
|
|
1395
777
|
var tmp;
|
|
@@ -1399,203 +781,435 @@ protoOf(RustEmitter).d1b = function (endpoints, logger) {
|
|
|
1399
781
|
tmp = false;
|
|
1400
782
|
}
|
|
1401
783
|
if (tmp) {
|
|
1402
|
-
tmp$ret$
|
|
784
|
+
tmp$ret$6 = true;
|
|
1403
785
|
break $l$block_0;
|
|
1404
786
|
}
|
|
1405
|
-
var
|
|
1406
|
-
while (
|
|
1407
|
-
var element_1 =
|
|
1408
|
-
if (element_1.
|
|
1409
|
-
tmp$ret$
|
|
787
|
+
var _iterator__ex2g4s_1 = endpoints.t();
|
|
788
|
+
while (_iterator__ex2g4s_1.u()) {
|
|
789
|
+
var element_1 = _iterator__ex2g4s_1.v();
|
|
790
|
+
if (element_1.gr_1.o1() === element_0.b1a_1) {
|
|
791
|
+
tmp$ret$6 = false;
|
|
1410
792
|
break $l$block_0;
|
|
1411
793
|
}
|
|
1412
794
|
}
|
|
1413
|
-
tmp$ret$
|
|
795
|
+
tmp$ret$6 = true;
|
|
1414
796
|
}
|
|
1415
|
-
if (tmp$ret$
|
|
797
|
+
if (tmp$ret$6) {
|
|
1416
798
|
destination_0.x(element_0);
|
|
1417
799
|
}
|
|
1418
800
|
}
|
|
1419
|
-
|
|
1420
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1421
|
-
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_0, 10));
|
|
1422
|
-
var _iterator__ex2g4s_3 = destination_0.t();
|
|
1423
|
-
while (_iterator__ex2g4s_3.u()) {
|
|
1424
|
-
var item = _iterator__ex2g4s_3.v();
|
|
1425
|
-
var tmp$ret$12 = import_0('super::model::' + toSnakeCase(this, item.x19_1), item.x19_1);
|
|
1426
|
-
destination_1.x(tmp$ret$12);
|
|
1427
|
-
}
|
|
1428
|
-
var modelImports = destination_1;
|
|
801
|
+
var modelImports = toImports(destination_0, 'super::model::');
|
|
1429
802
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1430
803
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1431
|
-
var
|
|
1432
|
-
var
|
|
1433
|
-
while (
|
|
1434
|
-
var element_2 =
|
|
1435
|
-
var
|
|
1436
|
-
|
|
1437
|
-
var list_1 = listOf_0([import_0('super::endpoint', endpointModuleName), import_0(clientModuleName, element_2.fr_1.o1() + 'Client')]);
|
|
1438
|
-
addAll(destination_2, list_1);
|
|
1439
|
-
}
|
|
1440
|
-
var endpointAndClientImports = destination_2;
|
|
1441
|
-
// Inline function 'kotlin.collections.flatMap' call
|
|
1442
|
-
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1443
|
-
var destination_3 = ArrayList_init_$Create$_0();
|
|
1444
|
-
var _iterator__ex2g4s_5 = endpoints.t();
|
|
1445
|
-
while (_iterator__ex2g4s_5.u()) {
|
|
1446
|
-
var element_3 = _iterator__ex2g4s_5.v();
|
|
1447
|
-
var endpointName = element_3.fr_1.o1();
|
|
1448
|
-
var endpointModuleName_0 = toSnakeCase(this, endpointName);
|
|
1449
|
-
var namespacePath = endpointModuleName_0 + '::' + endpointName;
|
|
1450
|
-
var methodName = toSnakeCase(this, endpointName);
|
|
1451
|
-
var _destruct__k2r9zo = buildClientParams(this, element_3);
|
|
1452
|
-
var paramsStr = _destruct__k2r9zo.ze();
|
|
1453
|
-
var callArgs = _destruct__k2r9zo.af();
|
|
1454
|
-
var delegateCall = endpointName + 'Client { serialization: &self.serialization, transportation: &self.transportation }\n' + (' .' + methodName + '(' + callArgs + ').await');
|
|
1455
|
-
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, ' }', '}']);
|
|
1456
|
-
addAll(destination_3, list_2);
|
|
804
|
+
var destination_1 = ArrayList_init_$Create$();
|
|
805
|
+
var _iterator__ex2g4s_2 = endpoints.t();
|
|
806
|
+
while (_iterator__ex2g4s_2.u()) {
|
|
807
|
+
var element_2 = _iterator__ex2g4s_2.v();
|
|
808
|
+
var list_0 = listOf_0([import_0('super::endpoint', toSnakeCase(element_2.gr_1.o1())), import_0(toSnakeCase(_get_clientName__yc59yj(this, element_2)), _get_clientName__yc59yj(this, element_2))]);
|
|
809
|
+
addAll(destination_1, list_0);
|
|
1457
810
|
}
|
|
1458
|
-
var
|
|
1459
|
-
var
|
|
1460
|
-
var
|
|
1461
|
-
|
|
1462
|
-
// Inline function 'kotlin.collections.buildListInternal' call
|
|
1463
|
-
// Inline function 'kotlin.apply' call
|
|
1464
|
-
var this_0 = ArrayList_init_$Create$_0();
|
|
1465
|
-
this_0.x(new RawElement(modDeclarations));
|
|
1466
|
-
this_0.x(import_0('super::wirespec', '*'));
|
|
1467
|
-
this_0.g1(modelImports);
|
|
1468
|
-
this_0.g1(endpointAndClientImports);
|
|
1469
|
-
this_0.x(new RawElement(code));
|
|
1470
|
-
var tmp$ret$19 = this_0.q5();
|
|
1471
|
-
return new File(tmp_0, tmp$ret$19);
|
|
811
|
+
var endpointAndClientImports = destination_1;
|
|
812
|
+
var implementations = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, RustEmitter$emitClient$lambda_0(this));
|
|
813
|
+
var code = 'pub struct Client<S: Serialization, T: Transportation> {\n pub serialization: S,\n pub transportation: T,\n}\n' + implementations;
|
|
814
|
+
return new File(Companion_getInstance().au(this.m38_1.dt() + 'client'), plus_0(plus(plus(listOf_0([new RawElement(modDeclarations), import_0('super::wirespec', '*')]), modelImports), endpointAndClientImports), new RawElement(code)));
|
|
1472
815
|
};
|
|
1473
|
-
function
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
}
|
|
1482
|
-
var rustResponsePattern;
|
|
1483
|
-
function fixResponseSwitchPatterns() {
|
|
1484
|
-
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1485
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1486
|
-
// Inline function 'kotlin.apply' call
|
|
1487
|
-
var this_0 = new TransformerBuilder();
|
|
1488
|
-
this_0.q19(fixResponseSwitchPatterns$lambda);
|
|
1489
|
-
return this_0.p19();
|
|
1490
|
-
}
|
|
1491
|
-
function buildModelImports(_this__u8e3s4) {
|
|
1492
|
-
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1493
|
-
// Inline function 'kotlin.collections.distinctBy' call
|
|
1494
|
-
var this_0 = importReferences(_this__u8e3s4);
|
|
1495
|
-
var set = HashSet_init_$Create$();
|
|
1496
|
-
var list = ArrayList_init_$Create$_0();
|
|
1497
|
-
var _iterator__ex2g4s = this_0.t();
|
|
1498
|
-
while (_iterator__ex2g4s.u()) {
|
|
1499
|
-
var e = _iterator__ex2g4s.v();
|
|
1500
|
-
var key = e.x19_1;
|
|
1501
|
-
if (set.x(key)) {
|
|
1502
|
-
list.x(e);
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
// Inline function 'kotlin.collections.map' call
|
|
1506
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1507
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1508
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
1509
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
1510
|
-
var item = _iterator__ex2g4s_0.v();
|
|
1511
|
-
var tmp$ret$4 = import_0('super::' + toRustSnakeCase(item.x19_1), Companion_getInstance().wt(item.x19_1).zt());
|
|
1512
|
-
destination.x(tmp$ret$4);
|
|
816
|
+
function isDerivable(_this__u8e3s4) {
|
|
817
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
818
|
+
var tmp;
|
|
819
|
+
var tmp_0;
|
|
820
|
+
if (equals(_this__u8e3s4, Any_instance)) {
|
|
821
|
+
tmp_0 = true;
|
|
822
|
+
} else {
|
|
823
|
+
tmp_0 = _this__u8e3s4 instanceof Function;
|
|
1513
824
|
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
}
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
825
|
+
if (tmp_0) {
|
|
826
|
+
tmp = false;
|
|
827
|
+
} else {
|
|
828
|
+
if (_this__u8e3s4 instanceof Custom) {
|
|
829
|
+
var tmp0 = _this__u8e3s4.su_1;
|
|
830
|
+
var tmp$ret$0;
|
|
831
|
+
$l$block_0: {
|
|
832
|
+
// Inline function 'kotlin.collections.all' call
|
|
833
|
+
var tmp_1;
|
|
834
|
+
if (isInterface(tmp0, Collection)) {
|
|
835
|
+
tmp_1 = tmp0.r();
|
|
836
|
+
} else {
|
|
837
|
+
tmp_1 = false;
|
|
838
|
+
}
|
|
839
|
+
if (tmp_1) {
|
|
840
|
+
tmp$ret$0 = true;
|
|
841
|
+
break $l$block_0;
|
|
842
|
+
}
|
|
843
|
+
var _iterator__ex2g4s = tmp0.t();
|
|
844
|
+
while (_iterator__ex2g4s.u()) {
|
|
845
|
+
var element = _iterator__ex2g4s.v();
|
|
846
|
+
if (!isDerivable(element)) {
|
|
847
|
+
tmp$ret$0 = false;
|
|
848
|
+
break $l$block_0;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
tmp$ret$0 = true;
|
|
852
|
+
}
|
|
853
|
+
tmp = tmp$ret$0;
|
|
854
|
+
} else {
|
|
855
|
+
if (_this__u8e3s4 instanceof Nullable) {
|
|
856
|
+
tmp = isDerivable(_this__u8e3s4.vu_1);
|
|
857
|
+
} else {
|
|
858
|
+
if (_this__u8e3s4 instanceof Array_0) {
|
|
859
|
+
tmp = isDerivable(_this__u8e3s4.mu_1);
|
|
860
|
+
} else {
|
|
861
|
+
if (_this__u8e3s4 instanceof Dict) {
|
|
862
|
+
tmp = (isDerivable(_this__u8e3s4.ou_1) && isDerivable(_this__u8e3s4.pu_1));
|
|
863
|
+
} else {
|
|
864
|
+
var tmp_2;
|
|
865
|
+
var tmp_3;
|
|
866
|
+
var tmp_4;
|
|
867
|
+
if (_this__u8e3s4 instanceof Integer) {
|
|
868
|
+
tmp_4 = true;
|
|
869
|
+
} else {
|
|
870
|
+
tmp_4 = _this__u8e3s4 instanceof Number_0;
|
|
871
|
+
}
|
|
872
|
+
if (tmp_4) {
|
|
873
|
+
tmp_3 = true;
|
|
874
|
+
} else {
|
|
875
|
+
tmp_3 = equals(_this__u8e3s4, String_instance) || (equals(_this__u8e3s4, Boolean_instance) || equals(_this__u8e3s4, Bytes_instance));
|
|
876
|
+
}
|
|
877
|
+
if (tmp_3) {
|
|
878
|
+
tmp_2 = true;
|
|
879
|
+
} else {
|
|
880
|
+
var tmp_5;
|
|
881
|
+
if (equals(_this__u8e3s4, Unit_instance_0) || equals(_this__u8e3s4, Wildcard_instance)) {
|
|
882
|
+
tmp_5 = true;
|
|
883
|
+
} else {
|
|
884
|
+
var tmp_6;
|
|
885
|
+
if (equals(_this__u8e3s4, Reflect_instance)) {
|
|
886
|
+
tmp_6 = true;
|
|
887
|
+
} else {
|
|
888
|
+
var tmp_7;
|
|
889
|
+
if (_this__u8e3s4 instanceof IntegerLiteral) {
|
|
890
|
+
tmp_7 = true;
|
|
891
|
+
} else {
|
|
892
|
+
tmp_7 = _this__u8e3s4 instanceof StringLiteral;
|
|
893
|
+
}
|
|
894
|
+
tmp_6 = tmp_7;
|
|
895
|
+
}
|
|
896
|
+
tmp_5 = tmp_6;
|
|
897
|
+
}
|
|
898
|
+
tmp_2 = tmp_5;
|
|
899
|
+
}
|
|
900
|
+
if (tmp_2) {
|
|
901
|
+
tmp = true;
|
|
902
|
+
} else {
|
|
903
|
+
noWhenBranchMatchedException();
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
return tmp;
|
|
911
|
+
}
|
|
912
|
+
function moduleName(_this__u8e3s4) {
|
|
913
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
914
|
+
// Inline function 'kotlin.collections.mapIndexed' call
|
|
915
|
+
var this_0 = split(_this__u8e3s4.o1(), ['.', ' ']);
|
|
916
|
+
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
917
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
918
|
+
var index = 0;
|
|
919
|
+
var _iterator__ex2g4s = this_0.t();
|
|
920
|
+
while (_iterator__ex2g4s.u()) {
|
|
921
|
+
var item = _iterator__ex2g4s.v();
|
|
922
|
+
var _unary__edvuaz = index;
|
|
923
|
+
index = _unary__edvuaz + 1 | 0;
|
|
924
|
+
var tmp$ret$2 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.zr(item) : item;
|
|
925
|
+
destination.x(tmp$ret$2);
|
|
926
|
+
}
|
|
927
|
+
// Inline function 'kotlin.text.filter' call
|
|
928
|
+
var tmp0 = joinToString(destination, '');
|
|
929
|
+
// Inline function 'kotlin.text.filterTo' call
|
|
930
|
+
var destination_0 = StringBuilder_init_$Create$();
|
|
931
|
+
var inductionVariable = 0;
|
|
932
|
+
var last = charSequenceLength(tmp0);
|
|
933
|
+
if (inductionVariable < last)
|
|
934
|
+
do {
|
|
935
|
+
var index_0 = inductionVariable;
|
|
936
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
937
|
+
var element = charSequenceGet(tmp0, index_0);
|
|
938
|
+
if (isLetterOrDigit(element) || element === _Char___init__impl__6a9atx(95)) {
|
|
939
|
+
destination_0.s(element);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
while (inductionVariable < last);
|
|
943
|
+
// Inline function 'kotlin.let' call
|
|
944
|
+
var it = destination_0.toString();
|
|
945
|
+
var tmp;
|
|
946
|
+
var tmp0_safe_receiver = firstOrNull_0(it);
|
|
947
|
+
var tmp_0;
|
|
948
|
+
var tmp_1 = tmp0_safe_receiver;
|
|
949
|
+
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
950
|
+
tmp_0 = null;
|
|
951
|
+
} else {
|
|
952
|
+
tmp_0 = isDigit(tmp0_safe_receiver);
|
|
953
|
+
}
|
|
954
|
+
if (tmp_0 === true) {
|
|
955
|
+
tmp = '_' + it;
|
|
956
|
+
} else {
|
|
957
|
+
tmp = it;
|
|
958
|
+
}
|
|
959
|
+
var tmp$ret$6 = tmp;
|
|
960
|
+
return toSnakeCase(tmp$ret$6);
|
|
961
|
+
}
|
|
962
|
+
function withStructDerives(_this__u8e3s4) {
|
|
963
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
964
|
+
// Inline function 'kotlin.collections.flatMap' call
|
|
965
|
+
// Inline function 'kotlin.collections.flatMapTo' call
|
|
966
|
+
var destination = ArrayList_init_$Create$();
|
|
967
|
+
var _iterator__ex2g4s = _this__u8e3s4.t();
|
|
968
|
+
while (_iterator__ex2g4s.u()) {
|
|
969
|
+
var element = _iterator__ex2g4s.v();
|
|
970
|
+
var tmp;
|
|
971
|
+
if (element instanceof Struct) {
|
|
972
|
+
tmp = listOf_0([new RawElement('#[derive(Debug, Clone, Default, PartialEq)]'), element]);
|
|
973
|
+
} else {
|
|
974
|
+
tmp = listOf(element);
|
|
975
|
+
}
|
|
976
|
+
var list = tmp;
|
|
977
|
+
addAll(destination, list);
|
|
978
|
+
}
|
|
979
|
+
return destination;
|
|
980
|
+
}
|
|
981
|
+
function withImports(_this__u8e3s4, imports) {
|
|
982
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
983
|
+
return _this__u8e3s4.jv(VOID, plus(imports, _this__u8e3s4.gv_1));
|
|
984
|
+
}
|
|
985
|
+
function toImports(_this__u8e3s4, path) {
|
|
986
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
987
|
+
// Inline function 'kotlin.collections.distinctBy' call
|
|
988
|
+
var set = HashSet_init_$Create$();
|
|
989
|
+
var list = ArrayList_init_$Create$();
|
|
990
|
+
var _iterator__ex2g4s = _this__u8e3s4.t();
|
|
991
|
+
while (_iterator__ex2g4s.u()) {
|
|
992
|
+
var e = _iterator__ex2g4s.v();
|
|
993
|
+
var key = e.b1a_1;
|
|
994
|
+
if (set.x(key)) {
|
|
995
|
+
list.x(e);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
// Inline function 'kotlin.collections.map' call
|
|
999
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1000
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(list, 10));
|
|
1001
|
+
var _iterator__ex2g4s_0 = list.t();
|
|
1002
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
1003
|
+
var item = _iterator__ex2g4s_0.v();
|
|
1004
|
+
var tmp$ret$4 = import_0(path + toSnakeCase(item.b1a_1), Companion_getInstance().au(item.b1a_1).du());
|
|
1005
|
+
destination.x(tmp$ret$4);
|
|
1006
|
+
}
|
|
1007
|
+
return destination;
|
|
1008
|
+
}
|
|
1009
|
+
function sanitizeEnum(_this__u8e3s4) {
|
|
1010
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
1011
|
+
var tmp = split(_this__u8e3s4, ['-', ', ', '.', ' ', '//', '_']);
|
|
1012
|
+
// Inline function 'kotlin.let' call
|
|
1013
|
+
var it = joinToString(tmp, '', VOID, VOID, VOID, VOID, sanitizeEnum$lambda);
|
|
1014
|
+
var tmp_0;
|
|
1015
|
+
var tmp0_safe_receiver = firstOrNull_0(it);
|
|
1016
|
+
var tmp_1;
|
|
1017
|
+
var tmp_2 = tmp0_safe_receiver;
|
|
1018
|
+
if ((tmp_2 == null ? null : new Char(tmp_2)) == null) {
|
|
1019
|
+
tmp_1 = null;
|
|
1020
|
+
} else {
|
|
1021
|
+
tmp_1 = isDigit(tmp0_safe_receiver);
|
|
1022
|
+
}
|
|
1023
|
+
if (tmp_1 === true) {
|
|
1024
|
+
tmp_0 = '_' + it;
|
|
1025
|
+
} else {
|
|
1026
|
+
tmp_0 = it;
|
|
1027
|
+
}
|
|
1028
|
+
return tmp_0;
|
|
1029
|
+
}
|
|
1030
|
+
function sanitizeEnum$lambda(s) {
|
|
1031
|
+
_init_properties_RustEmitter_kt__ix9brc();
|
|
1032
|
+
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
1033
|
+
var tmp;
|
|
1034
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
1035
|
+
if (charSequenceLength(s) > 0) {
|
|
1036
|
+
var it = charCodeAt(s, 0);
|
|
1037
|
+
var tmp0 = uppercaseChar(it);
|
|
1038
|
+
// Inline function 'kotlin.text.plus' call
|
|
1039
|
+
var other = substring(s, 1);
|
|
1040
|
+
tmp = toString(tmp0) + other;
|
|
1041
|
+
} else {
|
|
1042
|
+
tmp = s;
|
|
1043
|
+
}
|
|
1044
|
+
return tmp;
|
|
1045
|
+
}
|
|
1046
|
+
var properties_initialized_RustEmitter_kt_u3ttd2;
|
|
1047
|
+
function _init_properties_RustEmitter_kt__ix9brc() {
|
|
1048
|
+
if (!properties_initialized_RustEmitter_kt_u3ttd2) {
|
|
1049
|
+
properties_initialized_RustEmitter_kt_u3ttd2 = true;
|
|
1050
|
+
wirespecImports = listOf_0([import_0('super::super::wirespec', '*'), import_0('', 'regex')]);
|
|
1051
|
+
sharedImports = listOf_0([import_0('std::any', 'TypeId'), import_0('std::collections', 'HashMap')]);
|
|
1052
|
+
sharedDerive = new RawElement('#[derive(Debug, Clone, PartialEq)]');
|
|
1053
|
+
sharedMethod = 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}');
|
|
1054
|
+
// Inline function 'kotlin.collections.mapValues' call
|
|
1055
|
+
var this_0 = mapOf([to('Enum', '\n pub trait Enum: Sized {\n fn label(&self) -> &str;\n fn from_label(s: &str) -> Option<Self>;\n }\n '), to('Refined', '\n pub trait Refined<T> {\n fn value(&self) -> &T;\n fn validate(&self) -> bool;\n }\n '), to('Request', '\n pub trait Request<T> {\n fn path(&self) -> &dyn Path;\n fn method(&self) -> &Method;\n fn queries(&self) -> &dyn Queries;\n fn headers(&self) -> &dyn RequestHeaders;\n fn body(&self) -> &T;\n }\n pub trait RequestHeaders: Headers {}\n '), to('Response', '\n pub trait Response<T> {\n fn status(&self) -> i32;\n fn headers(&self) -> &dyn ResponseHeaders;\n fn body(&self) -> &T;\n }\n pub trait ResponseHeaders: Headers {}\n '), to('BodySerializer', "\n pub trait BodySerializer {\n fn serialize_body<T: 'static>(&self, t: &T, r#type: TypeId) -> Vec<u8>;\n }\n "), to('BodyDeserializer', "\n pub trait BodyDeserializer {\n fn deserialize_body<T: 'static>(&self, raw: &[u8], r#type: TypeId) -> T;\n }\n "), to('PathSerializer', '\n pub trait PathSerializer {\n fn serialize_path<T: std::fmt::Display>(&self, t: &T, r#type: TypeId) -> String;\n }\n '), to('PathDeserializer', '\n pub trait PathDeserializer {\n fn deserialize_path<T: std::str::FromStr>(&self, raw: &str, r#type: TypeId) -> T where T::Err: std::fmt::Debug;\n }\n '), to('ParamSerializer', "\n pub trait ParamSerializer {\n fn serialize_param<T: 'static>(&self, value: &T, r#type: TypeId) -> Vec<String>;\n }\n "), to('ParamDeserializer', "\n pub trait ParamDeserializer {\n fn deserialize_param<T: 'static>(&self, values: &[String], r#type: TypeId) -> T;\n }\n "), to('Transportation', '\n pub trait Transportation {\n async fn transport(&self, request: &RawRequest) -> RawResponse;\n }\n '), to('Generator', '\n pub trait Generator {\n fn generate<T>(&self, path: Vec<String>, field: impl GeneratorField<T>) -> T;\n }\n ')]);
|
|
1056
|
+
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1057
|
+
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.c1()));
|
|
1058
|
+
// Inline function 'kotlin.collections.associateByTo' call
|
|
1059
|
+
var _iterator__ex2g4s = this_0.m1().t();
|
|
1060
|
+
while (_iterator__ex2g4s.u()) {
|
|
1061
|
+
var element = _iterator__ex2g4s.v();
|
|
1062
|
+
var tmp = element.n1();
|
|
1063
|
+
// Inline function 'kotlin.collections.component2' call
|
|
1064
|
+
var code = element.o1();
|
|
1065
|
+
var tmp$ret$4 = new RawElement(trimIndent(code));
|
|
1066
|
+
destination.w2(tmp, tmp$ret$4);
|
|
1067
|
+
}
|
|
1068
|
+
sharedTraits = destination;
|
|
1069
|
+
sharedClientAndServer = listOf_0([new RawElement('pub trait Client {\n type Transport: Transportation;\n type Ser: Serialization;\n fn transport(&self) -> &Self::Transport;\n fn serialization(&self) -> &Self::Ser;\n}'), new RawElement("pub trait Server {\n type Req;\n type Res;\n fn path_template(&self) -> &'static str;\n fn method(&self) -> Method;\n}")]);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
function get_rustSelfParam() {
|
|
1073
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1074
|
+
return rustSelfParam;
|
|
1075
|
+
}
|
|
1076
|
+
var rustSelfParam;
|
|
1077
|
+
function get_rustResponsePattern() {
|
|
1078
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1079
|
+
return rustResponsePattern;
|
|
1080
|
+
}
|
|
1081
|
+
var rustResponsePattern;
|
|
1082
|
+
function get_serializerTraits() {
|
|
1083
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1084
|
+
return serializerTraits;
|
|
1085
|
+
}
|
|
1086
|
+
var serializerTraits;
|
|
1087
|
+
function get_serializationFunctions() {
|
|
1088
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1089
|
+
return serializationFunctions;
|
|
1090
|
+
}
|
|
1091
|
+
var serializationFunctions;
|
|
1092
|
+
function get_borrowParameters() {
|
|
1093
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1094
|
+
return borrowParameters;
|
|
1095
|
+
}
|
|
1096
|
+
var borrowParameters;
|
|
1097
|
+
function get_borrowSerializationArguments() {
|
|
1098
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1099
|
+
return borrowSerializationArguments;
|
|
1100
|
+
}
|
|
1101
|
+
var borrowSerializationArguments;
|
|
1102
|
+
function applyBorrowRules(_this__u8e3s4) {
|
|
1103
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1104
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1105
|
+
var scope = new TransformScope(_this__u8e3s4);
|
|
1106
|
+
scope.j19(get_borrowParameters());
|
|
1107
|
+
scope.j19(get_borrowSerializationArguments());
|
|
1108
|
+
var tmp = scope.e19_1;
|
|
1109
|
+
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1110
|
+
}
|
|
1111
|
+
function fixResponseSwitchPatterns() {
|
|
1112
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1113
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1114
|
+
// Inline function 'kotlin.apply' call
|
|
1115
|
+
var this_0 = new TransformerBuilder();
|
|
1116
|
+
this_0.u19(fixResponseSwitchPatterns$lambda);
|
|
1117
|
+
return this_0.t19();
|
|
1118
|
+
}
|
|
1119
|
+
function withSelfReceivers(_this__u8e3s4) {
|
|
1120
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1121
|
+
// Inline function 'kotlin.collections.map' call
|
|
1122
|
+
var this_0 = _this__u8e3s4.sv_1;
|
|
1123
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1124
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1125
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1126
|
+
while (_iterator__ex2g4s.u()) {
|
|
1127
|
+
var item = _iterator__ex2g4s.v();
|
|
1128
|
+
var tmp;
|
|
1129
|
+
if (item instanceof Function_0) {
|
|
1130
|
+
tmp = item.dy(VOID, VOID, plus(listOf(get_rustSelfParam()), item.tx_1));
|
|
1131
|
+
} else {
|
|
1132
|
+
tmp = item;
|
|
1133
|
+
}
|
|
1134
|
+
var tmp$ret$2 = tmp;
|
|
1135
|
+
destination.x(tmp$ret$2);
|
|
1136
|
+
}
|
|
1137
|
+
return _this__u8e3s4.zv(VOID, destination);
|
|
1138
|
+
}
|
|
1139
|
+
function toSnakeCase(_this__u8e3s4) {
|
|
1140
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1141
|
+
return Companion_getInstance().au(_this__u8e3s4).eu();
|
|
1142
|
+
}
|
|
1143
|
+
function sanitizeKeywords(_this__u8e3s4) {
|
|
1144
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1145
|
+
return Companion_getInstance_0().n37().i1(_this__u8e3s4) ? 'r#' + _this__u8e3s4 : _this__u8e3s4;
|
|
1146
|
+
}
|
|
1147
|
+
function replaceStructWithRefinedFunctions(_this__u8e3s4, refined) {
|
|
1148
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1149
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1553
1150
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1554
1151
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
1555
1152
|
var tmp = scope;
|
|
1556
1153
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
1557
|
-
var this_0 = scope.
|
|
1154
|
+
var this_0 = scope.e19_1;
|
|
1558
1155
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1559
1156
|
// Inline function 'kotlin.apply' call
|
|
1560
1157
|
var this_1 = new TransformerBuilder();
|
|
1561
|
-
this_1.
|
|
1562
|
-
var tmp$ret$4 = this_1.
|
|
1563
|
-
tmp.
|
|
1564
|
-
var tmp_0 = scope.
|
|
1158
|
+
this_1.y19(replaceStructWithRefinedFunctions$lambda(refined));
|
|
1159
|
+
var tmp$ret$4 = this_1.t19();
|
|
1160
|
+
tmp.e19_1 = transform(this_0, tmp$ret$4);
|
|
1161
|
+
var tmp_0 = scope.e19_1;
|
|
1565
1162
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1566
1163
|
}
|
|
1567
|
-
function
|
|
1164
|
+
function injectApiStruct(_this__u8e3s4, endpoint) {
|
|
1165
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1166
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1167
|
+
var scope = new TransformScope(_this__u8e3s4);
|
|
1168
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
1169
|
+
var tmp = scope;
|
|
1170
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
1171
|
+
var this_0 = scope.e19_1;
|
|
1172
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1173
|
+
// Inline function 'kotlin.apply' call
|
|
1174
|
+
var this_1 = new TransformerBuilder();
|
|
1175
|
+
this_1.y19(injectApiStruct$lambda(endpoint));
|
|
1176
|
+
var tmp$ret$4 = this_1.t19();
|
|
1177
|
+
tmp.e19_1 = transform(this_0, tmp$ret$4);
|
|
1178
|
+
var tmp_0 = scope.e19_1;
|
|
1179
|
+
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1180
|
+
}
|
|
1181
|
+
function injectResponseFromImpls(_this__u8e3s4) {
|
|
1568
1182
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1569
1183
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1570
1184
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1571
1185
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
1572
1186
|
var tmp = scope;
|
|
1573
1187
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
1574
|
-
var this_0 = scope.
|
|
1188
|
+
var this_0 = scope.e19_1;
|
|
1575
1189
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1576
1190
|
// Inline function 'kotlin.apply' call
|
|
1577
1191
|
var this_1 = new TransformerBuilder();
|
|
1578
|
-
this_1.
|
|
1579
|
-
var tmp$ret$4 = this_1.
|
|
1580
|
-
tmp.
|
|
1581
|
-
var tmp_0 = scope.
|
|
1192
|
+
this_1.y19(injectResponseFromImpls$lambda);
|
|
1193
|
+
var tmp$ret$4 = this_1.t19();
|
|
1194
|
+
tmp.e19_1 = transform(this_0, tmp$ret$4);
|
|
1195
|
+
var tmp_0 = scope.e19_1;
|
|
1582
1196
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1583
1197
|
}
|
|
1584
|
-
function
|
|
1198
|
+
function injectHandlerImplForClient(_this__u8e3s4) {
|
|
1585
1199
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1586
1200
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1587
1201
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1588
1202
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
1589
1203
|
var tmp = scope;
|
|
1590
1204
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
1591
|
-
var this_0 = scope.
|
|
1205
|
+
var this_0 = scope.e19_1;
|
|
1592
1206
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1593
1207
|
// Inline function 'kotlin.apply' call
|
|
1594
1208
|
var this_1 = new TransformerBuilder();
|
|
1595
|
-
this_1.
|
|
1596
|
-
var tmp$ret$4 = this_1.
|
|
1597
|
-
tmp.
|
|
1598
|
-
var tmp_0 = scope.
|
|
1209
|
+
this_1.y19(injectHandlerImplForClient$lambda);
|
|
1210
|
+
var tmp$ret$4 = this_1.t19();
|
|
1211
|
+
tmp.e19_1 = transform(this_0, tmp$ret$4);
|
|
1212
|
+
var tmp_0 = scope.e19_1;
|
|
1599
1213
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1600
1214
|
}
|
|
1601
1215
|
function stripResponseGenerics(_this__u8e3s4) {
|
|
@@ -1605,31 +1219,31 @@ function stripResponseGenerics(_this__u8e3s4) {
|
|
|
1605
1219
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matching' call
|
|
1606
1220
|
var tmp = scope;
|
|
1607
1221
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatching' call
|
|
1608
|
-
var this_0 = scope.
|
|
1222
|
+
var this_0 = scope.e19_1;
|
|
1609
1223
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1610
1224
|
// Inline function 'kotlin.apply' call
|
|
1611
1225
|
var this_1 = new TransformerBuilder();
|
|
1612
|
-
this_1.
|
|
1613
|
-
var tmp$ret$4 = this_1.
|
|
1614
|
-
tmp.
|
|
1615
|
-
var tmp_0 = scope.
|
|
1226
|
+
this_1.k19(stripResponseGenerics$lambda);
|
|
1227
|
+
var tmp$ret$4 = this_1.t19();
|
|
1228
|
+
tmp.e19_1 = transform(this_0, tmp$ret$4);
|
|
1229
|
+
var tmp_0 = scope.e19_1;
|
|
1616
1230
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1617
1231
|
}
|
|
1618
|
-
function
|
|
1232
|
+
function rustHandlerTraits(_this__u8e3s4) {
|
|
1619
1233
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1620
1234
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1621
1235
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1622
1236
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
1623
1237
|
var tmp = scope;
|
|
1624
1238
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
1625
|
-
var this_0 = scope.
|
|
1239
|
+
var this_0 = scope.e19_1;
|
|
1626
1240
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1627
1241
|
// Inline function 'kotlin.apply' call
|
|
1628
1242
|
var this_1 = new TransformerBuilder();
|
|
1629
|
-
this_1.
|
|
1630
|
-
var tmp$ret$4 = this_1.
|
|
1631
|
-
tmp.
|
|
1632
|
-
var tmp_0 = scope.
|
|
1243
|
+
this_1.y19(rustHandlerTraits$lambda);
|
|
1244
|
+
var tmp$ret$4 = this_1.t19();
|
|
1245
|
+
tmp.e19_1 = transform(this_0, tmp$ret$4);
|
|
1246
|
+
var tmp_0 = scope.e19_1;
|
|
1633
1247
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1634
1248
|
}
|
|
1635
1249
|
function convertSimpleRawExpressionsToVariableRefs(_this__u8e3s4) {
|
|
@@ -1637,8 +1251,8 @@ function convertSimpleRawExpressionsToVariableRefs(_this__u8e3s4) {
|
|
|
1637
1251
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
1638
1252
|
var scope = new TransformScope(_this__u8e3s4);
|
|
1639
1253
|
var identifierPattern = Regex_init_$Create$('[a-zA-Z_][a-zA-Z0-9_]*');
|
|
1640
|
-
scope.
|
|
1641
|
-
var tmp = scope.
|
|
1254
|
+
scope.w19(convertSimpleRawExpressionsToVariableRefs$lambda(identifierPattern));
|
|
1255
|
+
var tmp = scope.e19_1;
|
|
1642
1256
|
return isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
1643
1257
|
}
|
|
1644
1258
|
function stripWirespecPrefix(_this__u8e3s4) {
|
|
@@ -1648,23 +1262,23 @@ function stripWirespecPrefix(_this__u8e3s4) {
|
|
|
1648
1262
|
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matching' call
|
|
1649
1263
|
var tmp = scope;
|
|
1650
1264
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatching' call
|
|
1651
|
-
var this_0 = scope.
|
|
1265
|
+
var this_0 = scope.e19_1;
|
|
1652
1266
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1653
1267
|
// Inline function 'kotlin.apply' call
|
|
1654
1268
|
var this_1 = new TransformerBuilder();
|
|
1655
|
-
this_1.
|
|
1656
|
-
var tmp$ret$4 = this_1.
|
|
1657
|
-
tmp.
|
|
1658
|
-
var tmp_0 = scope.
|
|
1269
|
+
this_1.k19(stripWirespecPrefix$lambda);
|
|
1270
|
+
var tmp$ret$4 = this_1.t19();
|
|
1271
|
+
tmp.e19_1 = transform(this_0, tmp$ret$4);
|
|
1272
|
+
var tmp_0 = scope.e19_1;
|
|
1659
1273
|
return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
1660
1274
|
}
|
|
1661
1275
|
function flattenForRust(_this__u8e3s4) {
|
|
1662
1276
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1663
1277
|
// Inline function 'community.flock.wirespec.compiler.core.ir.findElement' call
|
|
1664
1278
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1665
|
-
var tmp0 = _this__u8e3s4.
|
|
1279
|
+
var tmp0 = _this__u8e3s4.hv();
|
|
1666
1280
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1667
|
-
var destination = ArrayList_init_$Create$
|
|
1281
|
+
var destination = ArrayList_init_$Create$();
|
|
1668
1282
|
var _iterator__ex2g4s = tmp0.t();
|
|
1669
1283
|
while (_iterator__ex2g4s.u()) {
|
|
1670
1284
|
var element = _iterator__ex2g4s.v();
|
|
@@ -1672,13 +1286,13 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1672
1286
|
destination.x(element);
|
|
1673
1287
|
}
|
|
1674
1288
|
}
|
|
1675
|
-
var tmp$ret$0 =
|
|
1289
|
+
var tmp$ret$0 = firstOrNull(destination);
|
|
1676
1290
|
var namespace = ensureNotNull(tmp$ret$0);
|
|
1677
|
-
// Inline function 'kotlin.collections.
|
|
1678
|
-
var
|
|
1679
|
-
|
|
1680
|
-
var
|
|
1681
|
-
var _iterator__ex2g4s_0 =
|
|
1291
|
+
// Inline function 'kotlin.collections.partition' call
|
|
1292
|
+
var this_0 = namespace.mv_1;
|
|
1293
|
+
var first = ArrayList_init_$Create$();
|
|
1294
|
+
var second = ArrayList_init_$Create$();
|
|
1295
|
+
var _iterator__ex2g4s_0 = this_0.t();
|
|
1682
1296
|
while (_iterator__ex2g4s_0.u()) {
|
|
1683
1297
|
var element_0 = _iterator__ex2g4s_0.v();
|
|
1684
1298
|
var tmp;
|
|
@@ -1688,246 +1302,523 @@ function flattenForRust(_this__u8e3s4) {
|
|
|
1688
1302
|
tmp = element_0 instanceof Union_0;
|
|
1689
1303
|
}
|
|
1690
1304
|
if (tmp) {
|
|
1691
|
-
|
|
1305
|
+
first.x(element_0);
|
|
1306
|
+
} else {
|
|
1307
|
+
second.x(element_0);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
var _destruct__k2r9zo = new Pair(first, second);
|
|
1311
|
+
var moduleElements = _destruct__k2r9zo.af();
|
|
1312
|
+
var classElements = _destruct__k2r9zo.bf();
|
|
1313
|
+
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1314
|
+
var tmp0_0 = namespace.mv_1;
|
|
1315
|
+
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1316
|
+
var destination_0 = ArrayList_init_$Create$();
|
|
1317
|
+
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
1318
|
+
while (_iterator__ex2g4s_1.u()) {
|
|
1319
|
+
var element_1 = _iterator__ex2g4s_1.v();
|
|
1320
|
+
if (element_1 instanceof Struct) {
|
|
1321
|
+
destination_0.x(element_1);
|
|
1692
1322
|
}
|
|
1693
1323
|
}
|
|
1694
1324
|
// Inline function 'kotlin.collections.map' call
|
|
1695
1325
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1696
|
-
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_0, 10));
|
|
1697
|
-
var
|
|
1698
|
-
while (
|
|
1699
|
-
var item =
|
|
1326
|
+
var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
|
|
1327
|
+
var _iterator__ex2g4s_2 = destination_0.t();
|
|
1328
|
+
while (_iterator__ex2g4s_2.u()) {
|
|
1329
|
+
var item = _iterator__ex2g4s_2.v();
|
|
1330
|
+
var tmp$ret$9 = item.fx_1.du();
|
|
1331
|
+
destination_1.x(tmp$ret$9);
|
|
1332
|
+
}
|
|
1333
|
+
// Inline function 'kotlin.collections.filter' call
|
|
1334
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
1335
|
+
var destination_2 = ArrayList_init_$Create$();
|
|
1336
|
+
var _iterator__ex2g4s_3 = destination_1.t();
|
|
1337
|
+
while (_iterator__ex2g4s_3.u()) {
|
|
1338
|
+
var element_2 = _iterator__ex2g4s_3.v();
|
|
1339
|
+
if (get_rustResponsePattern().sc(element_2)) {
|
|
1340
|
+
destination_2.x(element_2);
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
// Inline function 'kotlin.collections.map' call
|
|
1344
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1345
|
+
var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_2, 10));
|
|
1346
|
+
var _iterator__ex2g4s_4 = destination_2.t();
|
|
1347
|
+
while (_iterator__ex2g4s_4.u()) {
|
|
1348
|
+
var item_0 = _iterator__ex2g4s_4.v();
|
|
1349
|
+
var tmp$ret$15 = Custom_init_$Create$(item_0);
|
|
1350
|
+
destination_3.x(tmp$ret$15);
|
|
1351
|
+
}
|
|
1352
|
+
var responseMembers = destination_3;
|
|
1353
|
+
// Inline function 'kotlin.collections.map' call
|
|
1354
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1355
|
+
var destination_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(moduleElements, 10));
|
|
1356
|
+
var _iterator__ex2g4s_5 = moduleElements.t();
|
|
1357
|
+
while (_iterator__ex2g4s_5.u()) {
|
|
1358
|
+
var item_1 = _iterator__ex2g4s_5.v();
|
|
1700
1359
|
var tmp_0;
|
|
1701
1360
|
var tmp_1;
|
|
1702
|
-
if (
|
|
1703
|
-
tmp_1 =
|
|
1361
|
+
if (item_1 instanceof Union_0) {
|
|
1362
|
+
tmp_1 = item_1.lw_1.du() === 'Response';
|
|
1704
1363
|
} else {
|
|
1705
1364
|
tmp_1 = false;
|
|
1706
1365
|
}
|
|
1707
1366
|
if (tmp_1) {
|
|
1708
|
-
|
|
1709
|
-
var tmp0_1 = namespace.iv_1;
|
|
1710
|
-
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1711
|
-
var destination_2 = ArrayList_init_$Create$_0();
|
|
1712
|
-
var _iterator__ex2g4s_2 = tmp0_1.t();
|
|
1713
|
-
while (_iterator__ex2g4s_2.u()) {
|
|
1714
|
-
var element_1 = _iterator__ex2g4s_2.v();
|
|
1715
|
-
if (element_1 instanceof Struct) {
|
|
1716
|
-
destination_2.x(element_1);
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
// Inline function 'kotlin.collections.map' call
|
|
1720
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1721
|
-
var destination_3 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_2, 10));
|
|
1722
|
-
var _iterator__ex2g4s_3 = destination_2.t();
|
|
1723
|
-
while (_iterator__ex2g4s_3.u()) {
|
|
1724
|
-
var item_0 = _iterator__ex2g4s_3.v();
|
|
1725
|
-
var tmp$ret$13 = item_0.bx_1.zt();
|
|
1726
|
-
destination_3.x(tmp$ret$13);
|
|
1727
|
-
}
|
|
1728
|
-
// Inline function 'kotlin.collections.filter' call
|
|
1729
|
-
// Inline function 'kotlin.collections.filterTo' call
|
|
1730
|
-
var destination_4 = ArrayList_init_$Create$_0();
|
|
1731
|
-
var _iterator__ex2g4s_4 = destination_3.t();
|
|
1732
|
-
while (_iterator__ex2g4s_4.u()) {
|
|
1733
|
-
var element_2 = _iterator__ex2g4s_4.v();
|
|
1734
|
-
if (get_rustResponsePattern().rc(element_2)) {
|
|
1735
|
-
destination_4.x(element_2);
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
// Inline function 'kotlin.collections.map' call
|
|
1739
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1740
|
-
var destination_5 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_4, 10));
|
|
1741
|
-
var _iterator__ex2g4s_5 = destination_4.t();
|
|
1742
|
-
while (_iterator__ex2g4s_5.u()) {
|
|
1743
|
-
var item_1 = _iterator__ex2g4s_5.v();
|
|
1744
|
-
var tmp$ret$19 = Custom_init_$Create$(item_1);
|
|
1745
|
-
destination_5.x(tmp$ret$19);
|
|
1746
|
-
}
|
|
1747
|
-
var members = destination_5;
|
|
1748
|
-
tmp_0 = item.nw(VOID, VOID, members, emptyList());
|
|
1367
|
+
tmp_0 = item_1.rw(VOID, VOID, responseMembers, emptyList());
|
|
1749
1368
|
} else {
|
|
1750
|
-
if (
|
|
1751
|
-
tmp_0 =
|
|
1369
|
+
if (item_1 instanceof Union_0) {
|
|
1370
|
+
tmp_0 = item_1.rw(VOID, VOID, VOID, emptyList());
|
|
1752
1371
|
} else {
|
|
1753
|
-
tmp_0 =
|
|
1372
|
+
tmp_0 = item_1;
|
|
1754
1373
|
}
|
|
1755
1374
|
}
|
|
1756
|
-
var tmp$ret$
|
|
1757
|
-
|
|
1758
|
-
}
|
|
1759
|
-
var moduleElements = destination_1;
|
|
1760
|
-
// Inline function 'kotlin.collections.filterNot' call
|
|
1761
|
-
var tmp0_2 = namespace.iv_1;
|
|
1762
|
-
// Inline function 'kotlin.collections.filterNotTo' call
|
|
1763
|
-
var destination_6 = ArrayList_init_$Create$_0();
|
|
1764
|
-
var _iterator__ex2g4s_6 = tmp0_2.t();
|
|
1765
|
-
while (_iterator__ex2g4s_6.u()) {
|
|
1766
|
-
var element_3 = _iterator__ex2g4s_6.v();
|
|
1767
|
-
var tmp_2;
|
|
1768
|
-
if (element_3 instanceof Struct) {
|
|
1769
|
-
tmp_2 = true;
|
|
1770
|
-
} else {
|
|
1771
|
-
tmp_2 = element_3 instanceof Union_0;
|
|
1772
|
-
}
|
|
1773
|
-
if (!tmp_2) {
|
|
1774
|
-
destination_6.x(element_3);
|
|
1775
|
-
}
|
|
1375
|
+
var tmp$ret$18 = tmp_0;
|
|
1376
|
+
destination_4.x(tmp$ret$18);
|
|
1776
1377
|
}
|
|
1777
|
-
|
|
1778
|
-
return new File(namespace.hv_1, plus_0(moduleElements, new Namespace(namespace.hv_1, classElements, namespace.jv_1)));
|
|
1378
|
+
return new File(namespace.lv_1, plus_0(destination_4, new Namespace(namespace.lv_1, classElements, namespace.nv_1)));
|
|
1779
1379
|
}
|
|
1780
1380
|
function fixConstructorCalls() {
|
|
1781
1381
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1782
1382
|
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
1783
1383
|
// Inline function 'kotlin.apply' call
|
|
1784
1384
|
var this_0 = new TransformerBuilder();
|
|
1785
|
-
this_0.
|
|
1786
|
-
return this_0.
|
|
1385
|
+
this_0.w19(fixConstructorCalls$lambda);
|
|
1386
|
+
return this_0.t19();
|
|
1787
1387
|
}
|
|
1788
|
-
function
|
|
1388
|
+
function rustName(_this__u8e3s4) {
|
|
1789
1389
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1390
|
+
var tmp;
|
|
1391
|
+
if (_this__u8e3s4 instanceof Custom) {
|
|
1392
|
+
var tmp_0;
|
|
1393
|
+
if (_this__u8e3s4.su_1.r()) {
|
|
1394
|
+
tmp_0 = _this__u8e3s4.ru_1.du();
|
|
1395
|
+
} else {
|
|
1396
|
+
var tmp_1 = _this__u8e3s4.ru_1.du();
|
|
1397
|
+
tmp_0 = tmp_1 + '<' + joinToString(_this__u8e3s4.su_1, ', ', VOID, VOID, VOID, VOID, rustName$lambda) + '>';
|
|
1398
|
+
}
|
|
1399
|
+
tmp = tmp_0;
|
|
1400
|
+
} else {
|
|
1401
|
+
if (equals(_this__u8e3s4, String_instance)) {
|
|
1402
|
+
tmp = 'String';
|
|
1403
|
+
} else {
|
|
1404
|
+
if (_this__u8e3s4 instanceof Nullable) {
|
|
1405
|
+
tmp = 'Option<' + rustName(_this__u8e3s4.vu_1) + '>';
|
|
1406
|
+
} else {
|
|
1407
|
+
if (_this__u8e3s4 instanceof Array_0) {
|
|
1408
|
+
tmp = 'Vec<' + rustName(_this__u8e3s4.mu_1) + '>';
|
|
1409
|
+
} else {
|
|
1410
|
+
if (_this__u8e3s4 instanceof Dict) {
|
|
1411
|
+
tmp = 'std::collections::HashMap<' + rustName(_this__u8e3s4.ou_1) + ', ' + rustName(_this__u8e3s4.pu_1) + '>';
|
|
1412
|
+
} else {
|
|
1413
|
+
if (equals(_this__u8e3s4, Any_instance)) {
|
|
1414
|
+
tmp = 'Box<dyn std::any::Any>';
|
|
1415
|
+
} else {
|
|
1416
|
+
if (equals(_this__u8e3s4, Bytes_instance)) {
|
|
1417
|
+
tmp = 'Vec<u8>';
|
|
1418
|
+
} else {
|
|
1419
|
+
if (equals(_this__u8e3s4, Unit_instance_0)) {
|
|
1420
|
+
tmp = '()';
|
|
1421
|
+
} else {
|
|
1422
|
+
if (equals(_this__u8e3s4, Boolean_instance)) {
|
|
1423
|
+
tmp = 'bool';
|
|
1424
|
+
} else {
|
|
1425
|
+
if (equals(_this__u8e3s4, Wildcard_instance)) {
|
|
1426
|
+
tmp = '_';
|
|
1427
|
+
} else {
|
|
1428
|
+
if (equals(_this__u8e3s4, Reflect_instance)) {
|
|
1429
|
+
tmp = 'std::any::TypeId';
|
|
1430
|
+
} else {
|
|
1431
|
+
if (_this__u8e3s4 instanceof Integer) {
|
|
1432
|
+
var tmp_2;
|
|
1433
|
+
switch (_this__u8e3s4.ku_1.f3_1) {
|
|
1434
|
+
case 0:
|
|
1435
|
+
tmp_2 = 'i32';
|
|
1436
|
+
break;
|
|
1437
|
+
case 1:
|
|
1438
|
+
tmp_2 = 'i64';
|
|
1439
|
+
break;
|
|
1440
|
+
default:
|
|
1441
|
+
noWhenBranchMatchedException();
|
|
1442
|
+
break;
|
|
1443
|
+
}
|
|
1444
|
+
tmp = tmp_2;
|
|
1445
|
+
} else {
|
|
1446
|
+
if (_this__u8e3s4 instanceof Number_0) {
|
|
1447
|
+
var tmp_3;
|
|
1448
|
+
switch (_this__u8e3s4.lu_1.f3_1) {
|
|
1449
|
+
case 0:
|
|
1450
|
+
tmp_3 = 'f32';
|
|
1451
|
+
break;
|
|
1452
|
+
case 1:
|
|
1453
|
+
tmp_3 = 'f64';
|
|
1454
|
+
break;
|
|
1455
|
+
default:
|
|
1456
|
+
noWhenBranchMatchedException();
|
|
1457
|
+
break;
|
|
1458
|
+
}
|
|
1459
|
+
tmp = tmp_3;
|
|
1460
|
+
} else {
|
|
1461
|
+
if (_this__u8e3s4 instanceof IntegerLiteral) {
|
|
1462
|
+
tmp = 'i32';
|
|
1463
|
+
} else {
|
|
1464
|
+
if (_this__u8e3s4 instanceof StringLiteral) {
|
|
1465
|
+
tmp = 'String';
|
|
1466
|
+
} else {
|
|
1467
|
+
if (_this__u8e3s4 instanceof Function) {
|
|
1468
|
+
tmp = 'Box<dyn Fn(' + joinToString(_this__u8e3s4.yu_1, ', ', VOID, VOID, VOID, VOID, rustName$lambda_0) + ') -> ' + rustName(_this__u8e3s4.zu_1) + '>';
|
|
1469
|
+
} else {
|
|
1470
|
+
noWhenBranchMatchedException();
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1800
1485
|
}
|
|
1801
1486
|
}
|
|
1802
|
-
|
|
1803
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1804
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(list, 10));
|
|
1805
|
-
var _iterator__ex2g4s_0 = list.t();
|
|
1806
|
-
while (_iterator__ex2g4s_0.u()) {
|
|
1807
|
-
var item = _iterator__ex2g4s_0.v();
|
|
1808
|
-
var tmp$ret$4 = import_0('super::super::model::' + toRustSnakeCase(item.x19_1), Companion_getInstance().wt(item.x19_1).zt());
|
|
1809
|
-
destination.x(tmp$ret$4);
|
|
1810
|
-
}
|
|
1811
|
-
return destination;
|
|
1487
|
+
return tmp;
|
|
1812
1488
|
}
|
|
1813
|
-
function
|
|
1489
|
+
function borrowed(_this__u8e3s4) {
|
|
1814
1490
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1815
|
-
|
|
1491
|
+
var tmp;
|
|
1492
|
+
if (_this__u8e3s4 instanceof Nullable) {
|
|
1493
|
+
tmp = _this__u8e3s4.nu(borrowed(_this__u8e3s4.vu_1));
|
|
1494
|
+
} else {
|
|
1495
|
+
if (equals(_this__u8e3s4, String_instance)) {
|
|
1496
|
+
tmp = Custom_init_$Create$('&str');
|
|
1497
|
+
} else {
|
|
1498
|
+
var tmp_0;
|
|
1499
|
+
if (_this__u8e3s4 instanceof Custom) {
|
|
1500
|
+
tmp_0 = get_serializerTraits().i1(_this__u8e3s4.ru_1.du());
|
|
1501
|
+
} else {
|
|
1502
|
+
tmp_0 = false;
|
|
1503
|
+
}
|
|
1504
|
+
if (tmp_0) {
|
|
1505
|
+
tmp = _this__u8e3s4.uu(new Name(listOf('&impl ' + _this__u8e3s4.ru_1.du())));
|
|
1506
|
+
} else {
|
|
1507
|
+
tmp = _this__u8e3s4;
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
return tmp;
|
|
1816
1512
|
}
|
|
1817
|
-
function
|
|
1513
|
+
function toRawCode(_this__u8e3s4) {
|
|
1818
1514
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1819
|
-
var
|
|
1820
|
-
|
|
1515
|
+
var tmp;
|
|
1516
|
+
if (_this__u8e3s4 instanceof VariableReference) {
|
|
1517
|
+
tmp = sanitizeKeywords(_this__u8e3s4.ev_1.eu());
|
|
1518
|
+
} else {
|
|
1519
|
+
if (_this__u8e3s4 instanceof FieldCall) {
|
|
1520
|
+
var tmp1_safe_receiver = _this__u8e3s4.kz_1;
|
|
1521
|
+
var tmp_0;
|
|
1522
|
+
if (tmp1_safe_receiver == null) {
|
|
1523
|
+
tmp_0 = null;
|
|
1524
|
+
} else {
|
|
1525
|
+
// Inline function 'kotlin.let' call
|
|
1526
|
+
tmp_0 = toRawCode(tmp1_safe_receiver) + '.';
|
|
1527
|
+
}
|
|
1528
|
+
// Inline function 'kotlin.text.orEmpty' call
|
|
1529
|
+
var tmp0_elvis_lhs = tmp_0;
|
|
1530
|
+
tmp = (tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs) + sanitizeKeywords(_this__u8e3s4.lz_1.eu());
|
|
1531
|
+
} else {
|
|
1532
|
+
if (_this__u8e3s4 instanceof ArrayIndexCall) {
|
|
1533
|
+
var tmp_1 = _this__u8e3s4.c10_1;
|
|
1534
|
+
var tmp2_safe_receiver = tmp_1 instanceof Literal ? tmp_1 : null;
|
|
1535
|
+
var tmp_2;
|
|
1536
|
+
if (tmp2_safe_receiver == null) {
|
|
1537
|
+
tmp_2 = null;
|
|
1538
|
+
} else {
|
|
1539
|
+
// Inline function 'kotlin.takeIf' call
|
|
1540
|
+
var tmp_3;
|
|
1541
|
+
var tmp_4 = tmp2_safe_receiver.wy_1;
|
|
1542
|
+
if (tmp_4 instanceof String_0) {
|
|
1543
|
+
tmp_3 = tmp2_safe_receiver;
|
|
1544
|
+
} else {
|
|
1545
|
+
tmp_3 = null;
|
|
1546
|
+
}
|
|
1547
|
+
tmp_2 = tmp_3;
|
|
1548
|
+
}
|
|
1549
|
+
var tmp3_safe_receiver = tmp_2;
|
|
1550
|
+
var tmp_5;
|
|
1551
|
+
if (tmp3_safe_receiver == null) {
|
|
1552
|
+
tmp_5 = null;
|
|
1553
|
+
} else {
|
|
1554
|
+
// Inline function 'kotlin.let' call
|
|
1555
|
+
tmp_5 = '"' + toString_0(tmp3_safe_receiver.vy_1) + '"';
|
|
1556
|
+
}
|
|
1557
|
+
var tmp4_elvis_lhs = tmp_5;
|
|
1558
|
+
var key = tmp4_elvis_lhs == null ? toRawCode(_this__u8e3s4.c10_1) : tmp4_elvis_lhs;
|
|
1559
|
+
tmp = toRawCode(_this__u8e3s4.b10_1) + '[' + key + ']';
|
|
1560
|
+
} else {
|
|
1561
|
+
if (_this__u8e3s4 instanceof ConstructorStatement) {
|
|
1562
|
+
var tmp_6 = _this__u8e3s4.gu_1;
|
|
1563
|
+
var tmp5_safe_receiver = tmp_6 instanceof Custom ? tmp_6 : null;
|
|
1564
|
+
var tmp6_safe_receiver = tmp5_safe_receiver == null ? null : tmp5_safe_receiver.ru_1;
|
|
1565
|
+
var tmp7_elvis_lhs = tmp6_safe_receiver == null ? null : tmp6_safe_receiver.du();
|
|
1566
|
+
var typeName = tmp7_elvis_lhs == null ? toString_0(_this__u8e3s4.gu_1) : tmp7_elvis_lhs;
|
|
1567
|
+
var tmp_7 = _this__u8e3s4.hu_1.m1();
|
|
1568
|
+
var args = joinToString(tmp_7, ', ', VOID, VOID, VOID, VOID, toRawCode$lambda);
|
|
1569
|
+
var tmp_8;
|
|
1570
|
+
// Inline function 'kotlin.text.isEmpty' call
|
|
1571
|
+
if (charSequenceLength(args) === 0) {
|
|
1572
|
+
tmp_8 = typeName + ' {}';
|
|
1573
|
+
} else {
|
|
1574
|
+
tmp_8 = typeName + ' { ' + args + ' }';
|
|
1575
|
+
}
|
|
1576
|
+
tmp = tmp_8;
|
|
1577
|
+
} else {
|
|
1578
|
+
if (_this__u8e3s4 instanceof Literal) {
|
|
1579
|
+
var tmp_9;
|
|
1580
|
+
var tmp_10 = _this__u8e3s4.wy_1;
|
|
1581
|
+
if (tmp_10 instanceof String_0) {
|
|
1582
|
+
tmp_9 = 'String::from("' + toString_0(_this__u8e3s4.vy_1) + '")';
|
|
1583
|
+
} else {
|
|
1584
|
+
tmp_9 = toString_0(_this__u8e3s4.vy_1);
|
|
1585
|
+
}
|
|
1586
|
+
tmp = tmp_9;
|
|
1587
|
+
} else {
|
|
1588
|
+
if (_this__u8e3s4 instanceof RawExpression) {
|
|
1589
|
+
tmp = _this__u8e3s4.gy_1;
|
|
1590
|
+
} else {
|
|
1591
|
+
// Inline function 'kotlin.error' call
|
|
1592
|
+
var message = 'Unsupported expression type in toRawCode: ' + getKClassFromExpression(_this__u8e3s4).o();
|
|
1593
|
+
throw IllegalStateException_init_$Create$(toString_0(message));
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
return tmp;
|
|
1821
1601
|
}
|
|
1822
|
-
function
|
|
1602
|
+
function matchingResponse(_this__u8e3s4, variable, t) {
|
|
1823
1603
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1824
|
-
var tmp;
|
|
1825
|
-
|
|
1826
|
-
|
|
1604
|
+
var tmp = _this__u8e3s4.hz_1;
|
|
1605
|
+
var tmp0_safe_receiver = tmp instanceof Custom ? tmp : null;
|
|
1606
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.ru_1;
|
|
1607
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.du();
|
|
1608
|
+
var tmp_0;
|
|
1609
|
+
if (tmp2_safe_receiver == null) {
|
|
1610
|
+
tmp_0 = null;
|
|
1611
|
+
} else {
|
|
1612
|
+
// Inline function 'kotlin.takeIf' call
|
|
1613
|
+
var tmp_1;
|
|
1614
|
+
if (get_rustResponsePattern().sc(tmp2_safe_receiver)) {
|
|
1615
|
+
tmp_1 = tmp2_safe_receiver;
|
|
1616
|
+
} else {
|
|
1617
|
+
tmp_1 = null;
|
|
1618
|
+
}
|
|
1619
|
+
tmp_0 = tmp_1;
|
|
1620
|
+
}
|
|
1621
|
+
var tmp3_safe_receiver = tmp_0;
|
|
1622
|
+
var tmp_2;
|
|
1623
|
+
if (tmp3_safe_receiver == null) {
|
|
1624
|
+
tmp_2 = null;
|
|
1827
1625
|
} else {
|
|
1828
|
-
|
|
1626
|
+
// Inline function 'kotlin.let' call
|
|
1627
|
+
var tmp_3 = new RawExpression('Response::' + tmp3_safe_receiver + '(' + variable.eu() + ')');
|
|
1628
|
+
// Inline function 'kotlin.collections.map' call
|
|
1629
|
+
var this_0 = _this__u8e3s4.gz_1;
|
|
1630
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1631
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1632
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1633
|
+
while (_iterator__ex2g4s.u()) {
|
|
1634
|
+
var item = _iterator__ex2g4s.v();
|
|
1635
|
+
var tmp$ret$6 = t.y18(item);
|
|
1636
|
+
destination.x(tmp$ret$6);
|
|
1637
|
+
}
|
|
1638
|
+
tmp_2 = new Case(tmp_3, destination);
|
|
1829
1639
|
}
|
|
1830
|
-
var
|
|
1831
|
-
return
|
|
1640
|
+
var tmp4_elvis_lhs = tmp_2;
|
|
1641
|
+
return tmp4_elvis_lhs == null ? transformChildren_1(_this__u8e3s4, t) : tmp4_elvis_lhs;
|
|
1832
1642
|
}
|
|
1833
|
-
function
|
|
1643
|
+
function validateFunction(_this__u8e3s4) {
|
|
1834
1644
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1835
|
-
return
|
|
1645
|
+
return function_0('validate', VOID, VOID, validateFunction$lambda(_this__u8e3s4));
|
|
1836
1646
|
}
|
|
1837
|
-
function
|
|
1647
|
+
function toStringFunction(_this__u8e3s4) {
|
|
1838
1648
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1839
|
-
|
|
1840
|
-
var pathTemplate = '/' + joinToString(_this__u8e3s4.hr_1, '/', VOID, VOID, VOID, VOID, generateApiStructCode$lambda);
|
|
1841
|
-
var methodName = _this__u8e3s4.gr_1.d3_1;
|
|
1842
|
-
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 ');
|
|
1649
|
+
return function_0('to_string', VOID, VOID, toStringFunction$lambda(_this__u8e3s4));
|
|
1843
1650
|
}
|
|
1844
|
-
function
|
|
1651
|
+
function apiStruct(_this__u8e3s4) {
|
|
1652
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1653
|
+
var pathTemplate = joinToString(_this__u8e3s4.ir_1, '/', '/', VOID, VOID, VOID, apiStruct$lambda);
|
|
1654
|
+
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::' + _this__u8e3s4.hr_1.e3_1 + ' }\n }\n ');
|
|
1655
|
+
}
|
|
1656
|
+
function transformedArguments(_this__u8e3s4, t) {
|
|
1657
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1658
|
+
// Inline function 'kotlin.collections.mapValues' call
|
|
1659
|
+
var this_0 = _this__u8e3s4.hu_1;
|
|
1660
|
+
// Inline function 'kotlin.collections.mapValuesTo' call
|
|
1661
|
+
var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.c1()));
|
|
1662
|
+
// Inline function 'kotlin.collections.associateByTo' call
|
|
1663
|
+
var _iterator__ex2g4s = this_0.m1().t();
|
|
1664
|
+
while (_iterator__ex2g4s.u()) {
|
|
1665
|
+
var element = _iterator__ex2g4s.v();
|
|
1666
|
+
var tmp = element.n1();
|
|
1667
|
+
var tmp$ret$4 = t.z18(element.o1());
|
|
1668
|
+
destination.w2(tmp, tmp$ret$4);
|
|
1669
|
+
}
|
|
1670
|
+
return destination;
|
|
1671
|
+
}
|
|
1672
|
+
function borrowParameters$lambda(element, transformer) {
|
|
1845
1673
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1846
1674
|
var tmp;
|
|
1847
|
-
|
|
1848
|
-
|
|
1675
|
+
var tmp_0;
|
|
1676
|
+
if (element instanceof Interface) {
|
|
1677
|
+
tmp_0 = element.rv_1.equals(Companion_getInstance().au('Call'));
|
|
1849
1678
|
} else {
|
|
1850
|
-
|
|
1851
|
-
tmp = !((tmp0_safe_receiver == null ? null : tmp0_safe_receiver.yt()) === 'r');
|
|
1679
|
+
tmp_0 = false;
|
|
1852
1680
|
}
|
|
1853
|
-
if (
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
1858
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1859
|
-
var _iterator__ex2g4s = this_0.t();
|
|
1860
|
-
while (_iterator__ex2g4s.u()) {
|
|
1861
|
-
var item = _iterator__ex2g4s.v();
|
|
1862
|
-
var tmp_0 = item.dz_1;
|
|
1863
|
-
var tmp0_safe_receiver_0 = tmp_0 instanceof Custom ? tmp_0 : null;
|
|
1864
|
-
var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.nu_1;
|
|
1865
|
-
var typeName = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.zt();
|
|
1866
|
-
var tmp_1;
|
|
1867
|
-
if (!(typeName == null) && get_rustResponsePattern().rc(typeName)) {
|
|
1868
|
-
var tmp_2 = new RawExpression('Response::' + typeName + '(' + ensureNotNull(s.yy_1).au() + ')');
|
|
1681
|
+
if (tmp_0) {
|
|
1682
|
+
tmp = element;
|
|
1683
|
+
} else {
|
|
1684
|
+
if (element instanceof Function_0) {
|
|
1869
1685
|
// Inline function 'kotlin.collections.map' call
|
|
1870
|
-
var
|
|
1686
|
+
var this_0 = element.tx_1;
|
|
1871
1687
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1872
|
-
var
|
|
1873
|
-
var
|
|
1874
|
-
while (
|
|
1875
|
-
var
|
|
1876
|
-
var tmp$ret$
|
|
1877
|
-
|
|
1688
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1689
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1690
|
+
while (_iterator__ex2g4s.u()) {
|
|
1691
|
+
var item = _iterator__ex2g4s.v();
|
|
1692
|
+
var tmp$ret$2 = item.sz(VOID, borrowed(item.pz_1));
|
|
1693
|
+
destination.x(tmp$ret$2);
|
|
1878
1694
|
}
|
|
1879
|
-
|
|
1695
|
+
tmp = transformChildren_2(element.dy(VOID, VOID, destination), transformer);
|
|
1880
1696
|
} else {
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1697
|
+
tmp = transformChildren_2(element, transformer);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
return tmp;
|
|
1701
|
+
}
|
|
1702
|
+
function borrowSerializationArguments$lambda(statement, transformer) {
|
|
1703
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1704
|
+
var tmp;
|
|
1705
|
+
var tmp_0;
|
|
1706
|
+
if (statement instanceof FunctionCall) {
|
|
1707
|
+
tmp_0 = get_serializationFunctions().i1(statement.qy_1.eu());
|
|
1708
|
+
} else {
|
|
1709
|
+
tmp_0 = false;
|
|
1710
|
+
}
|
|
1711
|
+
if (tmp_0) {
|
|
1712
|
+
// Inline function 'kotlin.collections.mapIndexed' call
|
|
1713
|
+
var this_0 = statement.ry_1.m1();
|
|
1714
|
+
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
1715
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1716
|
+
var index = 0;
|
|
1717
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1718
|
+
while (_iterator__ex2g4s.u()) {
|
|
1719
|
+
var item = _iterator__ex2g4s.v();
|
|
1720
|
+
var _unary__edvuaz = index;
|
|
1721
|
+
index = _unary__edvuaz + 1 | 0;
|
|
1722
|
+
var index_0 = checkIndexOverflow(_unary__edvuaz);
|
|
1723
|
+
// Inline function 'kotlin.collections.component1' call
|
|
1724
|
+
var name = item.n1();
|
|
1725
|
+
// Inline function 'kotlin.collections.component2' call
|
|
1726
|
+
var value = item.o1();
|
|
1727
|
+
// Inline function 'kotlin.let' call
|
|
1728
|
+
var argument = transformer.z18(value);
|
|
1729
|
+
var tmp_1;
|
|
1730
|
+
var tmp_2;
|
|
1731
|
+
if (index_0 === 0) {
|
|
1732
|
+
var tmp_3;
|
|
1733
|
+
if (argument instanceof VariableReference) {
|
|
1734
|
+
tmp_3 = argument.ev_1.bu() === 'it';
|
|
1735
|
+
} else {
|
|
1736
|
+
tmp_3 = false;
|
|
1737
|
+
}
|
|
1738
|
+
tmp_2 = !tmp_3;
|
|
1739
|
+
} else {
|
|
1740
|
+
tmp_2 = false;
|
|
1891
1741
|
}
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
var tmp_5;
|
|
1895
|
-
if (tmp2_safe_receiver == null) {
|
|
1896
|
-
tmp_5 = null;
|
|
1742
|
+
if (tmp_2) {
|
|
1743
|
+
tmp_1 = new RawExpression('&' + toRawCode(argument));
|
|
1897
1744
|
} else {
|
|
1898
|
-
|
|
1899
|
-
tmp_5 = t.s18(tmp2_safe_receiver);
|
|
1745
|
+
tmp_1 = argument;
|
|
1900
1746
|
}
|
|
1901
|
-
|
|
1747
|
+
var tmp$ret$5 = tmp_1;
|
|
1748
|
+
var tmp$ret$2 = to(name, tmp$ret$5);
|
|
1749
|
+
destination.x(tmp$ret$2);
|
|
1902
1750
|
}
|
|
1903
|
-
|
|
1904
|
-
|
|
1751
|
+
tmp = statement.uy(VOID, VOID, VOID, toMap(destination));
|
|
1752
|
+
} else {
|
|
1753
|
+
tmp = transformChildren(statement, transformer);
|
|
1754
|
+
}
|
|
1755
|
+
return tmp;
|
|
1756
|
+
}
|
|
1757
|
+
function fixResponseSwitchPatterns$lambda(s, t) {
|
|
1758
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1759
|
+
var tmp0_safe_receiver = s instanceof Switch ? s : null;
|
|
1760
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.cz_1;
|
|
1761
|
+
var tmp;
|
|
1762
|
+
if (tmp1_safe_receiver == null) {
|
|
1763
|
+
tmp = null;
|
|
1764
|
+
} else {
|
|
1765
|
+
// Inline function 'kotlin.takeIf' call
|
|
1766
|
+
var tmp_0;
|
|
1767
|
+
if (tmp1_safe_receiver.cu() === 'r') {
|
|
1768
|
+
tmp_0 = tmp1_safe_receiver;
|
|
1769
|
+
} else {
|
|
1770
|
+
tmp_0 = null;
|
|
1771
|
+
}
|
|
1772
|
+
tmp = tmp_0;
|
|
1773
|
+
}
|
|
1774
|
+
var variable = tmp;
|
|
1775
|
+
var tmp_1;
|
|
1776
|
+
var tmp_2;
|
|
1777
|
+
if (s instanceof Switch) {
|
|
1778
|
+
tmp_2 = !(variable == null);
|
|
1779
|
+
} else {
|
|
1780
|
+
tmp_2 = false;
|
|
1781
|
+
}
|
|
1782
|
+
if (tmp_2) {
|
|
1783
|
+
var tmp_3 = t.z18(s.zy_1);
|
|
1784
|
+
// Inline function 'kotlin.collections.map' call
|
|
1785
|
+
var this_0 = s.az_1;
|
|
1786
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1787
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1788
|
+
var _iterator__ex2g4s = this_0.t();
|
|
1789
|
+
while (_iterator__ex2g4s.u()) {
|
|
1790
|
+
var item = _iterator__ex2g4s.v();
|
|
1791
|
+
var tmp$ret$4 = matchingResponse(item, variable, t);
|
|
1792
|
+
destination.x(tmp$ret$4);
|
|
1793
|
+
}
|
|
1794
|
+
tmp_1 = s.ez(tmp_3, destination, null);
|
|
1795
|
+
} else {
|
|
1796
|
+
tmp_1 = transformChildren(s, t);
|
|
1905
1797
|
}
|
|
1906
|
-
|
|
1907
|
-
return s.az(t.v18(s.vy_1), transformedCases, null);
|
|
1798
|
+
return tmp_1;
|
|
1908
1799
|
}
|
|
1909
1800
|
function replaceStructWithRefinedFunctions$lambda($refined) {
|
|
1910
1801
|
return function (element, transformer) {
|
|
1911
1802
|
var tmp;
|
|
1912
1803
|
if (element instanceof Struct) {
|
|
1913
|
-
tmp = element.
|
|
1804
|
+
tmp = element.qx(VOID, VOID, VOID, VOID, listOf_0([validateFunction($refined), toStringFunction($refined)]));
|
|
1914
1805
|
} else {
|
|
1915
1806
|
tmp = element;
|
|
1916
1807
|
}
|
|
1917
1808
|
var transformed = tmp;
|
|
1918
|
-
return
|
|
1809
|
+
return transformChildren_2(transformed, transformer);
|
|
1919
1810
|
};
|
|
1920
1811
|
}
|
|
1921
1812
|
function injectApiStruct$lambda($endpoint) {
|
|
1922
1813
|
return function (element, transformer) {
|
|
1923
1814
|
var tmp;
|
|
1924
1815
|
if (element instanceof Namespace) {
|
|
1925
|
-
tmp = element.
|
|
1816
|
+
tmp = element.qv(VOID, plus_0(element.mv_1, new RawElement(apiStruct($endpoint))));
|
|
1926
1817
|
} else {
|
|
1927
1818
|
tmp = element;
|
|
1928
1819
|
}
|
|
1929
1820
|
var transformed = tmp;
|
|
1930
|
-
return
|
|
1821
|
+
return transformChildren_2(transformed, transformer);
|
|
1931
1822
|
};
|
|
1932
1823
|
}
|
|
1933
1824
|
function injectResponseFromImpls$lambda(element, transformer) {
|
|
@@ -1935,96 +1826,85 @@ function injectResponseFromImpls$lambda(element, transformer) {
|
|
|
1935
1826
|
var tmp;
|
|
1936
1827
|
if (element instanceof File) {
|
|
1937
1828
|
// Inline function 'kotlin.collections.flatMap' call
|
|
1938
|
-
var tmp0 = element.
|
|
1829
|
+
var tmp0 = element.gv_1;
|
|
1939
1830
|
// Inline function 'kotlin.collections.flatMapTo' call
|
|
1940
|
-
var destination = ArrayList_init_$Create$
|
|
1831
|
+
var destination = ArrayList_init_$Create$();
|
|
1941
1832
|
var _iterator__ex2g4s = tmp0.t();
|
|
1942
1833
|
while (_iterator__ex2g4s.u()) {
|
|
1943
1834
|
var element_0 = _iterator__ex2g4s.v();
|
|
1944
|
-
var tmp_0;
|
|
1835
|
+
var tmp_0 = listOf(element_0);
|
|
1945
1836
|
var tmp_1;
|
|
1946
1837
|
var tmp_2;
|
|
1947
1838
|
if (element_0 instanceof Union_0) {
|
|
1948
|
-
tmp_2 = element_0.
|
|
1839
|
+
tmp_2 = element_0.lw_1.du() === 'Response';
|
|
1949
1840
|
} else {
|
|
1950
1841
|
tmp_2 = false;
|
|
1951
1842
|
}
|
|
1952
1843
|
if (tmp_2) {
|
|
1953
|
-
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1954
|
-
tmp_1 = !element_0.jw_1.r();
|
|
1955
|
-
} else {
|
|
1956
|
-
tmp_1 = false;
|
|
1957
|
-
}
|
|
1958
|
-
if (tmp_1) {
|
|
1959
|
-
var tmp_3 = listOf(element_0);
|
|
1960
1844
|
// Inline function 'kotlin.collections.map' call
|
|
1961
|
-
var this_0 = element_0.
|
|
1845
|
+
var this_0 = element_0.nw_1;
|
|
1962
1846
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1963
|
-
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1847
|
+
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1964
1848
|
var _iterator__ex2g4s_0 = this_0.t();
|
|
1965
1849
|
while (_iterator__ex2g4s_0.u()) {
|
|
1966
1850
|
var item = _iterator__ex2g4s_0.v();
|
|
1967
|
-
var memberName = item.
|
|
1968
|
-
var tmp$ret$
|
|
1969
|
-
destination_0.x(tmp$ret$
|
|
1851
|
+
var memberName = item.ru_1.du();
|
|
1852
|
+
var tmp$ret$6 = new RawElement('impl From<' + memberName + '> for Response { fn from(value: ' + memberName + ') -> Self { Response::' + memberName + '(value) } }\n');
|
|
1853
|
+
destination_0.x(tmp$ret$6);
|
|
1970
1854
|
}
|
|
1971
|
-
|
|
1855
|
+
tmp_1 = destination_0;
|
|
1972
1856
|
} else {
|
|
1973
|
-
|
|
1857
|
+
tmp_1 = emptyList();
|
|
1974
1858
|
}
|
|
1975
|
-
var list = tmp_0;
|
|
1859
|
+
var list = plus(tmp_0, tmp_1);
|
|
1976
1860
|
addAll(destination, list);
|
|
1977
1861
|
}
|
|
1978
|
-
tmp = element.
|
|
1862
|
+
tmp = element.jv(VOID, destination);
|
|
1979
1863
|
} else {
|
|
1980
1864
|
tmp = element;
|
|
1981
1865
|
}
|
|
1982
1866
|
var transformed = tmp;
|
|
1983
|
-
return
|
|
1867
|
+
return transformChildren_2(transformed, transformer);
|
|
1984
1868
|
}
|
|
1985
1869
|
function injectHandlerImplForClient$lambda(element, transformer) {
|
|
1986
1870
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
1987
1871
|
var tmp;
|
|
1988
1872
|
if (element instanceof Namespace) {
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
destination.x(element_0);
|
|
2000
|
-
}
|
|
1873
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.findElement' call
|
|
1874
|
+
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
1875
|
+
var tmp0 = element.hv();
|
|
1876
|
+
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
1877
|
+
var destination = ArrayList_init_$Create$();
|
|
1878
|
+
var _iterator__ex2g4s = tmp0.t();
|
|
1879
|
+
while (_iterator__ex2g4s.u()) {
|
|
1880
|
+
var element_0 = _iterator__ex2g4s.v();
|
|
1881
|
+
if (element_0 instanceof Interface) {
|
|
1882
|
+
destination.x(element_0);
|
|
2001
1883
|
}
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
1884
|
+
}
|
|
1885
|
+
var tmp$ret$4;
|
|
1886
|
+
$l$block: {
|
|
1887
|
+
// Inline function 'kotlin.collections.firstOrNull' call
|
|
1888
|
+
var _iterator__ex2g4s_0 = destination.t();
|
|
1889
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
1890
|
+
var element_1 = _iterator__ex2g4s_0.v();
|
|
1891
|
+
if (element_1.rv_1.equals(Companion_getInstance().au('Handler'))) {
|
|
1892
|
+
tmp$ret$4 = element_1;
|
|
1893
|
+
break $l$block;
|
|
2012
1894
|
}
|
|
2013
|
-
tmp$ret$3 = null;
|
|
2014
|
-
}
|
|
2015
|
-
var tmp0_elvis_lhs = tmp$ret$3;
|
|
2016
|
-
var tmp_0;
|
|
2017
|
-
if (tmp0_elvis_lhs == null) {
|
|
2018
|
-
tmp$ret$0 = element;
|
|
2019
|
-
break $l$block_1;
|
|
2020
|
-
} else {
|
|
2021
|
-
tmp_0 = tmp0_elvis_lhs;
|
|
2022
1895
|
}
|
|
2023
|
-
|
|
1896
|
+
tmp$ret$4 = null;
|
|
1897
|
+
}
|
|
1898
|
+
var tmp0_safe_receiver = tmp$ret$4;
|
|
1899
|
+
var tmp_0;
|
|
1900
|
+
if (tmp0_safe_receiver == null) {
|
|
1901
|
+
tmp_0 = null;
|
|
1902
|
+
} else {
|
|
1903
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.findElement' call
|
|
2024
1904
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
2025
|
-
var tmp0_0 =
|
|
1905
|
+
var tmp0_0 = tmp0_safe_receiver.hv();
|
|
2026
1906
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
2027
|
-
var destination_0 = ArrayList_init_$Create$
|
|
1907
|
+
var destination_0 = ArrayList_init_$Create$();
|
|
2028
1908
|
var _iterator__ex2g4s_1 = tmp0_0.t();
|
|
2029
1909
|
while (_iterator__ex2g4s_1.u()) {
|
|
2030
1910
|
var element_2 = _iterator__ex2g4s_1.v();
|
|
@@ -2032,67 +1912,23 @@ function injectHandlerImplForClient$lambda(element, transformer) {
|
|
|
2032
1912
|
destination_0.x(element_2);
|
|
2033
1913
|
}
|
|
2034
1914
|
}
|
|
2035
|
-
|
|
2036
|
-
var tmp_1;
|
|
2037
|
-
if (tmp1_elvis_lhs == null) {
|
|
2038
|
-
tmp$ret$0 = element;
|
|
2039
|
-
break $l$block_1;
|
|
2040
|
-
} else {
|
|
2041
|
-
tmp_1 = tmp1_elvis_lhs;
|
|
2042
|
-
}
|
|
2043
|
-
var method = tmp_1;
|
|
2044
|
-
var methodName = method.nx_1.au();
|
|
2045
|
-
tmp$ret$0 = element.mv(VOID, plus(element.iv_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 ')))));
|
|
1915
|
+
tmp_0 = firstOrNull(destination_0);
|
|
2046
1916
|
}
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
}
|
|
2054
|
-
function injectSelfToHandlerMethods$lambda(element, transformer) {
|
|
2055
|
-
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
2056
|
-
var tmp;
|
|
2057
|
-
if (element instanceof Interface) {
|
|
2058
|
-
var tmp$ret$0;
|
|
2059
|
-
$l$block: {
|
|
2060
|
-
if (!element.nv_1.equals(Companion_getInstance().wt('Handler')) && !element.nv_1.equals(Companion_getInstance().wt('Call'))) {
|
|
2061
|
-
tmp$ret$0 = element;
|
|
2062
|
-
break $l$block;
|
|
2063
|
-
}
|
|
2064
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
2065
|
-
var scope = new TransformScope(element);
|
|
2066
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.matchingElements' call
|
|
2067
|
-
var tmp_0 = scope;
|
|
2068
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
|
|
2069
|
-
var this_0 = scope.a19_1;
|
|
2070
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
2071
|
-
// Inline function 'kotlin.apply' call
|
|
2072
|
-
var this_1 = new TransformerBuilder();
|
|
2073
|
-
this_1.u19(injectSelfToHandlerMethods$lambda$lambda);
|
|
2074
|
-
var tmp$ret$5 = this_1.p19();
|
|
2075
|
-
tmp_0.a19_1 = transform(this_0, tmp$ret$5);
|
|
2076
|
-
var tmp_1 = scope.a19_1;
|
|
2077
|
-
tmp$ret$0 = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
1917
|
+
var tmp1_safe_receiver = tmp_0;
|
|
1918
|
+
var tmp_1;
|
|
1919
|
+
if (tmp1_safe_receiver == null) {
|
|
1920
|
+
tmp_1 = null;
|
|
1921
|
+
} else {
|
|
1922
|
+
// Inline function 'kotlin.let' call
|
|
1923
|
+
tmp_1 = element.qv(VOID, plus_0(element.mv_1, new RawElement(trimIndent('\n impl<C: Client> Handler for C {\n async fn ' + tmp1_safe_receiver.rx_1.eu() + '(&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 '))));
|
|
2078
1924
|
}
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
tmp = element;
|
|
2082
|
-
}
|
|
2083
|
-
var transformed = tmp;
|
|
2084
|
-
return transformChildren_0(transformed, transformer);
|
|
2085
|
-
}
|
|
2086
|
-
function injectSelfToHandlerMethods$lambda$lambda(element, transformer) {
|
|
2087
|
-
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
2088
|
-
var tmp;
|
|
2089
|
-
if (element instanceof Function_0) {
|
|
2090
|
-
tmp = element.zx(Companion_getInstance().wt(element.nx_1.au()), VOID, plus(listOf(get_rustSelfParam()), element.px_1));
|
|
1925
|
+
var tmp2_elvis_lhs = tmp_1;
|
|
1926
|
+
tmp = tmp2_elvis_lhs == null ? element : tmp2_elvis_lhs;
|
|
2091
1927
|
} else {
|
|
2092
1928
|
tmp = element;
|
|
2093
1929
|
}
|
|
2094
1930
|
var transformed = tmp;
|
|
2095
|
-
return
|
|
1931
|
+
return transformChildren_2(transformed, transformer);
|
|
2096
1932
|
}
|
|
2097
1933
|
function stripResponseGenerics$lambda(type, transformer) {
|
|
2098
1934
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
@@ -2100,14 +1936,14 @@ function stripResponseGenerics$lambda(type, transformer) {
|
|
|
2100
1936
|
if (type instanceof Custom) {
|
|
2101
1937
|
var tmp_0;
|
|
2102
1938
|
var tmp_1;
|
|
2103
|
-
if (startsWith(type.
|
|
1939
|
+
if (startsWith(type.ru_1.du(), 'Response')) {
|
|
2104
1940
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
2105
|
-
tmp_1 = !type.
|
|
1941
|
+
tmp_1 = !type.su_1.r();
|
|
2106
1942
|
} else {
|
|
2107
1943
|
tmp_1 = false;
|
|
2108
1944
|
}
|
|
2109
1945
|
if (tmp_1) {
|
|
2110
|
-
tmp_0 = type.
|
|
1946
|
+
tmp_0 = type.uu(VOID, emptyList());
|
|
2111
1947
|
} else {
|
|
2112
1948
|
tmp_0 = type;
|
|
2113
1949
|
}
|
|
@@ -2116,36 +1952,30 @@ function stripResponseGenerics$lambda(type, transformer) {
|
|
|
2116
1952
|
tmp = type;
|
|
2117
1953
|
}
|
|
2118
1954
|
var transformed = tmp;
|
|
2119
|
-
return
|
|
1955
|
+
return transformChildren_3(transformed, transformer);
|
|
2120
1956
|
}
|
|
2121
|
-
function
|
|
1957
|
+
function rustHandlerTraits$lambda(element, transformer) {
|
|
2122
1958
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
2123
1959
|
var tmp;
|
|
2124
1960
|
if (element instanceof Interface) {
|
|
2125
|
-
tmp = element.
|
|
1961
|
+
tmp = element.rv_1.equals(Companion_getInstance().au('Handler')) || element.rv_1.equals(Companion_getInstance().au('Call')) ? withSelfReceivers(element.zv(VOID, VOID, emptyList())) : element;
|
|
2126
1962
|
} else {
|
|
2127
1963
|
tmp = element;
|
|
2128
1964
|
}
|
|
2129
1965
|
var transformed = tmp;
|
|
2130
|
-
return
|
|
1966
|
+
return transformChildren_2(transformed, transformer);
|
|
2131
1967
|
}
|
|
2132
1968
|
function convertSimpleRawExpressionsToVariableRefs$lambda($identifierPattern) {
|
|
2133
1969
|
return function (s, t) {
|
|
2134
1970
|
var tmp;
|
|
2135
1971
|
var tmp_0;
|
|
2136
|
-
var tmp_1;
|
|
2137
1972
|
if (s instanceof RawExpression) {
|
|
2138
|
-
|
|
2139
|
-
} else {
|
|
2140
|
-
tmp_1 = false;
|
|
2141
|
-
}
|
|
2142
|
-
if (tmp_1) {
|
|
2143
|
-
tmp_0 = !contains(s.cy_1, '.');
|
|
1973
|
+
tmp_0 = $identifierPattern.sc(s.gy_1);
|
|
2144
1974
|
} else {
|
|
2145
1975
|
tmp_0 = false;
|
|
2146
1976
|
}
|
|
2147
1977
|
if (tmp_0) {
|
|
2148
|
-
tmp = new VariableReference(Companion_getInstance().
|
|
1978
|
+
tmp = new VariableReference(Companion_getInstance().au(s.gy_1));
|
|
2149
1979
|
} else {
|
|
2150
1980
|
tmp = transformChildren(s, t);
|
|
2151
1981
|
}
|
|
@@ -2156,67 +1986,85 @@ function stripWirespecPrefix$lambda(type, transformer) {
|
|
|
2156
1986
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
2157
1987
|
var tmp;
|
|
2158
1988
|
if (type instanceof Custom) {
|
|
2159
|
-
var pascalName = type.
|
|
2160
|
-
|
|
2161
|
-
if (startsWith(pascalName, 'Wirespec.')) {
|
|
2162
|
-
tmp_0 = type.qu(Companion_getInstance().wt(removePrefix(pascalName, 'Wirespec.')));
|
|
2163
|
-
} else {
|
|
2164
|
-
tmp_0 = type;
|
|
2165
|
-
}
|
|
2166
|
-
tmp = tmp_0;
|
|
1989
|
+
var pascalName = type.ru_1.du();
|
|
1990
|
+
tmp = startsWith(pascalName, 'Wirespec.') ? type.uu(Companion_getInstance().au(removePrefix(pascalName, 'Wirespec.'))) : type;
|
|
2167
1991
|
} else {
|
|
2168
1992
|
tmp = type;
|
|
2169
1993
|
}
|
|
2170
1994
|
var transformed = tmp;
|
|
2171
|
-
return
|
|
1995
|
+
return transformChildren_3(transformed, transformer);
|
|
2172
1996
|
}
|
|
2173
1997
|
function fixConstructorCalls$lambda(s, t) {
|
|
2174
1998
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
var
|
|
2178
|
-
var
|
|
2179
|
-
var
|
|
2180
|
-
var
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
1999
|
+
var tmp0_safe_receiver = s instanceof ConstructorStatement ? s : null;
|
|
2000
|
+
var tmp = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gu_1;
|
|
2001
|
+
var tmp1_safe_receiver = tmp instanceof Custom ? tmp : null;
|
|
2002
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.ru_1;
|
|
2003
|
+
var typeName = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.du();
|
|
2004
|
+
var tmp_0;
|
|
2005
|
+
var tmp_1;
|
|
2006
|
+
if (!(s instanceof ConstructorStatement)) {
|
|
2007
|
+
tmp_1 = true;
|
|
2008
|
+
} else {
|
|
2009
|
+
tmp_1 = typeName == null;
|
|
2010
|
+
}
|
|
2011
|
+
if (tmp_1) {
|
|
2012
|
+
tmp_0 = transformChildren(s, t);
|
|
2013
|
+
} else {
|
|
2014
|
+
if (get_rustResponsePattern().sc(typeName)) {
|
|
2015
|
+
tmp_0 = new FunctionCall(VOID, VOID, new Name(listOf('Response::' + typeName)), mapOf_0(to(Companion_getInstance().au('inner'), new FunctionCall(VOID, VOID, new Name(listOf(typeName + '::new')), transformedArguments(s, t)))));
|
|
2016
|
+
} else {
|
|
2017
|
+
if (typeName === 'Request') {
|
|
2018
|
+
tmp_0 = new FunctionCall(VOID, VOID, new Name(listOf('Request::new')), transformedArguments(s, t));
|
|
2019
|
+
} else {
|
|
2020
|
+
tmp_0 = transformChildren(s, t);
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2192
2023
|
}
|
|
2193
|
-
|
|
2194
|
-
|
|
2024
|
+
return tmp_0;
|
|
2025
|
+
}
|
|
2026
|
+
function rustName$lambda(it) {
|
|
2027
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
2028
|
+
return rustName(it);
|
|
2195
2029
|
}
|
|
2196
|
-
function
|
|
2030
|
+
function rustName$lambda_0(it) {
|
|
2031
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
2032
|
+
return rustName(it);
|
|
2033
|
+
}
|
|
2034
|
+
function toRawCode$lambda(it) {
|
|
2035
|
+
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
2036
|
+
return it.n1().eu() + ': ' + toRawCode(it.o1());
|
|
2037
|
+
}
|
|
2038
|
+
function validateFunction$lambda($this_validateFunction) {
|
|
2197
2039
|
return function ($this$function) {
|
|
2198
|
-
$this$function.
|
|
2199
|
-
$this$function.
|
|
2200
|
-
$this$function.
|
|
2040
|
+
$this$function.a14('&self', Custom_init_$Create$(''));
|
|
2041
|
+
$this$function.x13(Boolean_instance);
|
|
2042
|
+
$this$function.d14(convertConstraint($this_validateFunction.ns_1, new FieldCall(new VariableReference(Companion_getInstance().au('self')), Companion_getInstance().au('value'))));
|
|
2201
2043
|
return Unit_instance;
|
|
2202
2044
|
};
|
|
2203
2045
|
}
|
|
2204
|
-
function
|
|
2046
|
+
function toStringFunction$lambda($this_toStringFunction) {
|
|
2205
2047
|
return function ($this$function) {
|
|
2206
|
-
$this$function.
|
|
2207
|
-
$this$function.
|
|
2208
|
-
|
|
2048
|
+
$this$function.a14('&self', Custom_init_$Create$(''));
|
|
2049
|
+
$this$function.x13(String_instance);
|
|
2050
|
+
var tmp;
|
|
2051
|
+
if ($this_toStringFunction.ns_1.d1a_1 instanceof String_1) {
|
|
2052
|
+
tmp = 'self.value.clone()';
|
|
2053
|
+
} else {
|
|
2054
|
+
tmp = 'format!("{}", self.value)';
|
|
2055
|
+
}
|
|
2056
|
+
$this$function.d14(new RawExpression(tmp));
|
|
2209
2057
|
return Unit_instance;
|
|
2210
2058
|
};
|
|
2211
2059
|
}
|
|
2212
|
-
function
|
|
2060
|
+
function apiStruct$lambda(segment) {
|
|
2213
2061
|
_init_properties_RustIrTransformer_kt__rrvmwq();
|
|
2214
2062
|
var tmp;
|
|
2215
|
-
if (segment instanceof
|
|
2216
|
-
tmp = segment.
|
|
2063
|
+
if (segment instanceof Literal_0) {
|
|
2064
|
+
tmp = segment.e1b_1;
|
|
2217
2065
|
} else {
|
|
2218
2066
|
if (segment instanceof Param) {
|
|
2219
|
-
tmp = '{' + segment.
|
|
2067
|
+
tmp = '{' + segment.nr_1.o1() + '}';
|
|
2220
2068
|
} else {
|
|
2221
2069
|
noWhenBranchMatchedException();
|
|
2222
2070
|
}
|
|
@@ -2227,490 +2075,27 @@ var properties_initialized_RustIrTransformer_kt_hr6k9w;
|
|
|
2227
2075
|
function _init_properties_RustIrTransformer_kt__rrvmwq() {
|
|
2228
2076
|
if (!properties_initialized_RustIrTransformer_kt_hr6k9w) {
|
|
2229
2077
|
properties_initialized_RustIrTransformer_kt_hr6k9w = true;
|
|
2230
|
-
rustSelfParam = new Parameter(Companion_getInstance().
|
|
2078
|
+
rustSelfParam = new Parameter(Companion_getInstance().au('&self'), Custom_init_$Create$(''));
|
|
2231
2079
|
rustResponsePattern = Regex_init_$Create$('Response(\\d+|Default)');
|
|
2080
|
+
serializerTraits = setOf(['Serializer', 'Deserializer']);
|
|
2081
|
+
serializationFunctions = setOf(['serialize_path', 'serialize_param', 'serialize_body', 'deserialize_path', 'deserialize_param', 'deserialize_body']);
|
|
2082
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
2083
|
+
// Inline function 'kotlin.apply' call
|
|
2084
|
+
var this_0 = new TransformerBuilder();
|
|
2085
|
+
this_0.y19(borrowParameters$lambda);
|
|
2086
|
+
borrowParameters = this_0.t19();
|
|
2087
|
+
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
2088
|
+
// Inline function 'kotlin.apply' call
|
|
2089
|
+
var this_1 = new TransformerBuilder();
|
|
2090
|
+
this_1.w19(borrowSerializationArguments$lambda);
|
|
2091
|
+
borrowSerializationArguments = this_1.t19();
|
|
2232
2092
|
}
|
|
2233
2093
|
}
|
|
2234
|
-
function borrowParamsOf($this, fn) {
|
|
2235
|
-
// Inline function 'kotlin.collections.map' call
|
|
2236
|
-
var this_0 = fn.px_1;
|
|
2237
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
2238
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2239
|
-
var _iterator__ex2g4s = this_0.t();
|
|
2240
|
-
while (_iterator__ex2g4s.u()) {
|
|
2241
|
-
var item = _iterator__ex2g4s.v();
|
|
2242
|
-
var tmp;
|
|
2243
|
-
if (RustTransform_getInstance().x38(item.kz_1)) {
|
|
2244
|
-
tmp = item;
|
|
2245
|
-
} else {
|
|
2246
|
-
tmp = item.oz(VOID, applyBorrowRule(RustTransform_getInstance(), item.lz_1));
|
|
2247
|
-
}
|
|
2248
|
-
var tmp$ret$2 = tmp;
|
|
2249
|
-
destination.x(tmp$ret$2);
|
|
2250
|
-
}
|
|
2251
|
-
return fn.zx(VOID, VOID, destination);
|
|
2252
|
-
}
|
|
2253
|
-
function applyBorrowRule($this, type) {
|
|
2254
|
-
var tmp;
|
|
2255
|
-
if (type instanceof Nullable) {
|
|
2256
|
-
tmp = new Nullable(applyBorrowRule($this, type.ru_1));
|
|
2257
|
-
} else {
|
|
2258
|
-
if (equals(type, String_instance)) {
|
|
2259
|
-
tmp = Custom_init_$Create$('&str');
|
|
2260
|
-
} else {
|
|
2261
|
-
if (type instanceof Custom) {
|
|
2262
|
-
tmp = $this.a39(type) ? type : $this.z38(type) ? borrowImpl(type) : $this.y38(type) ? ownedImpl(type) : type;
|
|
2263
|
-
} else {
|
|
2264
|
-
tmp = type;
|
|
2265
|
-
}
|
|
2266
|
-
}
|
|
2267
|
-
}
|
|
2268
|
-
return tmp;
|
|
2269
|
-
}
|
|
2270
|
-
function toBorrowedRaw($this, $receiver) {
|
|
2271
|
-
return new RawExpression('&' + toRawCode($this, $receiver));
|
|
2272
|
-
}
|
|
2273
|
-
function sanitizeKeywords_0($this, $receiver) {
|
|
2274
|
-
return Companion_getInstance_0().i37().i1($receiver) ? 'r#' + $receiver : $receiver;
|
|
2275
|
-
}
|
|
2276
|
-
function toRawCode($this, $receiver) {
|
|
2277
|
-
var tmp;
|
|
2278
|
-
if ($receiver instanceof VariableReference) {
|
|
2279
|
-
tmp = sanitizeKeywords_0($this, $receiver.av_1.au());
|
|
2280
|
-
} else {
|
|
2281
|
-
if ($receiver instanceof FieldCall) {
|
|
2282
|
-
var tmp1_safe_receiver = $receiver.gz_1;
|
|
2283
|
-
var tmp_0;
|
|
2284
|
-
if (tmp1_safe_receiver == null) {
|
|
2285
|
-
tmp_0 = null;
|
|
2286
|
-
} else {
|
|
2287
|
-
// Inline function 'kotlin.let' call
|
|
2288
|
-
tmp_0 = toRawCode(RustTransform_getInstance(), tmp1_safe_receiver) + '.';
|
|
2289
|
-
}
|
|
2290
|
-
var tmp2_elvis_lhs = tmp_0;
|
|
2291
|
-
var recv = tmp2_elvis_lhs == null ? '' : tmp2_elvis_lhs;
|
|
2292
|
-
tmp = recv + sanitizeKeywords_0($this, $receiver.hz_1.au());
|
|
2293
|
-
} else {
|
|
2294
|
-
if ($receiver instanceof ArrayIndexCall) {
|
|
2295
|
-
var tmp_1 = $receiver.yz_1;
|
|
2296
|
-
var lit = tmp_1 instanceof Literal_0 ? tmp_1 : null;
|
|
2297
|
-
var tmp_2;
|
|
2298
|
-
var tmp_3;
|
|
2299
|
-
if (!(lit == null)) {
|
|
2300
|
-
var tmp_4;
|
|
2301
|
-
var tmp_5 = lit.sy_1;
|
|
2302
|
-
if (tmp_5 instanceof Integer) {
|
|
2303
|
-
tmp_4 = true;
|
|
2304
|
-
} else {
|
|
2305
|
-
var tmp_6 = lit.sy_1;
|
|
2306
|
-
tmp_4 = tmp_6 instanceof Number_0;
|
|
2307
|
-
}
|
|
2308
|
-
tmp_3 = tmp_4;
|
|
2309
|
-
} else {
|
|
2310
|
-
tmp_3 = false;
|
|
2311
|
-
}
|
|
2312
|
-
if (tmp_3) {
|
|
2313
|
-
tmp_2 = toString_0(lit.ry_1);
|
|
2314
|
-
} else {
|
|
2315
|
-
var tmp_7;
|
|
2316
|
-
if (!(lit == null)) {
|
|
2317
|
-
var tmp_8 = lit.sy_1;
|
|
2318
|
-
tmp_7 = tmp_8 instanceof String_1;
|
|
2319
|
-
} else {
|
|
2320
|
-
tmp_7 = false;
|
|
2321
|
-
}
|
|
2322
|
-
if (tmp_7) {
|
|
2323
|
-
tmp_2 = '"' + toString_0(lit.ry_1) + '"';
|
|
2324
|
-
} else {
|
|
2325
|
-
tmp_2 = toRawCode($this, $receiver.yz_1);
|
|
2326
|
-
}
|
|
2327
|
-
}
|
|
2328
|
-
var idx = tmp_2;
|
|
2329
|
-
tmp = toRawCode($this, $receiver.xz_1) + '[' + idx + ']';
|
|
2330
|
-
} else {
|
|
2331
|
-
if ($receiver instanceof ConstructorStatement) {
|
|
2332
|
-
var tmp_9 = $receiver.cu_1;
|
|
2333
|
-
var tmp3_safe_receiver = tmp_9 instanceof Custom ? tmp_9 : null;
|
|
2334
|
-
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.nu_1;
|
|
2335
|
-
var tmp5_elvis_lhs = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.zt();
|
|
2336
|
-
var typeName = tmp5_elvis_lhs == null ? toString_0($receiver.cu_1) : tmp5_elvis_lhs;
|
|
2337
|
-
var tmp_10 = $receiver.du_1.m1();
|
|
2338
|
-
var args = joinToString(tmp_10, ', ', VOID, VOID, VOID, VOID, RustTransform$toRawCode$lambda);
|
|
2339
|
-
var tmp_11;
|
|
2340
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
2341
|
-
if (charSequenceLength(args) === 0) {
|
|
2342
|
-
tmp_11 = typeName + ' {}';
|
|
2343
|
-
} else {
|
|
2344
|
-
tmp_11 = typeName + ' { ' + args + ' }';
|
|
2345
|
-
}
|
|
2346
|
-
tmp = tmp_11;
|
|
2347
|
-
} else {
|
|
2348
|
-
if ($receiver instanceof Literal_0) {
|
|
2349
|
-
var tmp_12;
|
|
2350
|
-
var tmp_13 = $receiver.sy_1;
|
|
2351
|
-
if (tmp_13 instanceof String_1) {
|
|
2352
|
-
tmp_12 = 'String::from("' + toString_0($receiver.ry_1) + '")';
|
|
2353
|
-
} else {
|
|
2354
|
-
var tmp_14 = $receiver.sy_1;
|
|
2355
|
-
if (tmp_14 instanceof Boolean_0) {
|
|
2356
|
-
tmp_12 = toString_0($receiver.ry_1);
|
|
2357
|
-
} else {
|
|
2358
|
-
var tmp_15 = $receiver.sy_1;
|
|
2359
|
-
if (tmp_15 instanceof Integer) {
|
|
2360
|
-
tmp_12 = toString_0($receiver.ry_1);
|
|
2361
|
-
} else {
|
|
2362
|
-
var tmp_16 = $receiver.sy_1;
|
|
2363
|
-
if (tmp_16 instanceof Number_0) {
|
|
2364
|
-
tmp_12 = toString_0($receiver.ry_1);
|
|
2365
|
-
} else {
|
|
2366
|
-
tmp_12 = toString_0($receiver.ry_1);
|
|
2367
|
-
}
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
}
|
|
2371
|
-
tmp = tmp_12;
|
|
2372
|
-
} else {
|
|
2373
|
-
if ($receiver instanceof RawExpression) {
|
|
2374
|
-
tmp = $receiver.cy_1;
|
|
2375
|
-
} else {
|
|
2376
|
-
// Inline function 'kotlin.error' call
|
|
2377
|
-
var message = 'Unsupported expression type in toRawCode: ' + getKClassFromExpression($receiver).o();
|
|
2378
|
-
throw IllegalStateException_init_$Create$(toString_0(message));
|
|
2379
|
-
}
|
|
2380
|
-
}
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
}
|
|
2384
|
-
}
|
|
2385
|
-
return tmp;
|
|
2386
|
-
}
|
|
2387
|
-
function RustTransform$primitivesToCustom$lambda(t, tr) {
|
|
2388
|
-
var tmp;
|
|
2389
|
-
if (equals(t, Any_instance)) {
|
|
2390
|
-
tmp = Custom_init_$Create$('Box<dyn std::any::Any>');
|
|
2391
|
-
} else {
|
|
2392
|
-
if (equals(t, Bytes_instance)) {
|
|
2393
|
-
tmp = Custom_init_$Create$('Vec<u8>');
|
|
2394
|
-
} else {
|
|
2395
|
-
if (equals(t, Reflect_instance)) {
|
|
2396
|
-
tmp = Custom_init_$Create$('std::any::TypeId');
|
|
2397
|
-
} else {
|
|
2398
|
-
if (equals(t, Wildcard_instance)) {
|
|
2399
|
-
tmp = Custom_init_$Create$('_');
|
|
2400
|
-
} else {
|
|
2401
|
-
if (t instanceof IntegerLiteral) {
|
|
2402
|
-
tmp = Custom_init_$Create$('i32');
|
|
2403
|
-
} else {
|
|
2404
|
-
if (t instanceof StringLiteral) {
|
|
2405
|
-
tmp = Custom_init_$Create$('String');
|
|
2406
|
-
} else {
|
|
2407
|
-
tmp = transformChildren_2(t, tr);
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
}
|
|
2411
|
-
}
|
|
2412
|
-
}
|
|
2413
|
-
}
|
|
2414
|
-
return tmp;
|
|
2415
|
-
}
|
|
2416
|
-
function RustTransform$borrow$lambda(element, tr) {
|
|
2417
|
-
var tmp;
|
|
2418
|
-
if (element instanceof Interface) {
|
|
2419
|
-
var tmp_0;
|
|
2420
|
-
if (element.nv_1.equals(Companion_getInstance().wt('Call'))) {
|
|
2421
|
-
tmp_0 = element;
|
|
2422
|
-
} else {
|
|
2423
|
-
// Inline function 'kotlin.collections.map' call
|
|
2424
|
-
var this_0 = element.ov_1;
|
|
2425
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
2426
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2427
|
-
var _iterator__ex2g4s = this_0.t();
|
|
2428
|
-
while (_iterator__ex2g4s.u()) {
|
|
2429
|
-
var item = _iterator__ex2g4s.v();
|
|
2430
|
-
var tmp_1;
|
|
2431
|
-
if (item instanceof Function_0) {
|
|
2432
|
-
tmp_1 = borrowParamsOf(RustTransform_getInstance(), item);
|
|
2433
|
-
} else {
|
|
2434
|
-
tmp_1 = item;
|
|
2435
|
-
}
|
|
2436
|
-
var tmp$ret$2 = tmp_1;
|
|
2437
|
-
destination.x(tmp$ret$2);
|
|
2438
|
-
}
|
|
2439
|
-
var borrowed = destination;
|
|
2440
|
-
tmp_0 = transformChildren_0(element.vv(VOID, borrowed), tr);
|
|
2441
|
-
}
|
|
2442
|
-
tmp = tmp_0;
|
|
2443
|
-
} else {
|
|
2444
|
-
if (element instanceof Function_0) {
|
|
2445
|
-
tmp = transformChildren_0(borrowParamsOf(RustTransform_getInstance(), element), tr);
|
|
2446
|
-
} else {
|
|
2447
|
-
tmp = transformChildren_0(element, tr);
|
|
2448
|
-
}
|
|
2449
|
-
}
|
|
2450
|
-
return tmp;
|
|
2451
|
-
}
|
|
2452
|
-
function RustTransform$serializationArgs$lambda(s, t) {
|
|
2453
|
-
var tmp;
|
|
2454
|
-
var tmp_0;
|
|
2455
|
-
if (s instanceof FunctionCall) {
|
|
2456
|
-
tmp_0 = RustTransform_getInstance().t38_1.i1(s.my_1.au());
|
|
2457
|
-
} else {
|
|
2458
|
-
tmp_0 = false;
|
|
2459
|
-
}
|
|
2460
|
-
if (tmp_0) {
|
|
2461
|
-
// Inline function 'kotlin.collections.mapIndexed' call
|
|
2462
|
-
var this_0 = s.ny_1.m1();
|
|
2463
|
-
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
2464
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2465
|
-
var index = 0;
|
|
2466
|
-
var _iterator__ex2g4s = this_0.t();
|
|
2467
|
-
while (_iterator__ex2g4s.u()) {
|
|
2468
|
-
var item = _iterator__ex2g4s.v();
|
|
2469
|
-
var _unary__edvuaz = index;
|
|
2470
|
-
index = _unary__edvuaz + 1 | 0;
|
|
2471
|
-
var idx = checkIndexOverflow(_unary__edvuaz);
|
|
2472
|
-
// Inline function 'kotlin.collections.component1' call
|
|
2473
|
-
var key = item.n1();
|
|
2474
|
-
// Inline function 'kotlin.collections.component2' call
|
|
2475
|
-
var value = item.o1();
|
|
2476
|
-
var transformed = t.v18(value);
|
|
2477
|
-
var tmp_1;
|
|
2478
|
-
var tmp_2;
|
|
2479
|
-
if (idx === 0) {
|
|
2480
|
-
var tmp_3;
|
|
2481
|
-
if (transformed instanceof VariableReference) {
|
|
2482
|
-
tmp_3 = transformed.av_1.xt() === 'it';
|
|
2483
|
-
} else {
|
|
2484
|
-
tmp_3 = false;
|
|
2485
|
-
}
|
|
2486
|
-
tmp_2 = !tmp_3;
|
|
2487
|
-
} else {
|
|
2488
|
-
tmp_2 = false;
|
|
2489
|
-
}
|
|
2490
|
-
if (tmp_2) {
|
|
2491
|
-
tmp_1 = to(key, toBorrowedRaw(RustTransform_getInstance(), transformed));
|
|
2492
|
-
} else {
|
|
2493
|
-
tmp_1 = to(key, transformed);
|
|
2494
|
-
}
|
|
2495
|
-
var tmp$ret$2 = tmp_1;
|
|
2496
|
-
destination.x(tmp$ret$2);
|
|
2497
|
-
}
|
|
2498
|
-
var newArgs = toMap(destination);
|
|
2499
|
-
tmp = s.qy(VOID, VOID, VOID, newArgs);
|
|
2500
|
-
} else {
|
|
2501
|
-
tmp = transformChildren(s, t);
|
|
2502
|
-
}
|
|
2503
|
-
return tmp;
|
|
2504
|
-
}
|
|
2505
|
-
function RustTransform$rustName$lambda(it) {
|
|
2506
|
-
return RustTransform_getInstance().v38(it);
|
|
2507
|
-
}
|
|
2508
|
-
function RustTransform$rustName$lambda_0(it) {
|
|
2509
|
-
return RustTransform_getInstance().v38(it);
|
|
2510
|
-
}
|
|
2511
|
-
function RustTransform$toRawCode$lambda(it) {
|
|
2512
|
-
return it.n1().au() + ': ' + toRawCode(RustTransform_getInstance(), it.o1());
|
|
2513
|
-
}
|
|
2514
|
-
function RustTransform() {
|
|
2515
|
-
RustTransform_instance = this;
|
|
2516
|
-
var tmp = this;
|
|
2517
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
2518
|
-
// Inline function 'kotlin.apply' call
|
|
2519
|
-
var this_0 = new TransformerBuilder();
|
|
2520
|
-
this_0.g19(RustTransform$primitivesToCustom$lambda);
|
|
2521
|
-
tmp.q38_1 = this_0.p19();
|
|
2522
|
-
var tmp_0 = this;
|
|
2523
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
2524
|
-
// Inline function 'kotlin.apply' call
|
|
2525
|
-
var this_1 = new TransformerBuilder();
|
|
2526
|
-
this_1.u19(RustTransform$borrow$lambda);
|
|
2527
|
-
tmp_0.r38_1 = this_1.p19();
|
|
2528
|
-
var tmp_1 = this;
|
|
2529
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
2530
|
-
// Inline function 'kotlin.apply' call
|
|
2531
|
-
tmp_1.s38_1 = (new TransformerBuilder()).p19();
|
|
2532
|
-
this.t38_1 = setOf(['serialize_path', 'serialize_param', 'serialize_body', 'deserialize_path', 'deserialize_param', 'deserialize_body']);
|
|
2533
|
-
var tmp_2 = this;
|
|
2534
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
|
|
2535
|
-
// Inline function 'kotlin.apply' call
|
|
2536
|
-
var this_2 = new TransformerBuilder();
|
|
2537
|
-
this_2.s19(RustTransform$serializationArgs$lambda);
|
|
2538
|
-
tmp_2.u38_1 = this_2.p19();
|
|
2539
|
-
}
|
|
2540
|
-
protoOf(RustTransform).w38 = function (element) {
|
|
2541
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
2542
|
-
var scope = new TransformScope(element);
|
|
2543
|
-
scope.f19(RustTransform_getInstance().q38_1);
|
|
2544
|
-
var tmp = scope.a19_1;
|
|
2545
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
2546
|
-
var this_0 = isInterface(tmp, Element) ? tmp : THROW_CCE();
|
|
2547
|
-
var scope_0 = new TransformScope(this_0);
|
|
2548
|
-
scope_0.f19(RustTransform_getInstance().r38_1);
|
|
2549
|
-
var tmp_0 = scope_0.a19_1;
|
|
2550
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
2551
|
-
var this_1 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
|
|
2552
|
-
var scope_1 = new TransformScope(this_1);
|
|
2553
|
-
scope_1.f19(RustTransform_getInstance().s38_1);
|
|
2554
|
-
var tmp_1 = scope_1.a19_1;
|
|
2555
|
-
// Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
|
|
2556
|
-
var this_2 = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
|
|
2557
|
-
var scope_2 = new TransformScope(this_2);
|
|
2558
|
-
scope_2.f19(RustTransform_getInstance().u38_1);
|
|
2559
|
-
var tmp_2 = scope_2.a19_1;
|
|
2560
|
-
return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
|
|
2561
|
-
};
|
|
2562
|
-
protoOf(RustTransform).v38 = function (_this__u8e3s4) {
|
|
2563
|
-
var tmp;
|
|
2564
|
-
if (_this__u8e3s4 instanceof Custom) {
|
|
2565
|
-
var pascalName = _this__u8e3s4.nu_1.zt();
|
|
2566
|
-
var tmp_0;
|
|
2567
|
-
if (_this__u8e3s4.ou_1.r()) {
|
|
2568
|
-
tmp_0 = pascalName;
|
|
2569
|
-
} else {
|
|
2570
|
-
tmp_0 = pascalName + '<' + joinToString(_this__u8e3s4.ou_1, ', ', VOID, VOID, VOID, VOID, RustTransform$rustName$lambda) + '>';
|
|
2571
|
-
}
|
|
2572
|
-
tmp = tmp_0;
|
|
2573
|
-
} else {
|
|
2574
|
-
if (equals(_this__u8e3s4, String_instance)) {
|
|
2575
|
-
tmp = 'String';
|
|
2576
|
-
} else {
|
|
2577
|
-
if (_this__u8e3s4 instanceof Nullable) {
|
|
2578
|
-
tmp = 'Option<' + this.v38(_this__u8e3s4.ru_1) + '>';
|
|
2579
|
-
} else {
|
|
2580
|
-
if (_this__u8e3s4 instanceof Array_0) {
|
|
2581
|
-
tmp = 'Vec<' + this.v38(_this__u8e3s4.iu_1) + '>';
|
|
2582
|
-
} else {
|
|
2583
|
-
if (_this__u8e3s4 instanceof Dict) {
|
|
2584
|
-
tmp = 'std::collections::HashMap<' + this.v38(_this__u8e3s4.ku_1) + ', ' + this.v38(_this__u8e3s4.lu_1) + '>';
|
|
2585
|
-
} else {
|
|
2586
|
-
if (equals(_this__u8e3s4, Any_instance)) {
|
|
2587
|
-
tmp = 'Box<dyn std::any::Any>';
|
|
2588
|
-
} else {
|
|
2589
|
-
if (equals(_this__u8e3s4, Bytes_instance)) {
|
|
2590
|
-
tmp = 'Vec<u8>';
|
|
2591
|
-
} else {
|
|
2592
|
-
if (equals(_this__u8e3s4, Unit_instance_0)) {
|
|
2593
|
-
tmp = '()';
|
|
2594
|
-
} else {
|
|
2595
|
-
if (equals(_this__u8e3s4, Boolean_instance)) {
|
|
2596
|
-
tmp = 'bool';
|
|
2597
|
-
} else {
|
|
2598
|
-
if (equals(_this__u8e3s4, Wildcard_instance)) {
|
|
2599
|
-
tmp = '_';
|
|
2600
|
-
} else {
|
|
2601
|
-
if (equals(_this__u8e3s4, Reflect_instance)) {
|
|
2602
|
-
tmp = 'std::any::TypeId';
|
|
2603
|
-
} else {
|
|
2604
|
-
if (_this__u8e3s4 instanceof Integer) {
|
|
2605
|
-
var tmp_1;
|
|
2606
|
-
switch (_this__u8e3s4.gu_1.e3_1) {
|
|
2607
|
-
case 0:
|
|
2608
|
-
tmp_1 = 'i32';
|
|
2609
|
-
break;
|
|
2610
|
-
case 1:
|
|
2611
|
-
tmp_1 = 'i64';
|
|
2612
|
-
break;
|
|
2613
|
-
default:
|
|
2614
|
-
noWhenBranchMatchedException();
|
|
2615
|
-
break;
|
|
2616
|
-
}
|
|
2617
|
-
tmp = tmp_1;
|
|
2618
|
-
} else {
|
|
2619
|
-
if (_this__u8e3s4 instanceof Number_0) {
|
|
2620
|
-
var tmp_2;
|
|
2621
|
-
switch (_this__u8e3s4.hu_1.e3_1) {
|
|
2622
|
-
case 0:
|
|
2623
|
-
tmp_2 = 'f32';
|
|
2624
|
-
break;
|
|
2625
|
-
case 1:
|
|
2626
|
-
tmp_2 = 'f64';
|
|
2627
|
-
break;
|
|
2628
|
-
default:
|
|
2629
|
-
noWhenBranchMatchedException();
|
|
2630
|
-
break;
|
|
2631
|
-
}
|
|
2632
|
-
tmp = tmp_2;
|
|
2633
|
-
} else {
|
|
2634
|
-
if (_this__u8e3s4 instanceof IntegerLiteral) {
|
|
2635
|
-
tmp = 'i32';
|
|
2636
|
-
} else {
|
|
2637
|
-
if (_this__u8e3s4 instanceof StringLiteral) {
|
|
2638
|
-
tmp = 'String';
|
|
2639
|
-
} else {
|
|
2640
|
-
if (_this__u8e3s4 instanceof Function) {
|
|
2641
|
-
tmp = 'Box<dyn Fn(' + joinToString(_this__u8e3s4.uu_1, ', ', VOID, VOID, VOID, VOID, RustTransform$rustName$lambda_0) + ') -> ' + this.v38(_this__u8e3s4.vu_1) + '>';
|
|
2642
|
-
} else {
|
|
2643
|
-
noWhenBranchMatchedException();
|
|
2644
|
-
}
|
|
2645
|
-
}
|
|
2646
|
-
}
|
|
2647
|
-
}
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
}
|
|
2651
|
-
}
|
|
2652
|
-
}
|
|
2653
|
-
}
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
}
|
|
2657
|
-
}
|
|
2658
|
-
}
|
|
2659
|
-
}
|
|
2660
|
-
return tmp;
|
|
2661
|
-
};
|
|
2662
|
-
protoOf(RustTransform).a39 = function (_this__u8e3s4) {
|
|
2663
|
-
var tmp;
|
|
2664
|
-
if (_this__u8e3s4 instanceof Custom) {
|
|
2665
|
-
// Inline function 'kotlin.let' call
|
|
2666
|
-
var it = _this__u8e3s4.nu_1.zt();
|
|
2667
|
-
tmp = startsWith(it, '&') || startsWith(it, '&dyn ') || startsWith(it, '&impl ') || startsWith(it, '&mut ');
|
|
2668
|
-
} else {
|
|
2669
|
-
tmp = false;
|
|
2670
|
-
}
|
|
2671
|
-
return tmp;
|
|
2672
|
-
};
|
|
2673
|
-
protoOf(RustTransform).z38 = function (_this__u8e3s4) {
|
|
2674
|
-
// Inline function 'kotlin.let' call
|
|
2675
|
-
var it = _this__u8e3s4.nu_1.zt();
|
|
2676
|
-
return it === 'Serializer' || it === 'Deserializer';
|
|
2677
|
-
};
|
|
2678
|
-
protoOf(RustTransform).y38 = function (_this__u8e3s4) {
|
|
2679
|
-
return _this__u8e3s4.nu_1.zt() === 'GeneratorField';
|
|
2680
|
-
};
|
|
2681
|
-
protoOf(RustTransform).x38 = function (_this__u8e3s4) {
|
|
2682
|
-
var v = _this__u8e3s4.xt();
|
|
2683
|
-
switch (v) {
|
|
2684
|
-
case 'self':
|
|
2685
|
-
case '&self':
|
|
2686
|
-
return true;
|
|
2687
|
-
default:
|
|
2688
|
-
return v === '&mut self';
|
|
2689
|
-
}
|
|
2690
|
-
};
|
|
2691
|
-
var RustTransform_instance;
|
|
2692
|
-
function RustTransform_getInstance() {
|
|
2693
|
-
if (RustTransform_instance == null)
|
|
2694
|
-
new RustTransform();
|
|
2695
|
-
return RustTransform_instance;
|
|
2696
|
-
}
|
|
2697
|
-
function borrow(_this__u8e3s4) {
|
|
2698
|
-
return _this__u8e3s4.qu(new Name(listOf('&' + _this__u8e3s4.nu_1.zt())));
|
|
2699
|
-
}
|
|
2700
|
-
function borrowDyn(_this__u8e3s4) {
|
|
2701
|
-
return _this__u8e3s4.qu(new Name(listOf('&dyn ' + _this__u8e3s4.nu_1.zt())));
|
|
2702
|
-
}
|
|
2703
|
-
function borrowImpl(_this__u8e3s4) {
|
|
2704
|
-
return _this__u8e3s4.qu(new Name(listOf('&impl ' + _this__u8e3s4.nu_1.zt())));
|
|
2705
|
-
}
|
|
2706
|
-
function ownedImpl(_this__u8e3s4) {
|
|
2707
|
-
return _this__u8e3s4.qu(new Name(listOf('impl ' + _this__u8e3s4.nu_1.zt())));
|
|
2708
|
-
}
|
|
2709
2094
|
//region block: post-declaration
|
|
2710
|
-
protoOf(RustEmitter).
|
|
2711
|
-
protoOf(RustEmitter).
|
|
2712
|
-
protoOf(RustEmitter).
|
|
2713
|
-
protoOf(RustEmitter).
|
|
2095
|
+
protoOf(RustEmitter).i1b = get_extensions;
|
|
2096
|
+
protoOf(RustEmitter).uo = emit_1;
|
|
2097
|
+
protoOf(RustEmitter).k1b = beforeGenerate;
|
|
2098
|
+
protoOf(RustEmitter).wp = get_supportsDefaults;
|
|
2714
2099
|
//endregion
|
|
2715
2100
|
//region block: exports
|
|
2716
2101
|
export {
|