kaitai-struct-compiler 0.11.0-SNAPSHOT20231104.85023.e581718 → 0.11.0-SNAPSHOT20240221.132806.29d37b8

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.
@@ -3099,8 +3099,8 @@ function $m_Lio_kaitai_struct_Utils$() {
3099
3099
  function $c_Lio_kaitai_struct_Version$() {
3100
3100
  this.Lio_kaitai_struct_Version$__f_version = null;
3101
3101
  this.Lio_kaitai_struct_Version$__f_gitTime = null;
3102
- this.Lio_kaitai_struct_Version$__f_version = "0.11-SNAPSHOT20231104.085023.e581718";
3103
- this.Lio_kaitai_struct_Version$__f_gitTime = "2023-11-04T08:50:23+00:00"
3102
+ this.Lio_kaitai_struct_Version$__f_version = "0.11-SNAPSHOT20240221.132806.29d37b8";
3103
+ this.Lio_kaitai_struct_Version$__f_gitTime = "2024-02-21T13:28:06+00:00"
3104
3104
  }
3105
3105
  $c_Lio_kaitai_struct_Version$.prototype = new $h_O();
3106
3106
  $c_Lio_kaitai_struct_Version$.prototype.constructor = $c_Lio_kaitai_struct_Version$;
@@ -18312,7 +18312,8 @@ function $f_Lio_kaitai_struct_languages_components_CommonReads__attrParse__Lio_k
18312
18312
  } else {
18313
18313
  var io$2 = $n($as_Lio_kaitai_struct_languages_components_LanguageCompiler($thiz)).normalIO__T()
18314
18314
  };
18315
- if ($thiz.attrDebugNeeded__Lio_kaitai_struct_format_Identifier__Z(id)) {
18315
+ var needsDebug = $thiz.attrDebugNeeded__Lio_kaitai_struct_format_Identifier__Z(id);
18316
+ if (needsDebug) {
18316
18317
  $thiz.attrDebugStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__s_Option__Lio_kaitai_struct_format_RepeatSpec__V(id, $n(attr).dataType__Lio_kaitai_struct_datatype_DataType(), new $c_s_Some(io$2), $m_Lio_kaitai_struct_format_NoRepeat$());
18317
18318
  var x$3 = $n($n(attr).cond__Lio_kaitai_struct_format_ConditionalSpec()).Lio_kaitai_struct_format_ConditionalSpec__f_repeat;
18318
18319
  var x$4 = $m_Lio_kaitai_struct_format_NoRepeat$();
@@ -18369,7 +18370,7 @@ function $f_Lio_kaitai_struct_languages_components_CommonReads__attrParse__Lio_k
18369
18370
  };
18370
18371
  throw new $c_s_MatchError(defEndian)
18371
18372
  };
