@flock/wirespec 0.8.46 → 0.8.49

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.
Files changed (32) hide show
  1. package/arrow-arrow-core.js +68 -47
  2. package/arrow-arrow-core.js.map +1 -1
  3. package/clikt-clikt.js +1207 -1207
  4. package/clikt-clikt.js.map +1 -1
  5. package/colormath-root-colormath.js +363 -363
  6. package/colormath-root-colormath.js.map +1 -1
  7. package/kotlin-kotlin-stdlib-js-ir.js +223 -223
  8. package/kotlin-kotlin-stdlib-js-ir.js.map +1 -1
  9. package/kotlin-openapi-bindings.js +2 -2
  10. package/kotlin-openapi-bindings.js.map +1 -1
  11. package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js +16 -16
  12. package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +1 -1
  13. package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js +9 -9
  14. package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +1 -1
  15. package/markdown.js +1896 -1896
  16. package/markdown.js.map +1 -1
  17. package/mordant-mordant.js +1650 -1650
  18. package/mordant-mordant.js.map +1 -1
  19. package/package.json +3 -3
  20. package/wirespec-bin.js +2 -2
  21. package/wirespec-src-compiler-core.js +1525 -1520
  22. package/wirespec-src-compiler-core.js.map +1 -1
  23. package/wirespec-src-compiler-lib.js +403 -380
  24. package/wirespec-src-compiler-lib.js.map +1 -1
  25. package/wirespec-src-converter-openapi.js +211 -211
  26. package/wirespec-src-converter-openapi.js.map +1 -1
  27. package/wirespec-src-plugin-arguments.js +543 -0
  28. package/wirespec-src-plugin-arguments.js.map +1 -0
  29. package/{wirespec-src-compiler-cli.js → wirespec-src-plugin-cli.js} +431 -812
  30. package/wirespec-src-plugin-cli.js.map +1 -0
  31. package/wirespec-src-compiler-cli.js.map +0 -1
  32. package/wirespec-src-compiler-lib.d.ts +0 -357
@@ -1,76 +1,83 @@
1
1
  (function (root, factory) {
2
2
  if (typeof define === 'function' && define.amd)
3
- define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './clikt-clikt.js', './wirespec-src-compiler-core.js', './wirespec-src-converter-openapi.js', './arrow-arrow-core.js'], factory);
3
+ define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './clikt-clikt.js', './wirespec-src-compiler-core.js', './wirespec-src-plugin-arguments.js', './wirespec-src-converter-openapi.js', './arrow-arrow-core.js', './wirespec-src-compiler-lib.js'], factory);
4
4
  else if (typeof exports === 'object')
5
- factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./clikt-clikt.js'), require('./wirespec-src-compiler-core.js'), require('./wirespec-src-converter-openapi.js'), require('./arrow-arrow-core.js'));
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./clikt-clikt.js'), require('./wirespec-src-compiler-core.js'), require('./wirespec-src-plugin-arguments.js'), require('./wirespec-src-converter-openapi.js'), require('./arrow-arrow-core.js'), require('./wirespec-src-compiler-lib.js'));
6
6
  else {
7
7
  if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
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'.");
8
+ throw new Error("Error loading module 'wirespec-src-plugin-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-plugin-cli'.");
9
9
  }
10
10
  if (typeof this['clikt-clikt'] === 'undefined') {
11
- throw new Error("Error loading module 'wirespec-src-compiler-cli'. Its dependency 'clikt-clikt' was not found. Please, check whether 'clikt-clikt' is loaded prior to 'wirespec-src-compiler-cli'.");
11
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'clikt-clikt' was not found. Please, check whether 'clikt-clikt' is loaded prior to 'wirespec-src-plugin-cli'.");
12
12
  }
13
13
  if (typeof this['wirespec-src-compiler-core'] === 'undefined') {
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'.");
14
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-compiler-core' was not found. Please, check whether 'wirespec-src-compiler-core' is loaded prior to 'wirespec-src-plugin-cli'.");
15
+ }
16
+ if (typeof this['wirespec-src-plugin-arguments'] === 'undefined') {
17
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-plugin-arguments' was not found. Please, check whether 'wirespec-src-plugin-arguments' is loaded prior to 'wirespec-src-plugin-cli'.");
15
18
  }
16
19
  if (typeof this['wirespec-src-converter-openapi'] === 'undefined') {
17
- throw new Error("Error loading module 'wirespec-src-compiler-cli'. Its dependency 'wirespec-src-converter-openapi' was not found. Please, check whether 'wirespec-src-converter-openapi' is loaded prior to 'wirespec-src-compiler-cli'.");
20
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-converter-openapi' was not found. Please, check whether 'wirespec-src-converter-openapi' is loaded prior to 'wirespec-src-plugin-cli'.");
18
21
  }
19
22
  if (typeof this['arrow-arrow-core'] === 'undefined') {
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'.");
23
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'arrow-arrow-core' was not found. Please, check whether 'arrow-arrow-core' is loaded prior to 'wirespec-src-plugin-cli'.");
24
+ }
25
+ if (typeof this['wirespec-src-compiler-lib'] === 'undefined') {
26
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-compiler-lib' was not found. Please, check whether 'wirespec-src-compiler-lib' is loaded prior to 'wirespec-src-plugin-cli'.");
21
27
  }
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['clikt-clikt'], this['wirespec-src-compiler-core'], this['wirespec-src-converter-openapi'], this['arrow-arrow-core']);
28
+ root['wirespec-src-plugin-cli'] = factory(typeof this['wirespec-src-plugin-cli'] === 'undefined' ? {} : this['wirespec-src-plugin-cli'], this['kotlin-kotlin-stdlib-js-ir'], this['clikt-clikt'], this['wirespec-src-compiler-core'], this['wirespec-src-plugin-arguments'], this['wirespec-src-converter-openapi'], this['arrow-arrow-core'], this['wirespec-src-compiler-lib']);
23
29
  }
