@flock/wirespec 0.8.37 → 0.8.39
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/{Kotlinx-Cli-Library-kotlinx-cli-js-ir.js → Kotlinx-Cli-Library-kotlinx-cli.js} +427 -379
- package/Kotlinx-Cli-Library-kotlinx-cli.js.map +1 -0
- package/arrow-arrow-atomic.js +15 -15
- package/arrow-arrow-continuations.js +3 -3
- package/arrow-arrow-core.js +86 -86
- package/kotlin-kotlin-stdlib-js-ir.js +1084 -1265
- package/kotlin-kotlin-stdlib-js-ir.js.map +1 -1
- package/kotlin-openapi-bindings.js +3627 -5777
- package/kotlin-openapi-bindings.js.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js +1478 -2508
- package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js +1182 -2319
- package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +1 -1
- package/package.json +1 -1
- package/wirespec-src-compiler-cli.js +656 -450
- package/wirespec-src-compiler-cli.js.map +1 -1
- package/wirespec-src-compiler-core.js +1450 -1782
- package/wirespec-src-compiler-core.js.map +1 -1
- package/wirespec-src-compiler-lib.js +251 -251
- package/wirespec-src-compiler-lib.js.map +1 -1
- package/wirespec-src-openapi.js +502 -502
- package/wirespec-src-openapi.js.map +1 -1
- package/Kotlinx-Cli-Library-kotlinx-cli-js-ir.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function (root, factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './Kotlinx-Cli-Library-kotlinx-cli
|
|
3
|
+
define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './Kotlinx-Cli-Library-kotlinx-cli.js', './wirespec-src-compiler-core.js', './wirespec-src-openapi.js', './arrow-arrow-core.js'], factory);
|
|
4
4
|
else if (typeof exports === 'object')
|
|
5
|
-
factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./Kotlinx-Cli-Library-kotlinx-cli
|
|
5
|
+
factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./Kotlinx-Cli-Library-kotlinx-cli.js'), require('./wirespec-src-compiler-core.js'), require('./wirespec-src-openapi.js'), require('./arrow-arrow-core.js'));
|
|
6
6
|
else {
|
|
7
7
|
if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
|
|
8
8
|
throw new Error("Error loading module 'wirespec-src-compiler-cli'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'wirespec-src-compiler-cli'.");
|
|
9
9
|
}
|
|
10
|
-
if (typeof this['Kotlinx-Cli-Library-kotlinx-cli
|
|
11
|
-
throw new Error("Error loading module 'wirespec-src-compiler-cli'. Its dependency 'Kotlinx-Cli-Library-kotlinx-cli
|
|
10
|
+
if (typeof this['Kotlinx-Cli-Library-kotlinx-cli'] === 'undefined') {
|
|
11
|
+
throw new Error("Error loading module 'wirespec-src-compiler-cli'. Its dependency 'Kotlinx-Cli-Library-kotlinx-cli' was not found. Please, check whether 'Kotlinx-Cli-Library-kotlinx-cli' is loaded prior to 'wirespec-src-compiler-cli'.");
|
|
12
12
|
}
|
|
13
13
|
if (typeof this['wirespec-src-compiler-core'] === 'undefined') {
|
|
14
14
|
throw new Error("Error loading module 'wirespec-src-compiler-cli'. Its dependency 'wirespec-src-compiler-core' was not found. Please, check whether 'wirespec-src-compiler-core' is loaded prior to 'wirespec-src-compiler-cli'.");
|
|
@@ -19,102 +19,107 @@
|
|
|
19
19
|
if (typeof this['arrow-arrow-core'] === 'undefined') {
|
|
20
20
|
throw new Error("Error loading module 'wirespec-src-compiler-cli'. Its dependency 'arrow-arrow-core' was not found. Please, check whether 'arrow-arrow-core' is loaded prior to 'wirespec-src-compiler-cli'.");
|
|
21
21
|
}
|
|
22
|
-
root['wirespec-src-compiler-cli'] = factory(typeof this['wirespec-src-compiler-cli'] === 'undefined' ? {} : this['wirespec-src-compiler-cli'], this['kotlin-kotlin-stdlib-js-ir'], this['Kotlinx-Cli-Library-kotlinx-cli
|
|
22
|
+
root['wirespec-src-compiler-cli'] = factory(typeof this['wirespec-src-compiler-cli'] === 'undefined' ? {} : this['wirespec-src-compiler-cli'], this['kotlin-kotlin-stdlib-js-ir'], this['Kotlinx-Cli-Library-kotlinx-cli'], this['wirespec-src-compiler-core'], this['wirespec-src-openapi'], this['arrow-arrow-core']);
|
|
23
23
|
}
|
|
24
24
|
}(this, function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_cli, kotlin_community_flock_wirespec_compiler_core, kotlin_community_flock_wirespec_openapi, kotlin_io_arrow_kt_arrow_core) {
|
|
25
25
|
'use strict';
|
|
26
26
|
//region block: imports
|
|
27
27
|
var imul = Math.imul;
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var VOID = kotlin_kotlin.$_$.
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
28
|
+
var protoOf = kotlin_kotlin.$_$.v7;
|
|
29
|
+
var hashCode = kotlin_kotlin.$_$.a7;
|
|
30
|
+
var getStringHashCode = kotlin_kotlin.$_$.z6;
|
|
31
|
+
var THROW_CCE = kotlin_kotlin.$_$.ia;
|
|
32
|
+
var equals = kotlin_kotlin.$_$.v6;
|
|
33
|
+
var classMeta = kotlin_kotlin.$_$.t6;
|
|
34
|
+
var VOID = kotlin_kotlin.$_$.ib;
|
|
35
|
+
var setMetadataFor = kotlin_kotlin.$_$.w7;
|
|
36
|
+
var equals_0 = kotlin_kotlin.$_$.s8;
|
|
37
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.b1;
|
|
38
|
+
var Subcommand = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.f;
|
|
39
39
|
var String_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.c;
|
|
40
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.l4;
|
|
41
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.f;
|
|
42
|
-
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.f1;
|
|
43
|
-
var Choice = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.e;
|
|
44
|
-
var multiple = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.g;
|
|
45
40
|
var Companion_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.b;
|
|
46
|
-
var toList = kotlin_kotlin.$_$.
|
|
41
|
+
var toList = kotlin_kotlin.$_$.b6;
|
|
42
|
+
var Choice = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.e;
|
|
43
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.e1;
|
|
44
|
+
var ArgParser = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.d;
|
|
45
|
+
var Boolean_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.a;
|
|
46
|
+
var default_0 = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.g;
|
|
47
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.b4;
|
|
48
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.f;
|
|
49
|
+
var multiple = kotlin_org_jetbrains_kotlinx_kotlinx_cli.$_$.h;
|
|
47
50
|
var get_DEFAULT_PACKAGE_NAME = kotlin_community_flock_wirespec_compiler_core.$_$.a;
|
|
48
|
-
var toSet = kotlin_kotlin.$_$.
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var objectMeta = kotlin_kotlin.$_$.j8;
|
|
58
|
-
var interfaceMeta = kotlin_kotlin.$_$.q7;
|
|
59
|
-
var endsWith = kotlin_kotlin.$_$.h9;
|
|
51
|
+
var toSet = kotlin_kotlin.$_$.d6;
|
|
52
|
+
var KProperty1 = kotlin_kotlin.$_$.g8;
|
|
53
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.y6;
|
|
54
|
+
var numberRangeToNumber = kotlin_kotlin.$_$.r7;
|
|
55
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.g;
|
|
56
|
+
var Unit_getInstance = kotlin_kotlin.$_$.h3;
|
|
57
|
+
var copyToArray = kotlin_kotlin.$_$.n4;
|
|
58
|
+
var Logger = kotlin_community_flock_wirespec_compiler_core.$_$.a1;
|
|
59
|
+
var endsWith = kotlin_kotlin.$_$.r8;
|
|
60
60
|
var Companion_getInstance_0 = kotlin_community_flock_wirespec_openapi.$_$.a;
|
|
61
61
|
var Companion_getInstance_1 = kotlin_community_flock_wirespec_openapi.$_$.b;
|
|
62
|
-
var noWhenBranchMatchedException = kotlin_kotlin.$_$.
|
|
63
|
-
var to = kotlin_kotlin.$_$.
|
|
64
|
-
var charSequenceLength = kotlin_kotlin.$_$.
|
|
65
|
-
var charSequenceGet = kotlin_kotlin.$_$.
|
|
66
|
-
var toString = kotlin_kotlin.$_$.
|
|
67
|
-
var toString_0 = kotlin_kotlin.$_$.
|
|
68
|
-
var first = kotlin_kotlin.$_$.
|
|
69
|
-
var listOf = kotlin_kotlin.$_$.
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
var
|
|
62
|
+
var noWhenBranchMatchedException = kotlin_kotlin.$_$.db;
|
|
63
|
+
var to = kotlin_kotlin.$_$.hb;
|
|
64
|
+
var charSequenceLength = kotlin_kotlin.$_$.r6;
|
|
65
|
+
var charSequenceGet = kotlin_kotlin.$_$.q6;
|
|
66
|
+
var toString = kotlin_kotlin.$_$.k1;
|
|
67
|
+
var toString_0 = kotlin_kotlin.$_$.a8;
|
|
68
|
+
var first = kotlin_kotlin.$_$.x4;
|
|
69
|
+
var listOf = kotlin_kotlin.$_$.k5;
|
|
70
|
+
var enumEntries = kotlin_kotlin.$_$.j6;
|
|
71
|
+
var Enum = kotlin_kotlin.$_$.z9;
|
|
72
|
+
var plus = kotlin_kotlin.$_$.r5;
|
|
73
|
+
var isInterface = kotlin_kotlin.$_$.k7;
|
|
74
|
+
var joinToString = kotlin_kotlin.$_$.d5;
|
|
75
|
+
var objectMeta = kotlin_kotlin.$_$.u7;
|
|
76
|
+
var interfaceMeta = kotlin_kotlin.$_$.b7;
|
|
77
|
+
var WirespecEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.f;
|
|
78
|
+
var TypeScriptEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.e;
|
|
79
|
+
var ScalaEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.d;
|
|
76
80
|
var KotlinEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.c;
|
|
77
81
|
var JavaEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.b;
|
|
78
|
-
var Wirespec_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.
|
|
79
|
-
var compile = kotlin_community_flock_wirespec_compiler_core.$_$.
|
|
82
|
+
var Wirespec_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.g1;
|
|
83
|
+
var compile = kotlin_community_flock_wirespec_compiler_core.$_$.z;
|
|
80
84
|
var Left = kotlin_io_arrow_kt_arrow_core.$_$.c;
|
|
81
85
|
var Right = kotlin_io_arrow_kt_arrow_core.$_$.d;
|
|
82
|
-
var println = kotlin_kotlin.$_$.
|
|
83
|
-
var
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
var
|
|
93
|
-
var
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
var
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
var createFailure = kotlin_kotlin.$_$.pb;
|
|
103
|
-
var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.q1;
|
|
104
|
-
var isObject = kotlin_kotlin.$_$.b8;
|
|
105
|
-
var _Result___get_isFailure__impl__jpiriv = kotlin_kotlin.$_$.p1;
|
|
106
|
-
var isArray = kotlin_kotlin.$_$.r7;
|
|
86
|
+
var println = kotlin_kotlin.$_$.k6;
|
|
87
|
+
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.h1;
|
|
88
|
+
var charArrayOf = kotlin_kotlin.$_$.o6;
|
|
89
|
+
var split = kotlin_kotlin.$_$.e9;
|
|
90
|
+
var split_0 = kotlin_kotlin.$_$.f9;
|
|
91
|
+
var dropLast = kotlin_kotlin.$_$.p4;
|
|
92
|
+
var last = kotlin_kotlin.$_$.h5;
|
|
93
|
+
var dropLast_0 = kotlin_kotlin.$_$.p8;
|
|
94
|
+
var iterator = kotlin_kotlin.$_$.o7;
|
|
95
|
+
var asSequence = kotlin_kotlin.$_$.i8;
|
|
96
|
+
var map = kotlin_kotlin.$_$.l8;
|
|
97
|
+
var filter = kotlin_kotlin.$_$.j8;
|
|
98
|
+
var toSet_0 = kotlin_kotlin.$_$.m8;
|
|
99
|
+
var Companion_getInstance_2 = kotlin_kotlin.$_$.c3;
|
|
100
|
+
var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.l1;
|
|
101
|
+
var createFailure = kotlin_kotlin.$_$.wa;
|
|
102
|
+
var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.o1;
|
|
103
|
+
var isObject = kotlin_kotlin.$_$.m7;
|
|
104
|
+
var _Result___get_isFailure__impl__jpiriv = kotlin_kotlin.$_$.n1;
|
|
105
|
+
var isArray = kotlin_kotlin.$_$.c7;
|
|
107
106
|
//endregion
|
|
108
107
|
//region block: pre-declaration
|
|
108
|
+
setMetadataFor(Arguments, 'Arguments', classMeta);
|
|
109
|
+
setMetadataFor(CompileCommand, 'CompileCommand', classMeta, Subcommand);
|
|
110
|
+
setMetadataFor(ConvertCommand, 'ConvertCommand', classMeta, Subcommand);
|
|
111
|
+
setMetadataFor(CommandLineEntitiesParser, 'CommandLineEntitiesParser', classMeta, ArgParser);
|
|
112
|
+
setMetadataFor(Convert, 'Convert', classMeta);
|
|
113
|
+
setMetadataFor(Compile, 'Compile', classMeta);
|
|
109
114
|
setMetadataFor(Language, 'Language', interfaceMeta);
|
|
110
115
|
setMetadataFor(Jvm, 'Jvm', classMeta, Enum, [Enum, Language]);
|
|
111
116
|
setMetadataFor(Script, 'Script', classMeta, Enum, [Enum, Language]);
|
|
112
|
-
setMetadataFor(
|
|
117
|
+
setMetadataFor(Spec, 'Spec', classMeta, Enum, [Enum, Language]);
|
|
113
118
|
setMetadataFor(Companion, 'Companion', objectMeta);
|
|
119
|
+
setMetadataFor(Companion_0, 'Companion', objectMeta);
|
|
114
120
|
setMetadataFor(Format, 'Format', classMeta, Enum);
|
|
115
|
-
setMetadataFor(cli$logger$1, VOID, classMeta, Logger);
|
|
116
121
|
setMetadataFor(Extension, 'Extension', classMeta, Enum);
|
|
117
|
-
setMetadataFor(
|
|
122
|
+
setMetadataFor(Companion_1, 'Companion', objectMeta);
|
|
118
123
|
setMetadataFor(FullFilePath, 'FullFilePath', classMeta);
|
|
119
124
|
setMetadataFor(File, 'File', classMeta);
|
|
120
125
|
setMetadataFor(JavaFile, 'JavaFile', classMeta, File);
|
|
@@ -125,13 +130,368 @@
|
|
|
125
130
|
setMetadataFor(WirespecFile, 'WirespecFile', classMeta, File);
|
|
126
131
|
setMetadataFor(Directory, 'Directory', classMeta);
|
|
127
132
|
//endregion
|
|
133
|
+
function Arguments(operation, output, languages, packageName, strict, debug) {
|
|
134
|
+
this.u21_1 = operation;
|
|
135
|
+
this.v21_1 = output;
|
|
136
|
+
this.w21_1 = languages;
|
|
137
|
+
this.x21_1 = packageName;
|
|
138
|
+
this.y21_1 = strict;
|
|
139
|
+
this.z21_1 = debug;
|
|
140
|
+
}
|
|
141
|
+
protoOf(Arguments).toString = function () {
|
|
142
|
+
return 'Arguments(operation=' + this.u21_1 + ', output=' + this.v21_1 + ', languages=' + this.w21_1 + ', packageName=' + this.x21_1 + ', strict=' + this.y21_1 + ', debug=' + this.z21_1 + ')';
|
|
143
|
+
};
|
|
144
|
+
protoOf(Arguments).hashCode = function () {
|
|
145
|
+
var result = hashCode(this.u21_1);
|
|
146
|
+
result = imul(result, 31) + (this.v21_1 == null ? 0 : getStringHashCode(this.v21_1)) | 0;
|
|
147
|
+
result = imul(result, 31) + hashCode(this.w21_1) | 0;
|
|
148
|
+
result = imul(result, 31) + getStringHashCode(this.x21_1) | 0;
|
|
149
|
+
result = imul(result, 31) + (this.y21_1 | 0) | 0;
|
|
150
|
+
result = imul(result, 31) + (this.z21_1 | 0) | 0;
|
|
151
|
+
return result;
|
|
152
|
+
};
|
|
153
|
+
protoOf(Arguments).equals = function (other) {
|
|
154
|
+
if (this === other)
|
|
155
|
+
return true;
|
|
156
|
+
if (!(other instanceof Arguments))
|
|
157
|
+
return false;
|
|
158
|
+
var tmp0_other_with_cast = other instanceof Arguments ? other : THROW_CCE();
|
|
159
|
+
if (!equals(this.u21_1, tmp0_other_with_cast.u21_1))
|
|
160
|
+
return false;
|
|
161
|
+
if (!(this.v21_1 == tmp0_other_with_cast.v21_1))
|
|
162
|
+
return false;
|
|
163
|
+
if (!equals(this.w21_1, tmp0_other_with_cast.w21_1))
|
|
164
|
+
return false;
|
|
165
|
+
if (!(this.x21_1 === tmp0_other_with_cast.x21_1))
|
|
166
|
+
return false;
|
|
167
|
+
if (!(this.y21_1 === tmp0_other_with_cast.y21_1))
|
|
168
|
+
return false;
|
|
169
|
+
if (!(this.z21_1 === tmp0_other_with_cast.z21_1))
|
|
170
|
+
return false;
|
|
171
|
+
return true;
|
|
172
|
+
};
|
|
173
|
+
function _get_input__g2gq7t($this) {
|
|
174
|
+
return $this.w22_1.b20($this, input$factory_0());
|
|
175
|
+
}
|
|
176
|
+
function _get_input__g2gq7t_0($this) {
|
|
177
|
+
return $this.u23_1.b20($this, input$factory_2());
|
|
178
|
+
}
|
|
179
|
+
function _get_format__qlarck($this) {
|
|
180
|
+
return $this.v23_1.b20($this, format$factory_0());
|
|
181
|
+
}
|
|
182
|
+
function CommandLineEntitiesParser$ConvertCommand$format$delegate$lambda(it) {
|
|
183
|
+
// Inline function 'kotlin.text.lowercase' call
|
|
184
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
185
|
+
return it.toString().toLowerCase();
|
|
186
|
+
}
|
|
187
|
+
function CommandLineEntitiesParser$ConvertCommand$format$delegate$lambda_0($tmp1_Choice) {
|
|
188
|
+
return function (it) {
|
|
189
|
+
var tmp$ret$3;
|
|
190
|
+
// Inline function 'kotlin.collections.find' call
|
|
191
|
+
var tmp$ret$0;
|
|
192
|
+
// Inline function 'kotlin.enumValues' call
|
|
193
|
+
tmp$ret$0 = values_2();
|
|
194
|
+
var tmp0_find = tmp$ret$0;
|
|
195
|
+
var tmp$ret$2;
|
|
196
|
+
$l$block: {
|
|
197
|
+
// Inline function 'kotlin.collections.firstOrNull' call
|
|
198
|
+
var indexedObject = tmp0_find;
|
|
199
|
+
var inductionVariable = 0;
|
|
200
|
+
var last = indexedObject.length;
|
|
201
|
+
while (inductionVariable < last) {
|
|
202
|
+
var element = indexedObject[inductionVariable];
|
|
203
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
204
|
+
var tmp$ret$1;
|
|
205
|
+
// Inline function 'kotlinx.cli.Companion.Choice.<anonymous>.<anonymous>' call
|
|
206
|
+
tmp$ret$1 = equals_0($tmp1_Choice(element), it, true);
|
|
207
|
+
if (tmp$ret$1) {
|
|
208
|
+
tmp$ret$2 = element;
|
|
209
|
+
break $l$block;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
tmp$ret$2 = null;
|
|
213
|
+
}
|
|
214
|
+
tmp$ret$3 = tmp$ret$2;
|
|
215
|
+
var tmp0_elvis_lhs = tmp$ret$3;
|
|
216
|
+
var tmp;
|
|
217
|
+
if (tmp0_elvis_lhs == null) {
|
|
218
|
+
throw IllegalArgumentException_init_$Create$('No enum constant ' + it);
|
|
219
|
+
} else {
|
|
220
|
+
tmp = tmp0_elvis_lhs;
|
|
221
|
+
}
|
|
222
|
+
return tmp;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function _get_output__ji2uqy($this) {
|
|
226
|
+
return $this.s24_1.b20($this, output$factory_0());
|
|
227
|
+
}
|
|
228
|
+
function _get_debug__ikvxnm($this) {
|
|
229
|
+
return $this.t24_1.b20($this, debug$factory_0());
|
|
230
|
+
}
|
|
231
|
+
function _get_languages__ojonze($this) {
|
|
232
|
+
return $this.u24_1.b20($this, languages$factory_0());
|
|
233
|
+
}
|
|
234
|
+
function _get_packageName__3ybzuo($this) {
|
|
235
|
+
return $this.v24_1.b20($this, packageName$factory_0());
|
|
236
|
+
}
|
|
237
|
+
function _get_strict__6o9vtu($this) {
|
|
238
|
+
return $this.w24_1.b20($this, strict$factory_0());
|
|
239
|
+
}
|
|
240
|
+
function CompileCommand() {
|
|
241
|
+
Subcommand.call(this, 'compile', 'Compile Wirespec');
|
|
242
|
+
this.w22_1 = this.m1y(String_getInstance(), VOID, 'Input file').o21(this, input$factory());
|
|
243
|
+
this.x22_1 = null;
|
|
244
|
+
}
|
|
245
|
+
protoOf(CompileCommand).z1z = function () {
|
|
246
|
+
this.x22_1 = new Compile(_get_input__g2gq7t(this));
|
|
247
|
+
};
|
|
248
|
+
function ConvertCommand() {
|
|
249
|
+
Subcommand.call(this, 'convert', 'Convert from OpenAPI');
|
|
250
|
+
this.u23_1 = this.m1y(String_getInstance(), VOID, 'Input file').o21(this, input$factory_1());
|
|
251
|
+
var tmp = this;
|
|
252
|
+
var tmp$ret$1;
|
|
253
|
+
// Inline function 'kotlinx.cli.Companion.Choice' call
|
|
254
|
+
Companion_getInstance();
|
|
255
|
+
var tmp1_Choice = CommandLineEntitiesParser$ConvertCommand$format$delegate$lambda;
|
|
256
|
+
var tmp$ret$0;
|
|
257
|
+
// Inline function 'kotlin.enumValues' call
|
|
258
|
+
tmp$ret$0 = values_2();
|
|
259
|
+
var tmp_0 = toList(tmp$ret$0);
|
|
260
|
+
var tmp_1;
|
|
261
|
+
if (null == null) {
|
|
262
|
+
tmp_1 = CommandLineEntitiesParser$ConvertCommand$format$delegate$lambda_0(tmp1_Choice);
|
|
263
|
+
} else {
|
|
264
|
+
tmp_1 = null;
|
|
265
|
+
}
|
|
266
|
+
tmp$ret$1 = new Choice(tmp_0, tmp_1, tmp1_Choice);
|
|
267
|
+
tmp.v23_1 = this.m1y(tmp$ret$1, VOID, 'Input format').o21(this, format$factory());
|
|
268
|
+
this.w23_1 = null;
|
|
269
|
+
}
|
|
270
|
+
protoOf(ConvertCommand).z1z = function () {
|
|
271
|
+
this.w23_1 = new Convert(_get_format__qlarck(this), _get_input__g2gq7t_0(this));
|
|
272
|
+
};
|
|
273
|
+
function CommandLineEntitiesParser$languages$delegate$lambda(it) {
|
|
274
|
+
var tmp0_elvis_lhs = Companion_getInstance_3().x24(it);
|
|
275
|
+
var tmp;
|
|
276
|
+
if (tmp0_elvis_lhs == null) {
|
|
277
|
+
throw IllegalStateException_init_$Create$('Language not found');
|
|
278
|
+
} else {
|
|
279
|
+
tmp = tmp0_elvis_lhs;
|
|
280
|
+
}
|
|
281
|
+
return tmp;
|
|
282
|
+
}
|
|
283
|
+
function CommandLineEntitiesParser(args) {
|
|
284
|
+
ArgParser.call(this, 'wirespec');
|
|
285
|
+
this.r24_1 = args;
|
|
286
|
+
this.s24_1 = this.k1y(String_getInstance(), VOID, 'o', 'Output directory').o21(this, output$factory());
|
|
287
|
+
this.t24_1 = default_0(this.k1y(Boolean_getInstance(), VOID, 'd', 'Debug mode'), false).o21(this, debug$factory());
|
|
288
|
+
var tmp = this;
|
|
289
|
+
// Inline function 'kotlin.collections.map' call
|
|
290
|
+
// Inline function 'kotlin.collections.map' call
|
|
291
|
+
var tmp0_map = Companion_getInstance_3().y24();
|
|
292
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
293
|
+
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
|
|
294
|
+
var tmp0_iterator = tmp0_map.c();
|
|
295
|
+
while (tmp0_iterator.d()) {
|
|
296
|
+
var item = tmp0_iterator.e();
|
|
297
|
+
var tmp$ret$0;
|
|
298
|
+
// Inline function 'community.flock.wirespec.compiler.cli.CommandLineEntitiesParser.languages$delegate.<anonymous>' call
|
|
299
|
+
tmp$ret$0 = item.t4_1;
|
|
300
|
+
tmp0_mapTo.a(tmp$ret$0);
|
|
301
|
+
}
|
|
302
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
303
|
+
var tmp0_mapTo_0 = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_mapTo, 10));
|
|
304
|
+
var tmp0_iterator_0 = tmp0_mapTo.c();
|
|
305
|
+
while (tmp0_iterator_0.d()) {
|
|
306
|
+
var item_0 = tmp0_iterator_0.e();
|
|
307
|
+
var tmp$ret$3;
|
|
308
|
+
// Inline function 'community.flock.wirespec.compiler.cli.CommandLineEntitiesParser.languages$delegate.<anonymous>' call
|
|
309
|
+
var tmp0_elvis_lhs = Companion_getInstance_3().x24(item_0);
|
|
310
|
+
var tmp_0;
|
|
311
|
+
if (tmp0_elvis_lhs == null) {
|
|
312
|
+
throw IllegalStateException_init_$Create$('Language not found');
|
|
313
|
+
} else {
|
|
314
|
+
tmp_0 = tmp0_elvis_lhs;
|
|
315
|
+
}
|
|
316
|
+
tmp$ret$3 = tmp_0;
|
|
317
|
+
tmp0_mapTo_0.a(tmp$ret$3);
|
|
318
|
+
}
|
|
319
|
+
var tmp_1 = tmp0_mapTo_0;
|
|
320
|
+
tmp.u24_1 = multiple(this.k1y(new Choice(tmp_1, CommandLineEntitiesParser$languages$delegate$lambda), VOID, 'l', 'Language type')).o21(this, languages$factory());
|
|
321
|
+
this.v24_1 = default_0(this.k1y(String_getInstance(), VOID, 'p', 'Package name'), get_DEFAULT_PACKAGE_NAME()).o21(this, packageName$factory());
|
|
322
|
+
this.w24_1 = default_0(this.k1y(Boolean_getInstance(), VOID, 's', 'Strict mode'), false).o21(this, strict$factory());
|
|
323
|
+
}
|
|
324
|
+
protoOf(CommandLineEntitiesParser).s1v = function () {
|
|
325
|
+
// Inline function 'kotlin.run' call
|
|
326
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
327
|
+
// Inline function 'community.flock.wirespec.compiler.cli.CommandLineEntitiesParser.parse.<anonymous>' call
|
|
328
|
+
var compileCommand = new CompileCommand();
|
|
329
|
+
var convertCommand = new ConvertCommand();
|
|
330
|
+
this.n1y([compileCommand, convertCommand]);
|
|
331
|
+
var tmp;
|
|
332
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
333
|
+
// Inline function 'kotlin.collections.isEmpty' call
|
|
334
|
+
if (!(this.r24_1.length === 0)) {
|
|
335
|
+
tmp = this.r24_1;
|
|
336
|
+
} else {
|
|
337
|
+
// Inline function 'kotlin.arrayOf' call
|
|
338
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
339
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
340
|
+
tmp = ['-h'];
|
|
341
|
+
}
|
|
342
|
+
this.l1z(tmp);
|
|
343
|
+
var tmp_0 = this.c1x_1.o2('compile');
|
|
344
|
+
var tmp0_safe_receiver = tmp_0 instanceof CompileCommand ? tmp_0 : null;
|
|
345
|
+
var compile = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.x22_1;
|
|
346
|
+
var tmp_1 = this.c1x_1.o2('convert');
|
|
347
|
+
var tmp1_safe_receiver = tmp_1 instanceof ConvertCommand ? tmp_1 : null;
|
|
348
|
+
var convert = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.w23_1;
|
|
349
|
+
var tmp3_elvis_lhs = compile == null ? convert : compile;
|
|
350
|
+
var tmp_2;
|
|
351
|
+
if (tmp3_elvis_lhs == null) {
|
|
352
|
+
throw IllegalStateException_init_$Create$('provide an operation');
|
|
353
|
+
} else {
|
|
354
|
+
tmp_2 = tmp3_elvis_lhs;
|
|
355
|
+
}
|
|
356
|
+
return new Arguments(tmp_2, _get_output__ji2uqy(this), toSet(_get_languages__ojonze(this)), _get_packageName__3ybzuo(this), _get_strict__6o9vtu(this), _get_debug__ikvxnm(this));
|
|
357
|
+
};
|
|
358
|
+
function Convert(format, input) {
|
|
359
|
+
this.z24_1 = format;
|
|
360
|
+
this.a25_1 = input;
|
|
361
|
+
}
|
|
362
|
+
protoOf(Convert).b25 = function () {
|
|
363
|
+
return this.a25_1;
|
|
364
|
+
};
|
|
365
|
+
protoOf(Convert).toString = function () {
|
|
366
|
+
return 'Convert(format=' + this.z24_1 + ', input=' + this.a25_1 + ')';
|
|
367
|
+
};
|
|
368
|
+
protoOf(Convert).hashCode = function () {
|
|
369
|
+
var result = this.z24_1.hashCode();
|
|
370
|
+
result = imul(result, 31) + getStringHashCode(this.a25_1) | 0;
|
|
371
|
+
return result;
|
|
372
|
+
};
|
|
373
|
+
protoOf(Convert).equals = function (other) {
|
|
374
|
+
if (this === other)
|
|
375
|
+
return true;
|
|
376
|
+
if (!(other instanceof Convert))
|
|
377
|
+
return false;
|
|
378
|
+
var tmp0_other_with_cast = other instanceof Convert ? other : THROW_CCE();
|
|
379
|
+
if (!this.z24_1.equals(tmp0_other_with_cast.z24_1))
|
|
380
|
+
return false;
|
|
381
|
+
if (!(this.a25_1 === tmp0_other_with_cast.a25_1))
|
|
382
|
+
return false;
|
|
383
|
+
return true;
|
|
384
|
+
};
|
|
385
|
+
function Compile(input) {
|
|
386
|
+
this.c25_1 = input;
|
|
387
|
+
}
|
|
388
|
+
protoOf(Compile).b25 = function () {
|
|
389
|
+
return this.c25_1;
|
|
390
|
+
};
|
|
391
|
+
protoOf(Compile).toString = function () {
|
|
392
|
+
return 'Compile(input=' + this.c25_1 + ')';
|
|
393
|
+
};
|
|
394
|
+
protoOf(Compile).hashCode = function () {
|
|
395
|
+
return getStringHashCode(this.c25_1);
|
|
396
|
+
};
|
|
397
|
+
protoOf(Compile).equals = function (other) {
|
|
398
|
+
if (this === other)
|
|
399
|
+
return true;
|
|
400
|
+
if (!(other instanceof Compile))
|
|
401
|
+
return false;
|
|
402
|
+
var tmp0_other_with_cast = other instanceof Compile ? other : THROW_CCE();
|
|
403
|
+
if (!(this.c25_1 === tmp0_other_with_cast.c25_1))
|
|
404
|
+
return false;
|
|
405
|
+
return true;
|
|
406
|
+
};
|
|
407
|
+
function output$factory() {
|
|
408
|
+
return getPropertyCallableRef('output', 1, KProperty1, function (receiver) {
|
|
409
|
+
return _get_output__ji2uqy(receiver);
|
|
410
|
+
}, null);
|
|
411
|
+
}
|
|
412
|
+
function debug$factory() {
|
|
413
|
+
return getPropertyCallableRef('debug', 1, KProperty1, function (receiver) {
|
|
414
|
+
return _get_debug__ikvxnm(receiver);
|
|
415
|
+
}, null);
|
|
416
|
+
}
|
|
417
|
+
function languages$factory() {
|
|
418
|
+
return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
|
|
419
|
+
return _get_languages__ojonze(receiver);
|
|
420
|
+
}, null);
|
|
421
|
+
}
|
|
422
|
+
function packageName$factory() {
|
|
423
|
+
return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
|
|
424
|
+
return _get_packageName__3ybzuo(receiver);
|
|
425
|
+
}, null);
|
|
426
|
+
}
|
|
427
|
+
function strict$factory() {
|
|
428
|
+
return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
|
|
429
|
+
return _get_strict__6o9vtu(receiver);
|
|
430
|
+
}, null);
|
|
431
|
+
}
|
|
432
|
+
function output$factory_0() {
|
|
433
|
+
return getPropertyCallableRef('output', 1, KProperty1, function (receiver) {
|
|
434
|
+
return _get_output__ji2uqy(receiver);
|
|
435
|
+
}, null);
|
|
436
|
+
}
|
|
437
|
+
function debug$factory_0() {
|
|
438
|
+
return getPropertyCallableRef('debug', 1, KProperty1, function (receiver) {
|
|
439
|
+
return _get_debug__ikvxnm(receiver);
|
|
440
|
+
}, null);
|
|
441
|
+
}
|
|
442
|
+
function languages$factory_0() {
|
|
443
|
+
return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
|
|
444
|
+
return _get_languages__ojonze(receiver);
|
|
445
|
+
}, null);
|
|
446
|
+
}
|
|
447
|
+
function packageName$factory_0() {
|
|
448
|
+
return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
|
|
449
|
+
return _get_packageName__3ybzuo(receiver);
|
|
450
|
+
}, null);
|
|
451
|
+
}
|
|
452
|
+
function strict$factory_0() {
|
|
453
|
+
return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
|
|
454
|
+
return _get_strict__6o9vtu(receiver);
|
|
455
|
+
}, null);
|
|
456
|
+
}
|
|
457
|
+
function input$factory() {
|
|
458
|
+
return getPropertyCallableRef('input', 1, KProperty1, function (receiver) {
|
|
459
|
+
return _get_input__g2gq7t(receiver);
|
|
460
|
+
}, null);
|
|
461
|
+
}
|
|
462
|
+
function input$factory_0() {
|
|
463
|
+
return getPropertyCallableRef('input', 1, KProperty1, function (receiver) {
|
|
464
|
+
return _get_input__g2gq7t(receiver);
|
|
465
|
+
}, null);
|
|
466
|
+
}
|
|
467
|
+
function input$factory_1() {
|
|
468
|
+
return getPropertyCallableRef('input', 1, KProperty1, function (receiver) {
|
|
469
|
+
return _get_input__g2gq7t_0(receiver);
|
|
470
|
+
}, null);
|
|
471
|
+
}
|
|
472
|
+
function format$factory() {
|
|
473
|
+
return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
|
|
474
|
+
return _get_format__qlarck(receiver);
|
|
475
|
+
}, null);
|
|
476
|
+
}
|
|
477
|
+
function input$factory_2() {
|
|
478
|
+
return getPropertyCallableRef('input', 1, KProperty1, function (receiver) {
|
|
479
|
+
return _get_input__g2gq7t_0(receiver);
|
|
480
|
+
}, null);
|
|
481
|
+
}
|
|
482
|
+
function format$factory_0() {
|
|
483
|
+
return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
|
|
484
|
+
return _get_format__qlarck(receiver);
|
|
485
|
+
}, null);
|
|
486
|
+
}
|
|
128
487
|
function main(args) {
|
|
488
|
+
// Inline function 'kotlin.let' call
|
|
129
489
|
// Inline function 'kotlin.let' call
|
|
130
490
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
131
491
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
132
492
|
var tmp0_mapNotNull = numberRangeToNumber(0, 20);
|
|
133
493
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
134
|
-
var tmp0_mapNotNullTo = ArrayList_init_$Create$();
|
|
494
|
+
var tmp0_mapNotNullTo = ArrayList_init_$Create$_0();
|
|
135
495
|
// Inline function 'kotlin.collections.forEach' call
|
|
136
496
|
var inductionVariable = tmp0_mapNotNull.y_1;
|
|
137
497
|
var last = tmp0_mapNotNull.z_1;
|
|
@@ -152,80 +512,101 @@
|
|
|
152
512
|
while (!(element === last));
|
|
153
513
|
var tmp2_let = copyToArray(tmp0_mapNotNullTo);
|
|
154
514
|
// Inline function 'kotlin.contracts.contract' call
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
var
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
var tmp0_map = Companion_getInstance_3().f2d();
|
|
171
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
172
|
-
var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
|
|
173
|
-
var tmp0_iterator = tmp0_map.c();
|
|
174
|
-
while (tmp0_iterator.d()) {
|
|
175
|
-
var item = tmp0_iterator.e();
|
|
176
|
-
var tmp$ret$0;
|
|
177
|
-
// Inline function 'community.flock.wirespec.compiler.cli.cli.<anonymous>' call
|
|
178
|
-
tmp$ret$0 = item.y4_1;
|
|
179
|
-
tmp0_mapTo.a(tmp$ret$0);
|
|
180
|
-
}
|
|
181
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
182
|
-
var tmp0_mapTo_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_mapTo, 10));
|
|
183
|
-
var tmp0_iterator_0 = tmp0_mapTo.c();
|
|
184
|
-
while (tmp0_iterator_0.d()) {
|
|
185
|
-
var item_0 = tmp0_iterator_0.e();
|
|
186
|
-
var tmp$ret$3;
|
|
187
|
-
// Inline function 'community.flock.wirespec.compiler.cli.cli.<anonymous>' call
|
|
188
|
-
var tmp0_elvis_lhs = Companion_getInstance_3().g2d(item_0);
|
|
515
|
+
var tmp3_let = (new CommandLineEntitiesParser(tmp2_let)).s1v();
|
|
516
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
517
|
+
compile_0(tmp3_let);
|
|
518
|
+
}
|
|
519
|
+
function compile_0(arguments_0) {
|
|
520
|
+
var input = arguments_0.u21_1.b25();
|
|
521
|
+
var output = arguments_0.v21_1;
|
|
522
|
+
var languages = arguments_0.w21_1;
|
|
523
|
+
var packageName = arguments_0.x21_1;
|
|
524
|
+
var logger = new Logger(arguments_0.z21_1);
|
|
525
|
+
var tmp0_subject = arguments_0.u21_1;
|
|
526
|
+
if (tmp0_subject instanceof Convert) {
|
|
527
|
+
var fullPath = Companion_getInstance_5().f25(input);
|
|
528
|
+
var file = new JsonFile(fullPath);
|
|
529
|
+
var strict = arguments_0.y21_1;
|
|
189
530
|
var tmp;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
531
|
+
switch (arguments_0.u21_1.z24_1.u4_1) {
|
|
532
|
+
case 0:
|
|
533
|
+
tmp = Companion_getInstance_0().q1v(file.d10(), !strict);
|
|
534
|
+
break;
|
|
535
|
+
case 1:
|
|
536
|
+
tmp = Companion_getInstance_1().q1v(file.d10(), !strict);
|
|
537
|
+
break;
|
|
538
|
+
default:
|
|
539
|
+
noWhenBranchMatchedException();
|
|
540
|
+
break;
|
|
541
|
+
}
|
|
542
|
+
var ast = tmp;
|
|
543
|
+
var path = out(fullPath, packageName, output);
|
|
544
|
+
// Inline function 'kotlin.collections.map' call
|
|
545
|
+
// Inline function 'kotlin.collections.map' call
|
|
546
|
+
var tmp0_map = emit(languages, packageName, path, logger);
|
|
547
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
548
|
+
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
|
|
549
|
+
var tmp0_iterator = tmp0_map.c();
|
|
550
|
+
while (tmp0_iterator.d()) {
|
|
551
|
+
var item = tmp0_iterator.e();
|
|
552
|
+
var tmp$ret$7;
|
|
553
|
+
// Inline function 'community.flock.wirespec.compiler.cli.compile.<anonymous>' call
|
|
554
|
+
var emitter = item.k3();
|
|
555
|
+
var file_0 = item.l3();
|
|
556
|
+
var result = emitter.k1p(ast);
|
|
557
|
+
var tmp_0;
|
|
558
|
+
if (!emitter.s1s()) {
|
|
559
|
+
var tmp$ret$6;
|
|
560
|
+
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
561
|
+
var tmp0_replaceFirstChar = fullPath.l25_1;
|
|
562
|
+
var tmp_1;
|
|
563
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
564
|
+
if (charSequenceLength(tmp0_replaceFirstChar) > 0) {
|
|
565
|
+
var tmp$ret$3;
|
|
566
|
+
// Inline function 'kotlin.text.uppercase' call
|
|
567
|
+
var tmp1_uppercase = charSequenceGet(tmp0_replaceFirstChar, 0);
|
|
568
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
569
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
570
|
+
tmp$ret$3 = toString(tmp1_uppercase).toUpperCase();
|
|
571
|
+
var tmp_2 = toString_0(tmp$ret$3);
|
|
572
|
+
// Inline function 'kotlin.text.substring' call
|
|
573
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
574
|
+
tmp_1 = tmp_2 + tmp0_replaceFirstChar.substring(1);
|
|
575
|
+
} else {
|
|
576
|
+
tmp_1 = tmp0_replaceFirstChar;
|
|
577
|
+
}
|
|
578
|
+
tmp$ret$6 = tmp_1;
|
|
579
|
+
tmp_0 = to(listOf(to(tmp$ret$6, first(result).j3_1)), file_0);
|
|
580
|
+
} else {
|
|
581
|
+
tmp_0 = to(result, file_0);
|
|
582
|
+
}
|
|
583
|
+
tmp$ret$7 = tmp_0;
|
|
584
|
+
tmp0_mapTo.a(tmp$ret$7);
|
|
585
|
+
}
|
|
586
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
587
|
+
var tmp0_mapTo_0 = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_mapTo, 10));
|
|
588
|
+
var tmp0_iterator_0 = tmp0_mapTo.c();
|
|
589
|
+
while (tmp0_iterator_0.d()) {
|
|
590
|
+
var item_0 = tmp0_iterator_0.e();
|
|
591
|
+
var results = item_0.k3();
|
|
592
|
+
var file_1 = item_0.l3();
|
|
593
|
+
write(results, file_1);
|
|
594
|
+
tmp0_mapTo_0.a(Unit_getInstance());
|
|
194
595
|
}
|
|
195
|
-
tmp$ret$3 = tmp;
|
|
196
|
-
tmp0_mapTo_0.a(tmp$ret$3);
|
|
197
|
-
}
|
|
198
|
-
var tmp_0 = tmp0_mapTo_0;
|
|
199
|
-
var language$delegate = multiple(default_0(parser.w29(new Choice(tmp_0, cli$lambda_6), VOID, 'l', 'Language type'), Jvm_Kotlin_getInstance())).z2c(null, getLocalDelegateReference('language', KProperty0, false, function () {
|
|
200
|
-
return THROW_ISE();
|
|
201
|
-
}));
|
|
202
|
-
var tmp$ret$7;
|
|
203
|
-
// Inline function 'kotlinx.cli.Companion.Choice' call
|
|
204
|
-
Companion_getInstance();
|
|
205
|
-
var tmp3_Choice = cli$lambda_7;
|
|
206
|
-
var tmp$ret$6;
|
|
207
|
-
// Inline function 'kotlin.enumValues' call
|
|
208
|
-
tmp$ret$6 = values_2();
|
|
209
|
-
var tmp_1 = toList(tmp$ret$6);
|
|
210
|
-
var tmp_2;
|
|
211
|
-
if (null == null) {
|
|
212
|
-
tmp_2 = cli$lambda_8(tmp3_Choice);
|
|
213
596
|
} else {
|
|
214
|
-
|
|
597
|
+
if (tmp0_subject instanceof Compile)
|
|
598
|
+
if (endsWith(input, '.' + Extension_Wirespec_getInstance().i25_1)) {
|
|
599
|
+
wirespec(new WirespecFile(Companion_getInstance_5().f25(input)), languages, packageName, output, logger);
|
|
600
|
+
} else {
|
|
601
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
602
|
+
var tmp0_iterator_1 = (new Directory(input)).e25().c();
|
|
603
|
+
while (tmp0_iterator_1.d()) {
|
|
604
|
+
var element = tmp0_iterator_1.e();
|
|
605
|
+
// Inline function 'community.flock.wirespec.compiler.cli.compile.<anonymous>' call
|
|
606
|
+
wirespec(element, languages, packageName, output, logger);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
215
609
|
}
|
|
216
|
-
tmp$ret$7 = new Choice(tmp_1, tmp_2, tmp3_Choice);
|
|
217
|
-
var format$delegate = default_0(parser.w29(tmp$ret$7, VOID, 'f', 'Input format'), Format_Wirespec_getInstance()).z2c(null, getLocalDelegateReference('format', KProperty0, false, function () {
|
|
218
|
-
return THROW_ISE();
|
|
219
|
-
}));
|
|
220
|
-
var packageName$delegate = default_0(parser.w29(String_getInstance(), VOID, 'p', 'Package name'), get_DEFAULT_PACKAGE_NAME()).z2c(null, getLocalDelegateReference('packageName', KProperty0, false, function () {
|
|
221
|
-
return THROW_ISE();
|
|
222
|
-
}));
|
|
223
|
-
var strict$delegate = default_0(parser.w29(Boolean_getInstance(), VOID, 's', 'Strict mode'), false).z2c(null, getLocalDelegateReference('strict', KProperty0, false, function () {
|
|
224
|
-
return THROW_ISE();
|
|
225
|
-
}));
|
|
226
|
-
parser.a2a(args);
|
|
227
|
-
var logger = new cli$logger$1(debug$delegate);
|
|
228
|
-
compile_0(toSet(cli$lambda_2(language$delegate)), cli$lambda_0(input$delegate), cli$lambda_1(output$delegate), cli$lambda_4(packageName$delegate), cli$lambda_3(format$delegate), cli$lambda_5(strict$delegate), logger);
|
|
229
610
|
}
|
|
230
611
|
var Jvm_Java_instance;
|
|
231
612
|
var Jvm_Kotlin_instance;
|
|
@@ -249,9 +630,8 @@
|
|
|
249
630
|
}
|
|
250
631
|
var $ENTRIES;
|
|
251
632
|
var Script_TypeScript_instance;
|
|
252
|
-
var Script_Wirespec_instance;
|
|
253
633
|
function values_0() {
|
|
254
|
-
return [Script_TypeScript_getInstance()
|
|
634
|
+
return [Script_TypeScript_getInstance()];
|
|
255
635
|
}
|
|
256
636
|
function get_entries_0() {
|
|
257
637
|
if ($ENTRIES_0 == null)
|
|
@@ -264,26 +644,23 @@
|
|
|
264
644
|
return Unit_getInstance();
|
|
265
645
|
Script_entriesInitialized = true;
|
|
266
646
|
Script_TypeScript_instance = new Script('TypeScript', 0);
|
|
267
|
-
Script_Wirespec_instance = new Script('Wirespec', 1);
|
|
268
647
|
}
|
|
269
648
|
var $ENTRIES_0;
|
|
270
|
-
var
|
|
271
|
-
var OpenApi_OpenApiV3_instance;
|
|
649
|
+
var Spec_Wirespec_instance;
|
|
272
650
|
function values_1() {
|
|
273
|
-
return [
|
|
651
|
+
return [Spec_Wirespec_getInstance()];
|
|
274
652
|
}
|
|
275
653
|
function get_entries_1() {
|
|
276
654
|
if ($ENTRIES_1 == null)
|
|
277
655
|
$ENTRIES_1 = enumEntries(values_1());
|
|
278
656
|
return $ENTRIES_1;
|
|
279
657
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
if (
|
|
658
|
+
var Spec_entriesInitialized;
|
|
659
|
+
function Spec_initEntries() {
|
|
660
|
+
if (Spec_entriesInitialized)
|
|
283
661
|
return Unit_getInstance();
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
OpenApi_OpenApiV3_instance = new OpenApi('OpenApiV3', 1);
|
|
662
|
+
Spec_entriesInitialized = true;
|
|
663
|
+
Spec_Wirespec_instance = new Spec('Wirespec', 0);
|
|
287
664
|
}
|
|
288
665
|
var $ENTRIES_1;
|
|
289
666
|
function Jvm(name, ordinal) {
|
|
@@ -292,18 +669,18 @@
|
|
|
292
669
|
function Script(name, ordinal) {
|
|
293
670
|
Enum.call(this, name, ordinal);
|
|
294
671
|
}
|
|
295
|
-
function
|
|
672
|
+
function Spec(name, ordinal) {
|
|
296
673
|
Enum.call(this, name, ordinal);
|
|
297
674
|
}
|
|
298
675
|
function Companion() {
|
|
299
676
|
Companion_instance = this;
|
|
300
677
|
}
|
|
301
|
-
protoOf(Companion).
|
|
678
|
+
protoOf(Companion).y24 = function () {
|
|
302
679
|
return plus(plus(get_entries(), get_entries_0()), get_entries_1());
|
|
303
680
|
};
|
|
304
|
-
protoOf(Companion).
|
|
681
|
+
protoOf(Companion).x24 = function (s) {
|
|
305
682
|
// Inline function 'kotlin.collections.find' call
|
|
306
|
-
var tmp0_find = this.
|
|
683
|
+
var tmp0_find = this.y24();
|
|
307
684
|
var tmp$ret$1;
|
|
308
685
|
$l$block: {
|
|
309
686
|
// Inline function 'kotlin.collections.firstOrNull' call
|
|
@@ -311,7 +688,7 @@
|
|
|
311
688
|
while (tmp0_iterator.d()) {
|
|
312
689
|
var element = tmp0_iterator.e();
|
|
313
690
|
// Inline function 'community.flock.wirespec.compiler.cli.Companion.valueOf.<anonymous>' call
|
|
314
|
-
if (element.
|
|
691
|
+
if (element.t4_1 === s) {
|
|
315
692
|
tmp$ret$1 = element;
|
|
316
693
|
break $l$block;
|
|
317
694
|
}
|
|
@@ -321,6 +698,9 @@
|
|
|
321
698
|
var tmp = tmp$ret$1;
|
|
322
699
|
return (tmp == null ? true : isInterface(tmp, Language)) ? tmp : THROW_CCE();
|
|
323
700
|
};
|
|
701
|
+
protoOf(Companion).toString = function () {
|
|
702
|
+
return joinToString(this.y24());
|
|
703
|
+
};
|
|
324
704
|
var Companion_instance;
|
|
325
705
|
function Companion_getInstance_3() {
|
|
326
706
|
if (Companion_instance == null)
|
|
@@ -343,123 +723,48 @@
|
|
|
343
723
|
Script_initEntries();
|
|
344
724
|
return Script_TypeScript_instance;
|
|
345
725
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
348
|
-
return
|
|
726
|
+
function Spec_Wirespec_getInstance() {
|
|
727
|
+
Spec_initEntries();
|
|
728
|
+
return Spec_Wirespec_instance;
|
|
349
729
|
}
|
|
350
|
-
function
|
|
351
|
-
OpenApi_initEntries();
|
|
352
|
-
return OpenApi_OpenApiV2_instance;
|
|
730
|
+
function Language() {
|
|
353
731
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
732
|
+
var Format_OPEN_API_V2_instance;
|
|
733
|
+
var Format_OPEN_API_V3_instance;
|
|
734
|
+
function Companion_0() {
|
|
735
|
+
Companion_instance_0 = this;
|
|
357
736
|
}
|
|
358
|
-
function
|
|
737
|
+
protoOf(Companion_0).toString = function () {
|
|
738
|
+
return joinToString(get_entries_2());
|
|
739
|
+
};
|
|
740
|
+
var Companion_instance_0;
|
|
741
|
+
function Companion_getInstance_4() {
|
|
742
|
+
Format_initEntries();
|
|
743
|
+
if (Companion_instance_0 == null)
|
|
744
|
+
new Companion_0();
|
|
745
|
+
return Companion_instance_0;
|
|
359
746
|
}
|
|
360
|
-
var Format_Wirespec_instance;
|
|
361
|
-
var Format_OpenApiV2_instance;
|
|
362
|
-
var Format_OpenApiV3_instance;
|
|
363
747
|
function values_2() {
|
|
364
|
-
return [
|
|
748
|
+
return [Format_OPEN_API_V2_getInstance(), Format_OPEN_API_V3_getInstance()];
|
|
749
|
+
}
|
|
750
|
+
function get_entries_2() {
|
|
751
|
+
if ($ENTRIES_2 == null)
|
|
752
|
+
$ENTRIES_2 = enumEntries(values_2());
|
|
753
|
+
return $ENTRIES_2;
|
|
365
754
|
}
|
|
366
755
|
var Format_entriesInitialized;
|
|
367
756
|
function Format_initEntries() {
|
|
368
757
|
if (Format_entriesInitialized)
|
|
369
758
|
return Unit_getInstance();
|
|
370
759
|
Format_entriesInitialized = true;
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
760
|
+
Format_OPEN_API_V2_instance = new Format('OPEN_API_V2', 0);
|
|
761
|
+
Format_OPEN_API_V3_instance = new Format('OPEN_API_V3', 1);
|
|
762
|
+
Companion_getInstance_4();
|
|
374
763
|
}
|
|
764
|
+
var $ENTRIES_2;
|
|
375
765
|
function Format(name, ordinal) {
|
|
376
766
|
Enum.call(this, name, ordinal);
|
|
377
767
|
}
|
|
378
|
-
function compile_0(languages, input, output, packageName, format, strict, logger) {
|
|
379
|
-
if (listOf_0([Format_OpenApiV2_getInstance(), Format_OpenApiV3_getInstance()]).k1(format)) {
|
|
380
|
-
var fullPath = Companion_getInstance_4().h2d(input);
|
|
381
|
-
var file = new JsonFile(fullPath);
|
|
382
|
-
var tmp;
|
|
383
|
-
switch (format.z4_1) {
|
|
384
|
-
case 1:
|
|
385
|
-
tmp = Companion_getInstance_0().c27(file.m16(), !strict);
|
|
386
|
-
break;
|
|
387
|
-
case 2:
|
|
388
|
-
tmp = Companion_getInstance_1().c27(file.m16(), !strict);
|
|
389
|
-
break;
|
|
390
|
-
case 0:
|
|
391
|
-
throw IllegalStateException_init_$Create$('Wirespec is not parsed here');
|
|
392
|
-
default:
|
|
393
|
-
noWhenBranchMatchedException();
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
var ast = tmp;
|
|
397
|
-
var path = out(fullPath, packageName, output);
|
|
398
|
-
// Inline function 'kotlin.collections.map' call
|
|
399
|
-
// Inline function 'kotlin.collections.map' call
|
|
400
|
-
var tmp0_map = emit(languages, packageName, path, logger);
|
|
401
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
402
|
-
var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
|
|
403
|
-
var tmp0_iterator = tmp0_map.c();
|
|
404
|
-
while (tmp0_iterator.d()) {
|
|
405
|
-
var item = tmp0_iterator.e();
|
|
406
|
-
var tmp$ret$7;
|
|
407
|
-
// Inline function 'community.flock.wirespec.compiler.cli.compile.<anonymous>' call
|
|
408
|
-
var emitter = item.k3();
|
|
409
|
-
var file_0 = item.l3();
|
|
410
|
-
var result = emitter.s20(ast);
|
|
411
|
-
var tmp_0;
|
|
412
|
-
if (!emitter.z23()) {
|
|
413
|
-
var tmp$ret$6;
|
|
414
|
-
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
415
|
-
var tmp0_replaceFirstChar = fullPath.m2d_1;
|
|
416
|
-
var tmp_1;
|
|
417
|
-
// Inline function 'kotlin.text.isNotEmpty' call
|
|
418
|
-
if (charSequenceLength(tmp0_replaceFirstChar) > 0) {
|
|
419
|
-
var tmp$ret$3;
|
|
420
|
-
// Inline function 'kotlin.text.uppercase' call
|
|
421
|
-
var tmp1_uppercase = charSequenceGet(tmp0_replaceFirstChar, 0);
|
|
422
|
-
// Inline function 'kotlin.js.unsafeCast' call
|
|
423
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
424
|
-
tmp$ret$3 = toString(tmp1_uppercase).toUpperCase();
|
|
425
|
-
var tmp_2 = toString_0(tmp$ret$3);
|
|
426
|
-
// Inline function 'kotlin.text.substring' call
|
|
427
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
428
|
-
tmp_1 = tmp_2 + tmp0_replaceFirstChar.substring(1);
|
|
429
|
-
} else {
|
|
430
|
-
tmp_1 = tmp0_replaceFirstChar;
|
|
431
|
-
}
|
|
432
|
-
tmp$ret$6 = tmp_1;
|
|
433
|
-
tmp_0 = to(listOf(to(tmp$ret$6, first(result).j3_1)), file_0);
|
|
434
|
-
} else {
|
|
435
|
-
tmp_0 = to(result, file_0);
|
|
436
|
-
}
|
|
437
|
-
tmp$ret$7 = tmp_0;
|
|
438
|
-
tmp0_mapTo.a(tmp$ret$7);
|
|
439
|
-
}
|
|
440
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
441
|
-
var tmp0_mapTo_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_mapTo, 10));
|
|
442
|
-
var tmp0_iterator_0 = tmp0_mapTo.c();
|
|
443
|
-
while (tmp0_iterator_0.d()) {
|
|
444
|
-
var item_0 = tmp0_iterator_0.e();
|
|
445
|
-
var results = item_0.k3();
|
|
446
|
-
var file_1 = item_0.l3();
|
|
447
|
-
write(results, file_1);
|
|
448
|
-
tmp0_mapTo_0.a(Unit_getInstance());
|
|
449
|
-
}
|
|
450
|
-
} else {
|
|
451
|
-
if (endsWith(input, '.ws')) {
|
|
452
|
-
return wirespec(new WirespecFile(Companion_getInstance_4().h2d(input)), languages, packageName, output, logger);
|
|
453
|
-
}
|
|
454
|
-
// Inline function 'kotlin.collections.forEach' call
|
|
455
|
-
var tmp0_iterator_1 = (new Directory(input)).j2d().c();
|
|
456
|
-
while (tmp0_iterator_1.d()) {
|
|
457
|
-
var element = tmp0_iterator_1.e();
|
|
458
|
-
// Inline function 'community.flock.wirespec.compiler.cli.compile.<anonymous>' call
|
|
459
|
-
wirespec(element, languages, packageName, output, logger);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
768
|
function out(_this__u8e3s4, packageName, output) {
|
|
464
769
|
return out$lambda(output, _this__u8e3s4, packageName);
|
|
465
770
|
}
|
|
@@ -471,13 +776,13 @@
|
|
|
471
776
|
// Inline function 'community.flock.wirespec.compiler.cli.write.<anonymous>' call
|
|
472
777
|
var name = element.k3();
|
|
473
778
|
var result = element.l3();
|
|
474
|
-
file.
|
|
779
|
+
file.n25(name).o25(result);
|
|
475
780
|
}
|
|
476
781
|
}
|
|
477
782
|
function emit(languages, packageName, path, logger) {
|
|
478
783
|
// Inline function 'kotlin.collections.map' call
|
|
479
784
|
// Inline function 'kotlin.collections.mapTo' call
|
|
480
|
-
var tmp0_mapTo = ArrayList_init_$Create$
|
|
785
|
+
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(languages, 10));
|
|
481
786
|
var tmp0_iterator = languages.c();
|
|
482
787
|
while (tmp0_iterator.d()) {
|
|
483
788
|
var item = tmp0_iterator.e();
|
|
@@ -492,12 +797,8 @@
|
|
|
492
797
|
tmp = to(new ScalaEmitter(packageName, logger), new ScalaFile(path(Extension_Scala_getInstance())));
|
|
493
798
|
} else if (equals(item, Script_TypeScript_getInstance())) {
|
|
494
799
|
tmp = to(new TypeScriptEmitter(logger), new TypeScriptFile(path(Extension_TypeScript_getInstance())));
|
|
495
|
-
} else if (equals(item,
|
|
800
|
+
} else if (equals(item, Spec_Wirespec_getInstance())) {
|
|
496
801
|
tmp = to(new WirespecEmitter(logger), new WirespecFile(path(Extension_Wirespec_getInstance())));
|
|
497
|
-
} else if (equals(item, OpenApi_OpenApiV2_getInstance())) {
|
|
498
|
-
tmp = to(new OpenApiV2Emitter(logger), new JsonFile(path(Extension_Json_getInstance())));
|
|
499
|
-
} else if (equals(item, OpenApi_OpenApiV3_getInstance())) {
|
|
500
|
-
tmp = to(new OpenApiV2Emitter(logger), new JsonFile(path(Extension_Json_getInstance())));
|
|
501
802
|
} else {
|
|
502
803
|
noWhenBranchMatchedException();
|
|
503
804
|
}
|
|
@@ -507,11 +808,11 @@
|
|
|
507
808
|
return tmp0_mapTo;
|
|
508
809
|
}
|
|
509
810
|
function wirespec(_this__u8e3s4, languages, packageName, output, logger) {
|
|
510
|
-
var path = out(_this__u8e3s4.
|
|
811
|
+
var path = out(_this__u8e3s4.j25_1, packageName, output);
|
|
511
812
|
// Inline function 'kotlin.collections.map' call
|
|
512
813
|
// Inline function 'kotlin.let' call
|
|
513
814
|
// Inline function 'kotlin.let' call
|
|
514
|
-
var tmp0_let = _this__u8e3s4.
|
|
815
|
+
var tmp0_let = _this__u8e3s4.d10();
|
|
515
816
|
var tmp1_let_this = Wirespec_getInstance();
|
|
516
817
|
// Inline function 'kotlin.contracts.contract' call
|
|
517
818
|
var tmp2_let = compile(tmp1_let_this, tmp0_let)(logger);
|
|
@@ -520,7 +821,7 @@
|
|
|
520
821
|
// Inline function 'kotlin.collections.map' call
|
|
521
822
|
var tmp0_map = emit(languages, packageName, path, logger);
|
|
522
823
|
// Inline function 'kotlin.collections.mapTo' call
|
|
523
|
-
var tmp0_mapTo = ArrayList_init_$Create$
|
|
824
|
+
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
|
|
524
825
|
var tmp0_iterator = tmp0_map.c();
|
|
525
826
|
while (tmp0_iterator.d()) {
|
|
526
827
|
var item = tmp0_iterator.e();
|
|
@@ -530,7 +831,7 @@
|
|
|
530
831
|
var file = item.l3();
|
|
531
832
|
var result = tmp2_let(emitter);
|
|
532
833
|
var tmp;
|
|
533
|
-
if (!emitter.
|
|
834
|
+
if (!emitter.s1s()) {
|
|
534
835
|
var tmp$ret$12;
|
|
535
836
|
// Inline function 'arrow.core.Either.map' call
|
|
536
837
|
// Inline function 'kotlin.contracts.contract' call
|
|
@@ -539,12 +840,12 @@
|
|
|
539
840
|
var tmp_0;
|
|
540
841
|
if (result instanceof Right) {
|
|
541
842
|
// Inline function 'arrow.core.Either.map.<anonymous>' call
|
|
542
|
-
var tmp0_anonymous = result.
|
|
843
|
+
var tmp0_anonymous = result.j1o_1;
|
|
543
844
|
var tmp$ret$9;
|
|
544
845
|
// Inline function 'community.flock.wirespec.compiler.cli.wirespec.<anonymous>.<anonymous>.<anonymous>' call
|
|
545
846
|
var tmp$ret$8;
|
|
546
847
|
// Inline function 'kotlin.text.replaceFirstChar' call
|
|
547
|
-
var tmp0_replaceFirstChar = _this__u8e3s4.
|
|
848
|
+
var tmp0_replaceFirstChar = _this__u8e3s4.j25_1.l25_1;
|
|
548
849
|
var tmp_1;
|
|
549
850
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
550
851
|
if (charSequenceLength(tmp0_replaceFirstChar) > 0) {
|
|
@@ -580,7 +881,7 @@
|
|
|
580
881
|
tmp0_mapTo.a(tmp$ret$13);
|
|
581
882
|
}
|
|
582
883
|
// Inline function 'kotlin.collections.mapTo' call
|
|
583
|
-
var tmp0_mapTo_0 = ArrayList_init_$Create$
|
|
884
|
+
var tmp0_mapTo_0 = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_mapTo, 10));
|
|
584
885
|
var tmp0_iterator_0 = tmp0_mapTo.c();
|
|
585
886
|
while (tmp0_iterator_0.d()) {
|
|
586
887
|
var item_0 = tmp0_iterator_0.e();
|
|
@@ -588,106 +889,15 @@
|
|
|
588
889
|
var results = item_0.k3();
|
|
589
890
|
var file_0 = item_0.l3();
|
|
590
891
|
if (results instanceof Right) {
|
|
591
|
-
write(results.
|
|
892
|
+
write(results.j1o_1, file_0);
|
|
592
893
|
} else {
|
|
593
894
|
if (results instanceof Left) {
|
|
594
|
-
println(results.
|
|
895
|
+
println(results.e1o_1);
|
|
595
896
|
}
|
|
596
897
|
}
|
|
597
898
|
tmp0_mapTo_0.a(Unit_getInstance());
|
|
598
899
|
}
|
|
599
900
|
}
|
|
600
|
-
function cli$lambda($debug$delegate) {
|
|
601
|
-
return $debug$delegate.m2b(null, getLocalDelegateReference('debug', KProperty0, false, function () {
|
|
602
|
-
return THROW_ISE();
|
|
603
|
-
}));
|
|
604
|
-
}
|
|
605
|
-
function cli$lambda_0($input$delegate) {
|
|
606
|
-
return $input$delegate.m2b(null, getLocalDelegateReference('input', KProperty0, false, function () {
|
|
607
|
-
return THROW_ISE();
|
|
608
|
-
}));
|
|
609
|
-
}
|
|
610
|
-
function cli$lambda_1($output$delegate) {
|
|
611
|
-
return $output$delegate.m2b(null, getLocalDelegateReference('output', KProperty0, false, function () {
|
|
612
|
-
return THROW_ISE();
|
|
613
|
-
}));
|
|
614
|
-
}
|
|
615
|
-
function cli$lambda_2($language$delegate) {
|
|
616
|
-
return $language$delegate.m2b(null, getLocalDelegateReference('language', KProperty0, false, function () {
|
|
617
|
-
return THROW_ISE();
|
|
618
|
-
}));
|
|
619
|
-
}
|
|
620
|
-
function cli$lambda_3($format$delegate) {
|
|
621
|
-
return $format$delegate.m2b(null, getLocalDelegateReference('format', KProperty0, false, function () {
|
|
622
|
-
return THROW_ISE();
|
|
623
|
-
}));
|
|
624
|
-
}
|
|
625
|
-
function cli$lambda_4($packageName$delegate) {
|
|
626
|
-
return $packageName$delegate.m2b(null, getLocalDelegateReference('packageName', KProperty0, false, function () {
|
|
627
|
-
return THROW_ISE();
|
|
628
|
-
}));
|
|
629
|
-
}
|
|
630
|
-
function cli$lambda_5($strict$delegate) {
|
|
631
|
-
return $strict$delegate.m2b(null, getLocalDelegateReference('strict', KProperty0, false, function () {
|
|
632
|
-
return THROW_ISE();
|
|
633
|
-
}));
|
|
634
|
-
}
|
|
635
|
-
function cli$lambda_6(it) {
|
|
636
|
-
var tmp0_elvis_lhs = Companion_getInstance_3().g2d(it);
|
|
637
|
-
var tmp;
|
|
638
|
-
if (tmp0_elvis_lhs == null) {
|
|
639
|
-
throw IllegalStateException_init_$Create$('Language not found');
|
|
640
|
-
} else {
|
|
641
|
-
tmp = tmp0_elvis_lhs;
|
|
642
|
-
}
|
|
643
|
-
return tmp;
|
|
644
|
-
}
|
|
645
|
-
function cli$lambda_7(it) {
|
|
646
|
-
// Inline function 'kotlin.text.lowercase' call
|
|
647
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
648
|
-
return it.toString().toLowerCase();
|
|
649
|
-
}
|
|
650
|
-
function cli$lambda_8($tmp3_Choice) {
|
|
651
|
-
return function (it) {
|
|
652
|
-
var tmp$ret$3;
|
|
653
|
-
// Inline function 'kotlin.collections.find' call
|
|
654
|
-
var tmp$ret$0;
|
|
655
|
-
// Inline function 'kotlin.enumValues' call
|
|
656
|
-
tmp$ret$0 = values_2();
|
|
657
|
-
var tmp0_find = tmp$ret$0;
|
|
658
|
-
var tmp$ret$2;
|
|
659
|
-
$l$block: {
|
|
660
|
-
// Inline function 'kotlin.collections.firstOrNull' call
|
|
661
|
-
var indexedObject = tmp0_find;
|
|
662
|
-
var inductionVariable = 0;
|
|
663
|
-
var last = indexedObject.length;
|
|
664
|
-
while (inductionVariable < last) {
|
|
665
|
-
var element = indexedObject[inductionVariable];
|
|
666
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
667
|
-
var tmp$ret$1;
|
|
668
|
-
// Inline function 'kotlinx.cli.Companion.Choice.<anonymous>.<anonymous>' call
|
|
669
|
-
tmp$ret$1 = equals_0($tmp3_Choice(element), it, true);
|
|
670
|
-
if (tmp$ret$1) {
|
|
671
|
-
tmp$ret$2 = element;
|
|
672
|
-
break $l$block;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
tmp$ret$2 = null;
|
|
676
|
-
}
|
|
677
|
-
tmp$ret$3 = tmp$ret$2;
|
|
678
|
-
var tmp0_elvis_lhs = tmp$ret$3;
|
|
679
|
-
var tmp;
|
|
680
|
-
if (tmp0_elvis_lhs == null) {
|
|
681
|
-
throw IllegalArgumentException_init_$Create$('No enum constant ' + it);
|
|
682
|
-
} else {
|
|
683
|
-
tmp = tmp0_elvis_lhs;
|
|
684
|
-
}
|
|
685
|
-
return tmp;
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
function cli$logger$1($debug$delegate) {
|
|
689
|
-
Logger.call(this, cli$lambda($debug$delegate));
|
|
690
|
-
}
|
|
691
901
|
function out$lambda($output, $this_out, $packageName) {
|
|
692
902
|
return function (extension) {
|
|
693
903
|
var tmp0_elvis_lhs = $output;
|
|
@@ -695,30 +905,26 @@
|
|
|
695
905
|
if (tmp0_elvis_lhs == null) {
|
|
696
906
|
var tmp$ret$1;
|
|
697
907
|
// Inline function 'kotlin.text.lowercase' call
|
|
698
|
-
var tmp0_lowercase = extension.
|
|
908
|
+
var tmp0_lowercase = extension.t4_1;
|
|
699
909
|
var tmp$ret$0;
|
|
700
910
|
// Inline function 'kotlin.js.asDynamic' call
|
|
701
911
|
tmp$ret$0 = tmp0_lowercase;
|
|
702
912
|
tmp$ret$1 = tmp$ret$0.toLowerCase();
|
|
703
|
-
tmp = $this_out.
|
|
913
|
+
tmp = $this_out.k25_1 + '/out/' + tmp$ret$1;
|
|
704
914
|
} else {
|
|
705
915
|
tmp = tmp0_elvis_lhs;
|
|
706
916
|
}
|
|
707
917
|
var dir = tmp;
|
|
708
|
-
return $this_out.
|
|
918
|
+
return $this_out.p25(dir + '/' + joinToString(split($packageName, charArrayOf([_Char___init__impl__6a9atx(46)])), '/'), VOID, extension);
|
|
709
919
|
};
|
|
710
920
|
}
|
|
711
|
-
function
|
|
921
|
+
function Format_OPEN_API_V2_getInstance() {
|
|
712
922
|
Format_initEntries();
|
|
713
|
-
return
|
|
923
|
+
return Format_OPEN_API_V2_instance;
|
|
714
924
|
}
|
|
715
|
-
function
|
|
925
|
+
function Format_OPEN_API_V3_getInstance() {
|
|
716
926
|
Format_initEntries();
|
|
717
|
-
return
|
|
718
|
-
}
|
|
719
|
-
function Format_OpenApiV3_getInstance() {
|
|
720
|
-
Format_initEntries();
|
|
721
|
-
return Format_OpenApiV3_instance;
|
|
927
|
+
return Format_OPEN_API_V3_instance;
|
|
722
928
|
}
|
|
723
929
|
var Extension_Java_instance;
|
|
724
930
|
var Extension_Kotlin_instance;
|
|
@@ -729,10 +935,10 @@
|
|
|
729
935
|
function values_3() {
|
|
730
936
|
return [Extension_Java_getInstance(), Extension_Kotlin_getInstance(), Extension_Scala_getInstance(), Extension_TypeScript_getInstance(), Extension_Wirespec_getInstance(), Extension_Json_getInstance()];
|
|
731
937
|
}
|
|
732
|
-
function
|
|
733
|
-
if ($
|
|
734
|
-
$
|
|
735
|
-
return $
|
|
938
|
+
function get_entries_3() {
|
|
939
|
+
if ($ENTRIES_3 == null)
|
|
940
|
+
$ENTRIES_3 = enumEntries(values_3());
|
|
941
|
+
return $ENTRIES_3;
|
|
736
942
|
}
|
|
737
943
|
var Extension_entriesInitialized;
|
|
738
944
|
function Extension_initEntries() {
|
|
@@ -746,10 +952,10 @@
|
|
|
746
952
|
Extension_Wirespec_instance = new Extension('Wirespec', 4, 'ws');
|
|
747
953
|
Extension_Json_instance = new Extension('Json', 5, 'json');
|
|
748
954
|
}
|
|
749
|
-
var $
|
|
955
|
+
var $ENTRIES_3;
|
|
750
956
|
function Extension(name, ordinal, ext) {
|
|
751
957
|
Enum.call(this, name, ordinal);
|
|
752
|
-
this.
|
|
958
|
+
this.i25_1 = ext;
|
|
753
959
|
}
|
|
754
960
|
function Extension_Java_getInstance() {
|
|
755
961
|
Extension_initEntries();
|
|
@@ -775,10 +981,10 @@
|
|
|
775
981
|
Extension_initEntries();
|
|
776
982
|
return Extension_Json_instance;
|
|
777
983
|
}
|
|
778
|
-
function
|
|
779
|
-
|
|
984
|
+
function Companion_1() {
|
|
985
|
+
Companion_instance_1 = this;
|
|
780
986
|
}
|
|
781
|
-
protoOf(
|
|
987
|
+
protoOf(Companion_1).f25 = function (input) {
|
|
782
988
|
// Inline function 'kotlin.let' call
|
|
783
989
|
var tmp0_let = split_0(input, ['/']);
|
|
784
990
|
// Inline function 'kotlin.contracts.contract' call
|
|
@@ -791,7 +997,7 @@
|
|
|
791
997
|
// Inline function 'kotlin.contracts.contract' call
|
|
792
998
|
// Inline function 'community.flock.wirespec.compiler.cli.io.Companion.parse.<anonymous>' call
|
|
793
999
|
// Inline function 'kotlin.collections.find' call
|
|
794
|
-
var tmp0_find =
|
|
1000
|
+
var tmp0_find = get_entries_3();
|
|
795
1001
|
var tmp$ret$5;
|
|
796
1002
|
$l$block: {
|
|
797
1003
|
// Inline function 'kotlin.collections.firstOrNull' call
|
|
@@ -799,7 +1005,7 @@
|
|
|
799
1005
|
while (tmp0_iterator.d()) {
|
|
800
1006
|
var element = tmp0_iterator.e();
|
|
801
1007
|
// Inline function 'community.flock.wirespec.compiler.cli.io.Companion.parse.<anonymous>.<anonymous>' call
|
|
802
|
-
if (element.
|
|
1008
|
+
if (element.i25_1 === tmp2_let) {
|
|
803
1009
|
tmp$ret$5 = element;
|
|
804
1010
|
break $l$block;
|
|
805
1011
|
}
|
|
@@ -818,35 +1024,35 @@
|
|
|
818
1024
|
var path = joinToString(list.s(0, list.f() - 2 | 0), '/');
|
|
819
1025
|
return new FullFilePath(path, filename, extension);
|
|
820
1026
|
};
|
|
821
|
-
var
|
|
822
|
-
function
|
|
823
|
-
if (
|
|
824
|
-
new
|
|
825
|
-
return
|
|
1027
|
+
var Companion_instance_1;
|
|
1028
|
+
function Companion_getInstance_5() {
|
|
1029
|
+
if (Companion_instance_1 == null)
|
|
1030
|
+
new Companion_1();
|
|
1031
|
+
return Companion_instance_1;
|
|
826
1032
|
}
|
|
827
1033
|
function FullFilePath(directory, fileName, extension) {
|
|
828
|
-
|
|
1034
|
+
Companion_getInstance_5();
|
|
829
1035
|
extension = extension === VOID ? Extension_Wirespec_getInstance() : extension;
|
|
830
|
-
this.
|
|
831
|
-
this.
|
|
832
|
-
this.
|
|
1036
|
+
this.k25_1 = directory;
|
|
1037
|
+
this.l25_1 = fileName;
|
|
1038
|
+
this.m25_1 = extension;
|
|
833
1039
|
}
|
|
834
1040
|
protoOf(FullFilePath).toString = function () {
|
|
835
|
-
return this.
|
|
1041
|
+
return this.k25_1 + '/' + this.l25_1 + '.' + this.m25_1.i25_1;
|
|
836
1042
|
};
|
|
837
|
-
protoOf(FullFilePath).
|
|
1043
|
+
protoOf(FullFilePath).q25 = function (directory, fileName, extension) {
|
|
838
1044
|
return new FullFilePath(directory, fileName, extension);
|
|
839
1045
|
};
|
|
840
|
-
protoOf(FullFilePath).
|
|
841
|
-
directory = directory === VOID ? this.
|
|
842
|
-
fileName = fileName === VOID ? this.
|
|
843
|
-
extension = extension === VOID ? this.
|
|
844
|
-
return $super === VOID ? this.
|
|
1046
|
+
protoOf(FullFilePath).p25 = function (directory, fileName, extension, $super) {
|
|
1047
|
+
directory = directory === VOID ? this.k25_1 : directory;
|
|
1048
|
+
fileName = fileName === VOID ? this.l25_1 : fileName;
|
|
1049
|
+
extension = extension === VOID ? this.m25_1 : extension;
|
|
1050
|
+
return $super === VOID ? this.q25(directory, fileName, extension) : $super.q25.call(this, directory, fileName, extension);
|
|
845
1051
|
};
|
|
846
1052
|
protoOf(FullFilePath).hashCode = function () {
|
|
847
|
-
var result = getStringHashCode(this.
|
|
848
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
849
|
-
result = imul(result, 31) + this.
|
|
1053
|
+
var result = getStringHashCode(this.k25_1);
|
|
1054
|
+
result = imul(result, 31) + getStringHashCode(this.l25_1) | 0;
|
|
1055
|
+
result = imul(result, 31) + this.m25_1.hashCode() | 0;
|
|
850
1056
|
return result;
|
|
851
1057
|
};
|
|
852
1058
|
protoOf(FullFilePath).equals = function (other) {
|
|
@@ -855,63 +1061,63 @@
|
|
|
855
1061
|
if (!(other instanceof FullFilePath))
|
|
856
1062
|
return false;
|
|
857
1063
|
var tmp0_other_with_cast = other instanceof FullFilePath ? other : THROW_CCE();
|
|
858
|
-
if (!(this.
|
|
1064
|
+
if (!(this.k25_1 === tmp0_other_with_cast.k25_1))
|
|
859
1065
|
return false;
|
|
860
|
-
if (!(this.
|
|
1066
|
+
if (!(this.l25_1 === tmp0_other_with_cast.l25_1))
|
|
861
1067
|
return false;
|
|
862
|
-
if (!this.
|
|
1068
|
+
if (!this.m25_1.equals(tmp0_other_with_cast.m25_1))
|
|
863
1069
|
return false;
|
|
864
1070
|
return true;
|
|
865
1071
|
};
|
|
866
1072
|
function JavaFile(path) {
|
|
867
|
-
File.call(this, path.
|
|
1073
|
+
File.call(this, path.p25(VOID, VOID, Extension_Java_getInstance()));
|
|
868
1074
|
}
|
|
869
|
-
protoOf(JavaFile).
|
|
870
|
-
return new JavaFile(this.
|
|
1075
|
+
protoOf(JavaFile).n25 = function (fileName) {
|
|
1076
|
+
return new JavaFile(this.j25_1.p25(VOID, fileName));
|
|
871
1077
|
};
|
|
872
1078
|
function JsonFile(path) {
|
|
873
|
-
File.call(this, path.
|
|
1079
|
+
File.call(this, path.p25(VOID, VOID, Extension_Json_getInstance()));
|
|
874
1080
|
}
|
|
875
|
-
protoOf(JsonFile).
|
|
876
|
-
return new JsonFile(this.
|
|
1081
|
+
protoOf(JsonFile).n25 = function (fileName) {
|
|
1082
|
+
return new JsonFile(this.j25_1.p25(VOID, fileName));
|
|
877
1083
|
};
|
|
878
1084
|
function KotlinFile(path) {
|
|
879
|
-
File.call(this, path.
|
|
1085
|
+
File.call(this, path.p25(VOID, VOID, Extension_Kotlin_getInstance()));
|
|
880
1086
|
}
|
|
881
|
-
protoOf(KotlinFile).
|
|
882
|
-
return new KotlinFile(this.
|
|
1087
|
+
protoOf(KotlinFile).n25 = function (fileName) {
|
|
1088
|
+
return new KotlinFile(this.j25_1.p25(VOID, fileName));
|
|
883
1089
|
};
|
|
884
1090
|
function ScalaFile(path) {
|
|
885
|
-
File.call(this, path.
|
|
1091
|
+
File.call(this, path.p25(VOID, VOID, Extension_Scala_getInstance()));
|
|
886
1092
|
}
|
|
887
|
-
protoOf(ScalaFile).
|
|
888
|
-
return new ScalaFile(this.
|
|
1093
|
+
protoOf(ScalaFile).n25 = function (fileName) {
|
|
1094
|
+
return new ScalaFile(this.j25_1.p25(VOID, fileName));
|
|
889
1095
|
};
|
|
890
1096
|
function TypeScriptFile(path) {
|
|
891
|
-
File.call(this, path.
|
|
1097
|
+
File.call(this, path.p25(VOID, VOID, Extension_TypeScript_getInstance()));
|
|
892
1098
|
}
|
|
893
|
-
protoOf(TypeScriptFile).
|
|
894
|
-
return new TypeScriptFile(this.
|
|
1099
|
+
protoOf(TypeScriptFile).n25 = function (fileName) {
|
|
1100
|
+
return new TypeScriptFile(this.j25_1.p25(VOID, fileName));
|
|
895
1101
|
};
|
|
896
1102
|
function WirespecFile(path) {
|
|
897
|
-
File.call(this, path.
|
|
1103
|
+
File.call(this, path.p25(VOID, VOID, Extension_Wirespec_getInstance()));
|
|
898
1104
|
}
|
|
899
|
-
protoOf(WirespecFile).
|
|
900
|
-
return new WirespecFile(this.
|
|
1105
|
+
protoOf(WirespecFile).n25 = function (fileName) {
|
|
1106
|
+
return new WirespecFile(this.j25_1.p25(VOID, fileName));
|
|
901
1107
|
};
|
|
902
1108
|
function Directory$wirespecFiles$lambda(it) {
|
|
903
1109
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
904
1110
|
return it;
|
|
905
1111
|
}
|
|
906
1112
|
function Directory$wirespecFiles$lambda_0(it) {
|
|
907
|
-
return endsWith(it, Extension_Wirespec_getInstance().
|
|
1113
|
+
return endsWith(it, Extension_Wirespec_getInstance().i25_1);
|
|
908
1114
|
}
|
|
909
1115
|
function Directory$wirespecFiles$lambda_1(it) {
|
|
910
|
-
return dropLast_0(it, Extension_Wirespec_getInstance().
|
|
1116
|
+
return dropLast_0(it, Extension_Wirespec_getInstance().i25_1.length + 1 | 0);
|
|
911
1117
|
}
|
|
912
1118
|
function Directory$wirespecFiles$lambda_2(this$0) {
|
|
913
1119
|
return function (it) {
|
|
914
|
-
return new FullFilePath(this$0.
|
|
1120
|
+
return new FullFilePath(this$0.d25_1, it);
|
|
915
1121
|
};
|
|
916
1122
|
}
|
|
917
1123
|
function WirespecFile$_init_$ref_cj1n5j() {
|
|
@@ -922,10 +1128,10 @@
|
|
|
922
1128
|
return l;
|
|
923
1129
|
}
|
|
924
1130
|
function Directory(path) {
|
|
925
|
-
this.
|
|
1131
|
+
this.d25_1 = path;
|
|
926
1132
|
}
|
|
927
|
-
protoOf(Directory).
|
|
928
|
-
var tmp = asSequence(iterator(get_fs().readdirSync(this.
|
|
1133
|
+
protoOf(Directory).e25 = function () {
|
|
1134
|
+
var tmp = asSequence(iterator(get_fs().readdirSync(this.d25_1, 'utf-8')));
|
|
929
1135
|
var tmp_0 = map(tmp, Directory$wirespecFiles$lambda);
|
|
930
1136
|
var tmp_1 = filter(tmp_0, Directory$wirespecFiles$lambda_0);
|
|
931
1137
|
var tmp_2 = map(tmp_1, Directory$wirespecFiles$lambda_1);
|
|
@@ -933,20 +1139,20 @@
|
|
|
933
1139
|
return toSet_0(map(tmp_3, WirespecFile$_init_$ref_cj1n5j()));
|
|
934
1140
|
};
|
|
935
1141
|
function File(path) {
|
|
936
|
-
this.
|
|
1142
|
+
this.j25_1 = path;
|
|
937
1143
|
}
|
|
938
|
-
protoOf(File).
|
|
1144
|
+
protoOf(File).d10 = function () {
|
|
939
1145
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
940
|
-
return get_fs().readFileSync(this.
|
|
1146
|
+
return get_fs().readFileSync(this.j25_1.toString(), 'utf-8');
|
|
941
1147
|
};
|
|
942
|
-
protoOf(File).
|
|
1148
|
+
protoOf(File).o25 = function (text) {
|
|
943
1149
|
// Inline function 'kotlin.run' call
|
|
944
|
-
var tmp0_run = this.
|
|
1150
|
+
var tmp0_run = this.j25_1.p25(joinToString(split_0(this.j25_1.k25_1, ['out']), 'out/node'));
|
|
945
1151
|
// Inline function 'kotlin.contracts.contract' call
|
|
946
1152
|
// Inline function 'community.flock.wirespec.compiler.cli.io.File.write.<anonymous>' call
|
|
947
1153
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
948
|
-
if (!get_fs().existsSync(tmp0_run.
|
|
949
|
-
get_fs().mkdirSync(tmp0_run.
|
|
1154
|
+
if (!get_fs().existsSync(tmp0_run.k25_1)) {
|
|
1155
|
+
get_fs().mkdirSync(tmp0_run.k25_1, {recursive: true});
|
|
950
1156
|
}
|
|
951
1157
|
get_fs().writeFileSync(tmp0_run.toString(), text);
|
|
952
1158
|
};
|