18372
- if ($n($n($as_Lio_kaitai_struct_languages_components_LanguageCompiler($thiz)).Lio_kaitai_struct_languages_components_LanguageCompiler__f_config).Lio_kaitai_struct_RuntimeConfig__f_readStoresPos) {
18373
+ if (needsDebug) {
18373
18374
  $thiz.attrDebugEnd__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__T__Lio_kaitai_struct_format_RepeatSpec__V(id, $n(attr).dataType__Lio_kaitai_struct_datatype_DataType(), io$2, $m_Lio_kaitai_struct_format_NoRepeat$())
18374
18375
  };
18375
18376
  if ((attr instanceof $c_Lio_kaitai_struct_format_ParseInstanceSpec)) {
@@ -19196,7 +19197,7 @@ function $p_Lio_kaitai_struct_precompile_LoadImports__loadImport__T__sci_List__s
19196
19197
  var this$2 = $n($thiz.Lio_kaitai_struct_precompile_LoadImports__f_specs);
19197
19198
  var this$1 = $n(p);
19198
19199
  var name$1 = $f_sc_TraversableOnce__mkString__T__T__T__T(this$1, "", "/", "");
19199
- var futureSpec = this$2.doImport__T__T__s_concurrent_Future(name$1, this$2.Lio_kaitai_struct_format_JavaScriptClassSpecs__f_MODE_REL)
19200
+ var futureSpec = this$2.doImport__T__sci_List__T__s_concurrent_Future(name$1, path, this$2.Lio_kaitai_struct_format_JavaScriptClassSpecs__f_MODE_REL)
19200
19201
  } else {
19201
19202
  if ((!(fullPath instanceof $c_Lio_kaitai_struct_precompile_LoadImports$AbsoluteImportPath))) {
19202
19203
  throw new $c_s_MatchError(fullPath)
@@ -19206,7 +19207,7 @@ function $p_Lio_kaitai_struct_precompile_LoadImports__loadImport__T__sci_List__s
19206
19207
  var this$4 = $n($thiz.Lio_kaitai_struct_precompile_LoadImports__f_specs);
19207
19208
  var this$3 = $n(p$2);
19208
19209
  var name$2 = $f_sc_TraversableOnce__mkString__T__T__T__T(this$3, "", "/", "");
19209
- var futureSpec = this$4.doImport__T__T__s_concurrent_Future(name$2, this$4.Lio_kaitai_struct_format_JavaScriptClassSpecs__f_MODE_ABS)
19210
+ var futureSpec = this$4.doImport__T__sci_List__T__s_concurrent_Future(name$2, path, this$4.Lio_kaitai_struct_format_JavaScriptClassSpecs__f_MODE_ABS)
19210
19211
  };
19211
19212
  return $n(futureSpec).flatMap__F1__s_concurrent_ExecutionContext__s_concurrent_Future(new $c_sjsr_AnonFunction1(((x0$1$2) => {
19212
19213
  var x0$1 = $as_s_Option(x0$1$2);
@@ -38487,6 +38488,15 @@ $c_scg_GenTraversableFactory$GenericCanBuildFrom.prototype.apply__O__scm_Builder
38487
38488
  var this$1 = $n(from$1);
38488
38489
  return $n(this$1.companion__scg_GenericCompanion()).newBuilder__scm_Builder()
38489
38490
  });
38491
+ function $as_scg_GenTraversableFactory$GenericCanBuildFrom(obj) {
38492
+ return (((obj instanceof $c_scg_GenTraversableFactory$GenericCanBuildFrom) || (obj === null)) ? obj : $throwClassCastException(obj, "scala.collection.generic.GenTraversableFactory$GenericCanBuildFrom"))
38493
+ }
38494
+ function $isArrayOf_scg_GenTraversableFactory$GenericCanBuildFrom(obj, depth) {
38495
+ return (!(!(((obj && obj.$classData) && (obj.$classData.arrayDepth === depth)) && obj.$classData.arrayBase.ancestors.scg_GenTraversableFactory$GenericCanBuildFrom)))
38496
+ }
38497
+ function $asArrayOf_scg_GenTraversableFactory$GenericCanBuildFrom(obj, depth) {
38498
+ return (($isArrayOf_scg_GenTraversableFactory$GenericCanBuildFrom(obj, depth) || (obj === null)) ? obj : $throwArrayCastException(obj, "Lscala.collection.generic.GenTraversableFactory$GenericCanBuildFrom;", depth))
38499
+ }
38490
38500
  function $f_scg_GenericTraversableTemplate__flatten__F1__sc_GenTraversable($thiz, asTraversable) {
38491
38501
  var b = $n($thiz.companion__scg_GenericCompanion()).newBuilder__scm_Builder();
38492
38502
  $n($n($as_sc_GenTraversableOnce($thiz)).seq__sc_TraversableOnce()).foreach__F1__V(new $c_sjsr_AnonFunction1(((xs$2) => $as_scm_Builder($n(b).$plus$plus$eq__sc_TraversableOnce__scg_Growable($n($as_sc_GenTraversableOnce($n(asTraversable).apply__O__O(xs$2))).seq__sc_TraversableOnce())))));
@@ -39359,6 +39369,46 @@ function $m_s_concurrent_BlockContext$DefaultBlockContext$() {
39359
39369
  };
39360
39370
  return $n_s_concurrent_BlockContext$DefaultBlockContext$
39361
39371
  }
39372
+ function $f_s_concurrent_Future__transform__F1__F1__s_concurrent_ExecutionContext__s_concurrent_Future($thiz, s, f, executor) {
39373
+ var f$1 = new $c_sjsr_AnonFunction1(((x0$1$2) => {
39374
+ var x0$1 = $as_s_util_Try(x0$1$2);
39375
+ if ((x0$1 instanceof $c_s_util_Success)) {
39376
+ var x2 = $as_s_util_Success(x0$1);
39377
+ var r = $n(x2).s_util_Success__f_value;
39378
+ try {
39379
+ return new $c_s_util_Success($n(s).apply__O__O(r))
39380
+ } catch (e) {
39381
+ var e$2 = ((e instanceof $c_jl_Throwable) ? e : new $c_sjs_js_JavaScriptException(e));
39382
+ var o11 = $m_s_util_control_NonFatal$().unapply__jl_Throwable__s_Option(e$2);
39383
+ if ((!$n(o11).isEmpty__Z())) {
39384
+ var e$3 = $as_jl_Throwable($n(o11).get__O());
39385
+ return new $c_s_util_Failure(e$3)
39386
+ };
39387
+ throw ((e$2 instanceof $c_sjs_js_JavaScriptException) ? e$2.sjs_js_JavaScriptException__f_exception : $n(e$2))
39388
+ }
39389
+ } else if ((x0$1 instanceof $c_s_util_Failure)) {
39390
+ var x3 = $as_s_util_Failure(x0$1);
39391
+ var t = $n(x3).s_util_Failure__f_exception;
39392
+ try {
39393
+ var $$x1;
39394
+ var $$x2 = $as_jl_Throwable($n(f).apply__O__O(t));
39395
+ throw (($$x2 instanceof $c_sjs_js_JavaScriptException) ? $$x2.sjs_js_JavaScriptException__f_exception : $n($$x2));
39396
+ return new $c_s_util_Success($$x1)
39397
+ } catch (e$1) {
39398
+ var e$2$1 = ((e$1 instanceof $c_jl_Throwable) ? e$1 : new $c_sjs_js_JavaScriptException(e$1));
39399
+ var o11$1 = $m_s_util_control_NonFatal$().unapply__jl_Throwable__s_Option(e$2$1);
39400
+ if ((!$n(o11$1).isEmpty__Z())) {
39401
+ var e$3$1 = $as_jl_Throwable($n(o11$1).get__O());
39402
+ return new $c_s_util_Failure(e$3$1)
39403
+ };
39404
+ throw ((e$2$1 instanceof $c_sjs_js_JavaScriptException) ? e$2$1.sjs_js_JavaScriptException__f_exception : $n(e$2$1))
39405
+ }
39406
+ } else {
39407
+ throw new $c_s_MatchError(x0$1)
39408
+ }
39409
+ }));
39410
+ return $f_s_concurrent_impl_Promise__transform__F1__s_concurrent_ExecutionContext__s_concurrent_Future($thiz, f$1, executor)
39411
+ }
39362
39412
  function $f_s_concurrent_Future__map__F1__s_concurrent_ExecutionContext__s_concurrent_Future($thiz, f, executor) {
39363
39413
  var f$1 = new $c_sjsr_AnonFunction1(((x$2$2) => {
39364
39414
  var x$2 = $as_s_util_Try(x$2$2);
@@ -46632,8 +46682,8 @@ function $f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__attrUs
46632
46682
  } else {
46633
46683
  var tempVarName = $thiz.localTemporaryName__Lio_kaitai_struct_format_Identifier__T(id);
46634
46684
  $thiz.handleAssignmentTempVar__Lio_kaitai_struct_datatype_DataType__T__T__V(dataType, tempVarName, expr);
46635
- $thiz.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V(tempVarName, dataType, assignType);
46636
- $f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__handleAssignment__Lio_kaitai_struct_format_Identifier__T__Lio_kaitai_struct_format_RepeatSpec__Z__V($thiz, id, tempVarName, rep, false)
46685
+ $f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__handleAssignment__Lio_kaitai_struct_format_Identifier__T__Lio_kaitai_struct_format_RepeatSpec__Z__V($thiz, id, tempVarName, rep, false);
46686
+ $thiz.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V(tempVarName, dataType, assignType)
46637
46687
  }
46638
46688
  }
46639
46689
  }
@@ -87225,8 +87275,8 @@ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.outImports__Lio_kait
87225
87275
  var $$x1 = $n(b).result__O()
87226
87276
  };
87227
87277
  var quotedImpList = $as_sci_List($$x1);
87228
- var this$7 = $n(quotedImpList);
87229
- var defineArgs = $f_sc_TraversableOnce__mkString__T__T__T__T(this$7, "", ", ", "");
87278
+ var this$7 = $m_sci_List$();
87279
+ var defineArgs = $n($as_sc_TraversableOnce($n(quotedImpList).$plus$colon__O__scg_CanBuildFrom__O("'exports'", this$7.scg_GenTraversableFactory__f_ReusableCBFInstance))).mkString__T__T(", ");
87230
87280
  var this$9 = $n(quotedImpList);
87231
87281
  var f$1 = ((x$3$2) => {
87232
87282
  var x$3 = $as_T(x$3$2);
@@ -87236,7 +87286,7 @@ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.outImports__Lio_kait
87236
87286
  var bf$1 = this$8.scg_GenTraversableFactory__f_ReusableCBFInstance;
87237
87287
  if ($p_sci_List__isLikeListReusableCBF__scg_CanBuildFrom__Z(this$9, bf$1)) {
87238
87288
  if ((this$9 === $m_sci_Nil$())) {
87239
- var $$x2 = $m_sci_Nil$()
87289
+ var $$x3 = $m_sci_Nil$()
87240
87290
  } else {
87241
87291
  var arg1$3 = this$9.head__O();
87242
87292
  var h$1 = new $c_sci_$colon$colon(f$1(arg1$3), $m_sci_Nil$());
@@ -87250,7 +87300,7 @@ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.outImports__Lio_kait
87250
87300
  var this$10 = $n(rest$1);
87251
87301
  rest$1 = this$10.tail__sci_List()
87252
87302
  };
87253
- var $$x2 = h$1
87303
+ var $$x3 = h$1
87254
87304
  }
87255
87305
  } else {
87256
87306
  var b$1 = $p_sc_TraversableLike__builder$1__scg_CanBuildFrom__scm_Builder(this$9, bf$1);
@@ -87261,95 +87311,134 @@ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.outImports__Lio_kait
87261
87311
  var this$11 = $n(these$1);
87262
87312
  these$1 = this$11.tail__sci_List()
87263
87313
  };
87264
- var $$x2 = $n(b$1).result__O()
87314
+ var $$x3 = $n(b$1).result__O()
87265
87315
  };
87266
- var moduleArgs = $n($as_sc_TraversableOnce($$x2)).mkString__T__T(", ");
87267
- var this$17 = $n(impList);
87316
+ var $$x2 = $as_sci_List($$x3);
87317
+ var this$12 = $m_sci_List$();
87318
+ var exportsArgs = $n($as_sc_TraversableOnce($n($$x2).$plus$colon__O__scg_CanBuildFrom__O("exports", this$12.scg_GenTraversableFactory__f_ReusableCBFInstance))).mkString__T__T(", ");
87319
+ var x$3$3 = $m_Lio_kaitai_struct_languages_JavaScriptCompiler$().types2class__sci_List__T($n(topClass).Lio_kaitai_struct_format_ClassSpec__f_name);
87320
+ var this$18 = $n(impList);
87268
87321
  var f$2 = ((x$4$2) => {
87269
87322
  var x$4 = $as_T(x$4$2);
87270
- var this$13 = new $c_sci_StringOps(x$4);
87271
- var xs = $f_sci_StringLike__split__C__AT(this$13, 47);
87272
- var this$15 = new $c_scm_ArrayOps$ofRef(xs);
87273
- return $as_T($f_sc_IndexedSeqOptimized__last__O(this$15))
87323
+ var this$14 = new $c_sci_StringOps(x$4);
87324
+ var xs = $f_sci_StringLike__split__C__AT(this$14, 47);
87325
+ var this$16 = new $c_scm_ArrayOps$ofRef(xs);
87326
+ return $as_T($f_sc_IndexedSeqOptimized__last__O(this$16))
87274
87327
  });
87275
- var this$16 = $m_sci_List$();
87276
- var bf$2 = this$16.scg_GenTraversableFactory__f_ReusableCBFInstance;
87277
- if ($p_sci_List__isLikeListReusableCBF__scg_CanBuildFrom__Z(this$17, bf$2)) {
87278
- if ((this$17 === $m_sci_Nil$())) {
87279
- var $$x3 = $m_sci_Nil$()
87328
+ var this$17 = $m_sci_List$();
87329
+ var bf$2 = this$17.scg_GenTraversableFactory__f_ReusableCBFInstance;
87330
+ if ($p_sci_List__isLikeListReusableCBF__scg_CanBuildFrom__Z(this$18, bf$2)) {
87331
+ if ((this$18 === $m_sci_Nil$())) {
87332
+ var $$x5 = $m_sci_Nil$()
87280
87333
  } else {
87281
- var arg1$6 = this$17.head__O();
87334
+ var arg1$6 = this$18.head__O();
87282
87335
  var h$2 = new $c_sci_$colon$colon(f$2(arg1$6), $m_sci_Nil$());
87283
87336
  var t$2 = h$2;
87284
- var rest$2 = this$17.tail__sci_List();
87337
+ var rest$2 = this$18.tail__sci_List();
87285
87338
  while ((rest$2 !== $m_sci_Nil$())) {
87286
87339
  var arg1$7 = $n(rest$2).head__O();
87287
87340
  var nx$2 = new $c_sci_$colon$colon(f$2(arg1$7), $m_sci_Nil$());
87288
87341
  $n(t$2).sci_$colon$colon__f_tl = nx$2;
87289
87342
  t$2 = nx$2;
87290
- var this$18 = $n(rest$2);
87291
- rest$2 = this$18.tail__sci_List()
87343
+ var this$19 = $n(rest$2);
87344
+ rest$2 = this$19.tail__sci_List()
87292
87345
  };
87293
- var $$x3 = h$2
87346
+ var $$x5 = h$2
87294
87347
  }
87295
87348
  } else {
87296
- var b$2 = $p_sc_TraversableLike__builder$1__scg_CanBuildFrom__scm_Builder(this$17, bf$2);
87297
- var these$2 = this$17;
87349
+ var b$2 = $p_sc_TraversableLike__builder$1__scg_CanBuildFrom__scm_Builder(this$18, bf$2);
87350
+ var these$2 = this$18;
87298
87351
  while ((!$n(these$2).isEmpty__Z())) {
87299
87352
  var arg1$8 = $n(these$2).head__O();
87300
87353
  $n(b$2).$plus$eq__O__scm_Builder(f$2(arg1$8));
87301
- var this$19 = $n(these$2);
87302
- these$2 = this$19.tail__sci_List()
87354
+ var this$20 = $n(these$2);
87355
+ these$2 = this$20.tail__sci_List()
87303
87356
  };
87304
- var $$x3 = $n(b$2).result__O()
87357
+ var $$x5 = $n(b$2).result__O()
87305
87358
  };
87306
- var argClasses = $as_sci_List($$x3);
87307
- var this$21 = $n(argClasses);
87359
+ var $$x4 = $as_sci_List($$x5);
87360
+ var this$21 = $m_sci_List$();
87361
+ var argClasses = $as_sci_List($n($$x4).$plus$colon__O__scg_CanBuildFrom__O(x$3$3, this$21.scg_GenTraversableFactory__f_ReusableCBFInstance));
87362
+ var this$23 = $n(argClasses);
87308
87363
  var f$3 = ((x$5$2) => {
87309
87364
  var x$5 = $as_T(x$5$2);
87310
- return ("root." + x$5)
87365
+ return ((x$5 === "KaitaiStream") ? ("root." + x$5) : (((("root." + x$5) + " || (root.") + x$5) + " = {})"))
87311
87366
  });
87312
- var this$20 = $m_sci_List$();
87313
- var bf$3 = this$20.scg_GenTraversableFactory__f_ReusableCBFInstance;
87314
- if ($p_sci_List__isLikeListReusableCBF__scg_CanBuildFrom__Z(this$21, bf$3)) {
87315
- if ((this$21 === $m_sci_Nil$())) {
87316
- var $$x4 = $m_sci_Nil$()
87367
+ var this$22 = $m_sci_List$();
87368
+ var bf$3 = this$22.scg_GenTraversableFactory__f_ReusableCBFInstance;
87369
+ if ($p_sci_List__isLikeListReusableCBF__scg_CanBuildFrom__Z(this$23, bf$3)) {
87370
+ if ((this$23 === $m_sci_Nil$())) {
87371
+ var $$x6 = $m_sci_Nil$()
87317
87372
  } else {
87318
- var arg1$9 = this$21.head__O();
87373
+ var arg1$9 = this$23.head__O();
87319
87374
  var h$3 = new $c_sci_$colon$colon(f$3(arg1$9), $m_sci_Nil$());
87320
87375
  var t$3 = h$3;
87321
- var rest$3 = this$21.tail__sci_List();
87376
+ var rest$3 = this$23.tail__sci_List();
87322
87377
  while ((rest$3 !== $m_sci_Nil$())) {
87323
87378
  var arg1$10 = $n(rest$3).head__O();
87324
87379
  var nx$3 = new $c_sci_$colon$colon(f$3(arg1$10), $m_sci_Nil$());
87325
87380
  $n(t$3).sci_$colon$colon__f_tl = nx$3;
87326
87381
  t$3 = nx$3;
87327
- var this$22 = $n(rest$3);
87328
- rest$3 = this$22.tail__sci_List()
87382
+ var this$24 = $n(rest$3);
87383
+ rest$3 = this$24.tail__sci_List()
87329
87384
  };
87330
- var $$x4 = h$3
87385
+ var $$x6 = h$3
87331
87386
  }
87332
87387
  } else {
87333
- var b$3 = $p_sc_TraversableLike__builder$1__scg_CanBuildFrom__scm_Builder(this$21, bf$3);
87334
- var these$3 = this$21;
87388
+ var b$3 = $p_sc_TraversableLike__builder$1__scg_CanBuildFrom__scm_Builder(this$23, bf$3);
87389
+ var these$3 = this$23;
87335
87390
  while ((!$n(these$3).isEmpty__Z())) {
87336
87391
  var arg1$11 = $n(these$3).head__O();
87337
87392
  $n(b$3).$plus$eq__O__scm_Builder(f$3(arg1$11));
87338
- var this$23 = $n(these$3);
87339
- these$3 = this$23.tail__sci_List()
87340
- };
87341
- var $$x4 = $n(b$3).result__O()
87342
- };
87343
- var rootArgs = $n($as_sc_TraversableOnce($$x4)).mkString__T__T(", ");
87344
- var this$25 = new $c_sci_StringOps(" ");
87345
- var $$x8 = $f_sci_StringLike__$times__I__T(this$25, 2);
87346
- var this$27 = new $c_sci_StringOps(" ");
87347
- var $$x7 = $f_sci_StringLike__$times__I__T(this$27, 2);
87348
- var this$29 = new $c_sci_StringOps(" ");
87349
- var $$x6 = $f_sci_StringLike__$times__I__T(this$29, 2);
87350
- var $$x5 = $m_Lio_kaitai_struct_languages_JavaScriptCompiler$().types2class__sci_List__T($n(topClass).Lio_kaitai_struct_format_ClassSpec__f_name);
87351
- var this$30 = $n(argClasses);
87352
- return ((((((((((("(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n" + $$x8) + ("define([" + defineArgs)) + "], factory);\n } else if (typeof module === 'object' && module.exports) {\n") + $$x7) + ("module.exports = factory(" + moduleArgs)) + ");\n } else {\n") + $$x6) + ((("root." + $$x5) + " = factory(") + rootArgs)) + ");\n }\n") + ("}(typeof self !== 'undefined' ? self : this, function (" + $f_sc_TraversableOnce__mkString__T__T__T__T(this$30, "", ", ", ""))) + ") {")
87393
+ var this$25 = $n(these$3);
87394
+ these$3 = this$25.tail__sci_List()
87395
+ };
87396
+ var $$x6 = $n(b$3).result__O()
87397
+ };
87398
+ var rootArgs = $n($as_sc_TraversableOnce($$x6)).mkString__T__T(", ");
87399
+ var this$27 = $n(argClasses);
87400
+ var f$4 = ((x$6$2) => {
87401
+ var x$6 = $as_T(x$6$2);
87402
+ return ((x$6 === "KaitaiStream") ? x$6 : (x$6 + "_"))
87403
+ });
87404
+ var this$26 = $m_sci_List$();
87405
+ var bf$4 = this$26.scg_GenTraversableFactory__f_ReusableCBFInstance;
87406
+ if ($p_sci_List__isLikeListReusableCBF__scg_CanBuildFrom__Z(this$27, bf$4)) {
87407
+ if ((this$27 === $m_sci_Nil$())) {
87408
+ var $$x7 = $m_sci_Nil$()
87409
+ } else {
87410
+ var arg1$12 = this$27.head__O();
87411
+ var h$4 = new $c_sci_$colon$colon(f$4(arg1$12), $m_sci_Nil$());
87412
+ var t$4 = h$4;
87413
+ var rest$4 = this$27.tail__sci_List();
87414
+ while ((rest$4 !== $m_sci_Nil$())) {
87415
+ var arg1$13 = $n(rest$4).head__O();
87416
+ var nx$4 = new $c_sci_$colon$colon(f$4(arg1$13), $m_sci_Nil$());
87417
+ $n(t$4).sci_$colon$colon__f_tl = nx$4;
87418
+ t$4 = nx$4;
87419
+ var this$28 = $n(rest$4);
87420
+ rest$4 = this$28.tail__sci_List()
87421
+ };
87422
+ var $$x7 = h$4
87423
+ }
87424
+ } else {
87425
+ var b$4 = $p_sc_TraversableLike__builder$1__scg_CanBuildFrom__scm_Builder(this$27, bf$4);
87426
+ var these$4 = this$27;
87427
+ while ((!$n(these$4).isEmpty__Z())) {
87428
+ var arg1$14 = $n(these$4).head__O();
87429
+ $n(b$4).$plus$eq__O__scm_Builder(f$4(arg1$14));
87430
+ var this$29 = $n(these$4);
87431
+ these$4 = this$29.tail__sci_List()
87432
+ };
87433
+ var $$x7 = $n(b$4).result__O()
87434
+ };
87435
+ var factoryParams = $n($as_sc_TraversableOnce($$x7)).mkString__T__T(", ");
87436
+ var this$31 = new $c_sci_StringOps(" ");
87437
+ var $$x9 = $f_sci_StringLike__$times__I__T(this$31, 2);
87438
+ var this$33 = new $c_sci_StringOps(" ");
87439
+ var $$x8 = $f_sci_StringLike__$times__I__T(this$33, 2);
87440
+ var this$35 = new $c_sci_StringOps(" ");
87441
+ return ((((((((((("(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n" + $$x9) + ("define([" + defineArgs)) + "], factory);\n } else if (typeof exports === 'object' && exports !== null && typeof exports.nodeType !== 'number') {\n") + $$x8) + ("factory(" + exportsArgs)) + ");\n } else {\n") + $f_sci_StringLike__$times__I__T(this$35, 2)) + ("factory(" + rootArgs)) + ");\n }\n") + ("})(typeof self !== 'undefined' ? self : this, function (" + factoryParams)) + ") {")
87353
87442
  });
87354
87443
  $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.fileHeader__T__V = (function(topClassName) {
87355
87444
  $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_outHeader).puts__T__V("// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild");
@@ -87359,8 +87448,8 @@ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.fileHeader__T__V = (
87359
87448
  $m_Lio_kaitai_struct_Utils$().addUniqueAttr__scm_ListBuffer__O__V(this$2.Lio_kaitai_struct_ImportList__f_list, "kaitai-struct/KaitaiStream")
87360
87449
  });
87361
87450
  $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.fileFooter__T__V = (function(name) {
87362
- $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V((("return " + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name)) + ";"));
87363
- $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V("}));")
87451
+ $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V(((((($m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name) + "_.") + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name)) + " = ") + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name)) + ";"));
87452
+ $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V("});")
87364
87453
  });
