@flock/wirespec 0.22.4 → 0.22.6

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 (49) hide show
  1. package/arrow-arrow-core.mjs +13 -8
  2. package/arrow-arrow-core.mjs.map +1 -1
  3. package/clikt-clikt-mordant.mjs +79 -79
  4. package/clikt-clikt.mjs +1367 -1366
  5. package/clikt-clikt.mjs.map +1 -1
  6. package/colormath-root-colormath.mjs +436 -436
  7. package/kotlin-kotlin-stdlib.mjs +304 -239
  8. package/kotlin-kotlin-stdlib.mjs.map +1 -1
  9. package/kotlin-openapi-bindings.mjs +10221 -10221
  10. package/kotlin-rgxgen.mjs +1771 -1771
  11. package/kotlinx-io-kotlinx-io-core.mjs +425 -425
  12. package/kotlinx-serialization-kotlinx-serialization-core.mjs +1824 -1824
  13. package/kotlinx-serialization-kotlinx-serialization-json.mjs +1509 -1509
  14. package/mordant-mordant.mjs +1246 -1246
  15. package/package.json +1 -1
  16. package/wirespec-src-compiler-core.mjs +5972 -5367
  17. package/wirespec-src-compiler-core.mjs.map +1 -1
  18. package/wirespec-src-compiler-emitters-java.mjs +171 -187
  19. package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
  20. package/wirespec-src-compiler-emitters-kotlin.mjs +174 -165
  21. package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
  22. package/wirespec-src-compiler-emitters-python.mjs +147 -160
  23. package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
  24. package/wirespec-src-compiler-emitters-rust.mjs +356 -370
  25. package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
  26. package/wirespec-src-compiler-emitters-scala.mjs +165 -175
  27. package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
  28. package/wirespec-src-compiler-emitters-typescript.mjs +187 -313
  29. package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
  30. package/wirespec-src-compiler-emitters-wirespec.mjs +81 -81
  31. package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
  32. package/wirespec-src-compiler-lib.mjs +194 -194
  33. package/wirespec-src-converter-asyncapi.mjs +545 -545
  34. package/wirespec-src-converter-avro.mjs +570 -514
  35. package/wirespec-src-converter-avro.mjs.map +1 -1
  36. package/wirespec-src-converter-common.mjs +11 -11
  37. package/wirespec-src-converter-graphql.mjs +942 -942
  38. package/wirespec-src-converter-openapi.mjs +453 -453
  39. package/wirespec-src-ide-lsp.mjs +1359 -1359
  40. package/wirespec-src-plugin-arguments.mjs +419 -224
  41. package/wirespec-src-plugin-arguments.mjs.map +1 -1
  42. package/wirespec-src-plugin-cli.mjs +170 -137
  43. package/wirespec-src-plugin-cli.mjs.map +1 -1
  44. package/wirespec-src-plugin-extensions.mjs +4874 -0
  45. package/wirespec-src-plugin-extensions.mjs.map +1 -0
  46. package/wirespec-src-plugin-npm.d.mts +43 -1
  47. package/wirespec-src-plugin-npm.mjs +230 -54
  48. package/wirespec-src-plugin-npm.mjs.map +1 -1
  49. package/wirespec-src-tools-generator.mjs +17 -17
@@ -5,10 +5,11 @@ import {
5
5
  optional2v0ee42t2688o as optional,
6
6
  option2wnxma00ykjjp as option,
7
7
  choice1qx2pgx161pnc as choice,
8
- multiple1ilt3bwdbyd8l as multiple,
9
8
  choiceie3147xkuo29 as choice_0,
10
9
  default2v6m45aspyoyr as default_0,
11
10
  flag3dod1qr8no54f as flag,
11
+ multiple1ilt3bwdbyd8l as multiple,
12
+ transformAll3vofua9ygklz8 as transformAll,
12
13
  main23hc8f9rb75p1 as main,
13
14
  } from './clikt-clikt.mjs';