24
- }(this, function (_, kotlin_kotlin, kotlin_clikt_clikt, kotlin_community_flock_wirespec_compiler_core, kotlin_community_flock_wirespec_converter_openapi, kotlin_io_arrow_kt_arrow_core) {
30
+ }(this, function (_, kotlin_kotlin, kotlin_clikt_clikt, kotlin_community_flock_wirespec_compiler_core, kotlin_community_flock_wirespec_plugin_arguments_arguments, kotlin_community_flock_wirespec_converter_openapi, kotlin_io_arrow_kt_arrow_core, kotlin_community_flock_wirespec_compiler_lib) {
25
31
  'use strict';
26
32
  //region block: imports
27
- var imul = Math.imul;
28
33
  var Unit_getInstance = kotlin_kotlin.$_$.t3;
29
- var subcommands = kotlin_clikt_clikt.$_$.c;
34
+ var Enum = kotlin_kotlin.$_$.cd;
30
35
  var protoOf = kotlin_kotlin.$_$.q9;
31
- var objectMeta = kotlin_kotlin.$_$.p9;
36
+ var classMeta = kotlin_kotlin.$_$.l8;
32
37
  var VOID = kotlin_kotlin.$_$.ke;
33
38
  var setMetadataFor = kotlin_kotlin.$_$.r9;
39
+ var subcommands = kotlin_clikt_clikt.$_$.c;
40
+ var objectMeta = kotlin_kotlin.$_$.p9;
34
41
  var NoOpCliktCommand = kotlin_clikt_clikt.$_$.b;
35
- var classMeta = kotlin_kotlin.$_$.l8;
36
- var hashCode = kotlin_kotlin.$_$.t8;
37
- var getStringHashCode = kotlin_kotlin.$_$.s8;
38
- var THROW_CCE = kotlin_kotlin.$_$.ld;
39
- var equals = kotlin_kotlin.$_$.o8;
42
+ var CliktCommand = kotlin_clikt_clikt.$_$.a;
40
43
  var option = kotlin_clikt_clikt.$_$.h;
44
+ var get_DEFAULT_PACKAGE_NAME = kotlin_community_flock_wirespec_compiler_core.$_$.a;
45
+ var default_0 = kotlin_clikt_clikt.$_$.e;
46
+ var flag = kotlin_clikt_clikt.$_$.f;
47
+ var Companion_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.t;
48
+ var FullDirPath = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.d;
49
+ var Console_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.s;
50
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.j1;
51
+ var Companion_getInstance_0 = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.u;
41
52
  var choice = kotlin_clikt_clikt.$_$.j;
42
53
  var multiple = kotlin_clikt_clikt.$_$.g;
54
+ var Compile_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.v;
43
55
  var toSet = kotlin_kotlin.$_$.o7;
56
+ var CompilerArguments = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.a;
44
57
  var argument = kotlin_clikt_clikt.$_$.d;
58
+ var values = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.c;
45
59
  var mapCapacity = kotlin_kotlin.$_$.m6;
46
60
  var coerceAtLeast = kotlin_kotlin.$_$.aa;
47
61
  var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.r;
48
62
  var choice_0 = kotlin_clikt_clikt.$_$.i;
63
+ var Spec_Wirespec_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.r;
49
64
  var listOf = kotlin_kotlin.$_$.k6;
65
+ var Convert = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.g;
50
66
  var setOf = kotlin_kotlin.$_$.x6;
51
- var CliktCommand = kotlin_clikt_clikt.$_$.a;
52
- var get_DEFAULT_PACKAGE_NAME = kotlin_community_flock_wirespec_compiler_core.$_$.a;
53
- var default_0 = kotlin_clikt_clikt.$_$.e;
54
- var flag = kotlin_clikt_clikt.$_$.f;
55
- var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.j1;
56
- var Enum = kotlin_kotlin.$_$.cd;
57
67
  var KProperty1 = kotlin_kotlin.$_$.ja;
58
68
  var getPropertyCallableRef = kotlin_kotlin.$_$.r8;
59
- var split = kotlin_kotlin.$_$.bc;
60
- var dropLast = kotlin_kotlin.$_$.f5;
61
- var last = kotlin_kotlin.$_$.i6;
62
- var plus = kotlin_kotlin.$_$.u6;
63
- var joinToString = kotlin_kotlin.$_$.x5;
64
- var readlnOrNull = kotlin_kotlin.$_$.c8;
65
- var generateSequence = kotlin_kotlin.$_$.oa;
66
- var joinToString_0 = kotlin_kotlin.$_$.pa;
67
69
  var numberRangeToNumber = kotlin_kotlin.$_$.k9;
68
70
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.j;
69
71
  var copyToArray = kotlin_kotlin.$_$.d5;
70
- var Logger = kotlin_community_flock_wirespec_compiler_core.$_$.b1;
72
+ var Logger = kotlin_community_flock_wirespec_compiler_core.$_$.d1;
71
73
  var toString = kotlin_kotlin.$_$.v9;
72
- var Companion_getInstance = kotlin_community_flock_wirespec_converter_openapi.$_$.a;
73
- var Companion_getInstance_0 = kotlin_community_flock_wirespec_converter_openapi.$_$.b;
74
+ var FileExtension_Wirespec_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.m;
75
+ var FullFilePath = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.e;
76
+ var Console = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.b;
77
+ var Compile = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.f;
78
+ var THROW_CCE = kotlin_kotlin.$_$.ld;
79
+ var Companion_getInstance_1 = kotlin_community_flock_wirespec_converter_openapi.$_$.a;
80
+ var Companion_getInstance_2 = kotlin_community_flock_wirespec_converter_openapi.$_$.b;
74
81
  var noWhenBranchMatchedException = kotlin_kotlin.$_$.ge;
75
82
  var collectionSizeOrDefault = kotlin_kotlin.$_$.q4;
76
83
  var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.i;
@@ -80,33 +87,47 @@
80
87
  var toString_0 = kotlin_kotlin.$_$.v1;
81
88
  var first = kotlin_kotlin.$_$.n5;
82
89
  var Emitted = kotlin_community_flock_wirespec_compiler_core.$_$.b;
83
- var enumEntries = kotlin_kotlin.$_$.y7;
84
- var isInterface = kotlin_kotlin.$_$.d9;
85
- var interfaceMeta = kotlin_kotlin.$_$.u8;
86
- var print = kotlin_kotlin.$_$.b8;
90
+ var Wirespec_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.k1;
91
+ var compile = kotlin_community_flock_wirespec_compiler_core.$_$.b1;
92
+ var Left = kotlin_io_arrow_kt_arrow_core.$_$.c;
93
+ var Companion_getInstance_3 = kotlin_community_flock_wirespec_compiler_core.$_$.j1;
94
+ var Right = kotlin_io_arrow_kt_arrow_core.$_$.d;
95
+ var println = kotlin_kotlin.$_$.z7;
87
96
  var WirespecEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.g;
97
+ var equals = kotlin_kotlin.$_$.o8;
88
98
  var TypeScriptEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.f;
99
+ var FileExtension_TypeScript_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.l;
100
+ var Script_TypeScript_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.q;
89
101
  var ScalaEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.e;
102
+ var FileExtension_Scala_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.k;
103
+ var Jvm_Scala_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.p;
90
104
  var KotlinEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.d;
105
+ var FileExtension_Kotlin_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.j;
106
+ var Jvm_Kotlin_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.o;
91
107
  var JavaEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.c;
92
- var Wirespec_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.h1;
93
- var compile = kotlin_community_flock_wirespec_compiler_core.$_$.a1;
94
- var Left = kotlin_io_arrow_kt_arrow_core.$_$.c;
95
- var Companion_getInstance_1 = kotlin_community_flock_wirespec_compiler_core.$_$.g1;
96
- var Right = kotlin_io_arrow_kt_arrow_core.$_$.d;
97
- var println = kotlin_kotlin.$_$.z7;
108
+ var FileExtension_Java_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.h;
109
+ var Jvm_Java_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.n;
110
+ var print = kotlin_kotlin.$_$.b8;
98
111
  var ensureNotNull = kotlin_kotlin.$_$.ae;
99
112
  var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.r1;
100
113
  var charArrayOf = kotlin_kotlin.$_$.g8;
101
- var split_0 = kotlin_kotlin.$_$.ac;
114
+ var split = kotlin_kotlin.$_$.ac;
115
+ var joinToString = kotlin_kotlin.$_$.x5;
116
+ var FileExtension_Json_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.i;
117
+ var parse = kotlin_community_flock_wirespec_compiler_core.$_$.c1;
118
+ var get_noLogger = kotlin_community_flock_wirespec_compiler_core.$_$.e1;
119
+ var Definition = kotlin_community_flock_wirespec_compiler_core.$_$.h;
120
+ var isInterface = kotlin_kotlin.$_$.d9;
121
+ var produce = kotlin_community_flock_wirespec_compiler_lib.$_$.a;
102
122
  var endsWith = kotlin_kotlin.$_$.bb;
103
- var dropLast_0 = kotlin_kotlin.$_$.za;
123
+ var dropLast = kotlin_kotlin.$_$.za;
104
124
  var iterator = kotlin_kotlin.$_$.h9;
105
125
  var asSequence = kotlin_kotlin.$_$.la;
106
126
  var map = kotlin_kotlin.$_$.qa;
107
127
  var filter = kotlin_kotlin.$_$.ma;
108
128
  var toSet_0 = kotlin_kotlin.$_$.sa;
109
- var Companion_getInstance_2 = kotlin_kotlin.$_$.o3;
129
+ var split_0 = kotlin_kotlin.$_$.bc;
130
+ var Companion_getInstance_4 = kotlin_kotlin.$_$.o3;
110
131
  var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.w1;
111
132
  var createFailure = kotlin_kotlin.$_$.zd;
112
133
  var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.a2;
@@ -115,27 +136,12 @@
115
136
  var isArray = kotlin_kotlin.$_$.v8;
116
137
  //endregion
117
138
  //region block: pre-declaration
139
+ setMetadataFor(Options, 'Options', classMeta, Enum);
118
140
  setMetadataFor(Companion, 'Companion', objectMeta);
119
141
  setMetadataFor(WirespecCli, 'WirespecCli', classMeta, NoOpCliktCommand);
120
- setMetadataFor(Arguments, 'Arguments', classMeta);
121
- setMetadataFor(Compile, 'Compile', objectMeta);
122
- setMetadataFor(Convert, 'Convert', classMeta);
123
142
  setMetadataFor(CommonOptions, 'CommonOptions', classMeta, CliktCommand);
124
143
  setMetadataFor(Compile_0, 'Compile', classMeta, CommonOptions);
125
144
  setMetadataFor(Convert_0, 'Convert', classMeta, CommonOptions);
126
- setMetadataFor(Options, 'Options', classMeta, Enum);
127
- setMetadataFor(Companion_0, 'Companion', objectMeta);
128
- setMetadataFor(FullFilePath, 'FullFilePath', classMeta);
129
- setMetadataFor(Console, 'Console', objectMeta);
130
- setMetadataFor(FullDirPath, 'FullDirPath', classMeta);
131
- setMetadataFor(Language, 'Language', interfaceMeta);
132
- setMetadataFor(Jvm, 'Jvm', classMeta, Enum, [Enum, Language]);
133
- setMetadataFor(Script, 'Script', classMeta, Enum, [Enum, Language]);
134
- setMetadataFor(Spec, 'Spec', classMeta, Enum, [Enum, Language]);
135
- setMetadataFor(Companion_1, 'Companion', objectMeta);
136
- setMetadataFor(Companion_2, 'Companion', objectMeta);
137
- setMetadataFor(Format, 'Format', classMeta, Enum);
138
- setMetadataFor(Extension, 'Extension', classMeta, Enum);
139
145
  setMetadataFor(File, 'File', classMeta);
140
146
  setMetadataFor(JavaFile, 'JavaFile', classMeta, File);
141
147
  setMetadataFor(JsonFile, 'JsonFile', classMeta, File);
@@ -145,9 +151,33 @@
145
151
  setMetadataFor(WirespecFile, 'WirespecFile', classMeta, File);
146
152
  setMetadataFor(Directory, 'Directory', classMeta);
147
153
  //endregion
154
+ var Options_InputDir_instance;
155
+ var Options_InputFile_instance;
156
+ var Options_OutputDir_instance;
157
+ var Options_Language_instance;
158
+ var Options_PackageName_instance;
159
+ var Options_Strict_instance;
160
+ var Options_Debug_instance;
161
+ var Options_entriesInitialized;
162
+ function Options_initEntries() {
163
+ if (Options_entriesInitialized)
164
+ return Unit_getInstance();
165
+ Options_entriesInitialized = true;
166
+ Options_InputDir_instance = new Options('InputDir', 0, ['-d', '--input-dir']);
167
+ Options_InputFile_instance = new Options('InputFile', 1, ['-f', '--input-file']);
168
+ Options_OutputDir_instance = new Options('OutputDir', 2, ['-o', '--output-dir']);
169
+ Options_Language_instance = new Options('Language', 3, ['-l', '--language']);
170
+ Options_PackageName_instance = new Options('PackageName', 4, ['-p', '--package']);
171
+ Options_Strict_instance = new Options('Strict', 5, ['--strict']);
172
+ Options_Debug_instance = new Options('Debug', 6, ['--debug']);
173
+ }
174
+ function Options(name, ordinal, flags) {
175
+ Enum.call(this, name, ordinal);
176
+ this.r3s_1 = flags;
177
+ }
148
178
  function WirespecCli$main$ref($boundThis) {
149
179
  var l = function (p0) {
150
- $boundThis.o3d(p0);
180
+ $boundThis.p3g(p0);
151
181
  return Unit_getInstance();
152
182
  };
153
183
  l.callableName = 'main';
@@ -156,134 +186,109 @@
156
186
  function Companion() {
157
187
  Companion_instance = this;
158
188
  }
159
- protoOf(Companion).o3p = function (compile, convert) {
189
+ protoOf(Companion).s3s = function (compile, convert) {
160
190
  return WirespecCli$main$ref(subcommands(new WirespecCli(), [new Compile_0(compile), new Convert_0(convert)]));
161
191
  };
162
192
  var Companion_instance;
163
- function Companion_getInstance_3() {
193
+ function Companion_getInstance_5() {
164
194
  if (Companion_instance == null)
165
195
  new Companion();
166
196
  return Companion_instance;
167
197
  }
168
198
  function WirespecCli() {
169
- Companion_getInstance_3();
199
+ Companion_getInstance_5();
170
200
  NoOpCliktCommand.call(this, VOID, VOID, 'wirespec');
171
201
  }
172
- function Arguments(operation, input, output, languages, packageName, strict, debug) {
173
- this.p3p_1 = operation;
174
- this.q3p_1 = input;
175
- this.r3p_1 = output;
176
- this.s3p_1 = languages;
177
- this.t3p_1 = packageName;
178
- this.u3p_1 = strict;
179
- this.v3p_1 = debug;
180
- }
181
- protoOf(Arguments).toString = function () {
182
- return 'Arguments(operation=' + this.p3p_1 + ', input=' + this.q3p_1 + ', output=' + this.r3p_1 + ', languages=' + this.s3p_1 + ', packageName=' + this.t3p_1 + ', strict=' + this.u3p_1 + ', debug=' + this.v3p_1 + ')';
183
- };
184
- protoOf(Arguments).hashCode = function () {
185
- var result = hashCode(this.p3p_1);
186
- result = imul(result, 31) + hashCode(this.q3p_1) | 0;
187
- result = imul(result, 31) + (this.r3p_1 == null ? 0 : getStringHashCode(this.r3p_1)) | 0;
188
- result = imul(result, 31) + hashCode(this.s3p_1) | 0;
189
- result = imul(result, 31) + getStringHashCode(this.t3p_1) | 0;
190
- result = imul(result, 31) + (this.u3p_1 | 0) | 0;
191
- result = imul(result, 31) + (this.v3p_1 | 0) | 0;
192
- return result;
193
- };
194
- protoOf(Arguments).equals = function (other) {
195
- if (this === other)
196
- return true;
197
- if (!(other instanceof Arguments))
198
- return false;
199
- var tmp0_other_with_cast = other instanceof Arguments ? other : THROW_CCE();
200
- if (!equals(this.p3p_1, tmp0_other_with_cast.p3p_1))
201
- return false;
202
- if (!equals(this.q3p_1, tmp0_other_with_cast.q3p_1))
203
- return false;
204
- if (!(this.r3p_1 == tmp0_other_with_cast.r3p_1))
205
- return false;
206
- if (!equals(this.s3p_1, tmp0_other_with_cast.s3p_1))
207
- return false;
208
- if (!(this.t3p_1 === tmp0_other_with_cast.t3p_1))
209
- return false;
210
- if (!(this.u3p_1 === tmp0_other_with_cast.u3p_1))
211
- return false;
212
- if (!(this.v3p_1 === tmp0_other_with_cast.v3p_1))
213
- return false;
214
- return true;
215
- };
216
- function Compile() {
217
- Compile_instance = this;
202
+ function _get_inputFile__x1bqj($this) {
203
+ return $this.k3t_1.r3p($this, inputFile$factory_0());
218
204
  }
219
- protoOf(Compile).toString = function () {
220
- return 'Compile';
205
+ function CommonOptions() {
206
+ CliktCommand.call(this);
207
+ this.k3t_1 = option(this, Options_InputFile_getInstance().r3s_1.slice(), 'Input file').t3q(this, inputFile$factory());
208
+ this.l3t_1 = option(this, Options_InputDir_getInstance().r3s_1.slice(), 'Input directory').t3q(this, inputDir$factory());
209
+ this.m3t_1 = option(this, Options_OutputDir_getInstance().r3s_1.slice(), 'Output directory').t3q(this, outputDir$factory());
210
+ this.n3t_1 = default_0(option(this, Options_PackageName_getInstance().r3s_1.slice(), 'Package name'), get_DEFAULT_PACKAGE_NAME()).t3q(this, packageName$factory());
211
+ this.o3t_1 = flag(option(this, Options_Strict_getInstance().r3s_1.slice(), 'Strict mode'), []).t3q(this, strict$factory());
212
+ this.p3t_1 = flag(option(this, Options_Debug_getInstance().r3s_1.slice(), 'Debug mode'), []).t3q(this, debug$factory());
213
+ }
214
+ protoOf(CommonOptions).q3t = function () {
215
+ return this.l3t_1.r3p(this, inputDir$factory_0());
221
216
  };
222
- protoOf(Compile).hashCode = function () {
223
- return -1309483685;
217
+ protoOf(CommonOptions).r3t = function () {
218
+ return this.m3t_1.r3p(this, outputDir$factory_0());
224
219
  };
225
- protoOf(Compile).equals = function (other) {
226
- if (this === other)
227
- return true;
228
- if (!(other instanceof Compile))
229
- return false;
230
- other instanceof Compile || THROW_CCE();
231
- return true;
220
+ protoOf(CommonOptions).s3t = function () {
221
+ return this.n3t_1.r3p(this, packageName$factory_0());
232
222
  };
233
- var Compile_instance;
234
- function Compile_getInstance() {
235
- if (Compile_instance == null)
236
- new Compile();
237
- return Compile_instance;
238
- }
239
- function Convert(format) {
240
- this.w3p_1 = format;
241
- }
242
- protoOf(Convert).toString = function () {
243
- return 'Convert(format=' + this.w3p_1 + ')';
223
+ protoOf(CommonOptions).t3t = function () {
224
+ return this.o3t_1.r3p(this, strict$factory_0());
244
225
  };
245
- protoOf(Convert).hashCode = function () {
246
- return this.w3p_1.hashCode();
226
+ protoOf(CommonOptions).u3t = function () {
227
+ return this.p3t_1.r3p(this, debug$factory_0());
247
228
  };
248
- protoOf(Convert).equals = function (other) {
249
- if (this === other)
250
- return true;
251
- if (!(other instanceof Convert))
252
- return false;
253
- var tmp0_other_with_cast = other instanceof Convert ? other : THROW_CCE();
254
- if (!this.w3p_1.equals(tmp0_other_with_cast.w3p_1))
255
- return false;
256
- return true;
229
+ protoOf(CommonOptions).v3t = function (inputDir) {
230
+ var tmp;
231
+ if (!(inputDir == null) ? !(_get_inputFile__x1bqj(this) == null) : false) {
232
+ throw IllegalStateException_init_$Create$('Choose either a file or a directory. Not Both.');
233
+ } else {
234
+ var tmp0_safe_receiver = _get_inputFile__x1bqj(this);
235
+ var tmp_0;
236
+ if (tmp0_safe_receiver == null) {
237
+ tmp_0 = null;
238
+ } else {
239
+ // Inline function 'kotlin.let' call
240
+ // Inline function 'kotlin.contracts.contract' call
241
+ tmp_0 = Companion_getInstance().a22(tmp0_safe_receiver);
242
+ }
243
+ var tmp2_elvis_lhs = tmp_0;
244
+ var tmp_1;
245
+ if (tmp2_elvis_lhs == null) {
246
+ var tmp_2;
247
+ if (inputDir == null) {
248
+ tmp_2 = null;
249
+ } else {
250
+ // Inline function 'kotlin.let' call
251
+ // Inline function 'kotlin.contracts.contract' call
252
+ tmp_2 = new FullDirPath(inputDir);
253
+ }
254
+ tmp_1 = tmp_2;
255
+ } else {
256
+ tmp_1 = tmp2_elvis_lhs;
257
+ }
258
+ var tmp3_elvis_lhs = tmp_1;
259
+ tmp = tmp3_elvis_lhs == null ? Console_getInstance() : tmp3_elvis_lhs;
260
+ }
261
+ return tmp;
257
262
  };
258
263
  function _get_languages__ojonze($this) {
259
- return $this.v3q_1.q3m($this, languages$factory_0());
264
+ return $this.u3u_1.r3p($this, languages$factory_0());
260
265
  }
261
266
  function Compile_0(block) {
262
267
  CommonOptions.call(this);
263
- this.u3q_1 = block;
264
- this.v3q_1 = multiple(choice(option(this, Options_Language_getInstance().y3q_1.slice(), 'Language'), Companion_getInstance_5().z3q()), VOID, true).s3n(this, languages$factory());
268
+ this.t3u_1 = block;
269
+ this.u3u_1 = multiple(choice(option(this, Options_Language_getInstance().r3s_1.slice(), 'Language'), Companion_getInstance_0().k22()), VOID, true).t3q(this, languages$factory());
265
270
  }
266
- protoOf(Compile_0).p3d = function () {
271
+ protoOf(Compile_0).q3g = function () {
267
272
  // Inline function 'kotlin.let' call
268
- var tmp0_let = new Arguments(Compile_getInstance(), this.y3r(this.x3r()), this.z3r(), toSet(_get_languages__ojonze(this)), this.a3s(), this.b3s(), this.c3s());
273
+ var tmp0_let = new CompilerArguments(Compile_getInstance(), this.v3t(this.q3t()), this.r3t(), toSet(_get_languages__ojonze(this)), this.s3t(), this.t3t(), this.u3t());
269
274
  // Inline function 'kotlin.contracts.contract' call
270
- this.u3q_1(tmp0_let);
275
+ this.t3u_1(tmp0_let);
271
276
  };
272
277
  function _get_format__qlarck($this) {
273
- return $this.b3t_1.q3m($this, format$factory_0());
278
+ return $this.t3v_1.r3p($this, format$factory_0());
274
279
  }
275
280
  function _get_languages__ojonze_0($this) {
276
- return $this.c3t_1.q3m($this, languages$factory_2());
281
+ return $this.u3v_1.r3p($this, languages$factory_2());
277
282
  }
278
283
  function Convert_0(block) {
279
284
  CommonOptions.call(this);
280
- this.a3t_1 = block;
285
+ this.s3v_1 = block;
281
286
  var tmp = this;
282
287
  // Inline function 'com.github.ajalt.clikt.parameters.types.enum' call
283
288
  var tmp0_enum = argument(this, VOID, 'Input format');
284
289
  // Inline function 'kotlin.collections.associateBy' call
285
290
  // Inline function 'kotlin.enumValues' call
286
- var tmp0_associateBy = values_3();
291
+ var tmp0_associateBy = values();
287
292
  var capacity = coerceAtLeast(mapCapacity(tmp0_associateBy.length), 16);
288
293
  // Inline function 'kotlin.collections.associateByTo' call
289
294
  var tmp0_associateByTo = LinkedHashMap_init_$Create$(capacity);
@@ -298,121 +303,36 @@
298
303
  tmp$ret$2 = element.o5_1;
299
304
  tmp0_associateByTo.n3(tmp$ret$2, element);
300
305
  }
301
- tmp.b3t_1 = choice_0(tmp0_enum, tmp0_associateByTo, true).w3l(this, format$factory());
302
- this.c3t_1 = multiple(choice(option(this, Options_Language_getInstance().y3q_1.slice(), 'Language'), Companion_getInstance_5().z3q(), VOID, true), listOf(Spec_Wirespec_getInstance())).s3n(this, languages$factory_1());
306
+ tmp.t3v_1 = choice_0(tmp0_enum, tmp0_associateByTo, true).x3o(this, format$factory());
307
+ this.u3v_1 = multiple(choice(option(this, Options_Language_getInstance().r3s_1.slice(), 'Language'), Companion_getInstance_0().k22(), VOID, true), listOf(Spec_Wirespec_getInstance())).t3q(this, languages$factory_1());
303
308
  }
304
- protoOf(Convert_0).p3d = function () {
305
- if (this.x3r() == null)
309
+ protoOf(Convert_0).q3g = function () {
310
+ if (this.q3t() == null)
306
311
  null;
307
312
  else {
308
313
  // Inline function 'kotlin.let' call
309
314
  // Inline function 'kotlin.contracts.contract' call
310
- this.i3d('To convert, please specify a file', VOID, true);
315
+ this.j3g('To convert, please specify a file', VOID, true);
311
316
  }
312
317
  // Inline function 'kotlin.let' call
313
318
  var tmp = new Convert(_get_format__qlarck(this));
314
- var tmp_0 = this.y3r(null);
315
- var tmp_1 = this.z3r();
319
+ var tmp_0 = this.v3t(null);
320
+ var tmp_1 = this.r3t();
316
321
  var tmp$ret$2;
317
322
  // Inline function 'kotlin.collections.ifEmpty' call
318
323
  var tmp0_ifEmpty = toSet(_get_languages__ojonze_0(this));
319
324
  var tmp_2;
320
- if (tmp0_ifEmpty.l()) {
321
- // Inline function 'community.flock.wirespec.compiler.cli.Convert.run.<anonymous>' call
325
+ if (tmp0_ifEmpty.g()) {
326
+ // Inline function 'community.flock.wirespec.plugin.cli.Convert.run.<anonymous>' call
322
327
  tmp_2 = setOf(Spec_Wirespec_getInstance());
323
328
  } else {
324
329
  tmp_2 = tmp0_ifEmpty;
325
330
  }
326
331
  tmp$ret$2 = tmp_2;
327
- var tmp1_let = new Arguments(tmp, tmp_0, tmp_1, tmp$ret$2, this.a3s(), this.b3s(), this.c3s());
332
+ var tmp1_let = new CompilerArguments(tmp, tmp_0, tmp_1, tmp$ret$2, this.s3t(), this.t3t(), this.u3t());
328
333
  // Inline function 'kotlin.contracts.contract' call
329
- this.a3t_1(tmp1_let);
330
- };
331
- function _get_inputFile__x1bqj($this) {
332
- return $this.r3r_1.q3m($this, inputFile$factory_0());
333
- }
334
- function CommonOptions() {
335
- CliktCommand.call(this);
336
- this.r3r_1 = option(this, Options_InputFile_getInstance().y3q_1.slice(), 'Input file').s3n(this, inputFile$factory());
337
- this.s3r_1 = option(this, Options_InputDir_getInstance().y3q_1.slice(), 'Input directory').s3n(this, inputDir$factory());
338
- this.t3r_1 = option(this, Options_OutputDir_getInstance().y3q_1.slice(), 'Output directory').s3n(this, outputDir$factory());
339
- this.u3r_1 = default_0(option(this, Options_PackageName_getInstance().y3q_1.slice(), 'Package name'), get_DEFAULT_PACKAGE_NAME()).s3n(this, packageName$factory());
340
- this.v3r_1 = flag(option(this, Options_Strict_getInstance().y3q_1.slice(), 'Strict mode'), []).s3n(this, strict$factory());
341
- this.w3r_1 = flag(option(this, Options_Debug_getInstance().y3q_1.slice(), 'Debug mode'), []).s3n(this, debug$factory());
342
- }
343
- protoOf(CommonOptions).x3r = function () {
344
- return this.s3r_1.q3m(this, inputDir$factory_0());
345
- };
346
- protoOf(CommonOptions).z3r = function () {
347
- return this.t3r_1.q3m(this, outputDir$factory_0());
348
- };
349
- protoOf(CommonOptions).a3s = function () {
350
- return this.u3r_1.q3m(this, packageName$factory_0());
351
- };
352
- protoOf(CommonOptions).b3s = function () {
353
- return this.v3r_1.q3m(this, strict$factory_0());
354
- };
355
- protoOf(CommonOptions).c3s = function () {
356
- return this.w3r_1.q3m(this, debug$factory_0());
357
- };
358
- protoOf(CommonOptions).y3r = function (inputDir) {
359
- var tmp;
360
- if (!(inputDir == null) ? !(_get_inputFile__x1bqj(this) == null) : false) {
361
- throw IllegalStateException_init_$Create$('Choose either a file or a directory. Not Both.');
362
- } else {
363
- var tmp0_safe_receiver = _get_inputFile__x1bqj(this);
364
- var tmp_0;
365
- if (tmp0_safe_receiver == null) {
366
- tmp_0 = null;
367
- } else {
368
- // Inline function 'kotlin.let' call
369
- // Inline function 'kotlin.contracts.contract' call
370
- tmp_0 = Companion_getInstance_4().d3t(tmp0_safe_receiver);
371
- }
372
- var tmp2_elvis_lhs = tmp_0;
373
- var tmp_1;
374
- if (tmp2_elvis_lhs == null) {
375
- var tmp_2;
376
- if (inputDir == null) {
377
- tmp_2 = null;
378
- } else {
379
- // Inline function 'kotlin.let' call
380
- // Inline function 'kotlin.contracts.contract' call
381
- tmp_2 = new FullDirPath(inputDir);
382
- }
383
- tmp_1 = tmp_2;
384
- } else {
385
- tmp_1 = tmp2_elvis_lhs;
386
- }
387
- var tmp3_elvis_lhs = tmp_1;
388
- tmp = tmp3_elvis_lhs == null ? Console_getInstance() : tmp3_elvis_lhs;
389
- }
390
- return tmp;
334
+ this.s3v_1(tmp1_let);
391
335
  };
392
- var Options_InputDir_instance;
393
- var Options_InputFile_instance;
394
- var Options_OutputDir_instance;
395
- var Options_Language_instance;
396
- var Options_PackageName_instance;
397
- var Options_Strict_instance;
398
- var Options_Debug_instance;
399
- var Options_entriesInitialized;
400
- function Options_initEntries() {
401
- if (Options_entriesInitialized)
402
- return Unit_getInstance();
403
- Options_entriesInitialized = true;
404
- Options_InputDir_instance = new Options('InputDir', 0, ['-d', '--input-dir']);
405
- Options_InputFile_instance = new Options('InputFile', 1, ['-f', '--input-file']);
406
- Options_OutputDir_instance = new Options('OutputDir', 2, ['-o', '--output-dir']);
407
- Options_Language_instance = new Options('Language', 3, ['-l', '--language']);
408
- Options_PackageName_instance = new Options('PackageName', 4, ['-p', '--package']);
409
- Options_Strict_instance = new Options('Strict', 5, ['--strict']);
410
- Options_Debug_instance = new Options('Debug', 6, ['--debug']);
411
- }
412
- function Options(name, ordinal, flags) {
413
- Enum.call(this, name, ordinal);
414
- this.y3q_1 = flags;
415
- }
416
336
  function Options_InputDir_getInstance() {
417
337
  Options_initEntries();
418
338
  return Options_InputDir_instance;
@@ -441,36 +361,6 @@
441
361
  Options_initEntries();
442
362
  return Options_Debug_instance;
443
363
  }
444
- function languages$factory() {
445
- return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
446
- return _get_languages__ojonze(receiver);
447
- }, null);
448
- }
449
- function languages$factory_0() {
450
- return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
451
- return _get_languages__ojonze(receiver);
452
- }, null);
453
- }
454
- function format$factory() {
455
- return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
456
- return _get_format__qlarck(receiver);
457
- }, null);
458
- }
459
- function languages$factory_1() {
460
- return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
461
- return _get_languages__ojonze_0(receiver);
462
- }, null);
463
- }
464
- function format$factory_0() {
465
- return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
466
- return _get_format__qlarck(receiver);
467
- }, null);
468
- }
469
- function languages$factory_2() {
470
- return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
471
- return _get_languages__ojonze_0(receiver);
472
- }, null);
473
- }
474
364
  function inputFile$factory() {
475
365
  return getPropertyCallableRef('inputFile', 1, KProperty1, function (receiver) {
476
366
  return _get_inputFile__x1bqj(receiver);
@@ -478,27 +368,27 @@
478
368
  }
479
369
  function inputDir$factory() {
480
370
  return getPropertyCallableRef('inputDir', 1, KProperty1, function (receiver) {
481
- return receiver.x3r();
371
+ return receiver.q3t();
482
372
  }, null);
483
373
  }
484
374
  function outputDir$factory() {
485
375
  return getPropertyCallableRef('outputDir', 1, KProperty1, function (receiver) {
486
- return receiver.z3r();
376
+ return receiver.r3t();
487
377
  }, null);
488
378
  }
489
379
  function packageName$factory() {
490
380
  return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
491
- return receiver.a3s();
381
+ return receiver.s3t();
492
382
  }, null);
493
383
  }
494
384
  function strict$factory() {
495
385
  return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
496
- return receiver.b3s();
386
+ return receiver.t3t();
497
387
  }, null);
498
388
  }
499
389
  function debug$factory() {
500
390
  return getPropertyCallableRef('debug', 1, KProperty1, function (receiver) {
501
- return receiver.c3s();
391
+ return receiver.u3t();
502
392
  }, null);
503
393
  }
504
394
  function inputFile$factory_0() {
@@ -508,165 +398,59 @@
508
398
  }
509
399
  function inputDir$factory_0() {
510
400
  return getPropertyCallableRef('inputDir', 1, KProperty1, function (receiver) {
511
- return receiver.x3r();
401
+ return receiver.q3t();
512
402
  }, null);
513
403
  }
514
404
  function outputDir$factory_0() {
515
405
  return getPropertyCallableRef('outputDir', 1, KProperty1, function (receiver) {
516
- return receiver.z3r();
406
+ return receiver.r3t();
517
407
  }, null);
518
408
  }
519
409
  function packageName$factory_0() {
520
410
  return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
521
- return receiver.a3s();
411
+ return receiver.s3t();
522
412
  }, null);