87365
87454
  $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.opaqueClassDeclaration__Lio_kaitai_struct_format_ClassSpec__V = (function(classSpec) {
87366
87455
  var name = $as_T($n($n(classSpec).Lio_kaitai_struct_format_ClassSpec__f_name).head__O());
@@ -87615,7 +87704,7 @@ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.attrProcess__Lio_kai
87615
87704
  return $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, e)
87616
87705
  }));
87617
87706
  var this$6 = $m_sc_Seq$();
87618
- $n($$x2).puts__T__V((((("var _process = new " + procClass) + "(") + $n($as_sc_TraversableOnce($n(args).map__F1__scg_CanBuildFrom__O($$x1, this$6.scg_GenTraversableFactory__f_ReusableCBFInstance))).mkString__T__T(", ")) + ");"));
87707
+ $n($$x2).puts__T__V((((((("var _process = new " + procClass) + "_.") + procClass) + "(") + $n($as_sc_TraversableOnce($n(args).map__F1__scg_CanBuildFrom__O($$x1, this$6.scg_GenTraversableFactory__f_ReusableCBFInstance))).mkString__T__T(", ")) + ");"));
87619
87708
  var expr$2 = (("_process.decode(" + srcExpr) + ")")
87620
87709
  }
87621
87710
  };
@@ -87817,7 +87906,25 @@ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.parseExpr__Lio_kaita
87817
87906
  }));