14
15
  import {
@@ -19,7 +20,6 @@ import {
19
20
  initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
20
21
  KProperty1ca4yb4wlo496 as KProperty1,
21
22
  getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
22
- listOfvhqybd2zx248 as listOf,
23
23
  noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
24
24
  Unit_instancev9v8hjid95df as Unit_instance,
25
25
  mapCapacity1h45rc3eh9p2l as mapCapacity,
@@ -30,13 +30,14 @@ import {
30
30
  trim11nh7r46at6sx as trim,
31
31
  toString1pkumu07cwy4m as toString,
32
32
  Enum3alwj03lh1n41 as Enum,
33
- collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
34
- ArrayList_init_$Create$2byt5m5yn22yy as ArrayList_init_$Create$,
35
- until1jbpn0z3f8lbg as until,
36
- ArrayList_init_$Create$37gc04va6yfo2 as ArrayList_init_$Create$_0,
33
+ first58ocm7j58k3q as first,
37
34
  joinToString1cxrrlmo0chqs as joinToString,
35
+ until1jbpn0z3f8lbg as until,
36
+ ArrayList_init_$Create$37gc04va6yfo2 as ArrayList_init_$Create$,
38
37
  IllegalStateException_init_$Create$1h4bcfod21ri0 as IllegalStateException_init_$Create$,
39
38
  addAll1k27qatfgp3k5 as addAll,
39
+ collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
40
+ ArrayList_init_$Create$2byt5m5yn22yy as ArrayList_init_$Create$_0,
40
41
  copyToArray2j022khrow2yi as copyToArray,
41
42
  isArray1hxjqtqy632bc as isArray,
42
43
  } from './kotlin-kotlin-stdlib.mjs';
@@ -79,11 +80,15 @@ import {
79
80
  getOutPutPathqmn3xkxu6se6 as getOutPutPath,
80
81
  CompilerArguments27p1etc1665zg as CompilerArguments,
81
82
  values39f22etrsivck as values,
83
+ Language_Wirespec_getInstancez8ixv3cb7hat as Language_Wirespec_getInstance,
82
84
  ConverterArgumentsa8xc45eyvf51 as ConverterArguments,
83
85
  Companion_instance3u189ncjgxp6 as Companion_instance_2,
84
86
  _DirectoryPath___get_value__impl__hdy2e31of6jj3zjtzs5 as _DirectoryPath___get_value__impl__hdy2e3,
85
87
  write1u316o1mmac8j as write,
88
+ Companion_instanceh05mpoofy9qh as Companion_instance_3,
86
89
  toEmitter3vk7m5bivtqhk as toEmitter,
90
+ toIrExtensions3bmv0ihl79yku as toIrExtensions,
91
+ withExtensions10gpwkl2s1rlm as withExtensions,
87
92
  compile3ocumkpx3p9ko as compile,
88
93
  convert3g5kyi4d6y9kc as convert,
89
94
  } from './wirespec-src-plugin-arguments.mjs';
@@ -92,15 +97,13 @@ import {
92
97
  Left2oemzq1tpcg4i as Left,
93
98
  nonEmptySetOf3p7fhmt51pz4b as nonEmptySetOf,
94
99
  NonEmptySet1rtvr2guloo52 as NonEmptySet,
95
- toNonEmptySetOrNull1tjnd9jrkd4bs as toNonEmptySetOrNull,
96
100
  nonEmptyListOf17xawqyzwrlrt as nonEmptyListOf,
97
101
  NonEmptyList3ak25ihy2gcvs as NonEmptyList,
98
102
  _NonEmptyList___get_all__impl__pmf5092xnz0i2teaa6d as _NonEmptyList___get_all__impl__pmf509,
99
103
  _NonEmptyList___init__impl__fxd0xprpnd63likgzm as _NonEmptyList___init__impl__fxd0xp,
100
104
  NonEmptyList__toList_impl_t5xcy266xhxpenbpfx as NonEmptyList__toList_impl_t5xcy2,
101
- Companion_instancexcyhq1gimo3o as Companion_instance_3,
105
+ Companion_instancexcyhq1gimo3o as Companion_instance_4,
102
106
  } from './arrow-arrow-core.mjs';
103
- import { WirespecEmitter2ad9je4ecrvjk as WirespecEmitter } from './wirespec-src-compiler-emitters-wirespec.mjs';
104
107
  import { produce6pbudlitvnns as produce } from './wirespec-src-compiler-lib.mjs';
105
108
  import { nonFatalOrThrow35agffkx4bbtz as nonFatalOrThrow } from './arrow-arrow-exception-utils.mjs';
106
109
  //region block: imports
@@ -151,23 +154,23 @@ function SpecificFile(extension) {
151
154
  }
152
155
  function Companion() {
153
156
  }
154
- protoOf(Companion).e5b = function (compile, convert) {
157
+ protoOf(Companion).w5h = function (compile, convert) {
155
158
  return subcommands(new WirespecCli(), [new Compile(compile), new Convert(convert)]);
156
159
  };
157
- var Companion_instance_4;
160
+ var Companion_instance_5;
158
161
  function Companion_getInstance() {
159
- return Companion_instance_4;
162
+ return Companion_instance_5;
160
163
  }
161
164
  function WirespecCli() {
162
165
  NoOpCliktCommand.call(this, 'wirespec');
163
166
  }
164
167
  function _get_stdin__b8xnlj($this) {
165
168
  var tmp = KProperty1;
166
- return $this.c5c_1.w1u($this, getPropertyCallableRef('stdin', 1, tmp, Compile$_get_stdin_$ref_5ywd7d_0(), null));
169
+ return $this.v5i_1.u1w($this, getPropertyCallableRef('stdin', 1, tmp, Compile$_get_stdin_$ref_5ywd7d_0(), null));
167
170
  }
168
- function _get_languages__ojonze($this) {
171
+ function _get_language__lew619($this) {
169
172
  var tmp = KProperty1;
170
- return $this.d5c_1.w1u($this, getPropertyCallableRef('languages', 1, tmp, Compile$_get_languages_$ref_nluohg_0(), null));
173
+ return $this.w5i_1.u1w($this, getPropertyCallableRef('language', 1, tmp, Compile$_get_language_$ref_dos4k3_0(), null));
171
174
  }
172
175
  function Compile$_get_stdin_$ref_5ywd7d() {
173
176
  return function (p0) {
@@ -179,14 +182,14 @@ function Compile$_get_stdin_$ref_5ywd7d_0() {
179
182
  return _get_stdin__b8xnlj(p0);
180
183
  };
181
184
  }
182
- function Compile$_get_languages_$ref_nluohg() {
185
+ function Compile$_get_language_$ref_dos4k3() {
183
186
  return function (p0) {
184
- return _get_languages__ojonze(p0);
187
+ return _get_language__lew619(p0);
185
188
  };
186
189
  }
187
- function Compile$_get_languages_$ref_nluohg_0() {
190
+ function Compile$_get_language_$ref_dos4k3_0() {
188
191
  return function (p0) {
189
- return _get_languages__ojonze(p0);
192
+ return _get_language__lew619(p0);
190
193
  };
191
194
  }
192
195
  function handleError$ref() {
@@ -210,24 +213,24 @@ function handleError$ref_1() {
210
213
  }
211
214
  function Compile(compiler) {
212
215
  CommonOptions.call(this);
213
- this.b5c_1 = compiler;
216
+ this.u5i_1 = compiler;
214
217
  var tmp = this;
215
218
  var tmp_0 = optional(argument(this, VOID, 'stdin'));
216
219
  var tmp_1 = KProperty1;
217
- tmp.c5c_1 = tmp_0.c1u(this, getPropertyCallableRef('stdin', 1, tmp_1, Compile$_get_stdin_$ref_5ywd7d(), null));
220
+ tmp.v5i_1 = tmp_0.a1w(this, getPropertyCallableRef('stdin', 1, tmp_1, Compile$_get_stdin_$ref_5ywd7d(), null));
218
221
  var tmp_2 = this;
219
- var tmp_3 = multiple(choice(option(this, Options_Language_getInstance().g5c_1.slice(), 'Language'), Companion_instance_1.v4q(), VOID, true), listOf(Language_Kotlin_getInstance()));
222
+ var tmp_3 = single(choice(option(this, Options_Language_getInstance().z5i_1.slice(), 'Language'), Companion_instance_1.i4x(), VOID, true), Language_Kotlin_getInstance());
220
223
  var tmp_4 = KProperty1;
221
- tmp_2.d5c_1 = tmp_3.g1v(this, getPropertyCallableRef('languages', 1, tmp_4, Compile$_get_languages_$ref_nluohg(), null));
224
+ tmp_2.w5i_1 = tmp_3.e1x(this, getPropertyCallableRef('language', 1, tmp_4, Compile$_get_language_$ref_dos4k3(), null));
222
225
  }
223
- protoOf(Compile).v1l = function () {
224
- var logger = new Logger(this.e5d(this.d5d()));
226
+ protoOf(Compile).t1n = function () {
227
+ var logger = new Logger(this.y5j(this.x5j()));
225
228
  // Inline function 'arrow.core.getOrElse' call
226
- var this_0 = getFullPath(this.f5d());
229
+ var this_0 = getFullPath(this.z5j());
227
230
  var tmp;
228
231
  if (this_0 instanceof Left) {
229
232
  var it = this_0.sm_1;
230
- throw new CliktError(it.b4s_1);
233
+ throw new CliktError(it.t4y_1);
231
234
  } else {
232
235
  if (this_0 instanceof Right) {
233
236
  tmp = this_0.um_1;
@@ -260,14 +263,14 @@ protoOf(Compile).v1l = function () {
260
263
  throw new NoClasspathPossible();
261
264
  } else {
262
265
  if (inputPath instanceof DirectoryPath) {
263
- var tmp_4 = wirespecSources(new Directory(inputPath.v4r_1), logger);
266
+ var tmp_4 = wirespecSources(new Directory(inputPath.n4y_1), logger);
264
267
  tmp_0 = or(tmp_4, handleError$ref()).in_1;
265
268
  } else {
266
269
  if (inputPath instanceof FilePath) {
267
270
  var tmp_5;
268
- if (inputPath.a4s_1.e3_1 === 6) {
271
+ if (inputPath.s4y_1.e3_1 === 6) {
269
272
  // Inline function 'kotlin.also' call
270
- var this_1 = new NonEmptySet(nonEmptySetOf(new Source(inputPath.z4r_1, read(inputPath)), []));
273
+ var this_1 = new NonEmptySet(nonEmptySetOf(new Source(inputPath.r4y_1, read(inputPath)), []));
271
274
  this_1.in_1;
272
275
  logger.as('Found 1 wirespec file to process: ' + inputPath.toString());
273
276
  tmp_5 = this_1.in_1;
@@ -282,32 +285,32 @@ protoOf(Compile).v1l = function () {
282
285
  }
283
286
  }
284
287
  var sources = tmp_0;
285
- var emitters = toEmitters(_get_languages__ojonze(this), Companion_instance_0.at(this.c20()), new EmitShared(this.n4p()));
288
+ var emitter = toEmitter_0(_get_language__lew619(this), Companion_instance_0.at(this.p37()), new EmitShared(this.a4w()), this.e1b());
286
289
  var tmp_6;
287
290
  if (inputPath == null) {
288
291
  tmp_6 = null;
289
292
  } else {
290
293
  // Inline function 'kotlin.let' call
291
- var tmp_7 = getOutPutPath(inputPath, this.g5d());
292
- tmp_6 = new Directory(or(tmp_7, handleError$ref_0()).v4r_1);
294
+ var tmp_7 = getOutPutPath(inputPath, this.a5k());
295
+ tmp_6 = new Directory(or(tmp_7, handleError$ref_0()).n4y_1);
293
296
  }
294
297
  var outputDir = tmp_6;
295
- var tmp_8 = this.h5d(outputDir);
296
- var tmp0 = new CompilerArguments(sources, emitters, tmp_8, handleError$ref_1(), Companion_instance_0.at(this.c20()), logger, this.n4p(), this.i5d(), this.j5d());
298
+ var tmp_8 = this.b5k(outputDir);
299
+ var tmp0 = new CompilerArguments(sources, emitter, tmp_8, handleError$ref_1(), Companion_instance_0.at(this.p37()), logger, this.a4w(), this.c5k(), this.d5k());
297
300
  // Inline function 'kotlin.let' call
298
- this.b5c_1(tmp0);
301
+ this.u5i_1(tmp0);
299
302
  };
300
303
  function _get_format__qlarck($this) {
301
304
  var tmp = KProperty1;
302
- return $this.h5e_1.w1u($this, getPropertyCallableRef('format', 1, tmp, Convert$_get_format_$ref_ve190_0(), null));
305
+ return $this.c5l_1.u1w($this, getPropertyCallableRef('format', 1, tmp, Convert$_get_format_$ref_ve190_0(), null));
303
306
  }
304
307
  function _get_stdin__b8xnlj_0($this) {
305
308
  var tmp = KProperty1;
306
- return $this.i5e_1.w1u($this, getPropertyCallableRef('stdin', 1, tmp, Convert$_get_stdin_$ref_yiqct5_0(), null));
309
+ return $this.d5l_1.u1w($this, getPropertyCallableRef('stdin', 1, tmp, Convert$_get_stdin_$ref_yiqct5_0(), null));
307
310
  }
308
- function _get_languages__ojonze_0($this) {
311
+ function _get_language__lew619_0($this) {
309
312
  var tmp = KProperty1;
310
- return $this.j5e_1.w1u($this, getPropertyCallableRef('languages', 1, tmp, Convert$_get_languages_$ref_ykvilw_0(), null));
313
+ return $this.e5l_1.u1w($this, getPropertyCallableRef('language', 1, tmp, Convert$_get_language_$ref_mm9xt9_0(), null));
311
314
  }
312
315
  function Convert$_get_format_$ref_ve190() {
313
316
  return function (p0) {
@@ -329,14 +332,14 @@ function Convert$_get_stdin_$ref_yiqct5_0() {
329
332
  return _get_stdin__b8xnlj_0(p0);
330
333
  };
331
334
  }
332
- function Convert$_get_languages_$ref_ykvilw() {
335
+ function Convert$_get_language_$ref_mm9xt9() {
333
336
  return function (p0) {
334
- return _get_languages__ojonze_0(p0);
337
+ return _get_language__lew619_0(p0);
335
338
  };
336
339
  }
337
- function Convert$_get_languages_$ref_ykvilw_0() {
340
+ function Convert$_get_language_$ref_mm9xt9_0() {
338
341
  return function (p0) {
339
- return _get_languages__ojonze_0(p0);
342
+ return _get_language__lew619_0(p0);
340
343
  };
341
344
  }
342
345
  function handleError$ref_2() {
@@ -360,7 +363,7 @@ function handleError$ref_4() {
360
363
  }
361
364
  function Convert(converter) {
362
365
  CommonOptions.call(this);
363
- this.g5e_1 = converter;
366
+ this.b5l_1 = converter;
364
367
  var tmp = this;
365
368
  // Inline function 'com.github.ajalt.clikt.parameters.types.enum' call
366
369
  var this_0 = argument(this, VOID, 'Input format');
@@ -380,19 +383,19 @@ function Convert(converter) {
380
383
  }
381
384
  var tmp_0 = choice_0(this_0, destination, true);
382
385
  var tmp_1 = KProperty1;
383
- tmp.h5e_1 = tmp_0.c1u(this, getPropertyCallableRef('format', 1, tmp_1, Convert$_get_format_$ref_ve190(), null));
386
+ tmp.c5l_1 = tmp_0.a1w(this, getPropertyCallableRef('format', 1, tmp_1, Convert$_get_format_$ref_ve190(), null));
384
387
  var tmp_2 = this;
385
388
  var tmp_3 = optional(argument(this, VOID, 'stdin'));
386
389
  var tmp_4 = KProperty1;
387
- tmp_2.i5e_1 = tmp_3.c1u(this, getPropertyCallableRef('stdin', 1, tmp_4, Convert$_get_stdin_$ref_yiqct5(), null));
390
+ tmp_2.d5l_1 = tmp_3.a1w(this, getPropertyCallableRef('stdin', 1, tmp_4, Convert$_get_stdin_$ref_yiqct5(), null));
388
391
  var tmp_5 = this;
389
- var tmp_6 = multiple(choice(option(this, Options_Language_getInstance().g5c_1.slice(), 'Language'), Companion_instance_1.v4q(), VOID, true));
392
+ var tmp_6 = single(choice(option(this, Options_Language_getInstance().z5i_1.slice(), 'Language'), Companion_instance_1.i4x(), VOID, true), Language_Wirespec_getInstance());
390
393
  var tmp_7 = KProperty1;
391
- tmp_5.j5e_1 = tmp_6.g1v(this, getPropertyCallableRef('languages', 1, tmp_7, Convert$_get_languages_$ref_ykvilw(), null));
394
+ tmp_5.e5l_1 = tmp_6.e1x(this, getPropertyCallableRef('language', 1, tmp_7, Convert$_get_language_$ref_mm9xt9(), null));
392
395
  }
393
- protoOf(Convert).v1l = function () {
394
- var logger = new Logger(this.e5d(this.d5d()));
395
- var tmp = getFullPath(this.f5d());
396
+ protoOf(Convert).t1n = function () {
397
+ var logger = new Logger(this.y5j(this.x5j()));
398
+ var tmp = getFullPath(this.z5j());
396
399
  var inputPath = or(tmp, handleError$ref_2());
397
400
  var tmp_0;
398
401
  if (inputPath == null) {
@@ -421,10 +424,10 @@ protoOf(Convert).v1l = function () {
421
424
  } else {
422
425
  if (inputPath instanceof FilePath) {
423
426
  var tmp_3;
424
- switch (inputPath.a4s_1.e3_1) {
427
+ switch (inputPath.s4y_1.e3_1) {
425
428
  case 7:
426
429
  case 11:
427
- tmp_3 = new Source(inputPath.z4r_1, read(inputPath));
430
+ tmp_3 = new Source(inputPath.r4y_1, read(inputPath));
428
431
  break;
429
432
  default:
430
433
  throw new JSONFileError();
@@ -440,91 +443,101 @@ protoOf(Convert).v1l = function () {
440
443
  }
441
444
  }
442
445
  var source = tmp_0;
443
- var emitters = toEmitters(_get_languages__ojonze_0(this), Companion_instance_0.at(this.c20()), new EmitShared(this.n4p()));
446
+ var emitter = toEmitter_0(_get_language__lew619_0(this), Companion_instance_0.at(this.p37()), new EmitShared(this.a4w()), this.e1b());
444
447
  var tmp_4;
445
448
  if (inputPath == null) {
446
449
  tmp_4 = null;
447
450
  } else {
448
451
  // Inline function 'kotlin.let' call
449
- var tmp_5 = getOutPutPath(inputPath, this.g5d());
450
- tmp_4 = new Directory(or(tmp_5, handleError$ref_3()).v4r_1);
452
+ var tmp_5 = getOutPutPath(inputPath, this.a5k());
453
+ tmp_4 = new Directory(or(tmp_5, handleError$ref_3()).n4y_1);
451
454
  }
452
455
  var directory = tmp_4;
453
456
  var tmp_6 = _get_format__qlarck(this);
454
457
  var tmp_7 = nonEmptySetOf(source, []);
455
- var tmp_8 = this.h5d(directory);
456
- var tmp0 = new ConverterArguments(tmp_6, tmp_7, emitters, tmp_8, handleError$ref_4(), Companion_instance_0.at(this.c20()), logger, this.n4p(), this.i5d(), this.j5d());
458
+ var tmp_8 = this.b5k(directory);
459
+ var tmp0 = new ConverterArguments(tmp_6, tmp_7, emitter, tmp_8, handleError$ref_4(), Companion_instance_0.at(this.p37()), logger, this.a4w(), this.c5k(), this.d5k());
457
460
  // Inline function 'kotlin.let' call
458
- this.g5e_1(tmp0);
461
+ this.b5l_1(tmp0);
459
462
  };
460
463
  function CommonOptions$_get_input_$ref_6c1nvp() {
461
464
  return function (p0) {
462
- return p0.f5d();
465
+ return p0.z5j();
463
466
  };
464
467
  }
465
468
  function CommonOptions$_get_input_$ref_6c1nvp_0() {
466
469
  return function (p0) {
467
- return p0.f5d();
470
+ return p0.z5j();
468
471
  };
469
472
  }
470
473
  function CommonOptions$_get_output_$ref_eo6xdi() {
471
474
  return function (p0) {
472
- return p0.g5d();
475
+ return p0.a5k();
473
476
  };
474
477
  }
475
478
  function CommonOptions$_get_output_$ref_eo6xdi_0() {
476
479
  return function (p0) {
477
- return p0.g5d();
480
+ return p0.a5k();
478
481
  };
479
482
  }
480
483
  function CommonOptions$_get_packageName_$ref_k5vxsu() {
481
484
  return function (p0) {
482
- return p0.c20();
485
+ return p0.p37();
483
486
  };
484
487
  }
485
488
  function CommonOptions$_get_packageName_$ref_k5vxsu_0() {
486
489
  return function (p0) {
487
- return p0.c20();
490
+ return p0.p37();
488
491
  };
489
492
  }
490
493
  function CommonOptions$_get_logLevel_$ref_mp4bhx() {
491
494
  return function (p0) {
492
- return p0.d5d();
495
+ return p0.x5j();
493
496
  };
494
497
  }
495
498
  function CommonOptions$_get_logLevel_$ref_mp4bhx_0() {
496
499
  return function (p0) {
497
- return p0.d5d();
500
+ return p0.x5j();
498
501
  };
499
502
  }
500
503
  function CommonOptions$_get_shared_$ref_7r7o2u() {
501
504
  return function (p0) {
502
- return p0.n4p();
505
+ return p0.a4w();
503
506
  };
504
507
  }
505
508
  function CommonOptions$_get_shared_$ref_7r7o2u_0() {
506
509
  return function (p0) {
507
- return p0.n4p();
510
+ return p0.a4w();
508
511
  };
509
512
  }
510
513
  function CommonOptions$_get_strict_$ref_vrzh6q() {
511
514
  return function (p0) {
512
- return p0.i5d();
515
+ return p0.c5k();
513
516
  };
514
517
  }
515
518
  function CommonOptions$_get_strict_$ref_vrzh6q_0() {
516
519
  return function (p0) {
517
- return p0.i5d();
520
+ return p0.c5k();
518
521
  };
519
522
  }
520
523
  function CommonOptions$_get_ignoreDefaults_$ref_doa1uh() {
521
524
  return function (p0) {
522
- return p0.j5d();
525
+ return p0.d5k();
523
526
  };
524
527
  }
525
528
  function CommonOptions$_get_ignoreDefaults_$ref_doa1uh_0() {
526
529
  return function (p0) {
527
- return p0.j5d();
530
+ return p0.d5k();
531
+ };
532
+ }
533
+ function CommonOptions$_get_extensions_$ref_scybvt() {
534
+ return function (p0) {
535
+ return p0.e1b();
536
+ };
537
+ }
538
+ function CommonOptions$_get_extensions_$ref_scybvt_0() {
539
+ return function (p0) {
540
+ return p0.e1b();
528
541
  };
529
542
  }
530
543
  function CommonOptions$writer$lambda($directory, this$0) {
@@ -539,11 +552,11 @@ function CommonOptions$writer$lambda($directory, this$0) {
539
552
  tmp = null;
540
553
  } else {
541
554
  // Inline function 'kotlin.let' call
542
- write(Companion_instance_2.x4r(_DirectoryPath___get_value__impl__hdy2e3(tmp0_safe_receiver.w4r_1) + '/' + element.hq_1), element.iq_1);
555
+ write(Companion_instance_2.p4y(_DirectoryPath___get_value__impl__hdy2e3(tmp0_safe_receiver.o4y_1) + '/' + element.hq_1), element.iq_1);
543
556
  tmp = Unit_instance;
544
557
  }
545
558
  if (tmp == null) {
546
- this$0.k1k(element.iq_1);
559
+ this$0.i1m(element.iq_1);
547
560
  }
548
561
  }
549
562
  return Unit_instance;
@@ -552,63 +565,71 @@ function CommonOptions$writer$lambda($directory, this$0) {
552
565
  function CommonOptions() {
553
566
  CliktCommand.call(this);
554
567
  var tmp = this;
555
- var tmp_0 = option(this, Options_Input_getInstance().g5c_1.slice(), 'Input');
568
+ var tmp_0 = option(this, Options_Input_getInstance().z5i_1.slice(), 'Input');
556
569
  var tmp_1 = KProperty1;
557
- tmp.w5c_1 = tmp_0.g1v(this, getPropertyCallableRef('input', 1, tmp_1, CommonOptions$_get_input_$ref_6c1nvp(), null));
570
+ tmp.p5j_1 = tmp_0.e1x(this, getPropertyCallableRef('input', 1, tmp_1, CommonOptions$_get_input_$ref_6c1nvp(), null));
558
571
  var tmp_2 = this;
559
- var tmp_3 = option(this, Options_Output_getInstance().g5c_1.slice(), 'Output');
572
+ var tmp_3 = option(this, Options_Output_getInstance().z5i_1.slice(), 'Output');
560
573
  var tmp_4 = KProperty1;
561
- tmp_2.x5c_1 = tmp_3.g1v(this, getPropertyCallableRef('output', 1, tmp_4, CommonOptions$_get_output_$ref_eo6xdi(), null));
574
+ tmp_2.q5j_1 = tmp_3.e1x(this, getPropertyCallableRef('output', 1, tmp_4, CommonOptions$_get_output_$ref_eo6xdi(), null));
562
575
  var tmp_5 = this;
563
- var tmp_6 = default_0(option(this, Options_PackageName_getInstance().g5c_1.slice(), 'Package name'), 'community.flock.wirespec.generated');
576
+ var tmp_6 = default_0(option(this, Options_PackageName_getInstance().z5i_1.slice(), 'Package name'), 'community.flock.wirespec.generated');
564
577
  var tmp_7 = KProperty1;
565
- tmp_5.y5c_1 = tmp_6.g1v(this, getPropertyCallableRef('packageName', 1, tmp_7, CommonOptions$_get_packageName_$ref_k5vxsu(), null));
578
+ tmp_5.r5j_1 = tmp_6.e1x(this, getPropertyCallableRef('packageName', 1, tmp_7, CommonOptions$_get_packageName_$ref_k5vxsu(), null));
566
579
  var tmp_8 = this;
567
- var tmp_9 = default_0(option(this, Options_LogLevel_getInstance().g5c_1.slice(), 'Log level: ' + Companion_instance.toString()), Level_INFO_getInstance().toString());
580
+ var tmp_9 = default_0(option(this, Options_LogLevel_getInstance().z5i_1.slice(), 'Log level: ' + Companion_instance.toString()), Level_INFO_getInstance().toString());
568
581
  var tmp_10 = KProperty1;
569
- tmp_8.z5c_1 = tmp_9.g1v(this, getPropertyCallableRef('logLevel', 1, tmp_10, CommonOptions$_get_logLevel_$ref_mp4bhx(), null));
582
+ tmp_8.s5j_1 = tmp_9.e1x(this, getPropertyCallableRef('logLevel', 1, tmp_10, CommonOptions$_get_logLevel_$ref_mp4bhx(), null));
570
583
  var tmp_11 = this;
571
- var tmp_12 = flag(option(this, Options_Shared_getInstance().g5c_1.slice(), 'Generate shared wirespec code'), [], false);
584
+ var tmp_12 = flag(option(this, Options_Shared_getInstance().z5i_1.slice(), 'Generate shared wirespec code'), [], false);
572
585
  var tmp_13 = KProperty1;
573
- tmp_11.a5d_1 = tmp_12.g1v(this, getPropertyCallableRef('shared', 1, tmp_13, CommonOptions$_get_shared_$ref_7r7o2u(), null));
586
+ tmp_11.t5j_1 = tmp_12.e1x(this, getPropertyCallableRef('shared', 1, tmp_13, CommonOptions$_get_shared_$ref_7r7o2u(), null));
574
587
  var tmp_14 = this;
575
- var tmp_15 = flag(option(this, Options_Strict_getInstance().g5c_1.slice(), 'Strict mode'), []);
588
+ var tmp_15 = flag(option(this, Options_Strict_getInstance().z5i_1.slice(), 'Strict mode'), []);
576
589
  var tmp_16 = KProperty1;
577
- tmp_14.b5d_1 = tmp_15.g1v(this, getPropertyCallableRef('strict', 1, tmp_16, CommonOptions$_get_strict_$ref_vrzh6q(), null));
590
+ tmp_14.u5j_1 = tmp_15.e1x(this, getPropertyCallableRef('strict', 1, tmp_16, CommonOptions$_get_strict_$ref_vrzh6q(), null));
578
591
  var tmp_17 = this;
579
- var tmp_18 = flag(option(this, Options_IgnoreDefaults_getInstance().g5c_1.slice(), 'Leave field default values out of the emitted code'), []);
592
+ var tmp_18 = flag(option(this, Options_IgnoreDefaults_getInstance().z5i_1.slice(), 'Leave field default values out of the emitted code'), []);
580
593
  var tmp_19 = KProperty1;
581
- tmp_17.c5d_1 = tmp_18.g1v(this, getPropertyCallableRef('ignoreDefaults', 1, tmp_19, CommonOptions$_get_ignoreDefaults_$ref_doa1uh(), null));
594
+ tmp_17.v5j_1 = tmp_18.e1x(this, getPropertyCallableRef('ignoreDefaults', 1, tmp_19, CommonOptions$_get_ignoreDefaults_$ref_doa1uh(), null));
595
+ var tmp_20 = this;
596
+ var tmp_21 = multiple(choice(option(this, Options_Extension_getInstance().z5i_1.slice(), 'Extension, applied to the languages it supports'), Companion_instance_3.i4x(), VOID, true));
597
+ var tmp_22 = KProperty1;
598
+ tmp_20.w5j_1 = tmp_21.e1x(this, getPropertyCallableRef('extensions', 1, tmp_22, CommonOptions$_get_extensions_$ref_scybvt(), null));
582
599
  }
583
- protoOf(CommonOptions).f5d = function () {
600
+ protoOf(CommonOptions).z5j = function () {
584
601
  var tmp = KProperty1;
585
- return this.w5c_1.w1u(this, getPropertyCallableRef('input', 1, tmp, CommonOptions$_get_input_$ref_6c1nvp_0(), null));
602
+ return this.p5j_1.u1w(this, getPropertyCallableRef('input', 1, tmp, CommonOptions$_get_input_$ref_6c1nvp_0(), null));
586
603
  };
587
- protoOf(CommonOptions).g5d = function () {
604
+ protoOf(CommonOptions).a5k = function () {
588
605
  var tmp = KProperty1;
589
- return this.x5c_1.w1u(this, getPropertyCallableRef('output', 1, tmp, CommonOptions$_get_output_$ref_eo6xdi_0(), null));
606
+ return this.q5j_1.u1w(this, getPropertyCallableRef('output', 1, tmp, CommonOptions$_get_output_$ref_eo6xdi_0(), null));
590
607
  };
591
- protoOf(CommonOptions).c20 = function () {
608
+ protoOf(CommonOptions).p37 = function () {
592
609
  var tmp = KProperty1;
593
- return this.y5c_1.w1u(this, getPropertyCallableRef('packageName', 1, tmp, CommonOptions$_get_packageName_$ref_k5vxsu_0(), null));
610
+ return this.r5j_1.u1w(this, getPropertyCallableRef('packageName', 1, tmp, CommonOptions$_get_packageName_$ref_k5vxsu_0(), null));
594
611
  };
595
- protoOf(CommonOptions).d5d = function () {
612
+ protoOf(CommonOptions).x5j = function () {
596
613
  var tmp = KProperty1;
597
- return this.z5c_1.w1u(this, getPropertyCallableRef('logLevel', 1, tmp, CommonOptions$_get_logLevel_$ref_mp4bhx_0(), null));
614
+ return this.s5j_1.u1w(this, getPropertyCallableRef('logLevel', 1, tmp, CommonOptions$_get_logLevel_$ref_mp4bhx_0(), null));
598
615
  };
599
- protoOf(CommonOptions).n4p = function () {
616
+ protoOf(CommonOptions).a4w = function () {
600
617
  var tmp = KProperty1;
601
- return this.a5d_1.w1u(this, getPropertyCallableRef('shared', 1, tmp, CommonOptions$_get_shared_$ref_7r7o2u_0(), null));
618
+ return this.t5j_1.u1w(this, getPropertyCallableRef('shared', 1, tmp, CommonOptions$_get_shared_$ref_7r7o2u_0(), null));
602
619
  };
603
- protoOf(CommonOptions).i5d = function () {
620
+ protoOf(CommonOptions).c5k = function () {
604
621
  var tmp = KProperty1;
605
- return this.b5d_1.w1u(this, getPropertyCallableRef('strict', 1, tmp, CommonOptions$_get_strict_$ref_vrzh6q_0(), null));
622
+ return this.u5j_1.u1w(this, getPropertyCallableRef('strict', 1, tmp, CommonOptions$_get_strict_$ref_vrzh6q_0(), null));
606
623
  };
607
- protoOf(CommonOptions).j5d = function () {
624
+ protoOf(CommonOptions).d5k = function () {
608
625
  var tmp = KProperty1;
609
- return this.c5d_1.w1u(this, getPropertyCallableRef('ignoreDefaults', 1, tmp, CommonOptions$_get_ignoreDefaults_$ref_doa1uh_0(), null));
626
+ return this.v5j_1.u1w(this, getPropertyCallableRef('ignoreDefaults', 1, tmp, CommonOptions$_get_ignoreDefaults_$ref_doa1uh_0(), null));
610
627
  };
611
- protoOf(CommonOptions).e5d = function (_this__u8e3s4) {
628
+ protoOf(CommonOptions).e1b = function () {
629
+ var tmp = KProperty1;
630
+ return this.w5j_1.u1w(this, getPropertyCallableRef('extensions', 1, tmp, CommonOptions$_get_extensions_$ref_scybvt_0(), null));
631
+ };
632
+ protoOf(CommonOptions).y5j = function (_this__u8e3s4) {
612
633
  // Inline function 'kotlin.text.trim' call
613
634
  // Inline function 'kotlin.text.uppercase' call
614
635
  // Inline function 'kotlin.js.asDynamic' call
@@ -631,12 +652,17 @@ protoOf(CommonOptions).e5d = function (_this__u8e3s4) {
631
652
  }
632
653
  return tmp;
633
654
  };
634
- protoOf(CommonOptions).h5d = function (directory) {
655
+ protoOf(CommonOptions).b5k = function (directory) {
635
656
  return CommonOptions$writer$lambda(directory, this);
636
657
  };
658
+ function single(_this__u8e3s4, default_0) {
659
+ var tmp = default_0.toString();
660
+ return transformAll(_this__u8e3s4, tmp, VOID, single$lambda(default_0));
661
+ }
637
662
  var Options_Input_instance;
638
663
  var Options_Output_instance;
639
664
  var Options_Language_instance;
665
+ var Options_Extension_instance;
640
666
  var Options_PackageName_instance;
641
667
  var Options_LogLevel_instance;
642
668
  var Options_Shared_instance;
@@ -650,38 +676,41 @@ function Options_initEntries() {
650
676
  Options_Input_instance = new Options('Input', 0, ['-i', '--input']);
651
677
  Options_Output_instance = new Options('Output', 1, ['-o', '--output']);
652
678
  Options_Language_instance = new Options('Language', 2, ['-l', '--language']);
653
- Options_PackageName_instance = new Options('PackageName', 3, ['-p', '--package']);
654
- Options_LogLevel_instance = new Options('LogLevel', 4, ['--log-level']);
655
- Options_Shared_instance = new Options('Shared', 5, ['--shared']);
656
- Options_Strict_instance = new Options('Strict', 6, ['--strict']);
657
- Options_IgnoreDefaults_instance = new Options('IgnoreDefaults', 7, ['--ignore-defaults']);
679
+ Options_Extension_instance = new Options('Extension', 3, ['-e', '--extension']);
680
+ Options_PackageName_instance = new Options('PackageName', 4, ['-p', '--package']);
681
+ Options_LogLevel_instance = new Options('LogLevel', 5, ['--log-level']);
682
+ Options_Shared_instance = new Options('Shared', 6, ['--shared']);
683
+ Options_Strict_instance = new Options('Strict', 7, ['--strict']);
684
+ Options_IgnoreDefaults_instance = new Options('IgnoreDefaults', 8, ['--ignore-defaults']);
658
685
  }
659
686
  function Options(name, ordinal, flags) {
660
687
  Enum.call(this, name, ordinal);
661
- this.g5c_1 = flags;
688
+ this.z5i_1 = flags;
662
689
  }
663
690
  function handleError(string) {
664
691
  throw new CliktError(string);
665
692
  }
666
- function toEmitters(_this__u8e3s4, packageName, emitShared) {
667
- // Inline function 'kotlin.collections.map' call
668
- // Inline function 'kotlin.collections.mapTo' call
669
- var destination = ArrayList_init_$Create$(collectionSizeOrDefault(_this__u8e3s4, 10));
670
- var _iterator__ex2g4s = _this__u8e3s4.t();
671
- while (_iterator__ex2g4s.u()) {
672
- var item = _iterator__ex2g4s.v();
673
- var tmp$ret$2 = toEmitter(item, packageName, emitShared);
674
- destination.x(tmp$ret$2);
675
- }
676
- var tmp0_elvis_lhs = toNonEmptySetOrNull(destination);
677
- var tmp;
678
- var tmp_0 = tmp0_elvis_lhs;
679
- if ((tmp_0 == null ? null : new NonEmptySet(tmp_0)) == null) {
680
- tmp = nonEmptySetOf(new WirespecEmitter(), []);
681
- } else {
682
- tmp = tmp0_elvis_lhs;
683
- }
684
- return tmp;
693
+ function toEmitter_0(_this__u8e3s4, packageName, emitShared, extensions) {
694
+ // Inline function 'kotlin.let' call
695
+ var it = toEmitter(_this__u8e3s4, packageName, emitShared);
696
+ return withExtensions(it, toIrExtensions(extensions, packageName, it.wp()));
697
+ }
698
+ function single$lambda($default) {
699
+ return function ($this$transformAll, languages) {
700
+ var tmp;
701
+ switch (languages.c1()) {
702
+ case 0:
703
+ tmp = $default;
704
+ break;
705
+ case 1:
706
+ tmp = first(languages);
707
+ break;
708
+ default:
709
+ $this$transformAll.d1w('Pick one language per run, not ' + joinToString(languages) + '.');
710
+ break;
711
+ }
712
+ return tmp;
713
+ };
685
714
  }
686
715
  function Options_Input_getInstance() {
687
716
  Options_initEntries();
@@ -695,6 +724,10 @@ function Options_Language_getInstance() {
695
724
  Options_initEntries();
696
725
  return Options_Language_instance;
697
726
  }
727
+ function Options_Extension_getInstance() {
728
+ Options_initEntries();
729
+ return Options_Extension_instance;
730
+ }
698
731
  function Options_PackageName_getInstance() {
699
732
  Options_initEntries();
700
733
  return Options_PackageName_instance;
@@ -719,7 +752,7 @@ function main_0(args) {
719
752
  // Inline function 'kotlin.collections.mapNotNull' call
720
753
  var tmp0 = until(0, 20);
721
754
  // Inline function 'kotlin.collections.mapNotNullTo' call
722
- var destination = ArrayList_init_$Create$_0();
755
+ var destination = ArrayList_init_$Create$();
723
756
  // Inline function 'kotlin.collections.forEach' call
724
757
  var inductionVariable = tmp0.q1_1;
725
758
  var last = tmp0.r1_1;
@@ -738,9 +771,9 @@ function main_0(args) {
738
771
  }
739
772
  while (!(element === last));
740
773
  // Inline function 'kotlin.let' call
741
- var tmp = Companion_instance_4;
774
+ var tmp = Companion_instance_5;
742
775
  var tmp_0 = compile$ref();
743
- main(tmp.e5b(tmp_0, convert$ref()), destination);
776
+ main(tmp.w5h(tmp_0, convert$ref()), destination);
744
777
  }
745
778
  function compile$ref() {
746
779
  var l = function (p0) {
@@ -782,7 +815,7 @@ function parser(source) {
782
815
  // Inline function 'kotlin.collections.flatMap' call
783
816
  var tmp0 = _NonEmptyList___get_all__impl__pmf509(this_1);
784
817
  // Inline function 'kotlin.collections.flatMapTo' call
785
- var destination = ArrayList_init_$Create$_0();
818
+ var destination = ArrayList_init_$Create$();
786
819
  var _iterator__ex2g4s = tmp0.t();
787
820
  while (_iterator__ex2g4s.u()) {
788
821
  var element = _iterator__ex2g4s.v();
@@ -793,7 +826,7 @@ function parser(source) {
793
826
  // Inline function 'kotlin.collections.map' call
794
827
  var this_2 = NonEmptyList__toList_impl_t5xcy2(tmp$ret$3);
795
828
  // Inline function 'kotlin.collections.mapTo' call
796
- var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10));
829
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
797
830
  var _iterator__ex2g4s_0 = this_2.t();
798
831
  while (_iterator__ex2g4s_0.u()) {
799
832
  var item = _iterator__ex2g4s_0.v();
@@ -852,7 +885,7 @@ protoOf(parser$1).lo = get_spec;
852
885
  protoOf(parser$1).mo = get_logger;
853
886
  //endregion
854
887
  //region block: init
855
- Companion_instance_4 = new Companion();
888
+ Companion_instance_5 = new Companion();
856
889
  //endregion
857
890
  //region block: exports
858
891
  export {