523
413
  }
524
414
  function strict$factory_0() {
525
415
  return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
526
- return receiver.b3s();
416
+ return receiver.t3t();
527
417
  }, null);
528
418
  }
529
419
  function debug$factory_0() {
530
420
  return getPropertyCallableRef('debug', 1, KProperty1, function (receiver) {
531
- return receiver.c3s();
421
+ return receiver.u3t();
532
422
  }, null);
533
423
  }
534
- function Companion_0() {
535
- Companion_instance_0 = this;
424
+ function languages$factory() {
425
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
426
+ return _get_languages__ojonze(receiver);
427
+ }, null);
536
428
  }
537
- protoOf(Companion_0).d3t = function (input) {
538
- // Inline function 'kotlin.let' call
539
- var tmp0_let = split(input, ['/']);
540
- // Inline function 'kotlin.contracts.contract' call
541
- // Inline function 'community.flock.wirespec.compiler.cli.Companion.parse.<anonymous>' call
542
- var list = plus(dropLast(tmp0_let, 1), split(last(tmp0_let), ['.']));
543
- // Inline function 'kotlin.let' call
544
- // Inline function 'kotlin.text.lowercase' call
545
- // Inline function 'kotlin.js.asDynamic' call
546
- var tmp2_let = last(list).toLowerCase();
547
- // Inline function 'kotlin.contracts.contract' call
548
- // Inline function 'community.flock.wirespec.compiler.cli.Companion.parse.<anonymous>' call
549
- // Inline function 'kotlin.collections.find' call
550
- var tmp0_find = get_entries_3();
551
- var tmp$ret$5;
552
- $l$block: {
553
- // Inline function 'kotlin.collections.firstOrNull' call
554
- var tmp0_iterator = tmp0_find.c();
555
- while (tmp0_iterator.d()) {
556
- var element = tmp0_iterator.e();
557
- // Inline function 'community.flock.wirespec.compiler.cli.Companion.parse.<anonymous>.<anonymous>' call
558
- if (element.g3t_1 === tmp2_let) {
559
- tmp$ret$5 = element;
560
- break $l$block;
561
- }
562
- }
563
- tmp$ret$5 = null;
564
- }
565
- var tmp0_elvis_lhs = tmp$ret$5;
566
- var tmp;
567
- if (tmp0_elvis_lhs == null) {
568
- throw IllegalStateException_init_$Create$('Invalid file extension');
569
- } else {
570
- tmp = tmp0_elvis_lhs;
571
- }
572
- var extension = tmp;
573
- var filename = list.k(list.f() - 2 | 0);
574
- var path = joinToString(list.s(0, list.f() - 2 | 0), '/');
575
- return new FullFilePath(path, filename, extension);
576
- };
577
- var Companion_instance_0;
578
- function Companion_getInstance_4() {
579
- if (Companion_instance_0 == null)
580
- new Companion_0();
581
- return Companion_instance_0;
582
- }
583
- function FullFilePath(directory, fileName, extension) {
584
- Companion_getInstance_4();
585
- extension = extension === VOID ? Extension_Wirespec_getInstance() : extension;
586
- this.h3t_1 = directory;
587
- this.i3t_1 = fileName;
588
- this.j3t_1 = extension;
589
- }
590
- protoOf(FullFilePath).toString = function () {
591
- return this.h3t_1 + '/' + this.i3t_1 + '.' + this.j3t_1.g3t_1;
592
- };
593
- protoOf(FullFilePath).k3t = function (directory, fileName, extension) {
594
- return new FullFilePath(directory, fileName, extension);
595
- };
596
- protoOf(FullFilePath).l3t = function (directory, fileName, extension, $super) {
597
- directory = directory === VOID ? this.h3t_1 : directory;
598
- fileName = fileName === VOID ? this.i3t_1 : fileName;
599
- extension = extension === VOID ? this.j3t_1 : extension;
600
- return $super === VOID ? this.k3t(directory, fileName, extension) : $super.k3t.call(this, directory, fileName, extension);
601
- };
602
- protoOf(FullFilePath).hashCode = function () {
603
- var result = getStringHashCode(this.h3t_1);
604
- result = imul(result, 31) + getStringHashCode(this.i3t_1) | 0;
605
- result = imul(result, 31) + this.j3t_1.hashCode() | 0;
606
- return result;
607
- };
608
- protoOf(FullFilePath).equals = function (other) {
609
- if (this === other)
610
- return true;
611
- if (!(other instanceof FullFilePath))
612
- return false;
613
- var tmp0_other_with_cast = other instanceof FullFilePath ? other : THROW_CCE();
614
- if (!(this.h3t_1 === tmp0_other_with_cast.h3t_1))
615
- return false;
616
- if (!(this.i3t_1 === tmp0_other_with_cast.i3t_1))
617
- return false;
618
- if (!this.j3t_1.equals(tmp0_other_with_cast.j3t_1))
619
- return false;
620
- return true;
621
- };
622
- function Console$read$lambda() {
623
- return readlnOrNull();
429
+ function languages$factory_0() {
430
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
431
+ return _get_languages__ojonze(receiver);
432
+ }, null);
624
433
  }