87818
87907
  var this$2 = $m_sc_Seq$();
87819
87908
  var addParams = $n($$x3).join__sc_TraversableOnce__T__T__T__T($as_sc_TraversableOnce($n($$x2).map__F1__scg_CanBuildFrom__O($$x1, this$2.scg_GenTraversableFactory__f_ReusableCBFInstance)), ", ", ", ", "");
87820
- return (((((((((("new " + $m_Lio_kaitai_struct_languages_JavaScriptCompiler$().types2class__sci_List__T($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name)) + "(") + io) + ", ") + parent) + ", ") + root) + addEndian) + addParams) + ")")
87909
+ var this$3 = $n($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_classSpec);
87910
+ if (this$3.isEmpty__Z()) {
87911
+ var $$x4 = $m_s_None$()
87912
+ } else {
87913
+ var arg1 = this$3.get__O();
87914
+ var classSpec = $as_Lio_kaitai_struct_format_ClassSpec(arg1);
87915
+ var x$1 = $n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name;
87916
+ var x$2 = $n(classSpec).Lio_kaitai_struct_format_ClassSpec__f_name;
87917
+ var $$x4 = new $c_s_Some(((x$1 === null) ? (x$2 === null) : $n(x$1).equals__O__Z(x$2)))
87918
+ };
87919
+ var this$4 = $n($$x4);
87920
+ if ($uZ((this$4.isEmpty__Z() ? false : this$4.get__O()))) {
87921
+ var this$5 = $n($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name);
87922
+ var name = $as_T($f_sc_LinearSeqOptimized__apply__I__O(this$5, 0));
87923
+ var topLevelModulePrefix = ($m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name) + "_.")
87924
+ } else {
87925
+ var topLevelModulePrefix = ""
87926
+ };
87927
+ return ((((((((((("new " + topLevelModulePrefix) + $m_Lio_kaitai_struct_languages_JavaScriptCompiler$().types2class__sci_List__T($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name)) + "(") + io) + ", ") + parent) + ", ") + root) + addEndian) + addParams) + ")")
87821
87928
  } else {
87822
87929
  throw new $c_s_MatchError(dataType)
87823
87930
  }
