@flock/wirespec 0.12.9 → 0.13.1

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.
@@ -24,20 +24,15 @@ import {
24
24
  mapCapacity1h45rc3eh9p2l as mapCapacity,
25
25
  coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
26
26
  LinkedHashMap_init_$Create$snys8oz8txtu as LinkedHashMap_init_$Create$,
27
- substringAfter35b3qhto7hchb as substringAfter,
28
- startsWith26w8qjqapeeq6 as startsWith,
29
27
  THROW_CCE2g6jy02ryeudk as THROW_CCE,
30
28
  isCharSequence1ju9jr1w86plq as isCharSequence,
31
29
  trim11nh7r46at6sx as trim,
32
30
  toString1pkumu07cwy4m as toString,
33
31
  Enum3alwj03lh1n41 as Enum,
34
- ArrayList_init_$Create$2rimpp4x9tjd3 as ArrayList_init_$Create$_0,
35
- to2cs3ny02qtbcb as to,
36
- _Char___init__impl__6a9atx367vrx0avsvbg as _Char___init__impl__6a9atx,
37
- substringAfterLast3r0t0my8cpqhk as substringAfterLast,
38
32
  KProperty1ca4yb4wlo496 as KProperty1,
39
33
  getPropertyCallableRef1ajb9in178r5r as getPropertyCallableRef,
40
34
  numberRangeToNumber25vse2rgp6rs8 as numberRangeToNumber,
35
+ ArrayList_init_$Create$2rimpp4x9tjd3 as ArrayList_init_$Create$_0,
41
36
  copyToArray2j022khrow2yi as copyToArray,
42
37
  joinToString1cxrrlmo0chqs as joinToString,
43
38
  IllegalStateException_init_$Create$1nm9y6jd3c9iy as IllegalStateException_init_$Create$,
@@ -53,6 +48,7 @@ import {
53
48
  KotlinEmitter3u2bd89c6zjpn as KotlinEmitter,
54
49
  ScalaEmittergcrbho15xuc5 as ScalaEmitter,
55
50
  TypeScriptEmitter15xnhgx1fp785 as TypeScriptEmitter,
51
+ PythonEmitter2ympv43525ly9 as PythonEmitter,
56
52
  WirespecEmitterzy8hsjgf4ddx as WirespecEmitter,
57
53
  Logger1cwdyrq5itr5l as Logger,
58
54
  Level_ERROR_getInstance2j4e9tt9l6uqw as Level_ERROR_getInstance,
@@ -66,31 +62,32 @@ import {
66
62
  NoLoggero51bdi3we1s0 as NoLogger,
67
63
  } from './wirespec-src-compiler-core.mjs';
68
64
  import {
65
+ write1u316o1mmac8j as write,
69
66
  Companion_instance16jo4jh8p2erh as Companion_instance_1,
70
- Source1opabw92penj5 as Source,
71
- FilePath1s8f7qc8qb6ia as FilePath,
72
- Directory32gwsfanzqyry as Directory,
73
- DirectoryPath1v7ae6itu451q as DirectoryPath,
74
- SourcePath1jk5f7tn3bc1s as SourcePath,
67
+ getFullPath4g3ciksg8rpm as getFullPath,
68
+ read1bpb5m43oodfb as read,
69
+ Source2leyaqfqfs5k3 as Source,
70
+ FilePath16n0cgvs38g6y as FilePath,
71
+ Directory1msbu5hqetml1 as Directory,
72
+ wirespecSources3k3ry4x3ljoa3 as wirespecSources,
73
+ or33xhl4wx85q9x as or,
74
+ DirectoryPath39bbfr0ixndbr as DirectoryPath,
75
+ SourcePath3m57qddtnytut as SourcePath,
76
+ getOutPutPathqmn3xkxu6se6 as getOutPutPath,
75
77
  CompilerArguments27p1etc1665zg as CompilerArguments,
76
78
  values39f22etrsivck as values,
77
79
  ConverterArgumentsa8xc45eyvf51 as ConverterArguments,
78
- Companion_instance2488692qc8bjd as Companion_instance_2,
79
- _DirectoryPath___init__impl__5bzkjd2lelmyoqn5cc4 as _DirectoryPath___init__impl__5bzkjd,
80
- _SourcePath___init__impl__vbnish5d8fdg1tbub5 as _SourcePath___init__impl__vbnish,
81
- path1zyjte8ev11m9 as path,
82
- _DirectoryPath___get_value__impl__hdy2e32f9du2juifznr as _DirectoryPath___get_value__impl__hdy2e3,
83
80
  compile3ocumkpx3p9ko as compile,
84
81
  convert3g5kyi4d6y9kc as convert,
85
82
  } from './wirespec-src-plugin-arguments.mjs';
86
83
  import {
84
+ Left2oemzq1tpcg4i as Left,
85
+ Right351sh2v8odavg as Right,
87
86
  nonEmptySetOf3p7fhmt51pz4b as nonEmptySetOf,
88
87
  toNonEmptySetOrNull1tjnd9jrkd4bs as toNonEmptySetOrNull,
89
88
  NonEmptySet1rtvr2guloo52 as NonEmptySet,
90
89
  nonEmptyListOf17xawqyzwrlrt as nonEmptyListOf,
91
- Left2oemzq1tpcg4i as Left,
92
- Right351sh2v8odavg as Right,
93
- Companion_instancel37dvvdi0gn2 as Companion_instance_3,
90
+ Companion_instancel37dvvdi0gn2 as Companion_instance_2,
94
91
  right2w60qw9uivnyr as right,
95
92
  nonFatalOrThrow35agffkx4bbtz as nonFatalOrThrow,
96
93
  left3pixsqou14wpr as left,
@@ -99,14 +96,6 @@ import {
99
96
  OpenAPIV2Emitter_getInstance339m3dn2m5b6v as OpenAPIV2Emitter_getInstance,
100
97
  OpenAPIV3Emitter_getInstanceja53nca07ivb as OpenAPIV3Emitter_getInstance,
101
98
  } from './wirespec-src-converter-openapi.mjs';
102
- import {
103
- Path21qufdfgaayly as Path,
104
- get_SystemFileSystemcqw7gp4jhbc7 as get_SystemFileSystem,
105
- buffered3kq86cdmguv3h as buffered,
106
- readString2nvggcfaijfhd as readString,
107
- buffered1hqdy4i9j28ez as buffered_0,
108
- writeString33ca4btrgctw7 as writeString,
109
- } from './kotlinx-io-kotlinx-io-core.mjs';
110
99
  import { produce1z6drlwotu836 as produce } from './wirespec-src-compiler-lib.mjs';
111
100
  //region block: imports
112
101
  //endregion
@@ -117,8 +106,6 @@ initMetadataForClass(SpecificFile, 'SpecificFile', VOID, CliktError);
117
106
  initMetadataForClass(WirespecFileError, 'WirespecFileError', WirespecFileError, SpecificFile);
118
107
  initMetadataForClass(ConvertNeedsAFile, 'ConvertNeedsAFile', ConvertNeedsAFile, CliktError);
119
108
  initMetadataForClass(JSONFileError, 'JSONFileError', JSONFileError, SpecificFile);
120
- initMetadataForClass(CannotAccessFileOrDirectory, 'CannotAccessFileOrDirectory', VOID, CliktError);
121
- initMetadataForClass(OutputShouldBeADirectory, 'OutputShouldBeADirectory', OutputShouldBeADirectory, CliktError);
122
109
  initMetadataForClass(ChooseALogLevel, 'ChooseALogLevel', ChooseALogLevel, CliktError);
123
110
  initMetadataForCompanion(Companion);
124
111
  initMetadataForClass(WirespecCli, 'WirespecCli', WirespecCli, NoOpCliktCommand);
@@ -148,40 +135,46 @@ function JSONFileError() {
148
135
  SpecificFile.call(this, FileExtension_JSON_getInstance());
149
136
  captureStack(this, JSONFileError);
150
137
  }
151
- function CannotAccessFileOrDirectory(input) {
152
- CliktError.call(this, 'Cannot access file or directory: ' + input + '.');
153
- captureStack(this, CannotAccessFileOrDirectory);
154
- }
155
- function OutputShouldBeADirectory() {
156
- CliktError.call(this, 'Output should be a directory.');
157
- captureStack(this, OutputShouldBeADirectory);
158
- }
159
138
  function ChooseALogLevel() {
160
139
  CliktError.call(this, 'Choose one of these log levels: ' + Companion_instance.toString() + '.');
161
140
  captureStack(this, ChooseALogLevel);
162
141
  }
163
142
  function SpecificFile(extension) {
164
- CliktError.call(this, 'No ' + extension.o2_1 + ' file found');
143
+ CliktError.call(this, 'No ' + extension.q2_1 + ' file found');
165
144
  captureStack(this, SpecificFile);
166
145
  }
167
146
  function Companion() {
168
147
  }
169
- protoOf(Companion).e4b = function (compile, convert) {
148
+ protoOf(Companion).u4b = function (compile, convert) {
170
149
  return subcommands(new WirespecCli(), [new Compile(compile), new Convert(convert)]);
171
150
  };
172
- var Companion_instance_4;
151
+ var Companion_instance_3;
173
152
  function Companion_getInstance() {
174
- return Companion_instance_4;
153
+ return Companion_instance_3;
175
154
  }
176
155
  function WirespecCli() {
177
156
  NoOpCliktCommand.call(this, VOID, VOID, 'wirespec');
178
157
  }
179
158
  function _get_languages__ojonze($this) {
180
- return $this.d4c_1.k45($this, languages$factory_0());
159
+ return $this.t4c_1.b49($this, languages$factory_0());
181
160
  }
182
161
  function run$handleError(p0) {
183
162
  handleError(p0);
184
163
  }
164
+ function handleError$ref() {
165
+ var l = function (p0) {
166
+ handleError(p0);
167
+ };
168
+ l.callableName = 'handleError';
169
+ return l;
170
+ }
171
+ function handleError$ref_0() {
172
+ var l = function (p0) {
173
+ handleError(p0);
174
+ };
175
+ l.callableName = 'handleError';
176
+ return l;
177
+ }
185
178
  function Compile$run$lambda(filePath, string) {
186
179
  write(filePath, string);
187
180
  return Unit_instance;
@@ -194,12 +187,30 @@ function Compile$run$handleError$ref() {
194
187
  }
195
188
  function Compile(compiler) {
196
189
  CommonOptions.call(this);
197
- this.c4c_1 = compiler;
198
- this.d4c_1 = multiple(choice(option(this, Options_Language_getInstance().g4c_1.slice(), 'Language'), Companion_instance_1.s2f(), VOID, true), VOID, true).v45(this, languages$factory());
190
+ this.s4c_1 = compiler;
191
+ this.t4c_1 = multiple(choice(option(this, Options_Language_getInstance().w4c_1.slice(), 'Language'), Companion_instance_1.i2j(), VOID, true), VOID, true).m49(this, languages$factory());
199
192
  }
200
- protoOf(Compile).z3v = function () {
201
- var inputPath = this.f4d(this.e4d());
193
+ protoOf(Compile).q3z = function () {
194
+ // Inline function 'arrow.core.getOrElse' call
195
+ // Inline function 'kotlin.contracts.contract' call
196
+ // Inline function 'arrow.core.Either.fold' call
197
+ var this_0 = getFullPath(this.u4d());
198
+ // Inline function 'kotlin.contracts.contract' call
202
199
  var tmp;
200
+ if (this_0 instanceof Right) {
201
+ // Inline function 'arrow.core.getOrElse.stub_for_inlining' call
202
+ // Inline function 'arrow.core.identity' call
203
+ tmp = this_0.pk_1;
204
+ } else {
205
+ if (this_0 instanceof Left) {
206
+ var it = this_0.jk_1;
207
+ throw new CliktError(it.w2k_1);
208
+ } else {
209
+ noWhenBranchMatchedException();
210
+ }
211
+ }
212
+ var inputPath = tmp;
213
+ var tmp_0;
203
214
  if (inputPath == null) {
204
215
  throw new IsNotAFileOrDirectory(null);
205
216
  } else {
@@ -207,85 +218,104 @@ protoOf(Compile).z3v = function () {
207
218
  throw new NoClasspathPossible();
208
219
  } else {
209
220
  if (inputPath instanceof DirectoryPath) {
210
- tmp = wirespecSources(new Directory(inputPath.c2h_1));
221
+ var tmp_1 = wirespecSources(new Directory(inputPath.s2k_1));
222
+ tmp_0 = or(tmp_1, handleError$ref()).cl_1;
211
223
  } else {
212
224
  if (inputPath instanceof FilePath) {
213
- var tmp_0;
214
- if (inputPath.y2f_1.p2_1 === 4) {
215
- tmp_0 = nonEmptySetOf(new Source(inputPath.x2f_1, read(inputPath)), []);
225
+ var tmp_2;
226
+ if (inputPath.w2j_1.r2_1 === 5) {
227
+ tmp_2 = nonEmptySetOf(new Source(inputPath.v2j_1, read(inputPath)), []);
216
228
  } else {
217
229
  throw new WirespecFileError();
218
230
  }
219
- tmp = tmp_0;
231
+ tmp_0 = tmp_2;
220
232
  } else {
221
233
  noWhenBranchMatchedException();
222
234
  }
223
235
  }
224
236
  }
225
237
  }
226
- var sources = tmp;
238
+ var sources = tmp_0;
227
239
  // Inline function 'kotlin.collections.map' call
228
- var this_0 = _get_languages__ojonze(this);
240
+ var this_1 = _get_languages__ojonze(this);
229
241
  // Inline function 'kotlin.collections.mapTo' call
230
- var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
231
- var _iterator__ex2g4s = this_0.g();
242
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
243
+ var _iterator__ex2g4s = this_1.g();
232
244
  while (_iterator__ex2g4s.h()) {
233
245
  var item = _iterator__ex2g4s.i();
234
246
  // Inline function 'community.flock.wirespec.plugin.cli.Compile.run.<anonymous>' call
235
- var tmp_1;
236
- switch (item.p2_1) {
247
+ var tmp_3;
248
+ switch (item.r2_1) {
237
249
  case 0:
238
- tmp_1 = new JavaEmitter(Companion_instance_0.c26(this.g4d()));
250
+ tmp_3 = new JavaEmitter(Companion_instance_0.c26(this.v4d()));
239
251
  break;
240
252
  case 1:
241
- tmp_1 = new KotlinEmitter(Companion_instance_0.c26(this.g4d()));
253
+ tmp_3 = new KotlinEmitter(Companion_instance_0.c26(this.v4d()));
242
254
  break;
243
255
  case 2:
244
- tmp_1 = new ScalaEmitter(Companion_instance_0.c26(this.g4d()));
256
+ tmp_3 = new ScalaEmitter(Companion_instance_0.c26(this.v4d()));
245
257
  break;
246
258
  case 3:
247
- tmp_1 = new TypeScriptEmitter();
259
+ tmp_3 = new TypeScriptEmitter();
248
260
  break;
249
261
  case 4:
250
- tmp_1 = new WirespecEmitter();
262
+ tmp_3 = new PythonEmitter();
251
263
  break;
252
264
  case 5:
253
- tmp_1 = OpenAPIV2Emitter_getInstance();
265
+ tmp_3 = new WirespecEmitter();
254
266
  break;
255
267
  case 6:
256
- tmp_1 = OpenAPIV3Emitter_getInstance();
268
+ tmp_3 = OpenAPIV2Emitter_getInstance();
269
+ break;
270
+ case 7:
271
+ tmp_3 = OpenAPIV3Emitter_getInstance();
257
272
  break;
258
273
  default:
259
274
  noWhenBranchMatchedException();
260
275
  break;
261
276
  }
262
- var tmp$ret$0 = tmp_1;
263
- destination.e(tmp$ret$0);
277
+ var tmp$ret$4 = tmp_3;
278
+ destination.e(tmp$ret$4);
264
279
  }
265
280
  var tmp2_elvis_lhs = toNonEmptySetOrNull(destination);
266
- var tmp_2;
267
- var tmp_3 = tmp2_elvis_lhs;
268
- if ((tmp_3 == null ? null : new NonEmptySet(tmp_3)) == null) {
269
- tmp_2 = nonEmptySetOf(new WirespecEmitter(), []);
281
+ var tmp_4;
282
+ var tmp_5 = tmp2_elvis_lhs;
283
+ if ((tmp_5 == null ? null : new NonEmptySet(tmp_5)) == null) {
284
+ tmp_4 = nonEmptySetOf(new WirespecEmitter(), []);
270
285
  } else {
271
- tmp_2 = tmp2_elvis_lhs;
286
+ tmp_4 = tmp2_elvis_lhs;
272
287
  }
273
- var emitters = tmp_2;
274
- var tmp_4 = new Directory(this.h4d(inputPath));
275
- var tmp_5 = Compile$run$lambda;
276
- var tmp2 = new CompilerArguments(sources, tmp_4, emitters, tmp_5, Compile$run$handleError$ref(), Companion_instance_0.c26(this.g4d()), new Logger(this.j4d(this.i4d())), this.e26(), this.k4d());
288
+ var emitters = tmp_4;
289
+ var tmp_6 = getOutPutPath(inputPath, this.n2k());
290
+ var tmp_7 = new Directory(or(tmp_6, handleError$ref_0()).s2k_1);
291
+ var tmp_8 = Compile$run$lambda;
292
+ var tmp4 = new CompilerArguments(sources, tmp_7, emitters, tmp_8, Compile$run$handleError$ref(), Companion_instance_0.c26(this.v4d()), new Logger(this.x4d(this.w4d())), this.e26(), this.y4d());
277
293
  // Inline function 'kotlin.let' call
278
- this.c4c_1(tmp2);
294
+ this.s4c_1(tmp4);
279
295
  };
280
296
  function _get_format__qlarck($this) {
281
- return $this.k4e_1.k45($this, format$factory_0());
297
+ return $this.x4e_1.b49($this, format$factory_0());
282
298
  }
283
299
  function _get_languages__ojonze_0($this) {
284
- return $this.l4e_1.k45($this, languages$factory_2());
300
+ return $this.y4e_1.b49($this, languages$factory_2());
285
301
  }
286
302
  function run$handleError_0(p0) {
287
303
  handleError(p0);
288
304
  }
305
+ function handleError$ref_1() {
306
+ var l = function (p0) {
307
+ handleError(p0);
308
+ };
309
+ l.callableName = 'handleError';
310
+ return l;
311
+ }
312
+ function handleError$ref_2() {
313
+ var l = function (p0) {
314
+ handleError(p0);
315
+ };
316
+ l.callableName = 'handleError';
317
+ return l;
318
+ }
289
319
  function Convert$run$lambda(filePath, string) {
290
320
  write(filePath, string);
291
321
  return Unit_instance;
@@ -298,7 +328,7 @@ function Convert$run$handleError$ref() {
298
328
  }
299
329
  function Convert(converter) {
300
330
  CommonOptions.call(this);
301
- this.j4e_1 = converter;
331
+ this.w4e_1 = converter;
302
332
  var tmp = this;
303
333
  // Inline function 'com.github.ajalt.clikt.parameters.types.enum' call
304
334
  var this_0 = argument(this, VOID, 'Input format');
@@ -315,15 +345,16 @@ function Convert(converter) {
315
345
  inductionVariable = inductionVariable + 1 | 0;
316
346
  // Inline function 'com.github.ajalt.clikt.parameters.types.enum.<anonymous>' call
317
347
  // Inline function 'com.github.ajalt.clikt.parameters.types.enum.<anonymous>' call
318
- var tmp$ret$2 = element.o2_1;
319
- destination.l2(tmp$ret$2, element);
348
+ var tmp$ret$2 = element.q2_1;
349
+ destination.n2(tmp$ret$2, element);
320
350
  }
321
- tmp.k4e_1 = choice_0(this_0, destination, true).q44(this, format$factory());
322
- this.l4e_1 = multiple(choice(option(this, Options_Language_getInstance().g4c_1.slice(), 'Language'), Companion_instance_1.s2f(), VOID, true)).v45(this, languages$factory_1());
351
+ tmp.x4e_1 = choice_0(this_0, destination, true).h48(this, format$factory());
352
+ this.y4e_1 = multiple(choice(option(this, Options_Language_getInstance().w4c_1.slice(), 'Language'), Companion_instance_1.i2j(), VOID, true)).m49(this, languages$factory_1());
323
353
  }
324
- protoOf(Convert).z3v = function () {
325
- var inputPath = this.f4d(this.e4d());
326
- var tmp;
354
+ protoOf(Convert).q3z = function () {
355
+ var tmp = getFullPath(this.u4d());
356
+ var inputPath = or(tmp, handleError$ref_1());
357
+ var tmp_0;
327
358
  if (inputPath == null) {
328
359
  throw new IsNotAFileOrDirectory(null);
329
360
  } else {
@@ -334,20 +365,20 @@ protoOf(Convert).z3v = function () {
334
365
  throw new ConvertNeedsAFile();
335
366
  } else {
336
367
  if (inputPath instanceof FilePath) {
337
- var tmp_0;
338
- if (inputPath.y2f_1.p2_1 === 5) {
339
- tmp_0 = new Source(inputPath.x2f_1, read(inputPath));
368
+ var tmp_1;
369
+ if (inputPath.w2j_1.r2_1 === 6) {
370
+ tmp_1 = new Source(inputPath.v2j_1, read(inputPath));
340
371
  } else {
341
372
  throw new JSONFileError();
342
373
  }
343
- tmp = tmp_0;
374
+ tmp_0 = tmp_1;
344
375
  } else {
345
376
  noWhenBranchMatchedException();
346
377
  }
347
378
  }
348
379
  }
349
380
  }
350
- var source = tmp;
381
+ var source = tmp_0;
351
382
  // Inline function 'kotlin.collections.map' call
352
383
  var this_0 = _get_languages__ojonze_0(this);
353
384
  // Inline function 'kotlin.collections.mapTo' call
@@ -356,138 +387,85 @@ protoOf(Convert).z3v = function () {
356
387
  while (_iterator__ex2g4s.h()) {
357
388
  var item = _iterator__ex2g4s.i();
358
389
  // Inline function 'community.flock.wirespec.plugin.cli.Convert.run.<anonymous>' call
359
- var tmp_1;
360
- switch (item.p2_1) {
390
+ var tmp_2;
391
+ switch (item.r2_1) {
361
392
  case 0:
362
- tmp_1 = new JavaEmitter(Companion_instance_0.c26(this.g4d()));
393
+ tmp_2 = new JavaEmitter(Companion_instance_0.c26(this.v4d()));
363
394
  break;
364
395
  case 1:
365
- tmp_1 = new KotlinEmitter(Companion_instance_0.c26(this.g4d()));
396
+ tmp_2 = new KotlinEmitter(Companion_instance_0.c26(this.v4d()));
366
397
  break;
367
398
  case 2:
368
- tmp_1 = new ScalaEmitter(Companion_instance_0.c26(this.g4d()));
399
+ tmp_2 = new ScalaEmitter(Companion_instance_0.c26(this.v4d()));
369
400
  break;
370
401
  case 3:
371
- tmp_1 = new TypeScriptEmitter();
402
+ tmp_2 = new TypeScriptEmitter();
372
403
  break;
373
404
  case 4:
374
- tmp_1 = new WirespecEmitter();
405
+ tmp_2 = new PythonEmitter();
375
406
  break;
376
407
  case 5:
377
- tmp_1 = OpenAPIV2Emitter_getInstance();
408
+ tmp_2 = new WirespecEmitter();
378
409
  break;
379
410
  case 6:
380
- tmp_1 = OpenAPIV3Emitter_getInstance();
411
+ tmp_2 = OpenAPIV2Emitter_getInstance();
412
+ break;
413
+ case 7:
414
+ tmp_2 = OpenAPIV3Emitter_getInstance();
381
415
  break;
382
416
  default:
383
417
  noWhenBranchMatchedException();
384
418
  break;
385
419
  }
386
- var tmp$ret$0 = tmp_1;
420
+ var tmp$ret$0 = tmp_2;
387
421
  destination.e(tmp$ret$0);
388
422
  }
389
423
  var tmp2_elvis_lhs = toNonEmptySetOrNull(destination);
390
- var tmp_2;
391
- var tmp_3 = tmp2_elvis_lhs;
392
- if ((tmp_3 == null ? null : new NonEmptySet(tmp_3)) == null) {
393
- tmp_2 = nonEmptySetOf(new WirespecEmitter(), []);
424
+ var tmp_3;
425
+ var tmp_4 = tmp2_elvis_lhs;
426
+ if ((tmp_4 == null ? null : new NonEmptySet(tmp_4)) == null) {
427
+ tmp_3 = nonEmptySetOf(new WirespecEmitter(), []);
394
428
  } else {
395
- tmp_2 = tmp2_elvis_lhs;
429
+ tmp_3 = tmp2_elvis_lhs;
396
430
  }
397
- var emitters = tmp_2;
398
- var tmp_4 = _get_format__qlarck(this);
399
- var tmp_5 = nonEmptySetOf(source, []);
400
- var tmp_6 = new Directory(this.h4d(inputPath));
401
- var tmp_7 = Convert$run$lambda;
402
- var tmp2 = new ConverterArguments(tmp_4, tmp_5, tmp_6, emitters, tmp_7, Convert$run$handleError$ref(), Companion_instance_0.c26(this.g4d()), new Logger(this.j4d(this.i4d())), this.e26(), this.k4d());
431
+ var emitters = tmp_3;
432
+ var tmp_5 = _get_format__qlarck(this);
433
+ var tmp_6 = nonEmptySetOf(source, []);
434
+ var tmp_7 = getOutPutPath(inputPath, this.n2k());
435
+ var tmp_8 = new Directory(or(tmp_7, handleError$ref_2()).s2k_1);
436
+ var tmp_9 = Convert$run$lambda;
437
+ var tmp2 = new ConverterArguments(tmp_5, tmp_6, tmp_8, emitters, tmp_9, Convert$run$handleError$ref(), Companion_instance_0.c26(this.v4d()), new Logger(this.x4d(this.w4d())), this.e26(), this.y4d());
403
438
  // Inline function 'kotlin.let' call
404
- this.j4e_1(tmp2);
439
+ this.w4e_1(tmp2);
405
440
  };
406
441
  function CommonOptions() {
407
442
  CliktCommand.call(this);
408
- this.y4c_1 = option(this, Options_Input_getInstance().g4c_1.slice(), 'Input').v45(this, input$factory());
409
- this.z4c_1 = option(this, Options_Output_getInstance().g4c_1.slice(), 'Output').v45(this, output$factory());
410
- this.a4d_1 = default_0(option(this, Options_PackageName_getInstance().g4c_1.slice(), 'Package name'), 'community.flock.wirespec.generated').v45(this, packageName$factory());
411
- this.b4d_1 = default_0(option(this, Options_LogLevel_getInstance().g4c_1.slice(), 'Log level: ' + Companion_instance.toString()), Level_ERROR_getInstance().toString()).v45(this, logLevel$factory());
412
- this.c4d_1 = flag(option(this, Options_Shared_getInstance().g4c_1.slice(), 'Generate shared wirespec code'), [], false).v45(this, shared$factory());
413
- this.d4d_1 = flag(option(this, Options_Strict_getInstance().g4c_1.slice(), 'Strict mode'), []).v45(this, strict$factory());
414
- }
415
- protoOf(CommonOptions).e4d = function () {
416
- return this.y4c_1.k45(this, input$factory_0());
443
+ this.o4d_1 = option(this, Options_Input_getInstance().w4c_1.slice(), 'Input').m49(this, input$factory());
444
+ this.p4d_1 = option(this, Options_Output_getInstance().w4c_1.slice(), 'Output').m49(this, output$factory());
445
+ this.q4d_1 = default_0(option(this, Options_PackageName_getInstance().w4c_1.slice(), 'Package name'), 'community.flock.wirespec.generated').m49(this, packageName$factory());
446
+ this.r4d_1 = default_0(option(this, Options_LogLevel_getInstance().w4c_1.slice(), 'Log level: ' + Companion_instance.toString()), Level_ERROR_getInstance().toString()).m49(this, logLevel$factory());
447
+ this.s4d_1 = flag(option(this, Options_Shared_getInstance().w4c_1.slice(), 'Generate shared wirespec code'), [], false).m49(this, shared$factory());
448
+ this.t4d_1 = flag(option(this, Options_Strict_getInstance().w4c_1.slice(), 'Strict mode'), []).m49(this, strict$factory());
449
+ }
450
+ protoOf(CommonOptions).u4d = function () {
451
+ return this.o4d_1.b49(this, input$factory_0());
417
452
  };
418
- protoOf(CommonOptions).v2f = function () {
419
- return this.z4c_1.k45(this, output$factory_0());
453
+ protoOf(CommonOptions).n2k = function () {
454
+ return this.p4d_1.b49(this, output$factory_0());
420
455
  };
421
- protoOf(CommonOptions).g4d = function () {
422
- return this.a4d_1.k45(this, packageName$factory_0());
456
+ protoOf(CommonOptions).v4d = function () {
457
+ return this.q4d_1.b49(this, packageName$factory_0());
423
458
  };
424
- protoOf(CommonOptions).i4d = function () {
425
- return this.b4d_1.k45(this, logLevel$factory_0());
459
+ protoOf(CommonOptions).w4d = function () {
460
+ return this.r4d_1.b49(this, logLevel$factory_0());
426
461
  };
427
462
  protoOf(CommonOptions).e26 = function () {
428
- return this.c4d_1.k45(this, shared$factory_0());
429
- };
430
- protoOf(CommonOptions).k4d = function () {
431
- return this.d4d_1.k45(this, strict$factory_0());
432
- };
433
- protoOf(CommonOptions).l4d = function (input, createIfNotExists_0) {
434
- var tmp;
435
- if (input == null) {
436
- tmp = null;
437
- } else if (startsWith(input, 'classpath:')) {
438
- tmp = new SourcePath(_SourcePath___init__impl__vbnish(substringAfter(input, 'classpath:')));
439
- } else {
440
- var path = createIfNotExists(Path(input), createIfNotExists_0);
441
- var tmp0_elvis_lhs = get_SystemFileSystem().q4a(path);
442
- var tmp_0;
443
- if (tmp0_elvis_lhs == null) {
444
- throw new CannotAccessFileOrDirectory(input);
445
- } else {
446
- tmp_0 = tmp0_elvis_lhs;
447
- }
448
- var meta = tmp_0;
449
- var pathString = path.toString();
450
- var tmp_1;
451
- if (meta.t4a_1) {
452
- tmp_1 = new DirectoryPath(_DirectoryPath___init__impl__5bzkjd(pathString));
453
- } else if (meta.s4a_1) {
454
- tmp_1 = Companion_instance_2.d2h(pathString);
455
- } else {
456
- throw new IsNotAFileOrDirectory(pathString);
457
- }
458
- tmp = tmp_1;
459
- }
460
- return tmp;
463
+ return this.s4d_1.b49(this, shared$factory_0());
461
464
  };
462
- protoOf(CommonOptions).f4d = function (input, createIfNotExists, $super) {
463
- createIfNotExists = createIfNotExists === VOID ? false : createIfNotExists;
464
- return $super === VOID ? this.l4d(input, createIfNotExists) : $super.l4d.call(this, input, createIfNotExists);
465
+ protoOf(CommonOptions).y4d = function () {
466
+ return this.t4d_1.b49(this, strict$factory_0());
465
467
  };
466
- protoOf(CommonOptions).h4d = function (inputPath) {
467
- var it = this.l4d(this.v2f(), true);
468
- var tmp;
469
- if (it == null) {
470
- tmp = _DirectoryPath___init__impl__5bzkjd(path(inputPath) + '/out');
471
- } else {
472
- if (it instanceof DirectoryPath) {
473
- tmp = it.c2h_1;
474
- } else {
475
- var tmp_0;
476
- if (it instanceof FilePath) {
477
- tmp_0 = true;
478
- } else {
479
- tmp_0 = it instanceof SourcePath;
480
- }
481
- if (tmp_0) {
482
- throw new OutputShouldBeADirectory();
483
- } else {
484
- noWhenBranchMatchedException();
485
- }
486
- }
487
- }
488
- return tmp;
489
- };
490
- protoOf(CommonOptions).j4d = function (_this__u8e3s4) {
468
+ protoOf(CommonOptions).x4d = function (_this__u8e3s4) {
491
469
  // Inline function 'kotlin.text.trim' call
492
470
  // Inline function 'kotlin.text.uppercase' call
493
471
  // Inline function 'kotlin.js.asDynamic' call
@@ -532,113 +510,11 @@ function Options_initEntries() {
532
510
  }
533
511
  function Options(name, ordinal, flags) {
534
512
  Enum.call(this, name, ordinal);
535
- this.g4c_1 = flags;
536
- }
537
- function wirespecSources(_this__u8e3s4) {
538
- var tmp0 = Path(_DirectoryPath___get_value__impl__hdy2e3(_this__u8e3s4.u2f_1));
539
- // Inline function 'kotlin.let' call
540
- // Inline function 'community.flock.wirespec.plugin.cli.wirespecSources.stub_for_inlining' call
541
- // Inline function 'kotlin.collections.filter' call
542
- var tmp0_0 = get_SystemFileSystem().r4a(tmp0);
543
- // Inline function 'kotlin.collections.filterTo' call
544
- var destination = ArrayList_init_$Create$_0();
545
- var _iterator__ex2g4s = tmp0_0.g();
546
- while (_iterator__ex2g4s.h()) {
547
- var element = _iterator__ex2g4s.i();
548
- // Inline function 'community.flock.wirespec.plugin.cli.wirespecSources.stub_for_inlining' call
549
- if (isRegularFile(element)) {
550
- destination.e(element);
551
- }
552
- }
553
- // Inline function 'kotlin.collections.filter' call
554
- // Inline function 'kotlin.collections.filterTo' call
555
- var destination_0 = ArrayList_init_$Create$_0();
556
- var _iterator__ex2g4s_0 = destination.g();
557
- while (_iterator__ex2g4s_0.h()) {
558
- var element_0 = _iterator__ex2g4s_0.i();
559
- // Inline function 'community.flock.wirespec.plugin.cli.wirespecSources.stub_for_inlining' call
560
- if (isWirespecFile(element_0)) {
561
- destination_0.e(element_0);
562
- }
563
- }
564
- // Inline function 'kotlin.collections.map' call
565
- // Inline function 'kotlin.collections.mapTo' call
566
- var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_0, 10));
567
- var _iterator__ex2g4s_1 = destination_0.g();
568
- while (_iterator__ex2g4s_1.h()) {
569
- var item = _iterator__ex2g4s_1.i();
570
- // Inline function 'community.flock.wirespec.plugin.cli.wirespecSources.<anonymous>' call
571
- var tmp$ret$8 = to(Companion_instance_2.d2h(item.toString()), readString(buffered(get_SystemFileSystem().n4a(item))));
572
- destination_1.e(tmp$ret$8);
573
- }
574
- // Inline function 'kotlin.collections.map' call
575
- // Inline function 'kotlin.collections.mapTo' call
576
- var destination_2 = ArrayList_init_$Create$(collectionSizeOrDefault(destination_1, 10));
577
- var _iterator__ex2g4s_2 = destination_1.g();
578
- while (_iterator__ex2g4s_2.h()) {
579
- var item_0 = _iterator__ex2g4s_2.i();
580
- // Inline function 'community.flock.wirespec.plugin.cli.wirespecSources.<anonymous>' call
581
- var path = item_0.yd();
582
- var source = item_0.zd();
583
- var tmp$ret$11 = new Source(path.x2f_1, source);
584
- destination_2.e(tmp$ret$11);
585
- }
586
- var tmp0_elvis_lhs = toNonEmptySetOrNull(destination_2);
587
- var tmp;
588
- var tmp_0 = tmp0_elvis_lhs;
589
- if ((tmp_0 == null ? null : new NonEmptySet(tmp_0)) == null) {
590
- throw new WirespecFileError();
591
- } else {
592
- tmp = tmp0_elvis_lhs;
593
- }
594
- return tmp;
595
- }
596
- function read(_this__u8e3s4) {
597
- // Inline function 'kotlin.let' call
598
- // Inline function 'community.flock.wirespec.plugin.cli.read.<anonymous>' call
599
- var it = Path(_this__u8e3s4.toString());
600
- return readString(buffered(get_SystemFileSystem().n4a(it)));
601
- }
602
- function write(_this__u8e3s4, string) {
603
- // Inline function 'kotlin.also' call
604
- var this_0 = Path(_this__u8e3s4.toString());
605
- // Inline function 'community.flock.wirespec.plugin.cli.write.<anonymous>' call
606
- var tmp0_safe_receiver = this_0.w4a();
607
- if (tmp0_safe_receiver == null)
608
- null;
609
- else
610
- createIfNotExists(tmp0_safe_receiver);
611
- // Inline function 'kotlin.let' call
612
- // Inline function 'community.flock.wirespec.plugin.cli.write.<anonymous>' call
613
- // Inline function 'kotlin.apply' call
614
- var this_1 = buffered_0(get_SystemFileSystem().p4a(this_0));
615
- // Inline function 'community.flock.wirespec.plugin.cli.write.<anonymous>.<anonymous>' call
616
- writeString(this_1, string);
617
- this_1.p8();
618
- return Unit_instance;
513
+ this.w4c_1 = flags;
619
514
  }
620
515
  function handleError(string) {
621
516
  throw new CliktError(string);
622
517
  }
623
- function createIfNotExists(_this__u8e3s4, create) {
624
- create = create === VOID ? true : create;
625
- // Inline function 'kotlin.also' call
626
- // Inline function 'community.flock.wirespec.plugin.cli.createIfNotExists.<anonymous>' call
627
- if (create && !get_SystemFileSystem().l4a(_this__u8e3s4)) {
628
- get_SystemFileSystem().m4a(_this__u8e3s4, true);
629
- }
630
- return _this__u8e3s4;
631
- }
632
- function isWirespecFile(path) {
633
- return get_extension(path) === FileExtension_Wirespec_getInstance().f29_1;
634
- }
635
- function isRegularFile(path) {
636
- var tmp0_safe_receiver = get_SystemFileSystem().q4a(path);
637
- return (tmp0_safe_receiver == null ? null : tmp0_safe_receiver.s4a_1) === true;
638
- }
639
- function get_extension(_this__u8e3s4) {
640
- return substringAfterLast(_this__u8e3s4.q2(), _Char___init__impl__6a9atx(46), '');
641
- }
642
518
  function Options_Input_getInstance() {
643
519
  Options_initEntries();
644
520
  return Options_Input_instance;
@@ -699,22 +575,22 @@ function languages$factory_2() {
699
575
  }
700
576
  function input$factory() {
701
577
  return getPropertyCallableRef('input', 1, KProperty1, function (receiver) {
702
- return receiver.e4d();
578
+ return receiver.u4d();
703
579
  }, null);
704
580
  }
705
581
  function output$factory() {
706
582
  return getPropertyCallableRef('output', 1, KProperty1, function (receiver) {
707
- return receiver.v2f();
583
+ return receiver.n2k();
708
584
  }, null);
709
585
  }
710
586
  function packageName$factory() {
711
587
  return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
712
- return receiver.g4d();
588
+ return receiver.v4d();
713
589
  }, null);
714
590
  }
715
591
  function logLevel$factory() {
716
592
  return getPropertyCallableRef('logLevel', 1, KProperty1, function (receiver) {
717
- return receiver.i4d();
593
+ return receiver.w4d();
718
594
  }, null);
719
595
  }
720
596
  function shared$factory() {
@@ -724,27 +600,27 @@ function shared$factory() {
724
600
  }
725
601
  function strict$factory() {
726
602
  return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
727
- return receiver.k4d();
603
+ return receiver.y4d();
728
604
  }, null);
729
605
  }
730
606
  function input$factory_0() {
731
607
  return getPropertyCallableRef('input', 1, KProperty1, function (receiver) {
732
- return receiver.e4d();
608
+ return receiver.u4d();
733
609
  }, null);
734
610
  }
735
611
  function output$factory_0() {
736
612
  return getPropertyCallableRef('output', 1, KProperty1, function (receiver) {
737
- return receiver.v2f();
613
+ return receiver.n2k();
738
614
  }, null);
739
615
  }
740
616
  function packageName$factory_0() {
741
617
  return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
742
- return receiver.g4d();
618
+ return receiver.v4d();
743
619
  }, null);
744
620
  }
745
621
  function logLevel$factory_0() {
746
622
  return getPropertyCallableRef('logLevel', 1, KProperty1, function (receiver) {
747
- return receiver.i4d();
623
+ return receiver.w4d();
748
624
  }, null);
749
625
  }
750
626
  function shared$factory_0() {
@@ -754,7 +630,7 @@ function shared$factory_0() {
754
630
  }
755
631
  function strict$factory_0() {
756
632
  return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
757
- return receiver.k4d();
633
+ return receiver.y4d();
758
634
  }, null);
759
635
  }
760
636
  function main(args) {
@@ -784,11 +660,11 @@ function main(args) {
784
660
  while (!(element === last));
785
661
  // Inline function 'kotlin.collections.toTypedArray' call
786
662
  var tmp4 = copyToArray(destination);
787
- var tmp = Companion_instance_4;
663
+ var tmp = Companion_instance_3;
788
664
  var tmp_0 = compile$ref();
789
665
  // Inline function 'kotlin.let' call
790
666
  // Inline function 'community.flock.wirespec.plugin.cli.main.stub_for_inlining' call
791
- tmp.e4b(tmp_0, convert$ref()).y3v(tmp4);
667
+ tmp.u4b(tmp_0, convert$ref()).p3z(tmp4);
792
668
  }
793
669
  function compile$ref() {
794
670
  var l = function (p0) {
@@ -830,7 +706,7 @@ function parser(source) {
830
706
  }
831
707
  }
832
708
  // Inline function 'arrow.core.NonEmptyList.flatMap' call
833
- var this_1 = tmp.b29_1;
709
+ var this_1 = tmp.n29_1;
834
710
  // Inline function 'community.flock.wirespec.plugin.cli.parser.stub_for_inlining' call
835
711
  var tmp_0 = this_1.uk_1.f27_1.sk();
836
712
  // Inline function 'kotlin.collections.flatMap' call
@@ -861,7 +737,7 @@ function parser(source) {
861
737
  function parser$1() {
862
738
  }
863
739
  function parser$lambda(e) {
864
- return e.g9();
740
+ return e.r1();
865
741
  }
866
742
  function get_nodeArgs() {
867
743
  _init_properties_CommandLineArguments_kt__b5v7hl();
@@ -905,7 +781,7 @@ protoOf(parser$1).h23 = get_spec;
905
781
  protoOf(parser$1).y22 = get_logger;
906
782
  //endregion
907
783
  //region block: init
908
- Companion_instance_4 = new Companion();
784
+ Companion_instance_3 = new Companion();
909
785
  //endregion
910
786
  //region block: exports
911
787
  export {