625
- function Console() {
626
- Console_instance = this;
434
+ function format$factory() {
435
+ return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
436
+ return _get_format__qlarck(receiver);
437
+ }, null);
627
438
  }
628
- protoOf(Console).q11 = function () {
629
- return joinToString_0(generateSequence(Console$read$lambda), '/n');
630
- };
631
- protoOf(Console).toString = function () {
632
- return 'Console';
633
- };
634
- protoOf(Console).hashCode = function () {
635
- return 1615669478;
636
- };
637
- protoOf(Console).equals = function (other) {
638
- if (this === other)
639
- return true;
640
- if (!(other instanceof Console))
641
- return false;
642
- other instanceof Console || THROW_CCE();
643
- return true;
644
- };
645
- var Console_instance;
646
- function Console_getInstance() {
647
- if (Console_instance == null)
648
- new Console();
649
- return Console_instance;
439
+ function languages$factory_1() {
440
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
441
+ return _get_languages__ojonze_0(receiver);
442
+ }, null);
650
443
  }
651
- function FullDirPath(path) {
652
- this.m3t_1 = path;
444
+ function format$factory_0() {
445
+ return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
446
+ return _get_format__qlarck(receiver);
447
+ }, null);
448
+ }
449
+ function languages$factory_2() {
450
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
451
+ return _get_languages__ojonze_0(receiver);
452
+ }, null);
653
453
  }