@@ -88042,7 +88149,15 @@ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.attrValidateExpr__Li
88042
88149
  var errArgsStr = $n($as_sc_TraversableOnce($$x1)).mkString__T__T(", ");
88043
88150
  $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V((("if (!(" + $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_translator).translate__Lio_kaitai_struct_exprlang_Ast$expr__T(checkExpr)) + ")) {"));
88044
88151
  $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).inc__V();
88045
- $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V((((("throw new " + $m_Lio_kaitai_struct_languages_JavaScriptCompiler$().ksErrorName__Lio_kaitai_struct_datatype_KSError__T(err)) + "(") + errArgsStr) + ");"));
88152
+ var errObj = (((("new " + $m_Lio_kaitai_struct_languages_JavaScriptCompiler$().ksErrorName__Lio_kaitai_struct_datatype_KSError__T(err)) + "(") + errArgsStr) + ")");
88153
+ if ($f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__attrDebugNeeded__Lio_kaitai_struct_format_Identifier__Z(this, attrId)) {
88154
+ var debugName = this.attrDebugName__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_RepeatSpec__Z__T(attrId, $m_Lio_kaitai_struct_format_NoRepeat$(), true);
88155
+ $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V((("var _err = " + errObj) + ";"));
88156
+ $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V((debugName + ".validationError = _err;"));
88157
+ $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V("throw _err;")
88158
+ } else {
88159
+ $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V((("throw " + errObj) + ";"))
88160
+ };
88046
88161
  $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).dec__V();