654
- protoOf(FullDirPath).toString = function () {
655
- return 'FullDirPath(path=' + this.m3t_1 + ')';
656
- };
657
- protoOf(FullDirPath).hashCode = function () {
658
- return getStringHashCode(this.m3t_1);
659
- };
660
- protoOf(FullDirPath).equals = function (other) {
661
- if (this === other)
662
- return true;
663
- if (!(other instanceof FullDirPath))
664
- return false;
665
- var tmp0_other_with_cast = other instanceof FullDirPath ? other : THROW_CCE();
666
- if (!(this.m3t_1 === tmp0_other_with_cast.m3t_1))
667
- return false;
668
- return true;
669
- };
670
454
  function main(args) {
671
455
  // Inline function 'kotlin.let' call
672
456
  // Inline function 'kotlin.collections.toTypedArray' call
@@ -693,29 +477,33 @@
693
477
  }
694
478
  while (!(element === last));
695
479
  var tmp2_let = copyToArray(tmp0_mapNotNullTo);
696
- var tmp = Companion_getInstance_3();
480
+ var tmp = Companion_getInstance_5();
697
481
  var tmp_0 = compile$ref();
698
482
  // Inline function 'kotlin.contracts.contract' call
699
- tmp.o3p(tmp_0, convert$ref())(tmp2_let);
483
+ tmp.s3s(tmp_0, convert$ref())(tmp2_let);
484
+ }
485
+ function convert(arguments_0) {
486
+ return compile_0(arguments_0);
700
487
  }
701
488
  function compile_0(arguments_0) {
702
- var input = arguments_0.q3p_1;
703
- var output = arguments_0.r3p_1;
704
- var languages = arguments_0.s3p_1;
705
- var packageName = arguments_0.t3p_1;
706
- var logger = new Logger(arguments_0.v3p_1);
707
- var tmp0_subject = arguments_0.p3p_1;
708
- if (tmp0_subject instanceof Convert) {
489
+ var input = arguments_0.t21_1;
490
+ var output = arguments_0.u21_1;
491
+ var languages = arguments_0.v21_1;
492
+ var packageName = arguments_0.w21_1;
493
+ var logger = new Logger(arguments_0.y21_1);
494
+ var operation = arguments_0.s21_1;
495
+ if (operation instanceof Convert) {
709
496
  var fullPath = input instanceof FullFilePath ? input : THROW_CCE();
710
497
  var file = new JsonFile(fullPath);
711
- var strict = arguments_0.u3p_1;
498
+ var strict = arguments_0.x21_1;
499
+ var format = operation.z21_1;
712
500
  var tmp;
713
- switch (arguments_0.p3p_1.w3p_1.p5_1) {
501
+ switch (format.p5_1) {
714
502
  case 0:
715
- tmp = Companion_getInstance().s21(file.q11(), !strict);
503
+ tmp = Companion_getInstance_1().m22(file.q11(), !strict);
716
504
  break;
717
505
  case 1:
718
- tmp = Companion_getInstance_0().s21(file.q11(), !strict);
506
+ tmp = Companion_getInstance_2().m22(file.q11(), !strict);
719
507
  break;
720
508
  default:
721
509
  noWhenBranchMatchedException();
@@ -732,15 +520,15 @@
732
520
  while (tmp0_iterator.d()) {
733
521
  var item = tmp0_iterator.e();
734
522
  var tmp$ret$7;
735
- // Inline function 'community.flock.wirespec.compiler.cli.compile.<anonymous>' call
523
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
736
524
  var emitter = item.e3();
737
525
  var file_0 = item.f3();
738
- var results = emitter.x1q(ast);
526
+ var results = emitter.y1q(ast);
739
527
  var tmp_0;
740
- if (!emitter.h1w()) {
528
+ if (!emitter.i1w()) {
741
529
  var tmp$ret$6;
742
530
  // Inline function 'kotlin.text.replaceFirstChar' call
743
- var tmp0_replaceFirstChar = fullPath.i3t_1;
531
+ var tmp0_replaceFirstChar = fullPath.f22_1;
744
532
  var tmp_1;
745
533
  // Inline function 'kotlin.text.isNotEmpty' call
746
534
  if (charSequenceLength(tmp0_replaceFirstChar) > 0) {
@@ -758,7 +546,7 @@
758
546
  tmp_1 = tmp0_replaceFirstChar;
759
547
  }
760
548
  tmp$ret$6 = tmp_1;
761
- tmp_0 = to(listOf(new Emitted(tmp$ret$6, first(results).o1s_1)), file_0);
549
+ tmp_0 = to(listOf(new Emitted(tmp$ret$6, first(results).p1s_1)), file_0);
762
550
  } else {
763
551
  tmp_0 = to(results, file_0);
764
552
  }
@@ -776,25 +564,25 @@
776
564
  tmp0_mapTo_0.a(Unit_getInstance());
777
565
  }
778
566
  } else {
779
- if (tmp0_subject instanceof Compile) {
567
+ if (operation instanceof Compile) {
780
568
  if (input instanceof Console) {
781
569
  wirespec(input, languages, packageName, compile$lambda(output), logger);
782
570
  } else {
783
571
  if (input instanceof FullDirPath) {
784
572
  // Inline function 'kotlin.collections.forEach' call
785
- var tmp0_iterator_1 = (new Directory(input.m3t_1)).p3t().c();
573
+ var tmp0_iterator_1 = (new Directory(input.j22_1)).x3v().c();
786
574
  while (tmp0_iterator_1.d()) {
787
575
  var element = tmp0_iterator_1.e();
788
- // Inline function 'community.flock.wirespec.compiler.cli.compile.<anonymous>' call
789
- wirespec(element, languages, packageName, out(element.n3t_1, packageName, output), logger);
576
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
577
+ wirespec(element, languages, packageName, out(element.v3v_1, packageName, output), logger);
790
578
  }
791
579
  } else {
792
580
  if (input instanceof FullFilePath)
793
- if (input.j3t_1.equals(Extension_Wirespec_getInstance())) {
581
+ if (input.g22_1.equals(FileExtension_Wirespec_getInstance())) {
794
582
  // Inline function 'kotlin.let' call
795
583
  var tmp3_let = new WirespecFile(input);
796
584
  // Inline function 'kotlin.contracts.contract' call
797
- wirespec(tmp3_let, languages, packageName, out(tmp3_let.n3t_1, packageName, output), logger);
585
+ wirespec(tmp3_let, languages, packageName, out(tmp3_let.v3v_1, packageName, output), logger);
798
586
  } else {
799
587
  // Inline function 'kotlin.error' call
800
588
  var tmp4_error = 'Path ' + input + ' is not a Wirespec file';
@@ -805,200 +593,74 @@
805
593
  }
806
594
  }
807
595
  }
808
- function convert(arguments_0) {
809
- return compile_0(arguments_0);
810
- }
811
- var Jvm_Java_instance;
812
- var Jvm_Kotlin_instance;
813
- var Jvm_Scala_instance;
814
- function values() {
815
- return [Jvm_Java_getInstance(), Jvm_Kotlin_getInstance(), Jvm_Scala_getInstance()];
816
- }
817
- function get_entries() {
818
- if ($ENTRIES == null)
819
- $ENTRIES = enumEntries(values());
820
- return $ENTRIES;
821
- }
822
- var Jvm_entriesInitialized;
823
- function Jvm_initEntries() {
824
- if (Jvm_entriesInitialized)
825
- return Unit_getInstance();
826
- Jvm_entriesInitialized = true;
827
- Jvm_Java_instance = new Jvm('Java', 0);
828
- Jvm_Kotlin_instance = new Jvm('Kotlin', 1);
829
- Jvm_Scala_instance = new Jvm('Scala', 2);
830
- }
831
- var $ENTRIES;
832
- var Script_TypeScript_instance;
833
- function values_0() {
834
- return [Script_TypeScript_getInstance()];
835
- }
836
- function get_entries_0() {
837
- if ($ENTRIES_0 == null)
838
- $ENTRIES_0 = enumEntries(values_0());
839
- return $ENTRIES_0;
840
- }
841
- var Script_entriesInitialized;
842
- function Script_initEntries() {
843
- if (Script_entriesInitialized)
844
- return Unit_getInstance();
845
- Script_entriesInitialized = true;
846
- Script_TypeScript_instance = new Script('TypeScript', 0);
847
- }
848
- var $ENTRIES_0;
849
- var Spec_Wirespec_instance;
850
- function values_1() {
851
- return [Spec_Wirespec_getInstance()];
852
- }
853
- function get_entries_1() {
854
- if ($ENTRIES_1 == null)
855
- $ENTRIES_1 = enumEntries(values_1());
856
- return $ENTRIES_1;
857
- }
858
- var Spec_entriesInitialized;
859
- function Spec_initEntries() {
860
- if (Spec_entriesInitialized)
861
- return Unit_getInstance();
862
- Spec_entriesInitialized = true;
863
- Spec_Wirespec_instance = new Spec('Wirespec', 0);
864
- }
865
- var $ENTRIES_1;
866
- function values_2($this) {
867
- return plus(plus(get_entries(), get_entries_0()), get_entries_1());
868
- }
869
- function Jvm(name, ordinal) {
870
- Enum.call(this, name, ordinal);
871
- }
872
- function Script(name, ordinal) {
873
- Enum.call(this, name, ordinal);
874
- }
875
- function Spec(name, ordinal) {
876
- Enum.call(this, name, ordinal);
877
- }
878
- function Companion_1() {
879
- Companion_instance_1 = this;
880
- }
881
- protoOf(Companion_1).z3q = function () {
882
- // Inline function 'kotlin.collections.mapValues' call
883
- // Inline function 'kotlin.collections.associateBy' call
884
- var tmp0_associateBy = values_2(this);
885
- var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(tmp0_associateBy, 10)), 16);
886
- // Inline function 'kotlin.collections.associateByTo' call
887
- var tmp0_associateByTo = LinkedHashMap_init_$Create$(capacity);
888
- var tmp0_iterator = tmp0_associateBy.c();
889
- while (tmp0_iterator.d()) {
890
- var element = tmp0_iterator.e();
891
- var tmp$ret$0;
892
- // Inline function 'community.flock.wirespec.compiler.cli.Companion.toMap.<anonymous>' call
893
- tmp$ret$0 = element.o5_1;
894
- tmp0_associateByTo.n3(tmp$ret$0, element);
895
- }
896
- // Inline function 'kotlin.collections.mapValuesTo' call
897
- var tmp0_mapValuesTo = LinkedHashMap_init_$Create$(mapCapacity(tmp0_associateByTo.f()));
898
- // Inline function 'kotlin.collections.associateByTo' call
899
- var tmp0_iterator_0 = tmp0_associateByTo.w().c();
900
- while (tmp0_iterator_0.d()) {
901
- var element_0 = tmp0_iterator_0.e();
902
- // Inline function 'kotlin.collections.mapValuesTo.<anonymous>' call
903
- var tmp = element_0.x();
904
- var tmp$ret$5;
905
- // Inline function 'community.flock.wirespec.compiler.cli.Companion.toMap.<anonymous>' call
906
- // Inline function 'kotlin.collections.component2' call
907
- var v = element_0.y();
908
- tmp$ret$5 = isInterface(v, Language) ? v : THROW_CCE();
909
- tmp0_mapValuesTo.n3(tmp, tmp$ret$5);
910
- }
911
- return tmp0_mapValuesTo;
912
- };
913
- protoOf(Companion_1).toString = function () {
914
- return joinToString(values_2(this));
915
- };
916
- var Companion_instance_1;
917
- function Companion_getInstance_5() {
918
- if (Companion_instance_1 == null)
919
- new Companion_1();
920
- return Companion_instance_1;
921
- }
922
- function Jvm_Java_getInstance() {
923
- Jvm_initEntries();
924
- return Jvm_Java_instance;
925
- }
926
- function Jvm_Kotlin_getInstance() {
927
- Jvm_initEntries();
928
- return Jvm_Kotlin_instance;
929
- }
930
- function Jvm_Scala_getInstance() {
931
- Jvm_initEntries();
932
- return Jvm_Scala_instance;
933
- }
934
- function Script_TypeScript_getInstance() {
935
- Script_initEntries();
936
- return Script_TypeScript_instance;
937
- }
938
- function Spec_Wirespec_getInstance() {
939
- Spec_initEntries();
940
- return Spec_Wirespec_instance;
941
- }
942
- function Language() {
943
- }
944
- var Format_OpenApiV2_instance;
945
- var Format_OpenApiV3_instance;
946
- function Companion_2() {
947
- Companion_instance_2 = this;
948
- }
949
- protoOf(Companion_2).toString = function () {
950
- return joinToString(get_entries_2());
951
- };
952
- var Companion_instance_2;
953
- function Companion_getInstance_6() {
954
- Format_initEntries();
955
- if (Companion_instance_2 == null)
956
- new Companion_2();
957
- return Companion_instance_2;
958
- }
959
- function values_3() {
960
- return [Format_OpenApiV2_getInstance(), Format_OpenApiV3_getInstance()];
961
- }
962
- function get_entries_2() {
963
- if ($ENTRIES_2 == null)
964
- $ENTRIES_2 = enumEntries(values_3());
965
- return $ENTRIES_2;
966
- }
967
- var Format_entriesInitialized;
968
- function Format_initEntries() {
969
- if (Format_entriesInitialized)
970
- return Unit_getInstance();
971
- Format_entriesInitialized = true;
972
- Format_OpenApiV2_instance = new Format('OpenApiV2', 0);
973
- Format_OpenApiV3_instance = new Format('OpenApiV3', 1);
974
- Companion_getInstance_6();
975
- }
976
- var $ENTRIES_2;
977
- function Format(name, ordinal) {
978
- Enum.call(this, name, ordinal);
979
- }
980
- function out(_this__u8e3s4, packageName, output) {
981
- return out$lambda(output, _this__u8e3s4, packageName);
982
- }
983
- function write(output, file) {
984
- // Inline function 'kotlin.collections.forEach' call
985
- var tmp0_iterator = output.c();
596
+ function wirespec(_this__u8e3s4, languages, packageName, path, logger) {
597
+ // Inline function 'kotlin.collections.map' call
598
+ // Inline function 'kotlin.let' call
599
+ // Inline function 'kotlin.let' call
600
+ var tmp0_let = _this__u8e3s4.q11();
601
+ var tmp1_let_this = Wirespec_getInstance();
602
+ // Inline function 'kotlin.contracts.contract' call
603
+ var tmp2_let = compile(tmp1_let_this, tmp0_let)(logger);
604
+ // Inline function 'kotlin.contracts.contract' call
605
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>' call
606
+ // Inline function 'kotlin.collections.map' call
607
+ var tmp0_map = emitters(languages, packageName, path, logger);
608
+ // Inline function 'kotlin.collections.mapTo' call
609
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
610
+ var tmp0_iterator = tmp0_map.c();
986
611
  while (tmp0_iterator.d()) {
987
- var element = tmp0_iterator.e();
988
- // Inline function 'community.flock.wirespec.compiler.cli.write.<anonymous>' call
989
- var name = element.e3();
990
- var result = element.f3();
991
- var tmp1_safe_receiver = file == null ? null : file.q3t(name);
612
+ var item = tmp0_iterator.e();
613
+ var tmp$ret$6;
614
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>' call
615
+ var emitter = item.e3();
616
+ var file = item.f3();
617
+ var results = tmp2_let(emitter);
992
618
  var tmp;
993
- if (tmp1_safe_receiver == null) {
994
- tmp = null;
619
+ if (!emitter.i1w()) {
620
+ var tmp$ret$5;
621
+ // Inline function 'arrow.core.Either.map' call
622
+ // Inline function 'kotlin.contracts.contract' call
623
+ // Inline function 'arrow.core.flatMap' call
624
+ // Inline function 'kotlin.contracts.contract' call
625
+ var tmp_0;
626
+ if (results instanceof Right) {
627
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
628
+ var tmp0_anonymous = results.x1p_1;
629
+ var tmp$ret$2;
630
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>.<anonymous>' call
631
+ tmp$ret$2 = listOf(new Emitted(Companion_getInstance_3().z1r(path(FileExtension_Wirespec_getInstance()).f22_1), first(tmp0_anonymous).p1s_1));
632
+ tmp_0 = new Right(tmp$ret$2);
633
+ } else {
634
+ if (results instanceof Left) {
635
+ tmp_0 = results;
636
+ } else {
637
+ noWhenBranchMatchedException();
638
+ }
639
+ }
640
+ tmp$ret$5 = tmp_0;
641
+ tmp = to(tmp$ret$5, file);
995
642
  } else {
996
- tmp1_safe_receiver.r3t(result);
997
- tmp = Unit_getInstance();
643
+ tmp = to(results, file);
998
644
  }
999
- if (tmp == null) {
1000
- print(result);
645
+ tmp$ret$6 = tmp;
646
+ tmp0_mapTo.a(tmp$ret$6);
647
+ }
648
+ // Inline function 'kotlin.collections.mapTo' call
649
+ var tmp0_mapTo_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_mapTo, 10));
650
+ var tmp0_iterator_0 = tmp0_mapTo.c();
651
+ while (tmp0_iterator_0.d()) {
652
+ var item_0 = tmp0_iterator_0.e();
653
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>' call
654
+ var results_0 = item_0.e3();
655
+ var file_0 = item_0.f3();
656
+ if (results_0 instanceof Right) {
657
+ write(results_0.x1p_1, file_0);
658
+ } else {
659
+ if (results_0 instanceof Left) {
660
+ println(results_0.r1p_1);
661
+ }
1001
662
  }
663
+ tmp0_mapTo_0.a(Unit_getInstance());
1002
664
  }
1003
665
  }
1004
666
  function emitters(_this__u8e3s4, packageName, path, logger) {
@@ -1009,7 +671,7 @@
1009
671
  while (tmp0_iterator.d()) {
1010
672
  var item = tmp0_iterator.e();
1011
673
  var tmp$ret$10;
1012
- // Inline function 'community.flock.wirespec.compiler.cli.emitters.<anonymous>' call
674
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>' call
1013
675
  var tmp;
1014
676
  if (equals(item, Jvm_Java_getInstance())) {
1015
677
  var tmp_0 = new JavaEmitter(packageName, logger);
@@ -1019,8 +681,8 @@
1019
681
  } else {
1020
682
  // Inline function 'kotlin.let' call
1021
683
  // Inline function 'kotlin.contracts.contract' call
1022
- // Inline function 'community.flock.wirespec.compiler.cli.emitters.<anonymous>.<anonymous>' call
1023
- tmp_1 = new JavaFile(path(Extension_Java_getInstance()));
684
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
685
+ tmp_1 = new JavaFile(path(FileExtension_Java_getInstance()));
1024
686
  }
1025
687
  tmp = to(tmp_0, tmp_1);
1026
688
  } else if (equals(item, Jvm_Kotlin_getInstance())) {
@@ -1031,8 +693,8 @@
1031
693
  } else {
1032
694
  // Inline function 'kotlin.let' call
1033
695
  // Inline function 'kotlin.contracts.contract' call
1034
- // Inline function 'community.flock.wirespec.compiler.cli.emitters.<anonymous>.<anonymous>' call
1035
- tmp_3 = new KotlinFile(path(Extension_Kotlin_getInstance()));
696
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
697
+ tmp_3 = new KotlinFile(path(FileExtension_Kotlin_getInstance()));
1036
698
  }
1037
699
  tmp = to(tmp_2, tmp_3);
1038
700
  } else if (equals(item, Jvm_Scala_getInstance())) {
@@ -1043,8 +705,8 @@
1043
705
  } else {
1044
706
  // Inline function 'kotlin.let' call
1045
707
  // Inline function 'kotlin.contracts.contract' call
1046
- // Inline function 'community.flock.wirespec.compiler.cli.emitters.<anonymous>.<anonymous>' call
1047
- tmp_5 = new ScalaFile(path(Extension_Scala_getInstance()));
708
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
709
+ tmp_5 = new ScalaFile(path(FileExtension_Scala_getInstance()));
1048
710
  }
1049
711
  tmp = to(tmp_4, tmp_5);
1050
712
  } else if (equals(item, Script_TypeScript_getInstance())) {
@@ -1055,8 +717,8 @@
1055
717
  } else {
1056
718
  // Inline function 'kotlin.let' call
1057
719
  // Inline function 'kotlin.contracts.contract' call
1058
- // Inline function 'community.flock.wirespec.compiler.cli.emitters.<anonymous>.<anonymous>' call
1059
- tmp_7 = new TypeScriptFile(path(Extension_TypeScript_getInstance()));
720
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
721
+ tmp_7 = new TypeScriptFile(path(FileExtension_TypeScript_getInstance()));
1060
722
  }
1061
723
  tmp = to(tmp_6, tmp_7);
1062
724
  } else if (equals(item, Spec_Wirespec_getInstance())) {
@@ -1067,8 +729,8 @@
1067
729
  } else {
1068
730
  // Inline function 'kotlin.let' call
1069
731
  // Inline function 'kotlin.contracts.contract' call
1070
- // Inline function 'community.flock.wirespec.compiler.cli.emitters.<anonymous>.<anonymous>' call
1071
- tmp_9 = new WirespecFile(path(Extension_Wirespec_getInstance()));
732
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
733
+ tmp_9 = new WirespecFile(path(FileExtension_Wirespec_getInstance()));
1072
734
  }
1073
735
  tmp = to(tmp_8, tmp_9);
1074
736
  } else {
@@ -1079,76 +741,30 @@
1079
741
  }
1080
742
  return tmp0_mapTo;
1081
743
  }
1082
- function wirespec(_this__u8e3s4, languages, packageName, path, logger) {
1083
- // Inline function 'kotlin.collections.map' call
1084
- // Inline function 'kotlin.let' call
1085
- // Inline function 'kotlin.let' call
1086
- var tmp0_let = _this__u8e3s4.q11();
1087
- var tmp1_let_this = Wirespec_getInstance();
1088
- // Inline function 'kotlin.contracts.contract' call
1089
- var tmp2_let = compile(tmp1_let_this, tmp0_let)(logger);
1090
- // Inline function 'kotlin.contracts.contract' call
1091
- // Inline function 'community.flock.wirespec.compiler.cli.wirespec.<anonymous>' call
1092
- // Inline function 'kotlin.collections.map' call
1093
- var tmp0_map = emitters(languages, packageName, path, logger);
1094
- // Inline function 'kotlin.collections.mapTo' call
1095
- var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
1096
- var tmp0_iterator = tmp0_map.c();
744
+ function write(output, file) {
745
+ // Inline function 'kotlin.collections.forEach' call
746
+ var tmp0_iterator = output.c();
1097
747
  while (tmp0_iterator.d()) {
1098
- var item = tmp0_iterator.e();
1099
- var tmp$ret$6;
1100
- // Inline function 'community.flock.wirespec.compiler.cli.wirespec.<anonymous>.<anonymous>' call
1101
- var emitter = item.e3();
1102
- var file = item.f3();
1103
- var results = tmp2_let(emitter);
748
+ var element = tmp0_iterator.e();
749
+ // Inline function 'community.flock.wirespec.plugin.cli.write.<anonymous>' call
750
+ var name = element.e3();
751
+ var result = element.f3();
752
+ var tmp1_safe_receiver = file == null ? null : file.j24(name);
1104
753
  var tmp;
1105
- if (!emitter.h1w()) {
1106
- var tmp$ret$5;
1107
- // Inline function 'arrow.core.Either.map' call
1108
- // Inline function 'kotlin.contracts.contract' call
1109
- // Inline function 'arrow.core.flatMap' call
1110
- // Inline function 'kotlin.contracts.contract' call
1111
- var tmp_0;
1112
- if (results instanceof Right) {
1113
- // Inline function 'arrow.core.Either.map.<anonymous>' call
1114
- var tmp0_anonymous = results.w1p_1;
1115
- var tmp$ret$2;
1116
- // Inline function 'community.flock.wirespec.compiler.cli.wirespec.<anonymous>.<anonymous>.<anonymous>' call
1117
- tmp$ret$2 = listOf(new Emitted(Companion_getInstance_1().y1r(path(Extension_Wirespec_getInstance()).i3t_1), first(tmp0_anonymous).o1s_1));
1118
- tmp_0 = new Right(tmp$ret$2);
1119
- } else {
1120
- if (results instanceof Left) {
1121
- tmp_0 = results;
1122
- } else {
1123
- noWhenBranchMatchedException();
1124
- }
1125
- }
1126
- tmp$ret$5 = tmp_0;
1127
- tmp = to(tmp$ret$5, file);
754
+ if (tmp1_safe_receiver == null) {
755
+ tmp = null;
1128
756
  } else {
1129
- tmp = to(results, file);
757
+ tmp1_safe_receiver.y3v(result);
758
+ tmp = Unit_getInstance();
1130
759
  }
1131
- tmp$ret$6 = tmp;
1132
- tmp0_mapTo.a(tmp$ret$6);
1133
- }
1134
- // Inline function 'kotlin.collections.mapTo' call
1135
- var tmp0_mapTo_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_mapTo, 10));
1136
- var tmp0_iterator_0 = tmp0_mapTo.c();
1137
- while (tmp0_iterator_0.d()) {
1138
- var item_0 = tmp0_iterator_0.e();
1139
- // Inline function 'community.flock.wirespec.compiler.cli.wirespec.<anonymous>' call
1140
- var results_0 = item_0.e3();
1141
- var file_0 = item_0.f3();
1142
- if (results_0 instanceof Right) {
1143
- write(results_0.w1p_1, file_0);
1144
- } else {
1145
- if (results_0 instanceof Left) {
1146
- println(results_0.r1p_1);
1147
- }
760
+ if (tmp == null) {
761
+ print(result);
1148
762
  }
1149
- tmp0_mapTo_0.a(Unit_getInstance());
1150
763
  }
1151
764
  }
765
+ function out(_this__u8e3s4, packageName, output) {
766
+ return out$lambda(output, _this__u8e3s4, packageName);
767
+ }
1152
768
  function compile$ref() {
1153
769
  var l = function (p0) {
1154
770
  compile_0(p0);
@@ -1182,126 +798,119 @@
1182
798
  // Inline function 'kotlin.js.asDynamic' call
1183
799
  tmp$ret$0 = tmp0_lowercase;
1184
800
  tmp$ret$1 = tmp$ret$0.toLowerCase();
1185
- tmp = $this_out.h3t_1 + '/out/' + tmp$ret$1;
801
+ tmp = $this_out.e22_1 + '/out/' + tmp$ret$1;
1186
802
  } else {
1187
803
  tmp = tmp0_elvis_lhs;
1188
804
  }
1189
805
  var dir = tmp;
1190
- return $this_out.l3t(dir + '/' + joinToString(split_0($packageName, charArrayOf([_Char___init__impl__6a9atx(46)])), '/'), VOID, extension);
806
+ return $this_out.i22(dir + '/' + joinToString(split($packageName, charArrayOf([_Char___init__impl__6a9atx(46)])), '/'), VOID, extension);
1191
807
  };
1192
808
  }
1193
- function Format_OpenApiV2_getInstance() {
1194
- Format_initEntries();
1195
- return Format_OpenApiV2_instance;
1196
- }
1197
- function Format_OpenApiV3_getInstance() {
1198
- Format_initEntries();
1199
- return Format_OpenApiV3_instance;
1200
- }
1201
- var Extension_Java_instance;
1202
- var Extension_Kotlin_instance;
1203
- var Extension_Scala_instance;
1204
- var Extension_TypeScript_instance;
1205
- var Extension_Wirespec_instance;
1206
- var Extension_Json_instance;
1207
- function values_4() {
1208
- return [Extension_Java_getInstance(), Extension_Kotlin_getInstance(), Extension_Scala_getInstance(), Extension_TypeScript_getInstance(), Extension_Wirespec_getInstance(), Extension_Json_getInstance()];
1209
- }
1210
- function get_entries_3() {
1211
- if ($ENTRIES_3 == null)
1212
- $ENTRIES_3 = enumEntries(values_4());
1213
- return $ENTRIES_3;
1214
- }
1215
- var Extension_entriesInitialized;
1216
- function Extension_initEntries() {
1217
- if (Extension_entriesInitialized)
1218
- return Unit_getInstance();
1219
- Extension_entriesInitialized = true;
1220
- Extension_Java_instance = new Extension('Java', 0, 'java');
1221
- Extension_Kotlin_instance = new Extension('Kotlin', 1, 'kt');
1222
- Extension_Scala_instance = new Extension('Scala', 2, 'scala');
1223
- Extension_TypeScript_instance = new Extension('TypeScript', 3, 'ts');
1224
- Extension_Wirespec_instance = new Extension('Wirespec', 4, 'ws');
1225
- Extension_Json_instance = new Extension('Json', 5, 'json');
1226
- }
1227
- var $ENTRIES_3;
1228
- function Extension(name, ordinal, ext) {
1229
- Enum.call(this, name, ordinal);
1230
- this.g3t_1 = ext;
1231
- }
1232
- function Extension_Java_getInstance() {
1233
- Extension_initEntries();
1234
- return Extension_Java_instance;
1235
- }
1236
- function Extension_Kotlin_getInstance() {
1237
- Extension_initEntries();
1238
- return Extension_Kotlin_instance;
1239
- }
1240
- function Extension_Scala_getInstance() {
1241
- Extension_initEntries();
1242
- return Extension_Scala_instance;
1243
- }
1244
- function Extension_TypeScript_getInstance() {
1245
- Extension_initEntries();
1246
- return Extension_TypeScript_instance;
1247
- }
1248
- function Extension_Wirespec_getInstance() {
1249
- Extension_initEntries();
1250
- return Extension_Wirespec_instance;
1251
- }
1252
- function Extension_Json_getInstance() {
1253
- Extension_initEntries();
1254
- return Extension_Json_instance;
1255
- }
1256
809
  function JavaFile(path) {
1257
- File.call(this, path.l3t(VOID, VOID, Extension_Java_getInstance()));
810
+ File.call(this, path.i22(VOID, VOID, FileExtension_Java_getInstance()));
1258
811
  }
1259
- protoOf(JavaFile).q3t = function (fileName) {
1260
- return new JavaFile(this.n3t_1.l3t(VOID, fileName));
812
+ protoOf(JavaFile).j24 = function (fileName) {
813
+ return new JavaFile(this.v3v_1.i22(VOID, fileName));
1261
814
  };
1262
815
  function JsonFile(path) {
1263
- File.call(this, path.l3t(VOID, VOID, Extension_Json_getInstance()));
816
+ File.call(this, path.i22(VOID, VOID, FileExtension_Json_getInstance()));
1264
817
  }
1265
- protoOf(JsonFile).q3t = function (fileName) {
1266
- return new JsonFile(this.n3t_1.l3t(VOID, fileName));
818
+ protoOf(JsonFile).j24 = function (fileName) {
819
+ return new JsonFile(this.v3v_1.i22(VOID, fileName));
1267
820
  };
1268
821
  function KotlinFile(path) {
1269
- File.call(this, path.l3t(VOID, VOID, Extension_Kotlin_getInstance()));
822
+ File.call(this, path.i22(VOID, VOID, FileExtension_Kotlin_getInstance()));
1270
823
  }
1271
- protoOf(KotlinFile).q3t = function (fileName) {
1272
- return new KotlinFile(this.n3t_1.l3t(VOID, fileName));
824
+ protoOf(KotlinFile).j24 = function (fileName) {
825
+ return new KotlinFile(this.v3v_1.i22(VOID, fileName));
1273
826
  };
1274
827
  function ScalaFile(path) {
1275
- File.call(this, path.l3t(VOID, VOID, Extension_Scala_getInstance()));
828
+ File.call(this, path.i22(VOID, VOID, FileExtension_Scala_getInstance()));
1276
829
  }
1277
- protoOf(ScalaFile).q3t = function (fileName) {
1278
- return new ScalaFile(this.n3t_1.l3t(VOID, fileName));
830
+ protoOf(ScalaFile).j24 = function (fileName) {
831
+ return new ScalaFile(this.v3v_1.i22(VOID, fileName));
1279
832
  };
1280
833
  function TypeScriptFile(path) {
1281
- File.call(this, path.l3t(VOID, VOID, Extension_TypeScript_getInstance()));
834
+ File.call(this, path.i22(VOID, VOID, FileExtension_TypeScript_getInstance()));
1282
835
  }
1283
- protoOf(TypeScriptFile).q3t = function (fileName) {
1284
- return new TypeScriptFile(this.n3t_1.l3t(VOID, fileName));
836
+ protoOf(TypeScriptFile).j24 = function (fileName) {
837
+ return new TypeScriptFile(this.v3v_1.i22(VOID, fileName));
1285
838
  };
1286
839
  function WirespecFile(path) {
1287
- File.call(this, path.l3t(VOID, VOID, Extension_Wirespec_getInstance()));
840
+ File.call(this, path.i22(VOID, VOID, FileExtension_Wirespec_getInstance()));
1288
841
  }
1289
- protoOf(WirespecFile).q3t = function (fileName) {
1290
- return new WirespecFile(this.n3t_1.l3t(VOID, fileName));
842
+ protoOf(WirespecFile).j24 = function (fileName) {
843
+ return new WirespecFile(this.v3v_1.i22(VOID, fileName));
1291
844
  };
845
+ function cli(args) {
846
+ main(args);
847
+ }
848
+ function parser(source) {
849
+ var tmp0_safe_receiver = parse(Wirespec_getInstance(), source)(get_noLogger()).w1p();
850
+ var tmp;
851
+ if (tmp0_safe_receiver == null) {
852
+ tmp = null;
853
+ } else {
854
+ // Inline function 'kotlin.collections.filterIsInstance' call
855
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
856
+ var tmp0_filterIsInstanceTo = ArrayList_init_$Create$();
857
+ var tmp0_iterator = tmp0_safe_receiver.c();
858
+ while (tmp0_iterator.d()) {
859
+ var element = tmp0_iterator.e();
860
+ if (!(element == null) ? isInterface(element, Definition) : false) {
861
+ tmp0_filterIsInstanceTo.a(element);
862
+ }
863
+ }
864
+ tmp = tmp0_filterIsInstanceTo;
865
+ }
866
+ var tmp1_safe_receiver = tmp;
867
+ var tmp_0;
868
+ if (tmp1_safe_receiver == null) {
869
+ tmp_0 = null;
870
+ } else {
871
+ // Inline function 'kotlin.collections.map' call
872
+ // Inline function 'kotlin.collections.mapTo' call
873
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_safe_receiver, 10));
874
+ var tmp0_iterator_0 = tmp1_safe_receiver.c();
875
+ while (tmp0_iterator_0.d()) {
876
+ var item = tmp0_iterator_0.e();
877
+ var tmp$ret$2;
878
+ // Inline function 'community.flock.wirespec.plugin.cli.parser.<anonymous>' call
879
+ tmp$ret$2 = produce(item);
880
+ tmp0_mapTo.a(tmp$ret$2);
881
+ }
882
+ tmp_0 = tmp0_mapTo;
883
+ }
884
+ var tmp2_safe_receiver = tmp_0;
885
+ var tmp_1;
886
+ if (tmp2_safe_receiver == null) {
887
+ tmp_1 = null;
888
+ } else {
889
+ // Inline function 'kotlin.collections.toTypedArray' call
890
+ tmp_1 = copyToArray(tmp2_safe_receiver);
891
+ }
892
+ var tmp3_elvis_lhs = tmp_1;
893
+ var tmp_2;
894
+ if (tmp3_elvis_lhs == null) {
895
+ throw IllegalStateException_init_$Create$('Cannot parse source');
896
+ } else {
897
+ tmp_2 = tmp3_elvis_lhs;
898
+ }
899
+ return tmp_2;
900
+ }
1292
901
  function Directory$wirespecFiles$lambda(it) {
1293
902
  // Inline function 'kotlin.js.unsafeCast' call
1294
903
  return it;
1295
904
  }
1296
905
  function Directory$wirespecFiles$lambda_0(it) {
1297
- return endsWith(it, Extension_Wirespec_getInstance().g3t_1);
906
+ return endsWith(it, FileExtension_Wirespec_getInstance().d22_1);
1298
907
  }
1299
908
  function Directory$wirespecFiles$lambda_1(it) {
1300
- return dropLast_0(it, Extension_Wirespec_getInstance().g3t_1.length + 1 | 0);
909
+ return dropLast(it, FileExtension_Wirespec_getInstance().d22_1.length + 1 | 0);
1301
910
  }
1302
911
  function Directory$wirespecFiles$lambda_2(this$0) {
1303
912
  return function (it) {
1304
- return new FullFilePath(this$0.o3t_1, it);
913
+ return new FullFilePath(this$0.w3v_1, it);
1305
914
  };
1306
915
  }
1307
916
  function WirespecFile$_init_$ref_cj1n5j() {
@@ -1312,10 +921,10 @@
1312
921
  return l;
1313
922
  }
1314
923
  function Directory(path) {
1315
- this.o3t_1 = path;
924
+ this.w3v_1 = path;
1316
925
  }
1317
- protoOf(Directory).p3t = function () {
1318
- var tmp = asSequence(iterator(get_fs().readdirSync(this.o3t_1, 'utf-8')));
926
+ protoOf(Directory).x3v = function () {
927
+ var tmp = asSequence(iterator(get_fs().readdirSync(this.w3v_1, 'utf-8')));
1319
928
  var tmp_0 = map(tmp, Directory$wirespecFiles$lambda);
1320
929
  var tmp_1 = filter(tmp_0, Directory$wirespecFiles$lambda_0);
1321
930
  var tmp_2 = map(tmp_1, Directory$wirespecFiles$lambda_1);
@@ -1323,20 +932,20 @@
1323
932
  return toSet_0(map(tmp_3, WirespecFile$_init_$ref_cj1n5j()));
1324
933
  };
1325
934
  function File(path) {
1326
- this.n3t_1 = path;
935
+ this.v3v_1 = path;
1327
936
  }
1328
937
  protoOf(File).q11 = function () {
1329
938
  // Inline function 'kotlin.js.unsafeCast' call
1330
- return get_fs().readFileSync(this.n3t_1.toString(), 'utf-8');
939
+ return get_fs().readFileSync(this.v3v_1.toString(), 'utf-8');
1331
940
  };
1332
- protoOf(File).r3t = function (text) {
941
+ protoOf(File).y3v = function (text) {
1333
942
  // Inline function 'kotlin.run' call
1334
- var tmp0_run = this.n3t_1.l3t(joinToString(split(this.n3t_1.h3t_1, ['out']), 'out/node'));
943
+ var tmp0_run = this.v3v_1.i22(joinToString(split_0(this.v3v_1.e22_1, ['out']), 'out/node'));
1335
944
  // Inline function 'kotlin.contracts.contract' call
1336
- // Inline function 'community.flock.wirespec.compiler.cli.io.File.write.<anonymous>' call
945
+ // Inline function 'community.flock.wirespec.plugin.cli.io.File.write.<anonymous>' call
1337
946
  // Inline function 'kotlin.js.unsafeCast' call
1338
- if (!get_fs().existsSync(tmp0_run.h3t_1)) {
1339
- get_fs().mkdirSync(tmp0_run.h3t_1, {recursive: true});
947
+ if (!get_fs().existsSync(tmp0_run.e22_1)) {
948
+ get_fs().mkdirSync(tmp0_run.e22_1, {recursive: true});
1340
949
  }
1341
950
  get_fs().writeFileSync(tmp0_run.toString(), text);
1342
951
  };
@@ -1364,8 +973,8 @@
1364
973
  var tmp;
1365
974
  try {
1366
975
  // Inline function 'kotlin.Companion.success' call
1367
- Companion_getInstance_2();
1368
- // Inline function 'community.flock.wirespec.compiler.utils.orNull.<anonymous>' call
976
+ Companion_getInstance_4();
977
+ // Inline function 'community.flock.wirespec.plugin.utils.orNull.<anonymous>' call
1369
978
  var tmp1_success = get_nodeArgs()[idx];
1370
979
  tmp = _Result___init__impl__xyqfz8(tmp1_success);
1371
980
  } catch ($p) {
@@ -1373,7 +982,7 @@
1373
982
  if ($p instanceof Error) {
1374
983
  var e = $p;
1375
984
  // Inline function 'kotlin.Companion.failure' call
1376
- Companion_getInstance_2();
985
+ Companion_getInstance_4();
1377
986
  tmp_0 = _Result___init__impl__xyqfz8(createFailure(e));
1378
987
  } else {
1379
988
  throw $p;
@@ -1399,10 +1008,20 @@
1399
1008
  }
1400
1009
  }
1401
1010
  //region block: exports
1402
- _.$_$ = _.$_$ || {};
1403
- _.$_$.a = main;
1011
+ function $jsExportAll$(_) {
1012
+ var $community = _.community || (_.community = {});
1013
+ var $community$flock = $community.flock || ($community.flock = {});
1014
+ var $community$flock$wirespec = $community$flock.wirespec || ($community$flock.wirespec = {});
1015
+ var $community$flock$wirespec$plugin = $community$flock$wirespec.plugin || ($community$flock$wirespec.plugin = {});
1016
+ var $community$flock$wirespec$plugin$cli = $community$flock$wirespec$plugin.cli || ($community$flock$wirespec$plugin.cli = {});
1017
+ $community$flock$wirespec$plugin$cli.cli = cli;
1018
+ $community$flock$wirespec$plugin$cli.parser = parser;
1019
+ }
1020
+ $jsExportAll$(_);
1021
+ kotlin_community_flock_wirespec_compiler_lib.$jsExportAll$(_);
1404
1022
  //endregion
1023
+ main([]);
1405
1024
  return _;
1406
1025
  }));
1407
1026
 
1408
- //# sourceMappingURL=wirespec-src-compiler-cli.js.map
1027
+ //# sourceMappingURL=wirespec-src-plugin-cli.js.map