88047
88162
  $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V("}")
88048
88163
  });
@@ -102689,6 +102804,9 @@ $c_sci_List.prototype.$colon$colon$colon__sci_List__sci_List = (function(prefix)
102689
102804
  $c_sci_List.prototype.$plus$plus__sc_GenTraversableOnce__scg_CanBuildFrom__O = (function(that, bf) {
102690
102805
  return ($p_sci_List__isLikeListReusableCBF__scg_CanBuildFrom__Z(this, bf) ? $n($n($n(that).seq__sc_TraversableOnce()).toList__sci_List()).$colon$colon$colon__sci_List__sci_List(this) : $f_sc_TraversableLike__$plus$plus__sc_GenTraversableOnce__scg_CanBuildFrom__O(this, that, bf))
102691
102806
  });
102807
+ $c_sci_List.prototype.$plus$colon__O__scg_CanBuildFrom__O = (function(elem, bf) {
102808
+ return ((bf instanceof $c_scg_GenTraversableFactory$GenericCanBuildFrom) ? new $c_sci_$colon$colon(elem, this) : $f_sc_SeqLike__$plus$colon__O__scg_CanBuildFrom__O(this, elem, bf))
102809
+ });
102692
102810
  $c_sci_List.prototype.toList__sci_List = (function() {
102693
102811
  return this
102694
102812
  });
@@ -107583,15 +107701,23 @@ function $h_Lio_kaitai_struct_format_JavaScriptClassSpecs() {
107583
107701
  /*<skip>*/
107584
107702
  }
107585
107703
  $h_Lio_kaitai_struct_format_JavaScriptClassSpecs.prototype = $c_Lio_kaitai_struct_format_JavaScriptClassSpecs.prototype;
107586
- $c_Lio_kaitai_struct_format_JavaScriptClassSpecs.prototype.doImport__T__T__s_concurrent_Future = (function(name, mode) {
107704
+ $c_Lio_kaitai_struct_format_JavaScriptClassSpecs.prototype.doImport__T__sci_List__T__s_concurrent_Future = (function(name, path, mode) {
107705
+ var ec = $m_sjs_concurrent_JSExecutionContext$().sjs_concurrent_JSExecutionContext$__f_queue;
107587
107706
  var $$x1 = $m_sjs_js_Thenable$ThenableOps$();
107588
107707
  var p = this.Lio_kaitai_struct_format_JavaScriptClassSpecs__f_importer.importYaml(name, mode);
107589
- return $n($n($$x1).toFuture$extension__sjs_js_Thenable__s_concurrent_Future(p)).map__F1__s_concurrent_ExecutionContext__s_concurrent_Future(new $c_sjsr_AnonFunction1(((yaml$2) => {
107708
+ var this$6 = $n($n($$x1).toFuture$extension__sjs_js_Thenable__s_concurrent_Future(p));
107709
+ var s = new $c_sjsr_AnonFunction1(((yaml$2) => {
107590
107710
  var yamlScala = $m_Lio_kaitai_struct_format_JavaScriptKSYParser$().yamlJavascriptToScala__O__O(yaml$2);
107591
107711
  var this$3 = $m_Lio_kaitai_struct_format_ClassSpec$();
107592
107712
  var fileName = new $c_s_Some(name);
107593
107713
  return new $c_s_Some(this$3.fromYaml__O__s_Option__sci_List__Lio_kaitai_struct_format_MetaSpec__Lio_kaitai_struct_format_ClassSpec(yamlScala, fileName, $m_sci_Nil$(), $m_Lio_kaitai_struct_format_MetaSpec$().Lio_kaitai_struct_format_MetaSpec$__f_OPAQUE))
107594
- })), $m_sjs_concurrent_JSExecutionContext$().sjs_concurrent_JSExecutionContext$__f_queue)
107714
+ }));
107715
+ var f = new $c_sjsr_AnonFunction1(((err$2) => {
107716
+ var err = $as_jl_Throwable(err$2);
107717
+ var this$5 = new $c_Lio_kaitai_struct_problems_ErrorInInput(err, path, $m_s_None$());
107718
+ throw new $c_Lio_kaitai_struct_problems_CompilationProblemException(this$5)
107719
+ }));
107720
+ return $f_s_concurrent_Future__transform__F1__F1__s_concurrent_ExecutionContext__s_concurrent_Future(this$6, s, f, ec)
107595
107721
  });
107596
107722
  var $d_Lio_kaitai_struct_format_JavaScriptClassSpecs = new $TypeData().initClass({
107597
107723
  Lio_kaitai_struct_format_JavaScriptClassSpecs: 0
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "scripts": {
36
36
  "test": "echo \"Error: no test specified\" && exit 1"
37
37
  },
38
- "version": "0.11.0-SNAPSHOT20231104.085023.e581718"
38
+ "version": "0.11.0-SNAPSHOT20240221.132806.29d37b8"
39
39
  }