kaitai-struct-compiler 0.11.0 → 0.12.0-SNAPSHOT20251018.14640.fac2ac9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kaitai-struct-compiler.js +1800 -37
- package/package.json +1 -1
|
@@ -3038,8 +3038,8 @@ function $m_Lio_kaitai_struct_Utils$() {
|
|
|
3038
3038
|
function $c_Lio_kaitai_struct_Version$() {
|
|
3039
3039
|
this.Lio_kaitai_struct_Version$__f_version = null;
|
|
3040
3040
|
this.Lio_kaitai_struct_Version$__f_gitTime = null;
|
|
3041
|
-
this.Lio_kaitai_struct_Version$__f_version = "0.
|
|
3042
|
-
this.Lio_kaitai_struct_Version$__f_gitTime = "2025-
|
|
3041
|
+
this.Lio_kaitai_struct_Version$__f_version = "0.12-SNAPSHOT20251018.014640.fac2ac9";
|
|
3042
|
+
this.Lio_kaitai_struct_Version$__f_gitTime = "2025-10-18T01:46:40Z"
|
|
3043
3043
|
}
|
|
3044
3044
|
$c_Lio_kaitai_struct_Version$.prototype = new $h_O();
|
|
3045
3045
|
$c_Lio_kaitai_struct_Version$.prototype.constructor = $c_Lio_kaitai_struct_Version$;
|
|
@@ -18619,39 +18619,41 @@ function $asArrayOf_Lio_kaitai_struct_languages_components_LanguageCompilerStati
|
|
|
18619
18619
|
function $c_Lio_kaitai_struct_languages_components_LanguageCompilerStatic$() {
|
|
18620
18620
|
this.Lio_kaitai_struct_languages_components_LanguageCompilerStatic$__f_NAME_TO_CLASS = null;
|
|
18621
18621
|
$n_Lio_kaitai_struct_languages_components_LanguageCompilerStatic$ = this;
|
|
18622
|
-
var this$
|
|
18622
|
+
var this$36 = $n($m_s_Predef$().s_Predef$__f_Map);
|
|
18623
18623
|
var y = $m_Lio_kaitai_struct_ConstructClassCompiler$();
|
|
18624
|
-
var $$
|
|
18624
|
+
var $$x15 = $ct_T2__O__O__(new $c_T2(), "construct", y);
|
|
18625
18625
|
var y$1 = $m_Lio_kaitai_struct_languages_CppCompiler$();
|
|
18626
|
-
var $$
|
|
18626
|
+
var $$x14 = $ct_T2__O__O__(new $c_T2(), "cpp_stl", y$1);
|
|
18627
18627
|
var y$2 = $m_Lio_kaitai_struct_languages_CSharpCompiler$();
|
|
18628
|
-
var $$
|
|
18628
|
+
var $$x13 = $ct_T2__O__O__(new $c_T2(), "csharp", y$2);
|
|
18629
18629
|
var y$3 = $m_Lio_kaitai_struct_GraphvizClassCompiler$();
|
|
18630
|
-
var $$
|
|
18630
|
+
var $$x12 = $ct_T2__O__O__(new $c_T2(), "graphviz", y$3);
|
|
18631
18631
|
var y$4 = $m_Lio_kaitai_struct_languages_GoCompiler$();
|
|
18632
|
-
var $$
|
|
18632
|
+
var $$x11 = $ct_T2__O__O__(new $c_T2(), "go", y$4);
|
|
18633
18633
|
var y$5 = $m_Lio_kaitai_struct_HtmlClassCompiler$();
|
|
18634
|
-
var $$
|
|
18634
|
+
var $$x10 = $ct_T2__O__O__(new $c_T2(), "html", y$5);
|
|
18635
18635
|
var y$6 = $m_Lio_kaitai_struct_languages_JavaCompiler$();
|
|
18636
|
-
var $$
|
|
18636
|
+
var $$x9 = $ct_T2__O__O__(new $c_T2(), "java", y$6);
|
|
18637
18637
|
var y$7 = $m_Lio_kaitai_struct_languages_JavaScriptCompiler$();
|
|
18638
|
-
var $$
|
|
18638
|
+
var $$x8 = $ct_T2__O__O__(new $c_T2(), "javascript", y$7);
|
|
18639
18639
|
var y$8 = $m_Lio_kaitai_struct_languages_LuaCompiler$();
|
|
18640
|
-
var $$
|
|
18640
|
+
var $$x7 = $ct_T2__O__O__(new $c_T2(), "lua", y$8);
|
|
18641
18641
|
var y$9 = $m_Lio_kaitai_struct_languages_NimCompiler$();
|
|
18642
|
-
var $$
|
|
18642
|
+
var $$x6 = $ct_T2__O__O__(new $c_T2(), "nim", y$9);
|
|
18643
18643
|
var y$10 = $m_Lio_kaitai_struct_languages_PerlCompiler$();
|
|
18644
|
-
var $$
|
|
18644
|
+
var $$x5 = $ct_T2__O__O__(new $c_T2(), "perl", y$10);
|
|
18645
18645
|
var y$11 = $m_Lio_kaitai_struct_languages_PHPCompiler$();
|
|
18646
|
-
var $$
|
|
18646
|
+
var $$x4 = $ct_T2__O__O__(new $c_T2(), "php", y$11);
|
|
18647
18647
|
var y$12 = $m_Lio_kaitai_struct_languages_PythonCompiler$();
|
|
18648
|
-
var $$
|
|
18648
|
+
var $$x3 = $ct_T2__O__O__(new $c_T2(), "python", y$12);
|
|
18649
18649
|
var y$13 = $m_Lio_kaitai_struct_languages_RubyCompiler$();
|
|
18650
|
-
var $$
|
|
18650
|
+
var $$x2 = $ct_T2__O__O__(new $c_T2(), "ruby", y$13);
|
|
18651
18651
|
var y$14 = $m_Lio_kaitai_struct_languages_RustCompiler$();
|
|
18652
|
-
var
|
|
18652
|
+
var $$x1 = $ct_T2__O__O__(new $c_T2(), "rust", y$14);
|
|
18653
|
+
var y$15 = $m_Lio_kaitai_struct_languages_ZigCompiler$();
|
|
18654
|
+
var array = [$$x15, $$x14, $$x13, $$x12, $$x11, $$x10, $$x9, $$x8, $$x7, $$x6, $$x5, $$x4, $$x3, $$x2, $$x1, $ct_T2__O__O__(new $c_T2(), "zig", y$15)];
|
|
18653
18655
|
var elems = $ct_sjsr_WrappedVarArgs__sjs_js_Array__(new $c_sjsr_WrappedVarArgs(), array);
|
|
18654
|
-
this.Lio_kaitai_struct_languages_components_LanguageCompilerStatic$__f_NAME_TO_CLASS = this$
|
|
18656
|
+
this.Lio_kaitai_struct_languages_components_LanguageCompilerStatic$__f_NAME_TO_CLASS = this$36.from__sc_IterableOnce__sci_Map(elems);
|
|
18655
18657
|
$as_sci_Map($n(this.Lio_kaitai_struct_languages_components_LanguageCompilerStatic$__f_NAME_TO_CLASS).map__F1__sc_IterableOps(new $c_sjsr_AnonFunction1(((x$1$2) => {
|
|
18656
18658
|
var x$1 = $as_T2(x$1$2);
|
|
18657
18659
|
return $n(x$1).swap__T2()
|
|
@@ -18710,7 +18712,7 @@ function $f_Lio_kaitai_struct_languages_components_SingleOutputFile__$init$__V($
|
|
|
18710
18712
|
$thiz.io$kaitai$struct$languages$components$SingleOutputFile$_setter_$importList_$eq__Lio_kaitai_struct_ImportList__V(new $c_Lio_kaitai_struct_ImportList())
|
|
18711
18713
|
}
|
|
18712
18714
|
function $f_Lio_kaitai_struct_languages_components_SwitchOps__switchCasesRender__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__sci_Map__F1__F1__V($thiz, id, on, cases, normalCaseProc, elseCaseProc) {
|
|
18713
|
-
var someNormalCases =
|
|
18715
|
+
var someNormalCases = $n(cases).exists__F1__Z(new $c_sjsr_AnonFunction1(((x0$1$2) => {
|
|
18714
18716
|
var x0$1 = $as_T2(x0$1$2);
|
|
18715
18717
|
if ((x0$1 !== null)) {
|
|
18716
18718
|
var caseExpr = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x0$1)._1__O());
|
|
@@ -18719,7 +18721,7 @@ function $f_Lio_kaitai_struct_languages_components_SwitchOps__switchCasesRender_
|
|
|
18719
18721
|
} else {
|
|
18720
18722
|
throw new $c_s_MatchError(x0$1)
|
|
18721
18723
|
}
|
|
18722
|
-
})))
|
|
18724
|
+
})));
|
|
18723
18725
|
if (someNormalCases) {
|
|
18724
18726
|
$thiz.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V(id, on);
|
|
18725
18727
|
var first = new $c_sr_BooleanRef(true);
|
|
@@ -20020,7 +20022,7 @@ function $p_Lio_kaitai_struct_translators_CommonArraysAndCast__valuesAsByteArray
|
|
|
20020
20022
|
}
|
|
20021
20023
|
}
|
|
20022
20024
|
function $f_Lio_kaitai_struct_translators_CommonLiterals__doStringLiteral__T__T($thiz, s) {
|
|
20023
|
-
return (("\"" + $
|
|
20025
|
+
return (("\"" + $thiz.doStringLiteralBody__T__T(s)) + "\"")
|
|
20024
20026
|
}
|
|
20025
20027
|
function $f_Lio_kaitai_struct_translators_CommonLiterals__doStringLiteralBody__T__T($thiz, s) {
|
|
20026
20028
|
var $$x10 = $m_s_Predef$();
|
|
@@ -28875,6 +28877,34 @@ function $m_sc_SeqFactory$UnapplySeqWrapper$() {
|
|
|
28875
28877
|
return $n_sc_SeqFactory$UnapplySeqWrapper$
|
|
28876
28878
|
}
|
|
28877
28879
|
/** @constructor */
|
|
28880
|
+
function $c_sc_Stepper$() {
|
|
28881
|
+
/*<skip>*/
|
|
28882
|
+
}
|
|
28883
|
+
$c_sc_Stepper$.prototype = new $h_O();
|
|
28884
|
+
$c_sc_Stepper$.prototype.constructor = $c_sc_Stepper$;
|
|
28885
|
+
/** @constructor */
|
|
28886
|
+
function $h_sc_Stepper$() {
|
|
28887
|
+
/*<skip>*/
|
|
28888
|
+
}
|
|
28889
|
+
$h_sc_Stepper$.prototype = $c_sc_Stepper$.prototype;
|
|
28890
|
+
$c_sc_Stepper$.prototype.throwNSEE__E = (function() {
|
|
28891
|
+
throw $ct_ju_NoSuchElementException__T__(new $c_ju_NoSuchElementException(), "Empty Stepper")
|
|
28892
|
+
});
|
|
28893
|
+
var $d_sc_Stepper$ = new $TypeData().initClass({
|
|
28894
|
+
sc_Stepper$: 0
|
|
28895
|
+
}, false, "scala.collection.Stepper$", {
|
|
28896
|
+
sc_Stepper$: 1,
|
|
28897
|
+
O: 1
|
|
28898
|
+
});
|
|
28899
|
+
$c_sc_Stepper$.prototype.$classData = $d_sc_Stepper$;
|
|
28900
|
+
var $n_sc_Stepper$;
|
|
28901
|
+
function $m_sc_Stepper$() {
|
|
28902
|
+
if ((!$n_sc_Stepper$)) {
|
|
28903
|
+
$n_sc_Stepper$ = new $c_sc_Stepper$()
|
|
28904
|
+
};
|
|
28905
|
+
return $n_sc_Stepper$
|
|
28906
|
+
}
|
|
28907
|
+
/** @constructor */
|
|
28878
28908
|
function $c_sc_StringOps$() {
|
|
28879
28909
|
this.sc_StringOps$__f_fallback = null;
|
|
28880
28910
|
$n_sc_StringOps$ = this;
|
|
@@ -34264,23 +34294,24 @@ $c_Lio_kaitai_struct_ClassCompiler.prototype.compileClass__Lio_kaitai_struct_for
|
|
|
34264
34294
|
this.compileInstances__Lio_kaitai_struct_format_ClassSpec__V(curClass);
|
|
34265
34295
|
var this$10 = $n($n(curClass).Lio_kaitai_struct_format_ClassSpec__f_seq);
|
|
34266
34296
|
var suffix$1 = $n(curClass).Lio_kaitai_struct_format_ClassSpec__f_params;
|
|
34267
|
-
var this$
|
|
34297
|
+
var this$22 = $n(this$10.appendedAll__sc_IterableOnce__sci_List(suffix$1));
|
|
34268
34298
|
$n($m_s_package$().s_package$__f_List);
|
|
34269
|
-
var $$x4 = new $c_Lio_kaitai_struct_format_AttrSpec($m_sci_Nil$(), $m_Lio_kaitai_struct_format_RootIdentifier$(),
|
|
34299
|
+
var $$x4 = new $c_Lio_kaitai_struct_format_AttrSpec($m_sci_Nil$(), $m_Lio_kaitai_struct_format_RootIdentifier$(), $n(this.topClass__Lio_kaitai_struct_format_ClassSpec()).toDataType__Lio_kaitai_struct_datatype_DataType(), ($m_Lio_kaitai_struct_format_AttrSpec$(), new $c_Lio_kaitai_struct_format_ConditionalSpec($m_s_None$(), $m_Lio_kaitai_struct_format_NoRepeat$())), ($m_Lio_kaitai_struct_format_AttrSpec$(), $m_s_None$()), ($m_Lio_kaitai_struct_format_AttrSpec$(), $m_Lio_kaitai_struct_format_DocSpec$().Lio_kaitai_struct_format_DocSpec$__f_EMPTY));
|
|
34270
34300
|
var $$x3 = $m_sci_Nil$();
|
|
34271
34301
|
var $$x2 = $m_Lio_kaitai_struct_format_ParentIdentifier$();
|
|
34272
|
-
var this$
|
|
34273
|
-
var array$1 = [$$x4, new $c_Lio_kaitai_struct_format_AttrSpec($$x3, $$x2, $n(this$
|
|
34302
|
+
var this$14 = $n(curClass);
|
|
34303
|
+
var array$1 = [$$x4, new $c_Lio_kaitai_struct_format_AttrSpec($$x3, $$x2, $n(this$14.Lio_kaitai_struct_format_ClassSpec__f_parentClass).toDataType__Lio_kaitai_struct_datatype_DataType(), ($m_Lio_kaitai_struct_format_AttrSpec$(), new $c_Lio_kaitai_struct_format_ConditionalSpec($m_s_None$(), $m_Lio_kaitai_struct_format_NoRepeat$())), ($m_Lio_kaitai_struct_format_AttrSpec$(), $m_s_None$()), ($m_Lio_kaitai_struct_format_AttrSpec$(), $m_Lio_kaitai_struct_format_DocSpec$().Lio_kaitai_struct_format_DocSpec$__f_EMPTY))];
|
|
34274
34304
|
var elems$1 = $ct_sjsr_WrappedVarArgs__sjs_js_Array__(new $c_sjsr_WrappedVarArgs(), array$1);
|
|
34275
34305
|
var suffix$2 = $m_sci_Nil$().prependedAll__sc_IterableOnce__sci_List(elems$1);
|
|
34276
|
-
var this$
|
|
34306
|
+
var this$23 = $n(this$22.appendedAll__sc_IterableOnce__sci_List(suffix$2));
|
|
34277
34307
|
var suffix$3 = $m_Lio_kaitai_struct_languages_components_ExtraAttrs$().forClassSpec__Lio_kaitai_struct_format_ClassSpec__Lio_kaitai_struct_languages_components_ExtraAttrs__sci_List(curClass, this.Lio_kaitai_struct_ClassCompiler__f_lang);
|
|
34278
|
-
var allAttrs = this$
|
|
34279
|
-
this.compileAttrDeclarations__sci_List__V(allAttrs);
|
|
34308
|
+
var allAttrs = this$23.appendedAll__sc_IterableOnce__sci_List(suffix$3);
|
|
34280
34309
|
this.compileAttrReaders__sci_List__V(allAttrs);
|
|
34281
|
-
|
|
34282
|
-
|
|
34283
|
-
|
|
34310
|
+
this.compileInstanceDeclarations__Lio_kaitai_struct_format_ClassSpec__V(curClass);
|
|
34311
|
+
this.compileAttrDeclarations__sci_List__V(allAttrs);
|
|
34312
|
+
var this$24 = $n($n(curClass).Lio_kaitai_struct_format_ClassSpec__f_toStringExpr);
|
|
34313
|
+
if ((!this$24.isEmpty__Z())) {
|
|
34314
|
+
var arg1 = this$24.get__O();
|
|
34284
34315
|
var expr = $as_Lio_kaitai_struct_exprlang_Ast$expr(arg1);
|
|
34285
34316
|
$n(this.Lio_kaitai_struct_ClassCompiler__f_lang).classToString__Lio_kaitai_struct_exprlang_Ast$expr__V(expr)
|
|
34286
34317
|
};
|
|
@@ -34694,6 +34725,20 @@ $c_Lio_kaitai_struct_ClassCompiler.prototype.compileSubclasses__Lio_kaitai_struc
|
|
|
34694
34725
|
}));
|
|
34695
34726
|
$m_sci_RedBlackTree$().foreach__sci_RedBlackTree$Tree__F1__V(this$2.sci_TreeMap__f_tree, f)
|
|
34696
34727
|
});
|
|
34728
|
+
$c_Lio_kaitai_struct_ClassCompiler.prototype.compileInstanceDeclarations__Lio_kaitai_struct_format_ClassSpec__V = (function(curClass) {
|
|
34729
|
+
var this$2 = $n($n(curClass).Lio_kaitai_struct_format_ClassSpec__f_instances);
|
|
34730
|
+
var f = new $c_sjsr_AnonFunction1(((x0$1$2) => {
|
|
34731
|
+
var x0$1 = $as_T2(x0$1$2);
|
|
34732
|
+
if ((x0$1 !== null)) {
|
|
34733
|
+
var instName = $as_Lio_kaitai_struct_format_InstanceIdentifier($n(x0$1)._1__O());
|
|
34734
|
+
var instSpec = $as_Lio_kaitai_struct_format_InstanceSpec($n(x0$1)._2__O());
|
|
34735
|
+
this.compileInstanceDeclaration__Lio_kaitai_struct_format_InstanceIdentifier__Lio_kaitai_struct_format_InstanceSpec__V(instName, instSpec)
|
|
34736
|
+
} else {
|
|
34737
|
+
throw new $c_s_MatchError(x0$1)
|
|
34738
|
+
}
|
|
34739
|
+
}));
|
|
34740
|
+
$m_sci_RedBlackTree$().foreach__sci_RedBlackTree$Tree__F1__V(this$2.sci_TreeMap__f_tree, f)
|
|
34741
|
+
});
|
|
34697
34742
|
$c_Lio_kaitai_struct_ClassCompiler.prototype.compileInstances__Lio_kaitai_struct_format_ClassSpec__V = (function(curClass) {
|
|
34698
34743
|
var this$2 = $n($n(curClass).Lio_kaitai_struct_format_ClassSpec__f_instances);
|
|
34699
34744
|
var f = new $c_sjsr_AnonFunction1(((x0$1$2) => {
|
|
@@ -34710,7 +34755,6 @@ $c_Lio_kaitai_struct_ClassCompiler.prototype.compileInstances__Lio_kaitai_struct
|
|
|
34710
34755
|
});
|
|
34711
34756
|
$c_Lio_kaitai_struct_ClassCompiler.prototype.compileInstance__sci_List__Lio_kaitai_struct_format_InstanceIdentifier__Lio_kaitai_struct_format_InstanceSpec__s_Option__V = (function(className, instName, instSpec, endian) {
|
|
34712
34757
|
var dataType = $n(instSpec).dataTypeComposite__Lio_kaitai_struct_datatype_DataType();
|
|
34713
|
-
this.compileInstanceDeclaration__Lio_kaitai_struct_format_InstanceIdentifier__Lio_kaitai_struct_format_InstanceSpec__V(instName, instSpec);
|
|
34714
34758
|
if ((!$n(this.Lio_kaitai_struct_ClassCompiler__f_lang).innerDocstrings__Z())) {
|
|
34715
34759
|
this.compileInstanceDoc__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_InstanceSpec__V(instName, instSpec)
|
|
34716
34760
|
};
|
|
@@ -34738,6 +34782,7 @@ $c_Lio_kaitai_struct_ClassCompiler.prototype.compileInstance__sci_List__Lio_kait
|
|
|
34738
34782
|
$n(this.Lio_kaitai_struct_ClassCompiler__f_lang).instanceReturnNullIfDisabled__Lio_kaitai_struct_format_InstanceIdentifier__V(instName)
|
|
34739
34783
|
};
|
|
34740
34784
|
$n(this.Lio_kaitai_struct_ClassCompiler__f_lang).instanceSetCalculated__Lio_kaitai_struct_format_InstanceIdentifier__V(instName);
|
|
34785
|
+
$n(this.Lio_kaitai_struct_ClassCompiler__f_lang).instanceTempVarDeclaration__Lio_kaitai_struct_datatype_DataType__Z__V(dataType, $n(instSpec).isNullable__Z());
|
|
34741
34786
|
if ((instSpec instanceof $c_Lio_kaitai_struct_format_ValueInstanceSpec)) {
|
|
34742
34787
|
var x2 = $as_Lio_kaitai_struct_format_ValueInstanceSpec(instSpec);
|
|
34743
34788
|
$n(this.Lio_kaitai_struct_ClassCompiler__f_lang).attrParseIfHeader__Lio_kaitai_struct_format_Identifier__s_Option__V(instName, $n(x2).Lio_kaitai_struct_format_ValueInstanceSpec__f_ifExpr);
|
|
@@ -52694,6 +52739,296 @@ function $m_Lio_kaitai_struct_languages_RubyCompiler$() {
|
|
|
52694
52739
|
};
|
|
52695
52740
|
return $n_Lio_kaitai_struct_languages_RubyCompiler$
|
|
52696
52741
|
}
|
|
52742
|
+
/** @constructor */
|
|
52743
|
+
function $c_Lio_kaitai_struct_languages_ZigCompiler$() {
|
|
52744
|
+
/*<skip>*/
|
|
52745
|
+
}
|
|
52746
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype = new $h_O();
|
|
52747
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype.constructor = $c_Lio_kaitai_struct_languages_ZigCompiler$;
|
|
52748
|
+
/** @constructor */
|
|
52749
|
+
function $h_Lio_kaitai_struct_languages_ZigCompiler$() {
|
|
52750
|
+
/*<skip>*/
|
|
52751
|
+
}
|
|
52752
|
+
$h_Lio_kaitai_struct_languages_ZigCompiler$.prototype = $c_Lio_kaitai_struct_languages_ZigCompiler$.prototype;
|
|
52753
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype.getCompiler__Lio_kaitai_struct_ClassTypeProvider__Lio_kaitai_struct_RuntimeConfig__Lio_kaitai_struct_languages_components_LanguageCompiler = (function(tp, config) {
|
|
52754
|
+
return new $c_Lio_kaitai_struct_languages_ZigCompiler(tp, config)
|
|
52755
|
+
});
|
|
52756
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype.idToStr__Lio_kaitai_struct_format_Identifier__T = (function(id) {
|
|
52757
|
+
if ((id instanceof $c_Lio_kaitai_struct_format_SpecialIdentifier)) {
|
|
52758
|
+
var x2 = $as_Lio_kaitai_struct_format_SpecialIdentifier(id);
|
|
52759
|
+
var name = $n(x2).Lio_kaitai_struct_format_SpecialIdentifier__f_name;
|
|
52760
|
+
return name
|
|
52761
|
+
} else if ((id instanceof $c_Lio_kaitai_struct_format_NamedIdentifier)) {
|
|
52762
|
+
var x3 = $as_Lio_kaitai_struct_format_NamedIdentifier(id);
|
|
52763
|
+
var name$2 = $n(x3).Lio_kaitai_struct_format_NamedIdentifier__f_name;
|
|
52764
|
+
return name$2
|
|
52765
|
+
} else if ((id instanceof $c_Lio_kaitai_struct_format_NumberedIdentifier)) {
|
|
52766
|
+
var x4 = $as_Lio_kaitai_struct_format_NumberedIdentifier(id);
|
|
52767
|
+
var idx = $n(x4).Lio_kaitai_struct_format_NumberedIdentifier__f_idx;
|
|
52768
|
+
return (("_" + $m_Lio_kaitai_struct_format_NumberedIdentifier$().Lio_kaitai_struct_format_NumberedIdentifier$__f_TEMPLATE) + idx)
|
|
52769
|
+
} else if ((id instanceof $c_Lio_kaitai_struct_format_InstanceIdentifier)) {
|
|
52770
|
+
var x5 = $as_Lio_kaitai_struct_format_InstanceIdentifier(id);
|
|
52771
|
+
var name$3 = $n(x5).Lio_kaitai_struct_format_InstanceIdentifier__f_name;
|
|
52772
|
+
return ("_m_" + name$3)
|
|
52773
|
+
} else if ((id instanceof $c_Lio_kaitai_struct_format_RawIdentifier)) {
|
|
52774
|
+
var x6 = $as_Lio_kaitai_struct_format_RawIdentifier(id);
|
|
52775
|
+
var innerId = $n(x6).Lio_kaitai_struct_format_RawIdentifier__f_innerId;
|
|
52776
|
+
return ("_raw_" + this.idToStr__Lio_kaitai_struct_format_Identifier__T(innerId))
|
|
52777
|
+
} else if ((id instanceof $c_Lio_kaitai_struct_format_IoStorageIdentifier)) {
|
|
52778
|
+
var x7 = $as_Lio_kaitai_struct_format_IoStorageIdentifier(id);
|
|
52779
|
+
var innerId$2 = $n(x7).Lio_kaitai_struct_format_IoStorageIdentifier__f_innerId;
|
|
52780
|
+
return ("_io_" + this.idToStr__Lio_kaitai_struct_format_Identifier__T(innerId$2))
|
|
52781
|
+
} else {
|
|
52782
|
+
throw new $c_s_MatchError(id)
|
|
52783
|
+
}
|
|
52784
|
+
});
|
|
52785
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype.privateMemberName__Lio_kaitai_struct_format_Identifier__T = (function(id) {
|
|
52786
|
+
return ("self." + this.idToStr__Lio_kaitai_struct_format_Identifier__T(id))
|
|
52787
|
+
});
|
|
52788
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T = (function(attrType, importList, curClass) {
|
|
52789
|
+
while (true) {
|
|
52790
|
+
var rc71 = false;
|
|
52791
|
+
var x2 = null;
|
|
52792
|
+
var rc72 = false;
|
|
52793
|
+
var x5 = null;
|
|
52794
|
+
var rc73 = false;
|
|
52795
|
+
var x44 = null;
|
|
52796
|
+
var x1 = attrType;
|
|
52797
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$Int1Type)) {
|
|
52798
|
+
rc71 = true;
|
|
52799
|
+
x2 = $as_Lio_kaitai_struct_datatype_DataType$Int1Type(x1);
|
|
52800
|
+
var p3 = $n(x2).Lio_kaitai_struct_datatype_DataType$Int1Type__f_signed;
|
|
52801
|
+
if ((p3 === false)) {
|
|
52802
|
+
return "u8"
|
|
52803
|
+
}
|
|
52804
|
+
};
|
|
52805
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$IntMultiType)) {
|
|
52806
|
+
rc72 = true;
|
|
52807
|
+
x5 = $as_Lio_kaitai_struct_datatype_DataType$IntMultiType(x1);
|
|
52808
|
+
var p6 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_signed;
|
|
52809
|
+
var p7 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_width;
|
|
52810
|
+
if ((p6 === false)) {
|
|
52811
|
+
var x = $m_Lio_kaitai_struct_datatype_DataType$Width2$();
|
|
52812
|
+
var $$x1 = (x === p7)
|
|
52813
|
+
} else {
|
|
52814
|
+
var $$x1 = false
|
|
52815
|
+
};
|
|
52816
|
+
if ($$x1) {
|
|
52817
|
+
return "u16"
|
|
52818
|
+
}
|
|
52819
|
+
};
|
|
52820
|
+
if (rc72) {
|
|
52821
|
+
var p12 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_signed;
|
|
52822
|
+
var p13 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_width;
|
|
52823
|
+
if ((p12 === false)) {
|
|
52824
|
+
var x$3 = $m_Lio_kaitai_struct_datatype_DataType$Width4$();
|
|
52825
|
+
var $$x2 = (x$3 === p13)
|
|
52826
|
+
} else {
|
|
52827
|
+
var $$x2 = false
|
|
52828
|
+
};
|
|
52829
|
+
if ($$x2) {
|
|
52830
|
+
return "u32"
|
|
52831
|
+
}
|
|
52832
|
+
};
|
|
52833
|
+
if (rc72) {
|
|
52834
|
+
var p18 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_signed;
|
|
52835
|
+
var p19 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_width;
|
|
52836
|
+
if ((p18 === false)) {
|
|
52837
|
+
var x$5 = $m_Lio_kaitai_struct_datatype_DataType$Width8$();
|
|
52838
|
+
var $$x3 = (x$5 === p19)
|
|
52839
|
+
} else {
|
|
52840
|
+
var $$x3 = false
|
|
52841
|
+
};
|
|
52842
|
+
if ($$x3) {
|
|
52843
|
+
return "u64"
|
|
52844
|
+
}
|
|
52845
|
+
};
|
|
52846
|
+
if (rc71) {
|
|
52847
|
+
var p24 = $n(x2).Lio_kaitai_struct_datatype_DataType$Int1Type__f_signed;
|
|
52848
|
+
if ((p24 === true)) {
|
|
52849
|
+
return "i8"
|
|
52850
|
+
}
|
|
52851
|
+
};
|
|
52852
|
+
if (rc72) {
|
|
52853
|
+
var p27 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_signed;
|
|
52854
|
+
var p28 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_width;
|
|
52855
|
+
if ((p27 === true)) {
|
|
52856
|
+
var x$7 = $m_Lio_kaitai_struct_datatype_DataType$Width2$();
|
|
52857
|
+
var $$x4 = (x$7 === p28)
|
|
52858
|
+
} else {
|
|
52859
|
+
var $$x4 = false
|
|
52860
|
+
};
|
|
52861
|
+
if ($$x4) {
|
|
52862
|
+
return "i16"
|
|
52863
|
+
}
|
|
52864
|
+
};
|
|
52865
|
+
if (rc72) {
|
|
52866
|
+
var p33 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_signed;
|
|
52867
|
+
var p34 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_width;
|
|
52868
|
+
if ((p33 === true)) {
|
|
52869
|
+
var x$9 = $m_Lio_kaitai_struct_datatype_DataType$Width4$();
|
|
52870
|
+
var $$x5 = (x$9 === p34)
|
|
52871
|
+
} else {
|
|
52872
|
+
var $$x5 = false
|
|
52873
|
+
};
|
|
52874
|
+
if ($$x5) {
|
|
52875
|
+
return "i32"
|
|
52876
|
+
}
|
|
52877
|
+
};
|
|
52878
|
+
if (rc72) {
|
|
52879
|
+
var p39 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_signed;
|
|
52880
|
+
var p40 = $n(x5).Lio_kaitai_struct_datatype_DataType$IntMultiType__f_width;
|
|
52881
|
+
if ((p39 === true)) {
|
|
52882
|
+
var x$11 = $m_Lio_kaitai_struct_datatype_DataType$Width8$();
|
|
52883
|
+
var $$x6 = (x$11 === p40)
|
|
52884
|
+
} else {
|
|
52885
|
+
var $$x6 = false
|
|
52886
|
+
};
|
|
52887
|
+
if ($$x6) {
|
|
52888
|
+
return "i64"
|
|
52889
|
+
}
|
|
52890
|
+
};
|
|
52891
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$FloatMultiType)) {
|
|
52892
|
+
rc73 = true;
|
|
52893
|
+
x44 = $as_Lio_kaitai_struct_datatype_DataType$FloatMultiType(x1);
|
|
52894
|
+
var p45 = $n(x44).Lio_kaitai_struct_datatype_DataType$FloatMultiType__f_width;
|
|
52895
|
+
var x$13 = $m_Lio_kaitai_struct_datatype_DataType$Width4$();
|
|
52896
|
+
if ((x$13 === p45)) {
|
|
52897
|
+
return "f32"
|
|
52898
|
+
}
|
|
52899
|
+
};
|
|
52900
|
+
if (rc73) {
|
|
52901
|
+
var p49 = $n(x44).Lio_kaitai_struct_datatype_DataType$FloatMultiType__f_width;
|
|
52902
|
+
var x$15 = $m_Lio_kaitai_struct_datatype_DataType$Width8$();
|
|
52903
|
+
if ((x$15 === p49)) {
|
|
52904
|
+
return "f64"
|
|
52905
|
+
}
|
|
52906
|
+
};
|
|
52907
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$BitsType)) {
|
|
52908
|
+
return "u64"
|
|
52909
|
+
};
|
|
52910
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$BooleanType)) {
|
|
52911
|
+
return "bool"
|
|
52912
|
+
};
|
|
52913
|
+
var x$17 = $m_Lio_kaitai_struct_datatype_DataType$CalcIntType$();
|
|
52914
|
+
if ((x$17 === x1)) {
|
|
52915
|
+
return "i32"
|
|
52916
|
+
};
|
|
52917
|
+
var x$19 = $m_Lio_kaitai_struct_datatype_DataType$CalcFloatType$();
|
|
52918
|
+
if ((x$19 === x1)) {
|
|
52919
|
+
return "f64"
|
|
52920
|
+
};
|
|
52921
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$StrType)) {
|
|
52922
|
+
return "[]u8"
|
|
52923
|
+
};
|
|
52924
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$BytesType)) {
|
|
52925
|
+
return "[]u8"
|
|
52926
|
+
};
|
|
52927
|
+
var x$21 = $m_Lio_kaitai_struct_datatype_DataType$KaitaiStreamType$();
|
|
52928
|
+
if ((x$21 === x1)) {
|
|
52929
|
+
var $$x7 = true
|
|
52930
|
+
} else {
|
|
52931
|
+
var x$23 = $m_Lio_kaitai_struct_datatype_DataType$OwnedKaitaiStreamType$();
|
|
52932
|
+
var $$x7 = (x$23 === x1)
|
|
52933
|
+
};
|
|
52934
|
+
if ($$x7) {
|
|
52935
|
+
return "*kaitai_struct.KaitaiStream"
|
|
52936
|
+
};
|
|
52937
|
+
var x$25 = $m_Lio_kaitai_struct_datatype_DataType$AnyType$();
|
|
52938
|
+
if ((x$25 === x1)) {
|
|
52939
|
+
var $$x8 = true
|
|
52940
|
+
} else {
|
|
52941
|
+
var x$27 = $m_Lio_kaitai_struct_datatype_DataType$KaitaiStructType$();
|
|
52942
|
+
if ((x$27 === x1)) {
|
|
52943
|
+
var $$x8 = true
|
|
52944
|
+
} else {
|
|
52945
|
+
var $$x8 = (x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$CalcKaitaiStructType)
|
|
52946
|
+
}
|
|
52947
|
+
};
|
|
52948
|
+
if ($$x8) {
|
|
52949
|
+
return "*anyopaque"
|
|
52950
|
+
};
|
|
52951
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$UserType)) {
|
|
52952
|
+
var x66 = $as_Lio_kaitai_struct_datatype_DataType$UserType(x1);
|
|
52953
|
+
var isExternal = $n(x66).isExternal__Lio_kaitai_struct_format_ClassSpec__Z(curClass);
|
|
52954
|
+
if (isExternal) {
|
|
52955
|
+
this.externalTypeDeclaration__Lio_kaitai_struct_ExternalType__Lio_kaitai_struct_ImportList__V(new $c_Lio_kaitai_struct_ExternalUserType($as_Lio_kaitai_struct_format_ClassSpec($n($n(x66).Lio_kaitai_struct_datatype_DataType$UserType__f_classSpec).get__O())), importList)
|
|
52956
|
+
};
|
|
52957
|
+
return ("*" + this.types2class__sci_List__Z__T($n(x66).Lio_kaitai_struct_datatype_DataType$UserType__f_name, isExternal))
|
|
52958
|
+
};
|
|
52959
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$EnumType)) {
|
|
52960
|
+
var x67 = $as_Lio_kaitai_struct_datatype_DataType$EnumType(x1);
|
|
52961
|
+
var isExternal$2 = $n(x67).isExternal__Lio_kaitai_struct_format_ClassSpec__Z(curClass);
|
|
52962
|
+
if (isExternal$2) {
|
|
52963
|
+
this.externalTypeDeclaration__Lio_kaitai_struct_ExternalType__Lio_kaitai_struct_ImportList__V(new $c_Lio_kaitai_struct_ExternalEnum($as_Lio_kaitai_struct_format_EnumSpec($n($n(x67).Lio_kaitai_struct_datatype_DataType$EnumType__f_enumSpec).get__O())), importList)
|
|
52964
|
+
};
|
|
52965
|
+
return this.types2class__sci_List__Z__T($n(x67).Lio_kaitai_struct_datatype_DataType$EnumType__f_name, isExternal$2)
|
|
52966
|
+
};
|
|
52967
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$ArrayType)) {
|
|
52968
|
+
var x68 = $as_Lio_kaitai_struct_datatype_DataType$ArrayType(x1);
|
|
52969
|
+
return (("*std.ArrayList(" + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T($n(x68).Lio_kaitai_struct_datatype_DataType$ArrayType__f_elType, importList, curClass)) + ")")
|
|
52970
|
+
};
|
|
52971
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$SwitchType)) {
|
|
52972
|
+
var x69 = $as_Lio_kaitai_struct_datatype_DataType$SwitchType(x1);
|
|
52973
|
+
attrType = $n(x69).combinedType__Lio_kaitai_struct_datatype_DataType();
|
|
52974
|
+
continue
|
|
52975
|
+
};
|
|
52976
|
+
throw new $c_s_MatchError(x1)
|
|
52977
|
+
}
|
|
52978
|
+
});
|
|
52979
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__Z__T = (function(attrType, importList, curClass, isNullable) {
|
|
52980
|
+
var nonNullable = this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T(attrType, importList, curClass);
|
|
52981
|
+
return (isNullable ? ("?" + nonNullable) : nonNullable)
|
|
52982
|
+
});
|
|
52983
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype.types2class__sci_List__Z__T = (function(name, isExternal) {
|
|
52984
|
+
var prefix = (isExternal ? ($n(name).head__O() + ".") : "");
|
|
52985
|
+
var this$3 = $n(name);
|
|
52986
|
+
var f = ((x$2) => {
|
|
52987
|
+
var x = $as_T(x$2);
|
|
52988
|
+
return $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(x)
|
|
52989
|
+
});
|
|
52990
|
+
if ((this$3 === $m_sci_Nil$())) {
|
|
52991
|
+
var $$x1 = $m_sci_Nil$()
|
|
52992
|
+
} else {
|
|
52993
|
+
var arg1 = this$3.head__O();
|
|
52994
|
+
var h = new $c_sci_$colon$colon(f(arg1), $m_sci_Nil$());
|
|
52995
|
+
var t = h;
|
|
52996
|
+
var rest = $as_sci_List(this$3.tail__O());
|
|
52997
|
+
while ((rest !== $m_sci_Nil$())) {
|
|
52998
|
+
var arg1$1 = $n(rest).head__O();
|
|
52999
|
+
var nx = new $c_sci_$colon$colon(f(arg1$1), $m_sci_Nil$());
|
|
53000
|
+
$n(t).sci_$colon$colon__f_next = nx;
|
|
53001
|
+
t = nx;
|
|
53002
|
+
rest = $as_sci_List($n(rest).tail__O())
|
|
53003
|
+
};
|
|
53004
|
+
var $$x1 = h
|
|
53005
|
+
};
|
|
53006
|
+
var this$4 = $n($$x1);
|
|
53007
|
+
return (prefix + $f_sc_IterableOnceOps__mkString__T__T__T__T(this$4, "", ".", ""))
|
|
53008
|
+
});
|
|
53009
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype.externalTypeDeclaration__Lio_kaitai_struct_ExternalType__Lio_kaitai_struct_ImportList__V = (function(extType, importList) {
|
|
53010
|
+
var moduleName = $as_T($n($n(extType).name__sci_List()).head__O());
|
|
53011
|
+
var this$1 = $n(importList);
|
|
53012
|
+
var s = (((("const " + moduleName) + " = @import(\"") + moduleName) + ".zig\");");
|
|
53013
|
+
$m_Lio_kaitai_struct_Utils$().addUniqueAttr__scm_ListBuffer__O__V(this$1.Lio_kaitai_struct_ImportList__f_list, s)
|
|
53014
|
+
});
|
|
53015
|
+
var $d_Lio_kaitai_struct_languages_ZigCompiler$ = new $TypeData().initClass({
|
|
53016
|
+
Lio_kaitai_struct_languages_ZigCompiler$: 0
|
|
53017
|
+
}, false, "io.kaitai.struct.languages.ZigCompiler$", {
|
|
53018
|
+
Lio_kaitai_struct_languages_ZigCompiler$: 1,
|
|
53019
|
+
O: 1,
|
|
53020
|
+
Lio_kaitai_struct_languages_components_LanguageCompilerStatic: 1,
|
|
53021
|
+
Lio_kaitai_struct_languages_components_UpperCamelCaseClasses: 1,
|
|
53022
|
+
Lio_kaitai_struct_languages_components_StreamStructNames: 1
|
|
53023
|
+
});
|
|
53024
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler$.prototype.$classData = $d_Lio_kaitai_struct_languages_ZigCompiler$;
|
|
53025
|
+
var $n_Lio_kaitai_struct_languages_ZigCompiler$;
|
|
53026
|
+
function $m_Lio_kaitai_struct_languages_ZigCompiler$() {
|
|
53027
|
+
if ((!$n_Lio_kaitai_struct_languages_ZigCompiler$)) {
|
|
53028
|
+
$n_Lio_kaitai_struct_languages_ZigCompiler$ = new $c_Lio_kaitai_struct_languages_ZigCompiler$()
|
|
53029
|
+
};
|
|
53030
|
+
return $n_Lio_kaitai_struct_languages_ZigCompiler$
|
|
53031
|
+
}
|
|
52697
53032
|
function $f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__attrParse2__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__T__Lio_kaitai_struct_format_RepeatSpec__Z__s_Option__s_Option__V($thiz, id, dataType, io, rep, isRaw, defEndian, assignTypeOpt) {
|
|
52698
53033
|
var this$1 = $n(assignTypeOpt);
|
|
52699
53034
|
var assignType = $as_Lio_kaitai_struct_datatype_DataType((this$1.isEmpty__Z() ? dataType : this$1.get__O()));
|
|
@@ -66630,7 +66965,7 @@ function $f_Lio_kaitai_struct_languages_components_GoReads__attrSwitchTypeParse_
|
|
|
66630
66965
|
var p5 = $as_s_Option($n(x1)._1__O());
|
|
66631
66966
|
var x$1 = $m_s_None$();
|
|
66632
66967
|
if ((x$1 === p5)) {
|
|
66633
|
-
var someNormalCases =
|
|
66968
|
+
var someNormalCases = $n(cases).exists__F1__Z(new $c_sjsr_AnonFunction1(((x0$1$2$2) => {
|
|
66634
66969
|
var x0$1$3 = $as_T2(x0$1$2$2);
|
|
66635
66970
|
if ((x0$1$3 !== null)) {
|
|
66636
66971
|
var caseExpr = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x0$1$3)._1__O());
|
|
@@ -66639,7 +66974,7 @@ function $f_Lio_kaitai_struct_languages_components_GoReads__attrSwitchTypeParse_
|
|
|
66639
66974
|
} else {
|
|
66640
66975
|
throw new $c_s_MatchError(x0$1$3)
|
|
66641
66976
|
}
|
|
66642
|
-
})))
|
|
66977
|
+
})));
|
|
66643
66978
|
if (someNormalCases) {
|
|
66644
66979
|
$thiz.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V(id, on);
|
|
66645
66980
|
var first = new $c_sr_BooleanRef(true);
|
|
@@ -67011,6 +67346,9 @@ $c_Lio_kaitai_struct_languages_components_LanguageCompiler.prototype.instanceSet
|
|
|
67011
67346
|
$c_Lio_kaitai_struct_languages_components_LanguageCompiler.prototype.instanceEnabledSetter__Lio_kaitai_struct_format_InstanceIdentifier__V = (function(instName) {
|
|
67012
67347
|
$m_s_Predef$().$qmark$qmark$qmark__E()
|
|
67013
67348
|
});
|
|
67349
|
+
$c_Lio_kaitai_struct_languages_components_LanguageCompiler.prototype.instanceTempVarDeclaration__Lio_kaitai_struct_datatype_DataType__Z__V = (function(dataType, isNullable) {
|
|
67350
|
+
/*<skip>*/
|
|
67351
|
+
});
|
|
67014
67352
|
$c_Lio_kaitai_struct_languages_components_LanguageCompiler.prototype.instanceInvalidate__Lio_kaitai_struct_format_InstanceIdentifier__V = (function(instName) {
|
|
67015
67353
|
$m_s_Predef$().$qmark$qmark$qmark__E()
|
|
67016
67354
|
});
|
|
@@ -71275,6 +71613,40 @@ function $asArrayOf_sc_SetOps(obj, depth) {
|
|
|
71275
71613
|
return (($isArrayOf_sc_SetOps(obj, depth) || (obj === null)) ? obj : $throwArrayCastException(obj, "Lscala.collection.SetOps;", depth))
|
|
71276
71614
|
}
|
|
71277
71615
|
/** @constructor */
|
|
71616
|
+
function $c_sc_Stepper$$anon$1(outer) {
|
|
71617
|
+
this.sc_Stepper$$anon$1__f_$outer = null;
|
|
71618
|
+
if ((outer === null)) {
|
|
71619
|
+
$n(null)
|
|
71620
|
+
} else {
|
|
71621
|
+
this.sc_Stepper$$anon$1__f_$outer = outer
|
|
71622
|
+
}
|
|
71623
|
+
}
|
|
71624
|
+
$c_sc_Stepper$$anon$1.prototype = new $h_sc_AbstractIterator();
|
|
71625
|
+
$c_sc_Stepper$$anon$1.prototype.constructor = $c_sc_Stepper$$anon$1;
|
|
71626
|
+
/** @constructor */
|
|
71627
|
+
function $h_sc_Stepper$$anon$1() {
|
|
71628
|
+
/*<skip>*/
|
|
71629
|
+
}
|
|
71630
|
+
$h_sc_Stepper$$anon$1.prototype = $c_sc_Stepper$$anon$1.prototype;
|
|
71631
|
+
$c_sc_Stepper$$anon$1.prototype.hasNext__Z = (function() {
|
|
71632
|
+
return $n(this.sc_Stepper$$anon$1__f_$outer).hasStep__Z()
|
|
71633
|
+
});
|
|
71634
|
+
$c_sc_Stepper$$anon$1.prototype.next__O = (function() {
|
|
71635
|
+
var this$1 = $n(this.sc_Stepper$$anon$1__f_$outer);
|
|
71636
|
+
return this$1.nextStep$mcI$sp__I()
|
|
71637
|
+
});
|
|
71638
|
+
var $d_sc_Stepper$$anon$1 = new $TypeData().initClass({
|
|
71639
|
+
sc_Stepper$$anon$1: 0
|
|
71640
|
+
}, false, "scala.collection.Stepper$$anon$1", {
|
|
71641
|
+
sc_Stepper$$anon$1: 1,
|
|
71642
|
+
sc_AbstractIterator: 1,
|
|
71643
|
+
O: 1,
|
|
71644
|
+
sc_Iterator: 1,
|
|
71645
|
+
sc_IterableOnce: 1,
|
|
71646
|
+
sc_IterableOnceOps: 1
|
|
71647
|
+
});
|
|
71648
|
+
$c_sc_Stepper$$anon$1.prototype.$classData = $d_sc_Stepper$$anon$1;
|
|
71649
|
+
/** @constructor */
|
|
71278
71650
|
function $c_sc_StrictOptimizedLinearSeqOps$$anon$1(outer) {
|
|
71279
71651
|
this.sc_StrictOptimizedLinearSeqOps$$anon$1__f_current = null;
|
|
71280
71652
|
this.sc_StrictOptimizedLinearSeqOps$$anon$1__f_current = outer
|
|
@@ -71474,6 +71846,45 @@ var $d_sc_View$DropRightIterator = new $TypeData().initClass({
|
|
|
71474
71846
|
sc_IterableOnceOps: 1
|
|
71475
71847
|
});
|
|
71476
71848
|
$c_sc_View$DropRightIterator.prototype.$classData = $d_sc_View$DropRightIterator;
|
|
71849
|
+
/** @constructor */
|
|
71850
|
+
function $c_sc_convert_impl_CodePointStringStepper(underlying, i0, iN) {
|
|
71851
|
+
this.sc_convert_impl_CodePointStringStepper__f_scala$collection$convert$impl$CodePointStringStepper$$underlying = null;
|
|
71852
|
+
this.sc_convert_impl_CodePointStringStepper__f_scala$collection$convert$impl$CodePointStringStepper$$i0 = 0;
|
|
71853
|
+
this.sc_convert_impl_CodePointStringStepper__f_iN = 0;
|
|
71854
|
+
this.sc_convert_impl_CodePointStringStepper__f_scala$collection$convert$impl$CodePointStringStepper$$underlying = underlying;
|
|
71855
|
+
this.sc_convert_impl_CodePointStringStepper__f_scala$collection$convert$impl$CodePointStringStepper$$i0 = i0;
|
|
71856
|
+
this.sc_convert_impl_CodePointStringStepper__f_iN = iN
|
|
71857
|
+
}
|
|
71858
|
+
$c_sc_convert_impl_CodePointStringStepper.prototype = new $h_O();
|
|
71859
|
+
$c_sc_convert_impl_CodePointStringStepper.prototype.constructor = $c_sc_convert_impl_CodePointStringStepper;
|
|
71860
|
+
/** @constructor */
|
|
71861
|
+
function $h_sc_convert_impl_CodePointStringStepper() {
|
|
71862
|
+
/*<skip>*/
|
|
71863
|
+
}
|
|
71864
|
+
$h_sc_convert_impl_CodePointStringStepper.prototype = $c_sc_convert_impl_CodePointStringStepper.prototype;
|
|
71865
|
+
$c_sc_convert_impl_CodePointStringStepper.prototype.hasStep__Z = (function() {
|
|
71866
|
+
return (this.sc_convert_impl_CodePointStringStepper__f_scala$collection$convert$impl$CodePointStringStepper$$i0 < this.sc_convert_impl_CodePointStringStepper__f_iN)
|
|
71867
|
+
});
|
|
71868
|
+
$c_sc_convert_impl_CodePointStringStepper.prototype.nextStep$mcI$sp__I = (function() {
|
|
71869
|
+
if (this.hasStep__Z()) {
|
|
71870
|
+
var cp = $f_T__codePointAt__I__I($n(this.sc_convert_impl_CodePointStringStepper__f_scala$collection$convert$impl$CodePointStringStepper$$underlying), this.sc_convert_impl_CodePointStringStepper__f_scala$collection$convert$impl$CodePointStringStepper$$i0);
|
|
71871
|
+
this.sc_convert_impl_CodePointStringStepper__f_scala$collection$convert$impl$CodePointStringStepper$$i0 = ((this.sc_convert_impl_CodePointStringStepper__f_scala$collection$convert$impl$CodePointStringStepper$$i0 + ((cp >= 65536) ? 2 : 1)) | 0);
|
|
71872
|
+
return cp
|
|
71873
|
+
} else {
|
|
71874
|
+
$m_sc_Stepper$().throwNSEE__E()
|
|
71875
|
+
}
|
|
71876
|
+
});
|
|
71877
|
+
var $d_sc_convert_impl_CodePointStringStepper = new $TypeData().initClass({
|
|
71878
|
+
sc_convert_impl_CodePointStringStepper: 0
|
|
71879
|
+
}, false, "scala.collection.convert.impl.CodePointStringStepper", {
|
|
71880
|
+
sc_convert_impl_CodePointStringStepper: 1,
|
|
71881
|
+
O: 1,
|
|
71882
|
+
sc_IntStepper: 1,
|
|
71883
|
+
sc_Stepper$mcI$sp: 1,
|
|
71884
|
+
sc_Stepper: 1,
|
|
71885
|
+
sc_Stepper$EfficientSplit: 1
|
|
71886
|
+
});
|
|
71887
|
+
$c_sc_convert_impl_CodePointStringStepper.prototype.$classData = $d_sc_convert_impl_CodePointStringStepper;
|
|
71477
71888
|
function $p_sci_HashMapBuilder__isAliased__Z($thiz) {
|
|
71478
71889
|
return ($thiz.sci_HashMapBuilder__f_aliased !== null)
|
|
71479
71890
|
}
|
|
@@ -86567,6 +86978,9 @@ $c_Lio_kaitai_struct_translators_BaseTranslator.prototype.doIntLiteral__s_math_B
|
|
|
86567
86978
|
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.doStringLiteral__T__T = (function(s) {
|
|
86568
86979
|
return $f_Lio_kaitai_struct_translators_CommonLiterals__doStringLiteral__T__T(this, s)
|
|
86569
86980
|
});
|
|
86981
|
+
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.doStringLiteralBody__T__T = (function(s) {
|
|
86982
|
+
return $f_Lio_kaitai_struct_translators_CommonLiterals__doStringLiteralBody__T__T(this, s)
|
|
86983
|
+
});
|
|
86570
86984
|
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.doBoolLiteral__Z__T = (function(n) {
|
|
86571
86985
|
return ("" + n)
|
|
86572
86986
|
});
|
|
@@ -86867,6 +87281,9 @@ $c_Lio_kaitai_struct_translators_BaseTranslator.prototype.doLocalName__T__T = (f
|
|
|
86867
87281
|
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.doInternalName__Lio_kaitai_struct_format_Identifier__T = (function(id) {
|
|
86868
87282
|
$m_s_Predef$().$qmark$qmark$qmark__E()
|
|
86869
87283
|
});
|
|
87284
|
+
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.userTypeField__Lio_kaitai_struct_datatype_DataType$UserType__Lio_kaitai_struct_exprlang_Ast$expr__T__T = (function(userType, value, attrName) {
|
|
87285
|
+
return this.anyField__Lio_kaitai_struct_exprlang_Ast$expr__T__T(value, attrName)
|
|
87286
|
+
});
|
|
86870
87287
|
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.strConcat__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__I__T = (function(left, right, extPrec) {
|
|
86871
87288
|
return this.genericBinOp__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$binaryop__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, $m_Lio_kaitai_struct_exprlang_Ast$operator$Add$(), right, extPrec)
|
|
86872
87289
|
});
|
|
@@ -86931,7 +87348,7 @@ $c_Lio_kaitai_struct_translators_BaseTranslator.prototype.kaitaiStructField__Lio
|
|
|
86931
87348
|
return this.anyField__Lio_kaitai_struct_exprlang_Ast$expr__T__T(value, name)
|
|
86932
87349
|
});
|
|
86933
87350
|
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.userTypeField__Lio_kaitai_struct_datatype_DataType$UserType__Lio_kaitai_struct_exprlang_Ast$expr__T__O = (function(ut, value, name) {
|
|
86934
|
-
return this.
|
|
87351
|
+
return this.userTypeField__Lio_kaitai_struct_datatype_DataType$UserType__Lio_kaitai_struct_exprlang_Ast$expr__T__T(ut, value, name)
|
|
86935
87352
|
});
|
|
86936
87353
|
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.doArrayLiteral__Lio_kaitai_struct_datatype_DataType__sci_Seq__O = (function(t, value) {
|
|
86937
87354
|
return this.doArrayLiteral__Lio_kaitai_struct_datatype_DataType__sci_Seq__T(t, value)
|
|
@@ -87107,6 +87524,9 @@ $c_Lio_kaitai_struct_translators_GoTranslator.prototype.cmpOp__Lio_kaitai_struct
|
|
|
87107
87524
|
$c_Lio_kaitai_struct_translators_GoTranslator.prototype.booleanOp__Lio_kaitai_struct_exprlang_Ast$boolop__T = (function(op) {
|
|
87108
87525
|
return $f_Lio_kaitai_struct_translators_CommonOps__booleanOp__Lio_kaitai_struct_exprlang_Ast$boolop__T(this, op)
|
|
87109
87526
|
});
|
|
87527
|
+
$c_Lio_kaitai_struct_translators_GoTranslator.prototype.doStringLiteralBody__T__T = (function(s) {
|
|
87528
|
+
return $f_Lio_kaitai_struct_translators_CommonLiterals__doStringLiteralBody__T__T(this, s)
|
|
87529
|
+
});
|
|
87110
87530
|
$c_Lio_kaitai_struct_translators_GoTranslator.prototype.strLiteralGenericCC__C__T = (function(code) {
|
|
87111
87531
|
return $f_Lio_kaitai_struct_translators_CommonLiterals__strLiteralGenericCC__C__T(this, code)
|
|
87112
87532
|
});
|
|
@@ -91105,7 +91525,8 @@ $c_Lio_kaitai_struct_translators_PythonTranslator.prototype.doEnumByLabel__Lio_k
|
|
|
91105
91525
|
return (($m_Lio_kaitai_struct_languages_PythonCompiler$().types2class__sci_List__Z__T($n(enumSpec).Lio_kaitai_struct_format_EnumSpec__f_name, isExternal) + ".") + label)
|
|
91106
91526
|
});
|
|
91107
91527
|
$c_Lio_kaitai_struct_translators_PythonTranslator.prototype.doEnumById__Lio_kaitai_struct_format_EnumSpec__T__T = (function(enumSpec, id) {
|
|
91108
|
-
|
|
91528
|
+
var isExternal = $n(enumSpec).isExternal__Lio_kaitai_struct_format_ClassSpec__Z($n(this.Lio_kaitai_struct_translators_BaseTranslator__f_provider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass);
|
|
91529
|
+
return (((("KaitaiStream.resolve_enum(" + $m_Lio_kaitai_struct_languages_PythonCompiler$().types2class__sci_List__Z__T($n(enumSpec).Lio_kaitai_struct_format_EnumSpec__f_name, isExternal)) + ", ") + id) + ")")
|
|
91109
91530
|
});
|
|
91110
91531
|
$c_Lio_kaitai_struct_translators_PythonTranslator.prototype.booleanOp__Lio_kaitai_struct_exprlang_Ast$boolop__T = (function(op) {
|
|
91111
91532
|
var x = $m_Lio_kaitai_struct_exprlang_Ast$boolop$Or$();
|
|
@@ -92470,6 +92891,419 @@ var $d_Lio_kaitai_struct_translators_RustTranslator = new $TypeData().initClass(
|
|
|
92470
92891
|
});
|
|
92471
92892
|
$c_Lio_kaitai_struct_translators_RustTranslator.prototype.$classData = $d_Lio_kaitai_struct_translators_RustTranslator;
|
|
92472
92893
|
/** @constructor */
|
|
92894
|
+
function $c_Lio_kaitai_struct_translators_ZigTranslator(provider, importList, config) {
|
|
92895
|
+
this.Lio_kaitai_struct_translators_TypeDetector__f_provider = null;
|
|
92896
|
+
this.Lio_kaitai_struct_translators_BaseTranslator__f_provider = null;
|
|
92897
|
+
this.Lio_kaitai_struct_translators_BaseTranslator__f_inSubIOWriteBackHandler = false;
|
|
92898
|
+
this.Lio_kaitai_struct_translators_BaseTranslator__f_METHODS_BY_TYPE = null;
|
|
92899
|
+
this.Lio_kaitai_struct_translators_BaseTranslator__f_OPERATOR_PRECEDENCE = null;
|
|
92900
|
+
this.Lio_kaitai_struct_translators_BaseTranslator__f_asciiCharQuoteMap = null;
|
|
92901
|
+
this.Lio_kaitai_struct_translators_ZigTranslator__f_importList = null;
|
|
92902
|
+
this.Lio_kaitai_struct_translators_ZigTranslator__f_OPERATOR_PRECEDENCE = null;
|
|
92903
|
+
this.Lio_kaitai_struct_translators_ZigTranslator__f_asciiCharQuoteMap = null;
|
|
92904
|
+
this.Lio_kaitai_struct_translators_ZigTranslator__f_importList = importList;
|
|
92905
|
+
$ct_Lio_kaitai_struct_translators_BaseTranslator__Lio_kaitai_struct_translators_TypeProvider__(this, provider);
|
|
92906
|
+
var this$36 = $n($m_s_Predef$().s_Predef$__f_Map);
|
|
92907
|
+
var self = $m_Lio_kaitai_struct_exprlang_Ast$operator$Mult$();
|
|
92908
|
+
var $$x15 = $ct_T2__O__O__(new $c_T2(), self, 130);
|
|
92909
|
+
var self$1 = $m_Lio_kaitai_struct_exprlang_Ast$operator$Div$();
|
|
92910
|
+
var $$x14 = $ct_T2__O__O__(new $c_T2(), self$1, 130);
|
|
92911
|
+
var self$2 = $m_Lio_kaitai_struct_exprlang_Ast$operator$Mod$();
|
|
92912
|
+
var $$x13 = $ct_T2__O__O__(new $c_T2(), self$2, 130);
|
|
92913
|
+
var self$3 = $m_Lio_kaitai_struct_exprlang_Ast$operator$Add$();
|
|
92914
|
+
var $$x12 = $ct_T2__O__O__(new $c_T2(), self$3, 120);
|
|
92915
|
+
var self$4 = $m_Lio_kaitai_struct_exprlang_Ast$operator$Sub$();
|
|
92916
|
+
var $$x11 = $ct_T2__O__O__(new $c_T2(), self$4, 120);
|
|
92917
|
+
var self$5 = $m_Lio_kaitai_struct_exprlang_Ast$operator$LShift$();
|
|
92918
|
+
var $$x10 = $ct_T2__O__O__(new $c_T2(), self$5, 110);
|
|
92919
|
+
var self$6 = $m_Lio_kaitai_struct_exprlang_Ast$operator$RShift$();
|
|
92920
|
+
var $$x9 = $ct_T2__O__O__(new $c_T2(), self$6, 110);
|
|
92921
|
+
var self$7 = $m_Lio_kaitai_struct_exprlang_Ast$operator$BitAnd$();
|
|
92922
|
+
var $$x8 = $ct_T2__O__O__(new $c_T2(), self$7, 100);
|
|
92923
|
+
var self$8 = $m_Lio_kaitai_struct_exprlang_Ast$operator$BitXor$();
|
|
92924
|
+
var $$x7 = $ct_T2__O__O__(new $c_T2(), self$8, 100);
|
|
92925
|
+
var self$9 = $m_Lio_kaitai_struct_exprlang_Ast$operator$BitOr$();
|
|
92926
|
+
var $$x6 = $ct_T2__O__O__(new $c_T2(), self$9, 100);
|
|
92927
|
+
var self$10 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$Lt$();
|
|
92928
|
+
var $$x5 = $ct_T2__O__O__(new $c_T2(), self$10, 90);
|
|
92929
|
+
var self$11 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$LtE$();
|
|
92930
|
+
var $$x4 = $ct_T2__O__O__(new $c_T2(), self$11, 90);
|
|
92931
|
+
var self$12 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$Gt$();
|
|
92932
|
+
var $$x3 = $ct_T2__O__O__(new $c_T2(), self$12, 90);
|
|
92933
|
+
var self$13 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$GtE$();
|
|
92934
|
+
var $$x2 = $ct_T2__O__O__(new $c_T2(), self$13, 90);
|
|
92935
|
+
var self$14 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$Eq$();
|
|
92936
|
+
var $$x1 = $ct_T2__O__O__(new $c_T2(), self$14, 90);
|
|
92937
|
+
var self$15 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$NotEq$();
|
|
92938
|
+
var array = [$$x15, $$x14, $$x13, $$x12, $$x11, $$x10, $$x9, $$x8, $$x7, $$x6, $$x5, $$x4, $$x3, $$x2, $$x1, $ct_T2__O__O__(new $c_T2(), self$15, 90)];
|
|
92939
|
+
var elems = $ct_sjsr_WrappedVarArgs__sjs_js_Array__(new $c_sjsr_WrappedVarArgs(), array);
|
|
92940
|
+
this.Lio_kaitai_struct_translators_ZigTranslator__f_OPERATOR_PRECEDENCE = this$36.from__sc_IterableOnce__sci_Map(elems);
|
|
92941
|
+
var this$50 = $n($m_s_Predef$().s_Predef$__f_Map);
|
|
92942
|
+
var array$1 = [$ct_T2__O__O__(new $c_T2(), $bC(10), "\\n"), $ct_T2__O__O__(new $c_T2(), $bC(13), "\\r"), $ct_T2__O__O__(new $c_T2(), $bC(9), "\\t"), $ct_T2__O__O__(new $c_T2(), $bC(92), "\\\\"), $ct_T2__O__O__(new $c_T2(), $bC(34), "\\\"")];
|
|
92943
|
+
var elems$1 = $ct_sjsr_WrappedVarArgs__sjs_js_Array__(new $c_sjsr_WrappedVarArgs(), array$1);
|
|
92944
|
+
this.Lio_kaitai_struct_translators_ZigTranslator__f_asciiCharQuoteMap = this$50.from__sc_IterableOnce__sci_Map(elems$1)
|
|
92945
|
+
}
|
|
92946
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype = new $h_Lio_kaitai_struct_translators_BaseTranslator();
|
|
92947
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.constructor = $c_Lio_kaitai_struct_translators_ZigTranslator;
|
|
92948
|
+
/** @constructor */
|
|
92949
|
+
function $h_Lio_kaitai_struct_translators_ZigTranslator() {
|
|
92950
|
+
/*<skip>*/
|
|
92951
|
+
}
|
|
92952
|
+
$h_Lio_kaitai_struct_translators_ZigTranslator.prototype = $c_Lio_kaitai_struct_translators_ZigTranslator.prototype;
|
|
92953
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.OPERATOR_PRECEDENCE__sci_Map = (function() {
|
|
92954
|
+
return this.Lio_kaitai_struct_translators_ZigTranslator__f_OPERATOR_PRECEDENCE
|
|
92955
|
+
});
|
|
92956
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doArrayLiteral__Lio_kaitai_struct_datatype_DataType__sci_Seq__T = (function(t, value) {
|
|
92957
|
+
var nativeType = $m_Lio_kaitai_struct_languages_ZigCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T(t, this.Lio_kaitai_struct_translators_ZigTranslator__f_importList, $n(this.Lio_kaitai_struct_translators_BaseTranslator__f_provider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass);
|
|
92958
|
+
var this$2 = $n($as_sc_IterableOnceOps($n(value).map__F1__O(new $c_sjsr_AnonFunction1(((v$2) => {
|
|
92959
|
+
var v = $as_Lio_kaitai_struct_exprlang_Ast$expr(v$2);
|
|
92960
|
+
return this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(v, 0)
|
|
92961
|
+
})))));
|
|
92962
|
+
var commaStr = $f_sc_IterableOnceOps__mkString__T__T__T__T(this$2, "", ", ", "");
|
|
92963
|
+
return (((((((("std.ArrayList(" + nativeType) + "){ .items = @constCast(@as([]const ") + nativeType) + ", &.{ ") + commaStr) + " })), .capacity = ") + $n(value).length__I()) + " }")
|
|
92964
|
+
});
|
|
92965
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doByteArrayLiteral__sci_Seq__T = (function(arr) {
|
|
92966
|
+
var this$2 = $n($as_sc_IterableOnceOps($n(arr).map__F1__O(new $c_sjsr_AnonFunction1(((x$1$2) => {
|
|
92967
|
+
var x$1 = $uB(x$1$2);
|
|
92968
|
+
return (255 & x$1)
|
|
92969
|
+
})))));
|
|
92970
|
+
return (("&[_]u8{ " + $f_sc_IterableOnceOps__mkString__T__T__T__T(this$2, "", ", ", "")) + " }")
|
|
92971
|
+
});
|
|
92972
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doByteArrayNonLiteral__sci_Seq__T = (function(elts) {
|
|
92973
|
+
var this$2 = $n($as_sc_IterableOnceOps($n(elts).map__F1__O(new $c_sjsr_AnonFunction1(((v$2) => {
|
|
92974
|
+
var v = $as_Lio_kaitai_struct_exprlang_Ast$expr(v$2);
|
|
92975
|
+
return this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(v, 0)
|
|
92976
|
+
})))));
|
|
92977
|
+
return (("&[_]u8{ " + $f_sc_IterableOnceOps__mkString__T__T__T__T(this$2, "", ", ", "")) + " }")
|
|
92978
|
+
});
|
|
92979
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.asciiCharQuoteMap__sci_Map = (function() {
|
|
92980
|
+
return this.Lio_kaitai_struct_translators_ZigTranslator__f_asciiCharQuoteMap
|
|
92981
|
+
});
|
|
92982
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doStringLiteralBody__T__T = (function(s) {
|
|
92983
|
+
$m_sc_StringOps$();
|
|
92984
|
+
var this$3 = $n(s);
|
|
92985
|
+
var this$4 = new $c_sc_convert_impl_CodePointStringStepper(s, 0, this$3.length);
|
|
92986
|
+
var this$10 = new $c_sc_Stepper$$anon$1(this$4);
|
|
92987
|
+
var f = new $c_sjsr_AnonFunction1(((code$2) => {
|
|
92988
|
+
var code = $uI(code$2);
|
|
92989
|
+
if ((code <= 255)) {
|
|
92990
|
+
var code$1 = (65535 & code);
|
|
92991
|
+
return $f_Lio_kaitai_struct_translators_CommonLiterals__strLiteralAsciiChar__C__T(this, code$1)
|
|
92992
|
+
} else {
|
|
92993
|
+
var $$x1 = $m_sc_StringOps$();
|
|
92994
|
+
var array = [code];
|
|
92995
|
+
return $n($$x1).format$extension__T__sci_Seq__T("\\u{%04x}", $ct_sjsr_WrappedVarArgs__sjs_js_Array__(new $c_sjsr_WrappedVarArgs(), array))
|
|
92996
|
+
}
|
|
92997
|
+
}));
|
|
92998
|
+
var this$11 = new $c_sc_Iterator$$anon$9(this$10, f);
|
|
92999
|
+
return $f_sc_IterableOnceOps__mkString__T__T__T__T(this$11, "", "", "")
|
|
93000
|
+
});
|
|
93001
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.strLiteralGenericCC__C__T = (function(code) {
|
|
93002
|
+
var $$x1 = $m_sc_StringOps$();
|
|
93003
|
+
var array = [code];
|
|
93004
|
+
return $n($$x1).format$extension__T__sci_Seq__T("\\u{%04x}", $ct_sjsr_WrappedVarArgs__sjs_js_Array__(new $c_sjsr_WrappedVarArgs(), array))
|
|
93005
|
+
});
|
|
93006
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.genericBinOp__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$binaryop__Lio_kaitai_struct_exprlang_Ast$expr__I__T = (function(left, op, right, extPrec) {
|
|
93007
|
+
var _1 = this.detectType__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType(left);
|
|
93008
|
+
var _2 = this.detectType__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType(right);
|
|
93009
|
+
if ((_1 instanceof $c_Lio_kaitai_struct_datatype_DataType$IntType)) {
|
|
93010
|
+
if ((_2 instanceof $c_Lio_kaitai_struct_datatype_DataType$IntType)) {
|
|
93011
|
+
var x = $m_Lio_kaitai_struct_exprlang_Ast$operator$Mod$();
|
|
93012
|
+
var $$x1 = (x === op)
|
|
93013
|
+
} else {
|
|
93014
|
+
var $$x1 = false
|
|
93015
|
+
}
|
|
93016
|
+
} else {
|
|
93017
|
+
var $$x1 = false
|
|
93018
|
+
};
|
|
93019
|
+
if ($$x1) {
|
|
93020
|
+
return (((("kaitai_struct.KaitaiStream.mod(" + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, 0)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(right, 0)) + ")")
|
|
93021
|
+
} else {
|
|
93022
|
+
return $f_Lio_kaitai_struct_translators_CommonOps__genericBinOp__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$binaryop__Lio_kaitai_struct_exprlang_Ast$expr__I__T(this, left, op, right, extPrec)
|
|
93023
|
+
}
|
|
93024
|
+
});
|
|
93025
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doLocalName__T__T = (function(s) {
|
|
93026
|
+
if (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR === s)) {
|
|
93027
|
+
return "_it"
|
|
93028
|
+
} else if (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR2 === s)) {
|
|
93029
|
+
return "_buf"
|
|
93030
|
+
} else if (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_SWITCH_ON === s)) {
|
|
93031
|
+
return "_on"
|
|
93032
|
+
} else if (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_INDEX === s)) {
|
|
93033
|
+
return "i"
|
|
93034
|
+
} else if ((($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ROOT === s) || ($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_PARENT === s))) {
|
|
93035
|
+
return (("self." + s) + ".?")
|
|
93036
|
+
} else if (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_IO === s)) {
|
|
93037
|
+
return ("self." + s)
|
|
93038
|
+
} else {
|
|
93039
|
+
var this$1 = $n(this.Lio_kaitai_struct_translators_BaseTranslator__f_provider);
|
|
93040
|
+
if (this$1.isLazy__Lio_kaitai_struct_format_ClassSpec__T__Z(this$1.Lio_kaitai_struct_ClassTypeProvider__f_nowClass, s)) {
|
|
93041
|
+
return (("(try self." + $m_Lio_kaitai_struct_Utils$().lowerCamelCase__T__T(s)) + "())")
|
|
93042
|
+
} else {
|
|
93043
|
+
return ("self." + s)
|
|
93044
|
+
}
|
|
93045
|
+
}
|
|
93046
|
+
});
|
|
93047
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doName__T__T = (function(s) {
|
|
93048
|
+
return s
|
|
93049
|
+
});
|
|
93050
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doInternalName__Lio_kaitai_struct_format_Identifier__T = (function(id) {
|
|
93051
|
+
return $m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id)
|
|
93052
|
+
});
|
|
93053
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.userTypeField__Lio_kaitai_struct_datatype_DataType$UserType__Lio_kaitai_struct_exprlang_Ast$expr__T__T = (function(ut, value, name) {
|
|
93054
|
+
var valueStr = this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 0);
|
|
93055
|
+
if ((($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ROOT === name) || ($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_PARENT === name))) {
|
|
93056
|
+
return (((valueStr + ".") + name) + ".?")
|
|
93057
|
+
} else if (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_IO === name)) {
|
|
93058
|
+
return ((valueStr + ".") + name)
|
|
93059
|
+
} else {
|
|
93060
|
+
var isLazy = $n(this.Lio_kaitai_struct_translators_BaseTranslator__f_provider).isLazy__Lio_kaitai_struct_format_ClassSpec__T__Z($as_Lio_kaitai_struct_format_ClassSpec($n($n(ut).Lio_kaitai_struct_datatype_DataType$UserType__f_classSpec).get__O()), name);
|
|
93061
|
+
return (isLazy ? (((("(try " + valueStr) + ".") + $m_Lio_kaitai_struct_Utils$().lowerCamelCase__T__T(name)) + "())") : ((valueStr + ".") + name))
|
|
93062
|
+
}
|
|
93063
|
+
});
|
|
93064
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doEnumByLabel__Lio_kaitai_struct_format_EnumSpec__T__T = (function(enumSpec, label) {
|
|
93065
|
+
var et = new $c_Lio_kaitai_struct_datatype_DataType$EnumType($n(enumSpec).Lio_kaitai_struct_format_EnumSpec__f_name, $m_Lio_kaitai_struct_datatype_DataType$CalcIntType$());
|
|
93066
|
+
et.Lio_kaitai_struct_datatype_DataType$EnumType__f_enumSpec = new $c_s_Some(enumSpec);
|
|
93067
|
+
return (($m_Lio_kaitai_struct_languages_ZigCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T(et, this.Lio_kaitai_struct_translators_ZigTranslator__f_importList, $n(this.Lio_kaitai_struct_translators_BaseTranslator__f_provider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass) + ".") + label)
|
|
93068
|
+
});
|
|
93069
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doEnumById__Lio_kaitai_struct_format_EnumSpec__T__T = (function(enumSpec, id) {
|
|
93070
|
+
var et = new $c_Lio_kaitai_struct_datatype_DataType$EnumType($n(enumSpec).Lio_kaitai_struct_format_EnumSpec__f_name, $m_Lio_kaitai_struct_datatype_DataType$CalcIntType$());
|
|
93071
|
+
et.Lio_kaitai_struct_datatype_DataType$EnumType__f_enumSpec = new $c_s_Some(enumSpec);
|
|
93072
|
+
return (((("@as(" + $m_Lio_kaitai_struct_languages_ZigCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T(et, this.Lio_kaitai_struct_translators_ZigTranslator__f_importList, $n(this.Lio_kaitai_struct_translators_BaseTranslator__f_provider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass)) + ", @enumFromInt(") + id) + "))")
|
|
93073
|
+
});
|
|
93074
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doStrCompareOp__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$cmpop__Lio_kaitai_struct_exprlang_Ast$expr__I__T = (function(left, op, right, extPrec) {
|
|
93075
|
+
return this.doBytesCompareOp__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$cmpop__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, op, right, extPrec)
|
|
93076
|
+
});
|
|
93077
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doBytesCompareOp__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$cmpop__Lio_kaitai_struct_exprlang_Ast$expr__I__T = (function(left, op, right, extPrec) {
|
|
93078
|
+
var x = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$Eq$();
|
|
93079
|
+
if ((x === op)) {
|
|
93080
|
+
return (((("std.mem.eql(u8, " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, 0)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(right, 0)) + ")")
|
|
93081
|
+
} else {
|
|
93082
|
+
var x$3 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$NotEq$();
|
|
93083
|
+
if ((x$3 === op)) {
|
|
93084
|
+
return (((("!std.mem.eql(u8, " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, 0)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(right, 0)) + ")")
|
|
93085
|
+
} else {
|
|
93086
|
+
var x$5 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$Lt$();
|
|
93087
|
+
if ((x$5 === op)) {
|
|
93088
|
+
return (((("(std.mem.order(u8, " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, 0)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(right, 0)) + ") == .lt)")
|
|
93089
|
+
} else {
|
|
93090
|
+
var x$7 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$Gt$();
|
|
93091
|
+
if ((x$7 === op)) {
|
|
93092
|
+
return (((("(std.mem.order(u8, " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, 0)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(right, 0)) + ") == .gt)")
|
|
93093
|
+
} else {
|
|
93094
|
+
var x$9 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$LtE$();
|
|
93095
|
+
if ((x$9 === op)) {
|
|
93096
|
+
return (((("std.mem.order(u8, " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, 0)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(right, 0)) + ").compare(.lte)")
|
|
93097
|
+
} else {
|
|
93098
|
+
var x$11 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$GtE$();
|
|
93099
|
+
if ((x$11 === op)) {
|
|
93100
|
+
return (((("std.mem.order(u8, " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, 0)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(right, 0)) + ").compare(.gte)")
|
|
93101
|
+
} else {
|
|
93102
|
+
throw new $c_s_MatchError(op)
|
|
93103
|
+
}
|
|
93104
|
+
}
|
|
93105
|
+
}
|
|
93106
|
+
}
|
|
93107
|
+
}
|
|
93108
|
+
}
|
|
93109
|
+
});
|
|
93110
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.booleanOp__Lio_kaitai_struct_exprlang_Ast$boolop__T = (function(op) {
|
|
93111
|
+
var x = $m_Lio_kaitai_struct_exprlang_Ast$boolop$Or$();
|
|
93112
|
+
if ((x === op)) {
|
|
93113
|
+
return "or"
|
|
93114
|
+
} else {
|
|
93115
|
+
var x$3 = $m_Lio_kaitai_struct_exprlang_Ast$boolop$And$();
|
|
93116
|
+
if ((x$3 === op)) {
|
|
93117
|
+
return "and"
|
|
93118
|
+
} else {
|
|
93119
|
+
throw new $c_s_MatchError(op)
|
|
93120
|
+
}
|
|
93121
|
+
}
|
|
93122
|
+
});
|
|
93123
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arraySubscript__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(container, idx) {
|
|
93124
|
+
return (((this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(container, 0) + ".items[") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(idx, 0)) + "]")
|
|
93125
|
+
});
|
|
93126
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doIfExp__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(condition, ifTrue, ifFalse) {
|
|
93127
|
+
return (((((("(if (" + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(condition, 0)) + ") ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(ifTrue, 0)) + " else ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(ifFalse, 0)) + ")")
|
|
93128
|
+
});
|
|
93129
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__T = (function(value, typeName) {
|
|
93130
|
+
return (((("@as(" + $m_Lio_kaitai_struct_languages_ZigCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T(typeName, this.Lio_kaitai_struct_translators_ZigTranslator__f_importList, $n(this.Lio_kaitai_struct_translators_BaseTranslator__f_provider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 0)) + ")")
|
|
93131
|
+
});
|
|
93132
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.strConcat__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__I__T = (function(left, right, extPrec) {
|
|
93133
|
+
return (((("(try std.mem.concat(self._allocator(), u8, &[_][]const u8{ " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(left, 0)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(right, 0)) + " }))")
|
|
93134
|
+
});
|
|
93135
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.strToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(s, base) {
|
|
93136
|
+
return (((("(try std.fmt.parseInt(i32, " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(s, 0)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(base, 0)) + "))")
|
|
93137
|
+
});
|
|
93138
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.enumToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType$EnumType__T = (function(v, et) {
|
|
93139
|
+
return (("@intFromEnum(" + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(v, 0)) + ")")
|
|
93140
|
+
});
|
|
93141
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.floatToInt__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(v) {
|
|
93142
|
+
return (("@intFromFloat(" + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(v, 0)) + ")")
|
|
93143
|
+
});
|
|
93144
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.boolToInt__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(value) {
|
|
93145
|
+
return (("@intFromBool(" + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 0)) + ")")
|
|
93146
|
+
});
|
|
93147
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.intToStr__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(i) {
|
|
93148
|
+
return (("(try std.fmt.allocPrint(self._allocator(), \"{d}\", .{ " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(i, 0)) + " }))")
|
|
93149
|
+
});
|
|
93150
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesToStr__T__T__T = (function(bytesExpr, encoding) {
|
|
93151
|
+
return (((("kaitai_struct.KaitaiStream.bytesToStr(" + bytesExpr) + ", ") + $f_Lio_kaitai_struct_translators_CommonLiterals__doStringLiteral__T__T(this, encoding)) + ")")
|
|
93152
|
+
});
|
|
93153
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesLength__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(b) {
|
|
93154
|
+
return (this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(b, 999) + ".len")
|
|
93155
|
+
});
|
|
93156
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesSubscript__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(container, idx) {
|
|
93157
|
+
return (((this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(container, 999) + "[") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(idx, 0)) + "]")
|
|
93158
|
+
});
|
|
93159
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesFirst__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(b) {
|
|
93160
|
+
var this$1 = $m_s_math_BigInt$();
|
|
93161
|
+
return this.bytesSubscript__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T(b, new $c_Lio_kaitai_struct_exprlang_Ast$expr$IntNum(this$1.apply__I__s_math_BigInt(0)))
|
|
93162
|
+
});
|
|
93163
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesLast__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(b) {
|
|
93164
|
+
var $$x2 = new $c_Lio_kaitai_struct_exprlang_Ast$expr$Attribute(b, new $c_Lio_kaitai_struct_exprlang_Ast$identifier("length"));
|
|
93165
|
+
var $$x1 = $m_Lio_kaitai_struct_exprlang_Ast$operator$Sub$();
|
|
93166
|
+
var this$1 = $m_s_math_BigInt$();
|
|
93167
|
+
return this.bytesSubscript__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T(b, new $c_Lio_kaitai_struct_exprlang_Ast$expr$BinOp($$x2, $$x1, new $c_Lio_kaitai_struct_exprlang_Ast$expr$IntNum(this$1.apply__I__s_math_BigInt(1))))
|
|
93168
|
+
});
|
|
93169
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesMin__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(b) {
|
|
93170
|
+
return (("std.mem.min(u8, " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(b, 0)) + ")")
|
|
93171
|
+
});
|
|
93172
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesMax__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(b) {
|
|
93173
|
+
return (("std.mem.max(u8, " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(b, 0)) + ")")
|
|
93174
|
+
});
|
|
93175
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.strReverse__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(s) {
|
|
93176
|
+
return (("new StringBuilder(" + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(s, 0)) + ").reverse().toString()")
|
|
93177
|
+
});
|
|
93178
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.strSubstring__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(s, from, to) {
|
|
93179
|
+
return (((((this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(s, 999) + "[") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(from, 0)) + "..") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(to, 0)) + "]")
|
|
93180
|
+
});
|
|
93181
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arrayFirst__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(a) {
|
|
93182
|
+
return (this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(a, 999) + ".items[0]")
|
|
93183
|
+
});
|
|
93184
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arrayLast__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(a) {
|
|
93185
|
+
var v = this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(a, 999);
|
|
93186
|
+
return (((v + ".items[") + v) + ".items.len - 1]")
|
|
93187
|
+
});
|
|
93188
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arraySize__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(a) {
|
|
93189
|
+
return (this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(a, 999) + ".items.len")
|
|
93190
|
+
});
|
|
93191
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arrayMin__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(a) {
|
|
93192
|
+
var t = this.detectType__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType(a);
|
|
93193
|
+
var elType = $n($as_Lio_kaitai_struct_datatype_DataType$ArrayType(t)).Lio_kaitai_struct_datatype_DataType$ArrayType__f_elType;
|
|
93194
|
+
return (((("std.mem.min(" + $m_Lio_kaitai_struct_languages_ZigCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T(elType, this.Lio_kaitai_struct_translators_ZigTranslator__f_importList, $n(this.Lio_kaitai_struct_translators_BaseTranslator__f_provider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(a, 999)) + ".items)")
|
|
93195
|
+
});
|
|
93196
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arrayMax__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(a) {
|
|
93197
|
+
var t = this.detectType__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType(a);
|
|
93198
|
+
var elType = $n($as_Lio_kaitai_struct_datatype_DataType$ArrayType(t)).Lio_kaitai_struct_datatype_DataType$ArrayType__f_elType;
|
|
93199
|
+
return (((("std.mem.max(" + $m_Lio_kaitai_struct_languages_ZigCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T(elType, this.Lio_kaitai_struct_translators_ZigTranslator__f_importList, $n(this.Lio_kaitai_struct_translators_BaseTranslator__f_provider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass)) + ", ") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(a, 999)) + ".items)")
|
|
93200
|
+
});
|
|
93201
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.kaitaiStreamSize__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(value) {
|
|
93202
|
+
return (("(try " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 999)) + ".size())")
|
|
93203
|
+
});
|
|
93204
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.kaitaiStreamEof__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(value) {
|
|
93205
|
+
return (("(try " + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 999)) + ".isEof())")
|
|
93206
|
+
});
|
|
93207
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.kaitaiStreamPos__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(value) {
|
|
93208
|
+
return (this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 999) + ".pos()")
|
|
93209
|
+
});
|
|
93210
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.kaitaiStreamPos__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(value) {
|
|
93211
|
+
return this.kaitaiStreamPos__Lio_kaitai_struct_exprlang_Ast$expr__T(value)
|
|
93212
|
+
});
|
|
93213
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.kaitaiStreamEof__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(value) {
|
|
93214
|
+
return this.kaitaiStreamEof__Lio_kaitai_struct_exprlang_Ast$expr__T(value)
|
|
93215
|
+
});
|
|
93216
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.kaitaiStreamSize__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(value) {
|
|
93217
|
+
return this.kaitaiStreamSize__Lio_kaitai_struct_exprlang_Ast$expr__T(value)
|
|
93218
|
+
});
|
|
93219
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arrayMax__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(a) {
|
|
93220
|
+
return this.arrayMax__Lio_kaitai_struct_exprlang_Ast$expr__T(a)
|
|
93221
|
+
});
|
|
93222
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arrayMin__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(a) {
|
|
93223
|
+
return this.arrayMin__Lio_kaitai_struct_exprlang_Ast$expr__T(a)
|
|
93224
|
+
});
|
|
93225
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arraySize__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(a) {
|
|
93226
|
+
return this.arraySize__Lio_kaitai_struct_exprlang_Ast$expr__T(a)
|
|
93227
|
+
});
|
|
93228
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arrayLast__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(a) {
|
|
93229
|
+
return this.arrayLast__Lio_kaitai_struct_exprlang_Ast$expr__T(a)
|
|
93230
|
+
});
|
|
93231
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.arrayFirst__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(a) {
|
|
93232
|
+
return this.arrayFirst__Lio_kaitai_struct_exprlang_Ast$expr__T(a)
|
|
93233
|
+
});
|
|
93234
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.strSubstring__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(s, from, to) {
|
|
93235
|
+
return this.strSubstring__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T(s, from, to)
|
|
93236
|
+
});
|
|
93237
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.strReverse__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(s) {
|
|
93238
|
+
return this.strReverse__Lio_kaitai_struct_exprlang_Ast$expr__T(s)
|
|
93239
|
+
});
|
|
93240
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.strLength__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(s) {
|
|
93241
|
+
return this.bytesLength__Lio_kaitai_struct_exprlang_Ast$expr__T(s)
|
|
93242
|
+
});
|
|
93243
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesMax__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(b) {
|
|
93244
|
+
return this.bytesMax__Lio_kaitai_struct_exprlang_Ast$expr__T(b)
|
|
93245
|
+
});
|
|
93246
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesMin__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(b) {
|
|
93247
|
+
return this.bytesMin__Lio_kaitai_struct_exprlang_Ast$expr__T(b)
|
|
93248
|
+
});
|
|
93249
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesLast__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(b) {
|
|
93250
|
+
return this.bytesLast__Lio_kaitai_struct_exprlang_Ast$expr__T(b)
|
|
93251
|
+
});
|
|
93252
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesFirst__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(b) {
|
|
93253
|
+
return this.bytesFirst__Lio_kaitai_struct_exprlang_Ast$expr__T(b)
|
|
93254
|
+
});
|
|
93255
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesSubscript__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(container, idx) {
|
|
93256
|
+
return this.bytesSubscript__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T(container, idx)
|
|
93257
|
+
});
|
|
93258
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.bytesLength__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(b) {
|
|
93259
|
+
return this.bytesLength__Lio_kaitai_struct_exprlang_Ast$expr__T(b)
|
|
93260
|
+
});
|
|
93261
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.intToStr__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(value) {
|
|
93262
|
+
return this.intToStr__Lio_kaitai_struct_exprlang_Ast$expr__T(value)
|
|
93263
|
+
});
|
|
93264
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.boolToInt__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(value) {
|
|
93265
|
+
return this.boolToInt__Lio_kaitai_struct_exprlang_Ast$expr__T(value)
|
|
93266
|
+
});
|
|
93267
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.floatToInt__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(value) {
|
|
93268
|
+
return this.floatToInt__Lio_kaitai_struct_exprlang_Ast$expr__T(value)
|
|
93269
|
+
});
|
|
93270
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.enumToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType$EnumType__O = (function(value, et) {
|
|
93271
|
+
return this.enumToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType$EnumType__T(value, et)
|
|
93272
|
+
});
|
|
93273
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.strToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__O = (function(s, base) {
|
|
93274
|
+
return this.strToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T(s, base)
|
|
93275
|
+
});
|
|
93276
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__O = (function(value, typeName) {
|
|
93277
|
+
return this.doCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__T(value, typeName)
|
|
93278
|
+
});
|
|
93279
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.userTypeField__Lio_kaitai_struct_datatype_DataType$UserType__Lio_kaitai_struct_exprlang_Ast$expr__T__O = (function(ut, value, name) {
|
|
93280
|
+
return this.userTypeField__Lio_kaitai_struct_datatype_DataType$UserType__Lio_kaitai_struct_exprlang_Ast$expr__T__T(ut, value, name)
|
|
93281
|
+
});
|
|
93282
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doByteArrayNonLiteral__sci_Seq__O = (function(elts) {
|
|
93283
|
+
return this.doByteArrayNonLiteral__sci_Seq__T(elts)
|
|
93284
|
+
});
|
|
93285
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doByteArrayLiteral__sci_Seq__O = (function(arr) {
|
|
93286
|
+
return this.doByteArrayLiteral__sci_Seq__T(arr)
|
|
93287
|
+
});
|
|
93288
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.doArrayLiteral__Lio_kaitai_struct_datatype_DataType__sci_Seq__O = (function(t, value) {
|
|
93289
|
+
return this.doArrayLiteral__Lio_kaitai_struct_datatype_DataType__sci_Seq__T(t, value)
|
|
93290
|
+
});
|
|
93291
|
+
var $d_Lio_kaitai_struct_translators_ZigTranslator = new $TypeData().initClass({
|
|
93292
|
+
Lio_kaitai_struct_translators_ZigTranslator: 0
|
|
93293
|
+
}, false, "io.kaitai.struct.translators.ZigTranslator", {
|
|
93294
|
+
Lio_kaitai_struct_translators_ZigTranslator: 1,
|
|
93295
|
+
Lio_kaitai_struct_translators_BaseTranslator: 1,
|
|
93296
|
+
Lio_kaitai_struct_translators_TypeDetector: 1,
|
|
93297
|
+
O: 1,
|
|
93298
|
+
Lio_kaitai_struct_translators_AbstractTranslator: 1,
|
|
93299
|
+
Lio_kaitai_struct_translators_CommonLiterals: 1,
|
|
93300
|
+
Lio_kaitai_struct_translators_CommonOps: 1,
|
|
93301
|
+
Lio_kaitai_struct_translators_CommonArraysAndCast: 1,
|
|
93302
|
+
Lio_kaitai_struct_translators_CommonMethods: 1,
|
|
93303
|
+
Lio_kaitai_struct_translators_ByteArraysAsTrueArrays: 1
|
|
93304
|
+
});
|
|
93305
|
+
$c_Lio_kaitai_struct_translators_ZigTranslator.prototype.$classData = $d_Lio_kaitai_struct_translators_ZigTranslator;
|
|
93306
|
+
/** @constructor */
|
|
92473
93307
|
function $c_sc_AbstractView() {
|
|
92474
93308
|
/*<skip>*/
|
|
92475
93309
|
}
|
|
@@ -106043,6 +106877,923 @@ $h_sci_AbstractSet.prototype = $c_sci_AbstractSet.prototype;
|
|
|
106043
106877
|
$c_sci_AbstractSet.prototype.iterableFactory__sc_IterableFactory = (function() {
|
|
106044
106878
|
return $m_sci_Set$()
|
|
106045
106879
|
});
|
|
106880
|
+
function $p_Lio_kaitai_struct_languages_ZigCompiler__attrValidate__Lio_kaitai_struct_format_AttrLikeSpec__T__Lio_kaitai_struct_datatype_KSError__Z__Lio_kaitai_struct_exprlang_Ast$expr__s_Option__V($thiz, attr, failCondExpr, err, useIo, actual, expected) {
|
|
106881
|
+
$n($thiz.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("if (" + failCondExpr) + ") {"));
|
|
106882
|
+
$n($thiz.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
106883
|
+
$n($thiz.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("return " + $thiz.ksErrorName__Lio_kaitai_struct_datatype_KSError__T(err)) + ";"));
|
|
106884
|
+
$n($thiz.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
106885
|
+
$n($thiz.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
106886
|
+
}
|
|
106887
|
+
/** @constructor */
|
|
106888
|
+
function $c_Lio_kaitai_struct_languages_ZigCompiler(typeProvider, config) {
|
|
106889
|
+
this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider = null;
|
|
106890
|
+
this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_config = null;
|
|
106891
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_translator = null;
|
|
106892
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_NAME_SWITCH_ON = null;
|
|
106893
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_outHeader = null;
|
|
106894
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_out = null;
|
|
106895
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_importList = null;
|
|
106896
|
+
$ct_Lio_kaitai_struct_languages_components_LanguageCompiler__Lio_kaitai_struct_ClassTypeProvider__Lio_kaitai_struct_RuntimeConfig__(this, typeProvider, config);
|
|
106897
|
+
$f_Lio_kaitai_struct_languages_components_SingleOutputFile__$init$__V(this);
|
|
106898
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_translator = new $c_Lio_kaitai_struct_translators_ZigTranslator(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider, this.Lio_kaitai_struct_languages_ZigCompiler__f_importList, this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_config);
|
|
106899
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_NAME_SWITCH_ON = new $c_Lio_kaitai_struct_exprlang_Ast$expr$Name(new $c_Lio_kaitai_struct_exprlang_Ast$identifier($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_SWITCH_ON))
|
|
106900
|
+
}
|
|
106901
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype = new $h_Lio_kaitai_struct_languages_components_LanguageCompiler();
|
|
106902
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.constructor = $c_Lio_kaitai_struct_languages_ZigCompiler;
|
|
106903
|
+
/** @constructor */
|
|
106904
|
+
function $h_Lio_kaitai_struct_languages_ZigCompiler() {
|
|
106905
|
+
/*<skip>*/
|
|
106906
|
+
}
|
|
106907
|
+
$h_Lio_kaitai_struct_languages_ZigCompiler.prototype = $c_Lio_kaitai_struct_languages_ZigCompiler.prototype;
|
|
106908
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.classHeader__sci_List__V = (function(name) {
|
|
106909
|
+
this.classHeader__T__V($as_T($n(name).last__O()))
|
|
106910
|
+
});
|
|
106911
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.classConstructorHeader__sci_List__Lio_kaitai_struct_datatype_DataType__sci_List__Z__sci_List__V = (function(name, parentType, rootClassName, isHybrid, params) {
|
|
106912
|
+
this.classConstructorHeader__T__Lio_kaitai_struct_datatype_DataType__T__Z__sci_List__V($as_T($n(name).last__O()), parentType, $as_T($n(rootClassName).last__O()), isHybrid, params)
|
|
106913
|
+
});
|
|
106914
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.instanceHeader__sci_List__Lio_kaitai_struct_format_InstanceIdentifier__Lio_kaitai_struct_datatype_DataType__Z__V = (function(className, instName, dataType, isNullable) {
|
|
106915
|
+
this.instanceHeader__T__Lio_kaitai_struct_format_InstanceIdentifier__Lio_kaitai_struct_datatype_DataType__Z__V($as_T($n(className).last__O()), instName, dataType, isNullable)
|
|
106916
|
+
});
|
|
106917
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.enumDeclaration__sci_List__T__sci_Seq__V = (function(curClass, enumName, enumColl) {
|
|
106918
|
+
$f_Lio_kaitai_struct_languages_components_NoNeedForFullClassPath__enumDeclaration__sci_List__T__sci_Seq__V(this, curClass, enumName, enumColl)
|
|
106919
|
+
});
|
|
106920
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchCases__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__sci_Map__F1__F1__V = (function(id, on, cases, normalCaseProc, elseCaseProc) {
|
|
106921
|
+
$f_Lio_kaitai_struct_languages_components_SwitchIfOps__switchCases__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__sci_Map__F1__F1__V(this, id, on, cases, normalCaseProc, elseCaseProc)
|
|
106922
|
+
});
|
|
106923
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchCasesUsingIf__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__sci_Map__F1__F1__V = (function(id, on, onType, cases, normalCaseProc, elseCaseProc) {
|
|
106924
|
+
$f_Lio_kaitai_struct_languages_components_SwitchIfOps__switchCasesUsingIf__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__sci_Map__F1__F1__V(this, id, on, onType, cases, normalCaseProc, elseCaseProc)
|
|
106925
|
+
});
|
|
106926
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.allocateIOFixed__Lio_kaitai_struct_format_Identifier__T__T = (function(varName, size) {
|
|
106927
|
+
$m_s_Predef$().$qmark$qmark$qmark__E()
|
|
106928
|
+
});
|
|
106929
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.extraAttrForIO__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_RepeatSpec__sci_List = (function(id, rep) {
|
|
106930
|
+
return $m_sci_Nil$()
|
|
106931
|
+
});
|
|
106932
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.classDoc__sci_List__Lio_kaitai_struct_format_DocSpec__V = (function(name, doc) {
|
|
106933
|
+
this.universalDoc__Lio_kaitai_struct_format_DocSpec__V(doc)
|
|
106934
|
+
});
|
|
106935
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attributeDoc__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_DocSpec__V = (function(id, doc) {
|
|
106936
|
+
this.universalDoc__Lio_kaitai_struct_format_DocSpec__V(doc)
|
|
106937
|
+
});
|
|
106938
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.readFooter__V = (function() {
|
|
106939
|
+
this.universalFooter__V()
|
|
106940
|
+
});
|
|
106941
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.writeFooter__V = (function() {
|
|
106942
|
+
this.universalFooter__V()
|
|
106943
|
+
});
|
|
106944
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.writeInstanceFooter__V = (function() {
|
|
106945
|
+
this.universalFooter__V()
|
|
106946
|
+
});
|
|
106947
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.checkInstanceFooter__V = (function() {
|
|
106948
|
+
this.universalFooter__V()
|
|
106949
|
+
});
|
|
106950
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condRepeatExprFooter__V = (function() {
|
|
106951
|
+
this.universalFooter__V()
|
|
106952
|
+
});
|
|
106953
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condRepeatCommonFooter__V = (function() {
|
|
106954
|
+
this.universalFooter__V()
|
|
106955
|
+
});
|
|
106956
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condIfFooter__V = (function() {
|
|
106957
|
+
this.universalFooter__V()
|
|
106958
|
+
});
|
|
106959
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.instanceFooter__V = (function() {
|
|
106960
|
+
this.universalFooter__V()
|
|
106961
|
+
});
|
|
106962
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrParse2__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__T__Lio_kaitai_struct_format_RepeatSpec__Z__s_Option__s_Option__V = (function(id, dataType, io, rep, isRaw, defEndian, assignTypeOpt) {
|
|
106963
|
+
$f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__attrParse2__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__T__Lio_kaitai_struct_format_RepeatSpec__Z__s_Option__s_Option__V(this, id, dataType, io, rep, isRaw, defEndian, assignTypeOpt)
|
|
106964
|
+
});
|
|
106965
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrParse2$default$7__s_Option = (function() {
|
|
106966
|
+
return $m_s_None$()
|
|
106967
|
+
});
|
|
106968
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.createSubstream__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType$BytesType__T__Lio_kaitai_struct_format_RepeatSpec__s_Option__T = (function(id, bt, io, rep, defEndian) {
|
|
106969
|
+
return $f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__createSubstream__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType$BytesType__T__Lio_kaitai_struct_format_RepeatSpec__s_Option__T(this, id, bt, io, rep, defEndian)
|
|
106970
|
+
});
|
|
106971
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.createSubstreamFixedSize__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType$BytesLimitType__T__Lio_kaitai_struct_format_RepeatSpec__s_Option__T = (function(id, blt, io, rep, defEndian) {
|
|
106972
|
+
return $f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__createSubstreamBuffered__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType$BytesType__T__Lio_kaitai_struct_format_RepeatSpec__s_Option__T(this, id, blt, io, rep, defEndian)
|
|
106973
|
+
});
|
|
106974
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.instanceCalculate__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(instName, dataType, value) {
|
|
106975
|
+
$f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__instanceCalculate__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_exprlang_Ast$expr__V(this, instName, dataType, value)
|
|
106976
|
+
});
|
|
106977
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrParse__Lio_kaitai_struct_format_AttrLikeSpec__Lio_kaitai_struct_format_Identifier__s_Option__V = (function(attr, id, defEndian) {
|
|
106978
|
+
$f_Lio_kaitai_struct_languages_components_CommonReads__attrParse__Lio_kaitai_struct_format_AttrLikeSpec__Lio_kaitai_struct_format_Identifier__s_Option__V(this, attr, id, defEndian)
|
|
106979
|
+
});
|
|
106980
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrDebugStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__s_Option__Lio_kaitai_struct_format_RepeatSpec__V = (function(attrId, attrType, io, repeat) {
|
|
106981
|
+
/*<skip>*/
|
|
106982
|
+
});
|
|
106983
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrDebugArrInit__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__V = (function(attrId, attrType) {
|
|
106984
|
+
/*<skip>*/
|
|
106985
|
+
});
|
|
106986
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrDebugEnd__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__T__Lio_kaitai_struct_format_RepeatSpec__V = (function(attrName, attrType, io, repeat) {
|
|
106987
|
+
/*<skip>*/
|
|
106988
|
+
});
|
|
106989
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.normalIO__T = (function() {
|
|
106990
|
+
var id = $m_Lio_kaitai_struct_format_IoIdentifier$();
|
|
106991
|
+
return $m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id)
|
|
106992
|
+
});
|
|
106993
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.type2class__T__T = (function(name) {
|
|
106994
|
+
return $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name)
|
|
106995
|
+
});
|
|
106996
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.results__Lio_kaitai_struct_format_ClassSpec__sci_Map = (function(topClass) {
|
|
106997
|
+
return $f_Lio_kaitai_struct_languages_components_SingleOutputFile__results__Lio_kaitai_struct_format_ClassSpec__sci_Map(this, topClass)
|
|
106998
|
+
});
|
|
106999
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.outHeader__Lio_kaitai_struct_StringLanguageOutputWriter = (function() {
|
|
107000
|
+
return this.Lio_kaitai_struct_languages_ZigCompiler__f_outHeader
|
|
107001
|
+
});
|
|
107002
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.out__Lio_kaitai_struct_StringLanguageOutputWriter = (function() {
|
|
107003
|
+
return this.Lio_kaitai_struct_languages_ZigCompiler__f_out
|
|
107004
|
+
});
|
|
107005
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.io$kaitai$struct$languages$components$SingleOutputFile$_setter_$outHeader_$eq__Lio_kaitai_struct_StringLanguageOutputWriter__V = (function(x$1) {
|
|
107006
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_outHeader = x$1
|
|
107007
|
+
});
|
|
107008
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.io$kaitai$struct$languages$components$SingleOutputFile$_setter_$out_$eq__Lio_kaitai_struct_StringLanguageOutputWriter__V = (function(x$1) {
|
|
107009
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_out = x$1
|
|
107010
|
+
});
|
|
107011
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.io$kaitai$struct$languages$components$SingleOutputFile$_setter_$importList_$eq__Lio_kaitai_struct_ImportList__V = (function(x$1) {
|
|
107012
|
+
this.Lio_kaitai_struct_languages_ZigCompiler__f_importList = x$1
|
|
107013
|
+
});
|
|
107014
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.universalFooter__V = (function() {
|
|
107015
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107016
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
107017
|
+
});
|
|
107018
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.indent__T = (function() {
|
|
107019
|
+
return " "
|
|
107020
|
+
});
|
|
107021
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.outFileName__T__T = (function(topClassName) {
|
|
107022
|
+
return (topClassName + ".zig")
|
|
107023
|
+
});
|
|
107024
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.outImports__Lio_kaitai_struct_format_ClassSpec__T = (function(topClass) {
|
|
107025
|
+
var this$1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_importList);
|
|
107026
|
+
var this$2 = $n($n(this$1.Lio_kaitai_struct_ImportList__f_list).toList__sci_List());
|
|
107027
|
+
return $f_sc_IterableOnceOps__mkString__T__T__T__T(this$2, "", "\n", "\n")
|
|
107028
|
+
});
|
|
107029
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.fileHeader__T__V = (function(topClassName) {
|
|
107030
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_outHeader).puts__T__V("// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild");
|
|
107031
|
+
var this$1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_outHeader);
|
|
107032
|
+
$n(this$1.Lio_kaitai_struct_StringLanguageOutputWriter__f_sb).append__T__scm_StringBuilder("\n");
|
|
107033
|
+
var this$2 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_importList);
|
|
107034
|
+
$m_Lio_kaitai_struct_Utils$().addUniqueAttr__scm_ListBuffer__O__V(this$2.Lio_kaitai_struct_ImportList__f_list, "const std = @import(\"std\");");
|
|
107035
|
+
var this$3 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_importList);
|
|
107036
|
+
$m_Lio_kaitai_struct_Utils$().addUniqueAttr__scm_ListBuffer__O__V(this$3.Lio_kaitai_struct_ImportList__f_list, "const kaitai_struct = @import(\"kaitai_struct\");");
|
|
107037
|
+
var this$4 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out);
|
|
107038
|
+
$n(this$4.Lio_kaitai_struct_StringLanguageOutputWriter__f_sb).append__T__scm_StringBuilder("\n")
|
|
107039
|
+
});
|
|
107040
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.externalTypeDeclaration__Lio_kaitai_struct_ExternalType__V = (function(extType) {
|
|
107041
|
+
$m_Lio_kaitai_struct_languages_ZigCompiler$().externalTypeDeclaration__Lio_kaitai_struct_ExternalType__Lio_kaitai_struct_ImportList__V(extType, this.Lio_kaitai_struct_languages_ZigCompiler__f_importList)
|
|
107042
|
+
});
|
|
107043
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.classHeader__T__V = (function(name) {
|
|
107044
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("pub const " + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name)) + " = struct {"));
|
|
107045
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107046
|
+
var x1 = $n($n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass).Lio_kaitai_struct_format_ClassSpec__f_meta).Lio_kaitai_struct_format_MetaSpec__f_endian;
|
|
107047
|
+
matchEnd6: {
|
|
107048
|
+
if ((x1 instanceof $c_s_Some)) {
|
|
107049
|
+
var x2 = $as_s_Some(x1);
|
|
107050
|
+
var p3 = $as_Lio_kaitai_struct_datatype_Endianness($n(x2).s_Some__f_value);
|
|
107051
|
+
var x = $m_Lio_kaitai_struct_datatype_InheritedEndian$();
|
|
107052
|
+
if ((x === p3)) {
|
|
107053
|
+
break matchEnd6
|
|
107054
|
+
}
|
|
107055
|
+
}
|
|
107056
|
+
}
|
|
107057
|
+
});
|
|
107058
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.classFooter__sci_List__V = (function(name) {
|
|
107059
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("_arena: *std.heap.ArenaAllocator,");
|
|
107060
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("_io: *kaitai_struct.KaitaiStream,");
|
|
107061
|
+
var rc9 = false;
|
|
107062
|
+
var x2 = null;
|
|
107063
|
+
var x1 = $n($n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass).Lio_kaitai_struct_format_ClassSpec__f_meta).Lio_kaitai_struct_format_MetaSpec__f_endian;
|
|
107064
|
+
matchEnd10: {
|
|
107065
|
+
if ((x1 instanceof $c_s_Some)) {
|
|
107066
|
+
rc9 = true;
|
|
107067
|
+
x2 = $as_s_Some(x1);
|
|
107068
|
+
var p3 = $as_Lio_kaitai_struct_datatype_Endianness($n(x2).s_Some__f_value);
|
|
107069
|
+
var x = $m_Lio_kaitai_struct_datatype_InheritedEndian$();
|
|
107070
|
+
if ((x === p3)) {
|
|
107071
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("_is_le: ?bool,");
|
|
107072
|
+
break matchEnd10
|
|
107073
|
+
}
|
|
107074
|
+
};
|
|
107075
|
+
if ((rc9 && ($n(x2).s_Some__f_value instanceof $c_Lio_kaitai_struct_datatype_CalcEndian))) {
|
|
107076
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("_is_le: ?bool = null,");
|
|
107077
|
+
break matchEnd10
|
|
107078
|
+
}
|
|
107079
|
+
};
|
|
107080
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107081
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("};")
|
|
107082
|
+
});
|
|
107083
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.classConstructorHeader__T__Lio_kaitai_struct_datatype_DataType__T__Z__sci_List__V = (function(name, parentType, rootClassName, isHybrid, params) {
|
|
107084
|
+
var $$x2 = $m_Lio_kaitai_struct_Utils$();
|
|
107085
|
+
var this$2 = $n(params);
|
|
107086
|
+
var f = ((p$2) => {
|
|
107087
|
+
var p = $as_Lio_kaitai_struct_format_ParamDefSpec(p$2);
|
|
107088
|
+
var id = $n(p).Lio_kaitai_struct_format_ParamDefSpec__f_id;
|
|
107089
|
+
return (($m_Lio_kaitai_struct_languages_ZigCompiler$().idToStr__Lio_kaitai_struct_format_Identifier__T(id) + ": ") + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__T($n(p).Lio_kaitai_struct_format_ParamDefSpec__f_dataType))
|
|
107090
|
+
});
|
|
107091
|
+
if ((this$2 === $m_sci_Nil$())) {
|
|
107092
|
+
var $$x1 = $m_sci_Nil$()
|
|
107093
|
+
} else {
|
|
107094
|
+
var arg1 = this$2.head__O();
|
|
107095
|
+
var h = new $c_sci_$colon$colon(f(arg1), $m_sci_Nil$());
|
|
107096
|
+
var t = h;
|
|
107097
|
+
var rest = $as_sci_List(this$2.tail__O());
|
|
107098
|
+
while ((rest !== $m_sci_Nil$())) {
|
|
107099
|
+
var arg1$1 = $n(rest).head__O();
|
|
107100
|
+
var nx = new $c_sci_$colon$colon(f(arg1$1), $m_sci_Nil$());
|
|
107101
|
+
$n(t).sci_$colon$colon__f_next = nx;
|
|
107102
|
+
t = nx;
|
|
107103
|
+
rest = $as_sci_List($n(rest).tail__O())
|
|
107104
|
+
};
|
|
107105
|
+
var $$x1 = h
|
|
107106
|
+
};
|
|
107107
|
+
var paramsArg = $n($$x2).join__sc_IterableOnce__T__T__T__T($$x1, ", ", ", ", "");
|
|
107108
|
+
var endianSuffix = (isHybrid ? ", _is_le: ?bool" : "");
|
|
107109
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((((((("pub fn create(_arena: *std.heap.ArenaAllocator, _io: *kaitai_struct.KaitaiStream, _parent: ?" + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__T(parentType)) + ", _root: ?*") + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(rootClassName)) + endianSuffix) + paramsArg) + ") !*") + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name)) + " {"));
|
|
107110
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107111
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("const self = try _arena.allocator().create(" + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name)) + ");"));
|
|
107112
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("self.* = .{");
|
|
107113
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107114
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("._arena = _arena,");
|
|
107115
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("._io = _io,");
|
|
107116
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("._parent = _parent,");
|
|
107117
|
+
if ((name === rootClassName)) {
|
|
107118
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("._root = _root orelse self,")
|
|
107119
|
+
} else {
|
|
107120
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("._root = _root,")
|
|
107121
|
+
};
|
|
107122
|
+
if (isHybrid) {
|
|
107123
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("._is_le = _is_le,")
|
|
107124
|
+
};
|
|
107125
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107126
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("};");
|
|
107127
|
+
var this$3 = $n(params);
|
|
107128
|
+
var these = this$3;
|
|
107129
|
+
while ((!$n(these).isEmpty__Z())) {
|
|
107130
|
+
var arg1$2 = $n(these).head__O();
|
|
107131
|
+
var p$3 = $as_Lio_kaitai_struct_format_ParamDefSpec(arg1$2);
|
|
107132
|
+
var $$x3 = $n(p$3).Lio_kaitai_struct_format_ParamDefSpec__f_id;
|
|
107133
|
+
var id$1 = $n(p$3).Lio_kaitai_struct_format_ParamDefSpec__f_id;
|
|
107134
|
+
this.handleAssignmentSimple__Lio_kaitai_struct_format_Identifier__T__V($$x3, $m_Lio_kaitai_struct_languages_ZigCompiler$().idToStr__Lio_kaitai_struct_format_Identifier__T(id$1));
|
|
107135
|
+
these = $as_sci_List($n(these).tail__O())
|
|
107136
|
+
}
|
|
107137
|
+
});
|
|
107138
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.classConstructorFooter__V = (function() {
|
|
107139
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("return self;");
|
|
107140
|
+
this.universalFooter__V();
|
|
107141
|
+
var $$x1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out);
|
|
107142
|
+
var name = $as_T($n($n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass).Lio_kaitai_struct_format_ClassSpec__f_name).last__O());
|
|
107143
|
+
$n($$x1).puts__T__V((("fn _allocator(self: *const " + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name)) + ") std.mem.Allocator {"));
|
|
107144
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107145
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("return self._arena.allocator();");
|
|
107146
|
+
this.universalFooter__V()
|
|
107147
|
+
});
|
|
107148
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.runRead__sci_List__V = (function(name) {
|
|
107149
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("try self._read();")
|
|
107150
|
+
});
|
|
107151
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.runReadCalc__V = (function() {
|
|
107152
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("if (self._is_le == true) {");
|
|
107153
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107154
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("try self._readLE();");
|
|
107155
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107156
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("} else if (self._is_le == false) {");
|
|
107157
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107158
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("try self._readBE();");
|
|
107159
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107160
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("} else {");
|
|
107161
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107162
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("return " + this.ksErrorName__Lio_kaitai_struct_datatype_KSError__T($m_Lio_kaitai_struct_datatype_UndecidedEndiannessError$())) + ";"));
|
|
107163
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107164
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
107165
|
+
});
|
|
107166
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.readHeader__s_Option__Z__V = (function(endian, isEmpty) {
|
|
107167
|
+
var name = $as_T($n($n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass).Lio_kaitai_struct_format_ClassSpec__f_name).last__O());
|
|
107168
|
+
var className = $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name);
|
|
107169
|
+
if ((endian instanceof $c_s_Some)) {
|
|
107170
|
+
var x2 = $as_s_Some(endian);
|
|
107171
|
+
var e = $as_Lio_kaitai_struct_datatype_FixedEndian($n(x2).s_Some__f_value);
|
|
107172
|
+
var $$x1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out);
|
|
107173
|
+
$m_Lio_kaitai_struct_Utils$();
|
|
107174
|
+
var s = $n(e).toSuffix__T();
|
|
107175
|
+
var this$3 = $n(s);
|
|
107176
|
+
$n($$x1).puts__T__V((((("fn _read" + $as_T(this$3.toUpperCase())) + "(self: *") + className) + ") !void {"))
|
|
107177
|
+
} else {
|
|
107178
|
+
var x = $m_s_None$();
|
|
107179
|
+
if ((x === endian)) {
|
|
107180
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((((!$n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_config).Lio_kaitai_struct_RuntimeConfig__f_autoRead) ? "pub " : "") + "fn _read(self: *") + className) + ") !void {"))
|
|
107181
|
+
} else {
|
|
107182
|
+
throw new $c_s_MatchError(endian)
|
|
107183
|
+
}
|
|
107184
|
+
};
|
|
107185
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107186
|
+
if (isEmpty) {
|
|
107187
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("_ = self;")
|
|
107188
|
+
}
|
|
107189
|
+
});
|
|
107190
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attributeDeclaration__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__Z__V = (function(attrName, attrType, isNullable) {
|
|
107191
|
+
var x$2 = $m_Lio_kaitai_struct_format_RootIdentifier$();
|
|
107192
|
+
if (((attrName !== null) && $n(attrName).equals__O__Z(x$2))) {
|
|
107193
|
+
var $$x1 = true
|
|
107194
|
+
} else {
|
|
107195
|
+
var x$4 = $m_Lio_kaitai_struct_format_ParentIdentifier$();
|
|
107196
|
+
var $$x1 = ((attrName !== null) && $n(attrName).equals__O__Z(x$4))
|
|
107197
|
+
};
|
|
107198
|
+
if ($$x1) {
|
|
107199
|
+
var isNullableCorrected = true
|
|
107200
|
+
} else {
|
|
107201
|
+
var isNullableCorrected = isNullable
|
|
107202
|
+
};
|
|
107203
|
+
var x$6 = $m_Lio_kaitai_struct_format_RootIdentifier$();
|
|
107204
|
+
if (((attrName !== null) && $n(attrName).equals__O__Z(x$6))) {
|
|
107205
|
+
var $$x2 = true
|
|
107206
|
+
} else {
|
|
107207
|
+
var x$8 = $m_Lio_kaitai_struct_format_ParentIdentifier$();
|
|
107208
|
+
var $$x2 = ((attrName !== null) && $n(attrName).equals__O__Z(x$8))
|
|
107209
|
+
};
|
|
107210
|
+
if ($$x2) {
|
|
107211
|
+
var defaultValue = ""
|
|
107212
|
+
} else {
|
|
107213
|
+
var defaultValue = (isNullable ? " = null" : " = undefined")
|
|
107214
|
+
};
|
|
107215
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((($m_Lio_kaitai_struct_languages_ZigCompiler$().idToStr__Lio_kaitai_struct_format_Identifier__T(attrName) + ": ") + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Z__T(attrType, isNullableCorrected)) + defaultValue) + ","))
|
|
107216
|
+
});
|
|
107217
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attributeReader__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__Z__V = (function(attrName, attrType, isNullable) {
|
|
107218
|
+
/*<skip>*/
|
|
107219
|
+
});
|
|
107220
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.universalDoc__Lio_kaitai_struct_format_DocSpec__V = (function(doc) {
|
|
107221
|
+
var this$1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out);
|
|
107222
|
+
$n(this$1.Lio_kaitai_struct_StringLanguageOutputWriter__f_sb).append__T__scm_StringBuilder("\n");
|
|
107223
|
+
var this$2 = $n($n(doc).Lio_kaitai_struct_format_DocSpec__f_summary);
|
|
107224
|
+
if ((!this$2.isEmpty__Z())) {
|
|
107225
|
+
var arg1 = this$2.get__O();
|
|
107226
|
+
var summary = $as_T(arg1);
|
|
107227
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).putsLines__T__T__T__V("/// ", summary, ($n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out), ""))
|
|
107228
|
+
};
|
|
107229
|
+
var this$3 = $n($n(doc).Lio_kaitai_struct_format_DocSpec__f_ref);
|
|
107230
|
+
if ((!this$3.isEmpty__Z())) {
|
|
107231
|
+
var this$4 = $n($n(doc).Lio_kaitai_struct_format_DocSpec__f_summary);
|
|
107232
|
+
if ((!this$4.isEmpty__Z())) {
|
|
107233
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("///")
|
|
107234
|
+
};
|
|
107235
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("/// See also:");
|
|
107236
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("///")
|
|
107237
|
+
};
|
|
107238
|
+
var this$5 = $n($n(doc).Lio_kaitai_struct_format_DocSpec__f_ref);
|
|
107239
|
+
var these = this$5;
|
|
107240
|
+
while ((!$n(these).isEmpty__Z())) {
|
|
107241
|
+
var arg1$1 = $n(these).head__O();
|
|
107242
|
+
var x0$1 = $as_Lio_kaitai_struct_format_RefSpec(arg1$1);
|
|
107243
|
+
if ((x0$1 instanceof $c_Lio_kaitai_struct_format_TextRef)) {
|
|
107244
|
+
var x2 = $as_Lio_kaitai_struct_format_TextRef(x0$1);
|
|
107245
|
+
var text = $n(x2).Lio_kaitai_struct_format_TextRef__f_text;
|
|
107246
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).putsLines__T__T__T__V("/// ", ("* " + text), " ")
|
|
107247
|
+
} else if ((x0$1 instanceof $c_Lio_kaitai_struct_format_UrlRef)) {
|
|
107248
|
+
var x3 = $as_Lio_kaitai_struct_format_UrlRef(x0$1);
|
|
107249
|
+
var url = $n(x3).Lio_kaitai_struct_format_UrlRef__f_url;
|
|
107250
|
+
var text$2 = $n(x3).Lio_kaitai_struct_format_UrlRef__f_text;
|
|
107251
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).putsLines__T__T__T__V("/// ", (((("* [" + text$2) + "](") + url) + ")"), " ")
|
|
107252
|
+
} else {
|
|
107253
|
+
throw new $c_s_MatchError(x0$1)
|
|
107254
|
+
};
|
|
107255
|
+
these = $as_sci_List($n(these).tail__O())
|
|
107256
|
+
}
|
|
107257
|
+
});
|
|
107258
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrParseHybrid__F0__F0__V = (function(leProc, beProc) {
|
|
107259
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("if (self._is_le.?) {");
|
|
107260
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107261
|
+
var this$1 = $n(leProc);
|
|
107262
|
+
this$1.apply__O();
|
|
107263
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107264
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("} else {");
|
|
107265
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107266
|
+
var this$2 = $n(beProc);
|
|
107267
|
+
this$2.apply__O();
|
|
107268
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107269
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
107270
|
+
});
|
|
107271
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrProcess__Lio_kaitai_struct_format_ProcessExpr__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_RepeatSpec__V = (function(proc, varSrc, varDest, rep) {
|
|
107272
|
+
var srcExpr = this.getRawIdExpr__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_RepeatSpec__T(varSrc, rep);
|
|
107273
|
+
if ((proc instanceof $c_Lio_kaitai_struct_format_ProcessXor)) {
|
|
107274
|
+
var x2 = $as_Lio_kaitai_struct_format_ProcessXor(proc);
|
|
107275
|
+
var xorValue = $n(x2).Lio_kaitai_struct_format_ProcessXor__f_key;
|
|
107276
|
+
var x1$2 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator).detectType__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType(xorValue);
|
|
107277
|
+
var xorValueStr = ((x1$2 instanceof $c_Lio_kaitai_struct_datatype_DataType$IntType) ? $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator).doCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__T(xorValue, new $c_Lio_kaitai_struct_datatype_DataType$Int1Type(true)) : $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, xorValue));
|
|
107278
|
+
var expr$2 = (((("kaitai_struct.KaitaiStream.processXor(" + srcExpr) + ", ") + xorValueStr) + ")")
|
|
107279
|
+
} else {
|
|
107280
|
+
var x = $m_Lio_kaitai_struct_format_ProcessZlib$();
|
|
107281
|
+
if ((x === proc)) {
|
|
107282
|
+
var expr$2 = (("kaitai_struct.KaitaiStream.processZlib(" + srcExpr) + ")")
|
|
107283
|
+
} else if ((proc instanceof $c_Lio_kaitai_struct_format_ProcessRotate)) {
|
|
107284
|
+
var x4 = $as_Lio_kaitai_struct_format_ProcessRotate(proc);
|
|
107285
|
+
var isLeft = $n(x4).Lio_kaitai_struct_format_ProcessRotate__f_left;
|
|
107286
|
+
var rotValue = $n(x4).Lio_kaitai_struct_format_ProcessRotate__f_key;
|
|
107287
|
+
var expr = (isLeft ? $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, rotValue) : (("8 - (" + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, rotValue)) + ")"));
|
|
107288
|
+
var expr$2 = (((("kaitai_struct.KaitaiStream.processRotateLeft(" + srcExpr) + ", ") + expr) + ", 1)")
|
|
107289
|
+
} else {
|
|
107290
|
+
if ((!(proc instanceof $c_Lio_kaitai_struct_format_ProcessCustom))) {
|
|
107291
|
+
throw new $c_s_MatchError(proc)
|
|
107292
|
+
};
|
|
107293
|
+
var x5 = $as_Lio_kaitai_struct_format_ProcessCustom(proc);
|
|
107294
|
+
var name = $n(x5).Lio_kaitai_struct_format_ProcessCustom__f_name;
|
|
107295
|
+
var args = $n(x5).Lio_kaitai_struct_format_ProcessCustom__f_args;
|
|
107296
|
+
var this$1 = $n($as_sc_IterableOnceOps($n(name).init__O()));
|
|
107297
|
+
var namespace = $f_sc_IterableOnceOps__mkString__T__T__T__T(this$1, "", ".", "");
|
|
107298
|
+
$m_sc_StringOps$();
|
|
107299
|
+
var this$4 = $n(namespace);
|
|
107300
|
+
if ((!(this$4 === ""))) {
|
|
107301
|
+
var $$x1 = "."
|
|
107302
|
+
} else {
|
|
107303
|
+
var $$x1 = ""
|
|
107304
|
+
};
|
|
107305
|
+
var name$1 = $as_T($n(name).last__O());
|
|
107306
|
+
var procClass = ((namespace + $$x1) + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(name$1));
|
|
107307
|
+
var procName = ("_process_" + $m_Lio_kaitai_struct_languages_ZigCompiler$().idToStr__Lio_kaitai_struct_format_Identifier__T(varSrc));
|
|
107308
|
+
var $$x2 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out);
|
|
107309
|
+
var this$6 = $n($as_sc_IterableOnceOps($n(args).map__F1__O(new $c_sjsr_AnonFunction1(((e$2) => {
|
|
107310
|
+
var e = $as_Lio_kaitai_struct_exprlang_Ast$expr(e$2);
|
|
107311
|
+
return $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, e)
|
|
107312
|
+
})))));
|
|
107313
|
+
$n($$x2).puts__T__V((((((((procClass + " ") + procName) + " = new ") + procClass) + "(") + $f_sc_IterableOnceOps__mkString__T__T__T__T(this$6, "", ", ", "")) + ");"));
|
|
107314
|
+
var expr$2 = (((procName + ".decode(") + srcExpr) + ")")
|
|
107315
|
+
}
|
|
107316
|
+
};
|
|
107317
|
+
$f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__handleAssignment__Lio_kaitai_struct_format_Identifier__T__Lio_kaitai_struct_format_RepeatSpec__Z__V(this, varDest, expr$2, rep, false)
|
|
107318
|
+
});
|
|
107319
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.allocateIO__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_RepeatSpec__T = (function(varName, rep) {
|
|
107320
|
+
var id = new $c_Lio_kaitai_struct_format_IoStorageIdentifier(varName);
|
|
107321
|
+
var ioName = $m_Lio_kaitai_struct_languages_ZigCompiler$().idToStr__Lio_kaitai_struct_format_Identifier__T(id);
|
|
107322
|
+
var args = ((rep instanceof $c_Lio_kaitai_struct_format_RepeatUntil) ? $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator).doLocalName__T__T($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR2) : this.getRawIdExpr__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_RepeatSpec__T(varName, rep));
|
|
107323
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("const " + ioName) + " = try self._allocator().create(kaitai_struct.KaitaiStream);"));
|
|
107324
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((ioName + ".* = kaitai_struct.KaitaiStream.fromBytes(") + args) + ");"));
|
|
107325
|
+
return ioName
|
|
107326
|
+
});
|
|
107327
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.getRawIdExpr__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_format_RepeatSpec__T = (function(varName, rep) {
|
|
107328
|
+
var memberName = $m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(varName);
|
|
107329
|
+
var x = $m_Lio_kaitai_struct_format_NoRepeat$();
|
|
107330
|
+
if ((x === rep)) {
|
|
107331
|
+
return memberName
|
|
107332
|
+
} else {
|
|
107333
|
+
return (memberName + ".items[i]")
|
|
107334
|
+
}
|
|
107335
|
+
});
|
|
107336
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.useIO__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(ioEx) {
|
|
107337
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("const io = " + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, ioEx)) + ";"));
|
|
107338
|
+
return "io"
|
|
107339
|
+
});
|
|
107340
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.pushPos__T__V = (function(io) {
|
|
107341
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("const _pos = " + io) + ".pos();"))
|
|
107342
|
+
});
|
|
107343
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.seek__T__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(io, pos) {
|
|
107344
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((("try " + io) + ".seek(") + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, pos)) + ");"))
|
|
107345
|
+
});
|
|
107346
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.popPos__T__V = (function(io) {
|
|
107347
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("try " + io) + ".seek(_pos);"))
|
|
107348
|
+
});
|
|
107349
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.alignToByte__T__V = (function(io) {
|
|
107350
|
+
/*<skip>*/
|
|
107351
|
+
});
|
|
107352
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condIfHeader__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(expr) {
|
|
107353
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("if (" + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, expr)) + ") {"));
|
|
107354
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107355
|
+
});
|
|
107356
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condRepeatInitAttr__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__V = (function(id, dataType) {
|
|
107357
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V(((($m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id) + " = try self._allocator().create(std.ArrayList(") + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__T(dataType)) + "));"));
|
|
107358
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V(($m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id) + ".* = .empty;"))
|
|
107359
|
+
});
|
|
107360
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condRepeatEosHeader__Lio_kaitai_struct_format_Identifier__T__Lio_kaitai_struct_datatype_DataType__V = (function(id, io, dataType) {
|
|
107361
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("{");
|
|
107362
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107363
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("var i: usize = 0;");
|
|
107364
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("while (!try " + io) + ".isEof()) : (i += 1) {"));
|
|
107365
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107366
|
+
});
|
|
107367
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.handleAssignmentRepeatEos__Lio_kaitai_struct_format_Identifier__T__V = (function(id, expr) {
|
|
107368
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((("try " + $m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id)) + ".append(self._allocator(), ") + expr) + ");"))
|
|
107369
|
+
});
|
|
107370
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condRepeatEosFooter__V = (function() {
|
|
107371
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107372
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}");
|
|
107373
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107374
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
107375
|
+
});
|
|
107376
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condRepeatExprHeader__Lio_kaitai_struct_format_Identifier__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, io, dataType, repeatExpr) {
|
|
107377
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("for (0.." + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, repeatExpr)) + ") |i| {"));
|
|
107378
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107379
|
+
this.blockScopeHeader__V();
|
|
107380
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("const _maybe_unused = i;");
|
|
107381
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("_ = _maybe_unused;");
|
|
107382
|
+
this.universalFooter__V()
|
|
107383
|
+
});
|
|
107384
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.handleAssignmentRepeatExpr__Lio_kaitai_struct_format_Identifier__T__V = (function(id, expr) {
|
|
107385
|
+
this.handleAssignmentRepeatEos__Lio_kaitai_struct_format_Identifier__T__V(id, expr)
|
|
107386
|
+
});
|
|
107387
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condRepeatUntilHeader__Lio_kaitai_struct_format_Identifier__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, io, dataType, untilExpr) {
|
|
107388
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("{");
|
|
107389
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107390
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("var i: usize = 0;");
|
|
107391
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("while (true) : (i += 1) {");
|
|
107392
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107393
|
+
});
|
|
107394
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.handleAssignmentRepeatUntil__Lio_kaitai_struct_format_Identifier__T__Z__V = (function(id, expr, isRaw) {
|
|
107395
|
+
var tmpName = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator).doLocalName__T__T((isRaw ? $m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR2 : $m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR));
|
|
107396
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((("const " + tmpName) + " = ") + expr) + ";"));
|
|
107397
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((("try " + $m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id)) + ".append(self._allocator(), ") + tmpName) + ");"))
|
|
107398
|
+
});
|
|
107399
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.condRepeatUntilFooter__Lio_kaitai_struct_format_Identifier__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, io, dataType, untilExpr) {
|
|
107400
|
+
$n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f__currentIteratorType = new $c_s_Some(dataType);
|
|
107401
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("if (" + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, untilExpr)) + ") {"));
|
|
107402
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107403
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("break;");
|
|
107404
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107405
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}");
|
|
107406
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107407
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}");
|
|
107408
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107409
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
107410
|
+
});
|
|
107411
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.handleAssignmentSimple__Lio_kaitai_struct_format_Identifier__T__V = (function(id, expr) {
|
|
107412
|
+
var lhs = ((id instanceof $c_Lio_kaitai_struct_format_InstanceIdentifier) ? "_v" : $m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id));
|
|
107413
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((lhs + " = ") + expr) + ";"))
|
|
107414
|
+
});
|
|
107415
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.handleAssignmentTempVar__Lio_kaitai_struct_datatype_DataType__T__T__V = (function(dataType, id, expr) {
|
|
107416
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((("const " + id) + " = ") + expr) + ";"))
|
|
107417
|
+
});
|
|
107418
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.blockScopeHeader__V = (function() {
|
|
107419
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("{");
|
|
107420
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107421
|
+
});
|
|
107422
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.blockScopeFooter__V = (function() {
|
|
107423
|
+
this.universalFooter__V()
|
|
107424
|
+
});
|
|
107425
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.parseExpr__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__T__s_Option__T = (function(dataType, assignType, io, defEndian) {
|
|
107426
|
+
if ($is_Lio_kaitai_struct_datatype_DataType$ReadableType(dataType)) {
|
|
107427
|
+
var x2 = $as_Lio_kaitai_struct_datatype_DataType$ReadableType(dataType);
|
|
107428
|
+
var expr = (((io + ".read") + $m_Lio_kaitai_struct_Utils$().capitalize__T__T($n(x2).apiCall__s_Option__T(defEndian))) + "()")
|
|
107429
|
+
} else if ((dataType instanceof $c_Lio_kaitai_struct_datatype_DataType$BytesLimitType)) {
|
|
107430
|
+
var x3 = $as_Lio_kaitai_struct_datatype_DataType$BytesLimitType(dataType);
|
|
107431
|
+
var e = $n(x3).Lio_kaitai_struct_datatype_DataType$BytesLimitType__f_size;
|
|
107432
|
+
var expr = (((io + ".readBytes(self._allocator(), ") + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, e)) + ")")
|
|
107433
|
+
} else if ((dataType instanceof $c_Lio_kaitai_struct_datatype_DataType$BytesEosType)) {
|
|
107434
|
+
var expr = (io + ".readBytesFull(self._allocator())")
|
|
107435
|
+
} else if ((dataType instanceof $c_Lio_kaitai_struct_datatype_DataType$BytesTerminatedType)) {
|
|
107436
|
+
var x5 = $as_Lio_kaitai_struct_datatype_DataType$BytesTerminatedType(dataType);
|
|
107437
|
+
var terminator = $n(x5).Lio_kaitai_struct_datatype_DataType$BytesTerminatedType__f_terminator;
|
|
107438
|
+
var include = $n(x5).Lio_kaitai_struct_datatype_DataType$BytesTerminatedType__f_include;
|
|
107439
|
+
var consume = $n(x5).Lio_kaitai_struct_datatype_DataType$BytesTerminatedType__f_consume;
|
|
107440
|
+
var eosError = $n(x5).Lio_kaitai_struct_datatype_DataType$BytesTerminatedType__f_eosError;
|
|
107441
|
+
if (($n(terminator).length__I() === 1)) {
|
|
107442
|
+
var term = (255 & $uB($n(terminator).head__O()));
|
|
107443
|
+
var expr = (((((((((io + ".readBytesTerm(self._allocator(), ") + term) + ", ") + include) + ", ") + consume) + ", ") + eosError) + ")")
|
|
107444
|
+
} else {
|
|
107445
|
+
var expr = (((((((((io + ".readBytesTermMulti(self._allocator(), ") + $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator).doByteArrayLiteral__sci_Seq__T(terminator)) + ", ") + include) + ", ") + consume) + ", ") + eosError) + ")")
|
|
107446
|
+
}
|
|
107447
|
+
} else if ((dataType instanceof $c_Lio_kaitai_struct_datatype_DataType$BitsType1)) {
|
|
107448
|
+
var x7 = $as_Lio_kaitai_struct_datatype_DataType$BitsType1(dataType);
|
|
107449
|
+
var bitEndian = $n(x7).Lio_kaitai_struct_datatype_DataType$BitsType1__f_bitEndian;
|
|
107450
|
+
var expr = (((io + ".readBitsInt") + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T($n(bitEndian).toSuffix__T())) + "(1) != 0")
|
|
107451
|
+
} else if ((dataType instanceof $c_Lio_kaitai_struct_datatype_DataType$BitsType)) {
|
|
107452
|
+
var x8 = $as_Lio_kaitai_struct_datatype_DataType$BitsType(dataType);
|
|
107453
|
+
var width = $n(x8).Lio_kaitai_struct_datatype_DataType$BitsType__f_width;
|
|
107454
|
+
var bitEndian$2 = $n(x8).Lio_kaitai_struct_datatype_DataType$BitsType__f_bitEndian;
|
|
107455
|
+
var expr = (((((io + ".readBitsInt") + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T($n(bitEndian$2).toSuffix__T())) + "(") + width) + ")")
|
|
107456
|
+
} else if ((dataType instanceof $c_Lio_kaitai_struct_datatype_DataType$UserType)) {
|
|
107457
|
+
var x10 = $as_Lio_kaitai_struct_datatype_DataType$UserType(dataType);
|
|
107458
|
+
if ($n(x10).isExternal__Lio_kaitai_struct_format_ClassSpec__Z($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass)) {
|
|
107459
|
+
var x1$3___1 = "null";
|
|
107460
|
+
var x1$3___2 = "null"
|
|
107461
|
+
} else {
|
|
107462
|
+
var rc8 = false;
|
|
107463
|
+
var x2$2 = null;
|
|
107464
|
+
var x1$2 = $n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_forcedParent;
|
|
107465
|
+
matchEnd9: {
|
|
107466
|
+
var parent;
|
|
107467
|
+
if ((x1$2 instanceof $c_s_Some)) {
|
|
107468
|
+
rc8 = true;
|
|
107469
|
+
x2$2 = $as_s_Some(x1$2);
|
|
107470
|
+
var p3 = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x2$2).s_Some__f_value);
|
|
107471
|
+
var x = $m_Lio_kaitai_struct_datatype_DataType$().Lio_kaitai_struct_datatype_DataType$__f_USER_TYPE_NO_PARENT;
|
|
107472
|
+
if (((x === null) ? (p3 === null) : $n(x).equals__O__Z(p3))) {
|
|
107473
|
+
var parent = "null";
|
|
107474
|
+
break matchEnd9
|
|
107475
|
+
}
|
|
107476
|
+
};
|
|
107477
|
+
if (rc8) {
|
|
107478
|
+
var fp = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x2$2).s_Some__f_value);
|
|
107479
|
+
var this$1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator);
|
|
107480
|
+
var parent = this$1.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(fp, 0);
|
|
107481
|
+
break matchEnd9
|
|
107482
|
+
};
|
|
107483
|
+
var x$3 = $m_s_None$();
|
|
107484
|
+
if ((x$3 === x1$2)) {
|
|
107485
|
+
var parent = "self";
|
|
107486
|
+
break matchEnd9
|
|
107487
|
+
};
|
|
107488
|
+
throw new $c_s_MatchError(x1$2)
|
|
107489
|
+
};
|
|
107490
|
+
var x1$3___1 = parent;
|
|
107491
|
+
var x1$3___2 = "self._root"
|
|
107492
|
+
};
|
|
107493
|
+
var parent$2 = $as_T(x1$3___1);
|
|
107494
|
+
var root = $as_T(x1$3___2);
|
|
107495
|
+
var x1$4 = $n($n($as_Lio_kaitai_struct_format_ClassSpec($n($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_classSpec).get__O())).Lio_kaitai_struct_format_ClassSpec__f_meta).Lio_kaitai_struct_format_MetaSpec__f_endian;
|
|
107496
|
+
matchEnd6: {
|
|
107497
|
+
var addEndian;
|
|
107498
|
+
if ((x1$4 instanceof $c_s_Some)) {
|
|
107499
|
+
var x2$3 = $as_s_Some(x1$4);
|
|
107500
|
+
var p3$2 = $as_Lio_kaitai_struct_datatype_Endianness($n(x2$3).s_Some__f_value);
|
|
107501
|
+
var x$5 = $m_Lio_kaitai_struct_datatype_InheritedEndian$();
|
|
107502
|
+
if ((x$5 === p3$2)) {
|
|
107503
|
+
var addEndian = ", self._is_le";
|
|
107504
|
+
break matchEnd6
|
|
107505
|
+
}
|
|
107506
|
+
};
|
|
107507
|
+
var addEndian = ""
|
|
107508
|
+
};
|
|
107509
|
+
var addParams = $m_Lio_kaitai_struct_Utils$().join__sc_IterableOnce__T__T__T__T($as_sc_IterableOnce($n($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_args).map__F1__O(new $c_sjsr_AnonFunction1(((a$2) => {
|
|
107510
|
+
var a = $as_Lio_kaitai_struct_exprlang_Ast$expr(a$2);
|
|
107511
|
+
var this$3 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator);
|
|
107512
|
+
return this$3.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(a, 0)
|
|
107513
|
+
})))), ", ", ", ", "");
|
|
107514
|
+
var expr = ((((((((($m_Lio_kaitai_struct_languages_ZigCompiler$().types2class__sci_List__Z__T($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name, $n(x10).isExternal__Lio_kaitai_struct_format_ClassSpec__Z($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass)) + ".create(self._arena, ") + io) + ", ") + parent$2) + ", ") + root) + addEndian) + addParams) + ")")
|
|
107515
|
+
} else {
|
|
107516
|
+
var expr;
|
|
107517
|
+
throw new $c_s_MatchError(dataType)
|
|
107518
|
+
};
|
|
107519
|
+
return ("try " + expr)
|
|
107520
|
+
});
|
|
107521
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.bytesPadTermExpr__T__s_Option__s_Option__Z__T = (function(expr0, padRight, terminator, include) {
|
|
107522
|
+
matchEnd4: {
|
|
107523
|
+
var expr1;
|
|
107524
|
+
if ((padRight instanceof $c_s_Some)) {
|
|
107525
|
+
var x2 = $as_s_Some(padRight);
|
|
107526
|
+
var padByte = $uI($n(x2).s_Some__f_value);
|
|
107527
|
+
var this$1 = $n(terminator);
|
|
107528
|
+
if (this$1.isEmpty__Z()) {
|
|
107529
|
+
var $$x1 = $m_s_None$()
|
|
107530
|
+
} else {
|
|
107531
|
+
var arg1 = this$1.get__O();
|
|
107532
|
+
var term = $as_sci_Seq(arg1);
|
|
107533
|
+
var $$x1 = new $c_s_Some((padByte !== (255 & $uB($n(term).last__O()))))
|
|
107534
|
+
};
|
|
107535
|
+
var this$2 = $n($$x1);
|
|
107536
|
+
if ($uZ((this$2.isEmpty__Z() || this$2.get__O()))) {
|
|
107537
|
+
var expr1 = (((("kaitai_struct.KaitaiStream.bytesStripRight(" + expr0) + ", ") + padByte) + ")");
|
|
107538
|
+
break matchEnd4
|
|
107539
|
+
}
|
|
107540
|
+
};
|
|
107541
|
+
var expr1 = expr0
|
|
107542
|
+
};
|
|
107543
|
+
if ((terminator instanceof $c_s_Some)) {
|
|
107544
|
+
var x2$2 = $as_s_Some(terminator);
|
|
107545
|
+
var term$3 = $as_sci_Seq($n(x2$2).s_Some__f_value);
|
|
107546
|
+
if (($n(term$3).length__I() === 1)) {
|
|
107547
|
+
var t = (255 & $uB($n(term$3).head__O()));
|
|
107548
|
+
var expr2 = (((((("kaitai_struct.KaitaiStream.bytesTerminate(" + expr1) + ", ") + t) + ", ") + include) + ")")
|
|
107549
|
+
} else {
|
|
107550
|
+
var expr2 = (((((("kaitai_struct.KaitaiStream.bytesTerminateMulti(" + expr1) + ", ") + $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator).doByteArrayLiteral__sci_Seq__T(term$3)) + ", ") + include) + ")")
|
|
107551
|
+
}
|
|
107552
|
+
} else {
|
|
107553
|
+
var x = $m_s_None$();
|
|
107554
|
+
if ((!(x === terminator))) {
|
|
107555
|
+
throw new $c_s_MatchError(terminator)
|
|
107556
|
+
};
|
|
107557
|
+
var expr2 = expr1
|
|
107558
|
+
};
|
|
107559
|
+
return expr2
|
|
107560
|
+
});
|
|
107561
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V = (function(id, dataType, assignType) {
|
|
107562
|
+
var expr = ((!((assignType === null) ? (dataType === null) : $n(assignType).equals__O__Z(dataType))) ? (((("@as(" + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__T(dataType)) + ", ") + id) + ")") : id);
|
|
107563
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((expr + "._read();"))
|
|
107564
|
+
});
|
|
107565
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) {
|
|
107566
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("try {");
|
|
107567
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107568
|
+
var this$1 = $n(tryBlock);
|
|
107569
|
+
this$1.apply__O();
|
|
107570
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107571
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("} finally {");
|
|
107572
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107573
|
+
var this$2 = $n(finallyBlock);
|
|
107574
|
+
this$2.apply__O();
|
|
107575
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107576
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
107577
|
+
});
|
|
107578
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchCasesRender__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__sci_Map__F1__F1__V = (function(id, on, cases, normalCaseProc, elseCaseProc) {
|
|
107579
|
+
this.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V(id, on);
|
|
107580
|
+
var first = new $c_sr_BooleanRef(true);
|
|
107581
|
+
$n(cases).foreach__F1__V(new $c_sjsr_AnonFunction1(((x0$1$2) => {
|
|
107582
|
+
var x0$1 = $as_T2(x0$1$2);
|
|
107583
|
+
if ((x0$1 !== null)) {
|
|
107584
|
+
var condition = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x0$1)._1__O());
|
|
107585
|
+
var result = $n(x0$1)._2__O();
|
|
107586
|
+
var x = $m_Lio_kaitai_struct_datatype_DataType$SwitchType$().Lio_kaitai_struct_datatype_DataType$SwitchType$__f_ELSE_CONST;
|
|
107587
|
+
if ((!((x === null) ? (condition === null) : $n(x).equals__O__Z(condition)))) {
|
|
107588
|
+
if (first.sr_BooleanRef__f_elem) {
|
|
107589
|
+
this.switchCaseStart__Lio_kaitai_struct_exprlang_Ast$expr__V(condition);
|
|
107590
|
+
first.sr_BooleanRef__f_elem = false
|
|
107591
|
+
} else {
|
|
107592
|
+
this.switchCaseStart__Lio_kaitai_struct_exprlang_Ast$expr__V(condition)
|
|
107593
|
+
};
|
|
107594
|
+
$n(normalCaseProc).apply__O__O(result);
|
|
107595
|
+
this.switchCaseEnd__V()
|
|
107596
|
+
}
|
|
107597
|
+
} else {
|
|
107598
|
+
throw new $c_s_MatchError(x0$1)
|
|
107599
|
+
}
|
|
107600
|
+
})));
|
|
107601
|
+
this.switchElseStart__V();
|
|
107602
|
+
var this$3 = $n($n(cases).get__O__s_Option($m_Lio_kaitai_struct_datatype_DataType$SwitchType$().Lio_kaitai_struct_datatype_DataType$SwitchType$__f_ELSE_CONST));
|
|
107603
|
+
if ((!this$3.isEmpty__Z())) {
|
|
107604
|
+
var arg1 = this$3.get__O();
|
|
107605
|
+
$n(elseCaseProc).apply__O__O(arg1)
|
|
107606
|
+
};
|
|
107607
|
+
this.switchCaseEnd__V();
|
|
107608
|
+
this.universalFooter__V()
|
|
107609
|
+
});
|
|
107610
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchRequiresIfs__Lio_kaitai_struct_datatype_DataType__Z = (function(onType) {
|
|
107611
|
+
return (!((onType instanceof $c_Lio_kaitai_struct_datatype_DataType$IntType) || (onType instanceof $c_Lio_kaitai_struct_datatype_DataType$EnumType)))
|
|
107612
|
+
});
|
|
107613
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, on) {
|
|
107614
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("switch (" + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, on)) + ") {"));
|
|
107615
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107616
|
+
});
|
|
107617
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchCaseFirstStart__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(condition) {
|
|
107618
|
+
this.switchCaseStart__Lio_kaitai_struct_exprlang_Ast$expr__V(condition)
|
|
107619
|
+
});
|
|
107620
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchCaseStart__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(condition) {
|
|
107621
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V(($f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, condition) + " => {"));
|
|
107622
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107623
|
+
});
|
|
107624
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchCaseEnd__V = (function() {
|
|
107625
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107626
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("},")
|
|
107627
|
+
});
|
|
107628
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchElseStart__V = (function() {
|
|
107629
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("else => {");
|
|
107630
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107631
|
+
});
|
|
107632
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchEnd__V = (function() {
|
|
107633
|
+
this.universalFooter__V()
|
|
107634
|
+
});
|
|
107635
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchIfStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__V = (function(id, on, onType) {
|
|
107636
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("{");
|
|
107637
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107638
|
+
var $$x1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out);
|
|
107639
|
+
var e = this.Lio_kaitai_struct_languages_ZigCompiler__f_NAME_SWITCH_ON;
|
|
107640
|
+
$n($$x1).puts__T__V((((("const " + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, e)) + " = ") + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, on)) + ";"))
|
|
107641
|
+
});
|
|
107642
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchCmpExpr__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(condition) {
|
|
107643
|
+
var e = new $c_Lio_kaitai_struct_exprlang_Ast$expr$Compare(this.Lio_kaitai_struct_languages_ZigCompiler__f_NAME_SWITCH_ON, $m_Lio_kaitai_struct_exprlang_Ast$cmpop$Eq$(), condition);
|
|
107644
|
+
return $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, e)
|
|
107645
|
+
});
|
|
107646
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchIfCaseFirstStart__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(condition) {
|
|
107647
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("if (" + this.switchCmpExpr__Lio_kaitai_struct_exprlang_Ast$expr__T(condition)) + ") {"));
|
|
107648
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107649
|
+
});
|
|
107650
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchIfCaseStart__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(condition) {
|
|
107651
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("else if (" + this.switchCmpExpr__Lio_kaitai_struct_exprlang_Ast$expr__T(condition)) + ") {"));
|
|
107652
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107653
|
+
});
|
|
107654
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchIfCaseEnd__V = (function() {
|
|
107655
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107656
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
107657
|
+
});
|
|
107658
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchIfElseStart__V = (function() {
|
|
107659
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("else {");
|
|
107660
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107661
|
+
});
|
|
107662
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.switchIfEnd__V = (function() {
|
|
107663
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107664
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
107665
|
+
});
|
|
107666
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.instanceDeclaration__Lio_kaitai_struct_format_InstanceIdentifier__Lio_kaitai_struct_datatype_DataType__Z__V = (function(attrName, attrType, isNullable) {
|
|
107667
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V(((($m_Lio_kaitai_struct_languages_ZigCompiler$().idToStr__Lio_kaitai_struct_format_Identifier__T(attrName) + ": ?") + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Z__T(attrType, isNullable)) + " = null,"))
|
|
107668
|
+
});
|
|
107669
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.instanceHeader__T__Lio_kaitai_struct_format_InstanceIdentifier__Lio_kaitai_struct_datatype_DataType__Z__V = (function(className, instName, dataType, isNullable) {
|
|
107670
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((((((("pub fn " + this.publicMemberName__Lio_kaitai_struct_format_Identifier__T(instName)) + "(self: *") + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(className)) + ") !") + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Z__T(dataType, isNullable)) + " {"));
|
|
107671
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V()
|
|
107672
|
+
});
|
|
107673
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.instanceCheckCacheAndReturn__Lio_kaitai_struct_format_InstanceIdentifier__Lio_kaitai_struct_datatype_DataType__V = (function(instName, dataType) {
|
|
107674
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("if (" + $m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(instName)) + ") |_v|"));
|
|
107675
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107676
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("return _v;");
|
|
107677
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V()
|
|
107678
|
+
});
|
|
107679
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.instanceTempVarDeclaration__Lio_kaitai_struct_datatype_DataType__Z__V = (function(dataType, isNullable) {
|
|
107680
|
+
var defaultValue = (isNullable ? " = null" : " = undefined");
|
|
107681
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V(((("var _v: " + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Z__T(dataType, isNullable)) + defaultValue) + ";"))
|
|
107682
|
+
});
|
|
107683
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.instanceReturn__Lio_kaitai_struct_format_InstanceIdentifier__Lio_kaitai_struct_datatype_DataType__V = (function(instName, attrType) {
|
|
107684
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V(($m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(instName) + " = _v;"));
|
|
107685
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("return _v;")
|
|
107686
|
+
});
|
|
107687
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.enumDeclaration__T__T__sci_Seq__V = (function(curClass, enumName, enumColl) {
|
|
107688
|
+
var enumClass = $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T(enumName);
|
|
107689
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V((("pub const " + enumClass) + " = enum(i32) {"));
|
|
107690
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107691
|
+
$n(enumColl).foreach__F1__V(new $c_sjsr_AnonFunction1(((x0$1$2) => {
|
|
107692
|
+
var x0$1 = $as_T2(x0$1$2);
|
|
107693
|
+
if ((x0$1 !== null)) {
|
|
107694
|
+
var this$2 = $n(x0$1);
|
|
107695
|
+
var t = $uJ(this$2._1__O());
|
|
107696
|
+
var lo = t.RTLong__f_lo;
|
|
107697
|
+
var hi = t.RTLong__f_hi;
|
|
107698
|
+
var label = $as_T($n(x0$1)._2__O());
|
|
107699
|
+
var $$x1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out);
|
|
107700
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator);
|
|
107701
|
+
var this$3 = $m_s_math_BigInt$();
|
|
107702
|
+
var n = this$3.apply__J__s_math_BigInt(new $c_RTLong(lo, hi));
|
|
107703
|
+
$n($$x1).puts__T__V((((label + " = ") + $n(n).toString__T()) + ","))
|
|
107704
|
+
} else {
|
|
107705
|
+
throw new $c_s_MatchError(x0$1)
|
|
107706
|
+
}
|
|
107707
|
+
})));
|
|
107708
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("_,");
|
|
107709
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107710
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("};")
|
|
107711
|
+
});
|
|
107712
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.classToString__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(toStringExpr) {
|
|
107713
|
+
var this$1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out);
|
|
107714
|
+
$n(this$1.Lio_kaitai_struct_StringLanguageOutputWriter__f_sb).append__T__scm_StringBuilder("\n");
|
|
107715
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("@Override");
|
|
107716
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("public String toString() {");
|
|
107717
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).inc__V();
|
|
107718
|
+
var $$x1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out);
|
|
107719
|
+
var this$2 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator);
|
|
107720
|
+
$n($$x1).puts__T__V((("return " + this$2.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(toStringExpr, 0)) + ";"));
|
|
107721
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).dec__V();
|
|
107722
|
+
$n(this.Lio_kaitai_struct_languages_ZigCompiler__f_out).puts__T__V("}")
|
|
107723
|
+
});
|
|
107724
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.publicMemberName__Lio_kaitai_struct_format_Identifier__T = (function(id) {
|
|
107725
|
+
if ((id instanceof $c_Lio_kaitai_struct_format_InstanceIdentifier)) {
|
|
107726
|
+
var x2 = $as_Lio_kaitai_struct_format_InstanceIdentifier(id);
|
|
107727
|
+
var name = $n(x2).Lio_kaitai_struct_format_InstanceIdentifier__f_name;
|
|
107728
|
+
return $m_Lio_kaitai_struct_Utils$().lowerCamelCase__T__T(name)
|
|
107729
|
+
} else {
|
|
107730
|
+
return $m_Lio_kaitai_struct_languages_ZigCompiler$().idToStr__Lio_kaitai_struct_format_Identifier__T(id)
|
|
107731
|
+
}
|
|
107732
|
+
});
|
|
107733
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.privateMemberName__Lio_kaitai_struct_format_Identifier__T = (function(id) {
|
|
107734
|
+
return $m_Lio_kaitai_struct_languages_ZigCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id)
|
|
107735
|
+
});
|
|
107736
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.localTemporaryName__Lio_kaitai_struct_format_Identifier__T = (function(id) {
|
|
107737
|
+
return ("_t_" + $m_Lio_kaitai_struct_languages_ZigCompiler$().idToStr__Lio_kaitai_struct_format_Identifier__T(id))
|
|
107738
|
+
});
|
|
107739
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__T = (function(attrType) {
|
|
107740
|
+
return $m_Lio_kaitai_struct_languages_ZigCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__T(attrType, this.Lio_kaitai_struct_languages_ZigCompiler__f_importList, $n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass)
|
|
107741
|
+
});
|
|
107742
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Z__T = (function(attrType, isNullable) {
|
|
107743
|
+
return $m_Lio_kaitai_struct_languages_ZigCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_format_ClassSpec__Z__T(attrType, this.Lio_kaitai_struct_languages_ZigCompiler__f_importList, $n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass, isNullable)
|
|
107744
|
+
});
|
|
107745
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.ksErrorName__Lio_kaitai_struct_datatype_KSError__T = (function(err) {
|
|
107746
|
+
var x = $m_Lio_kaitai_struct_datatype_EndOfStreamError$();
|
|
107747
|
+
if ((x === err)) {
|
|
107748
|
+
return "error.EndOfStream"
|
|
107749
|
+
} else {
|
|
107750
|
+
var x$3 = $m_Lio_kaitai_struct_datatype_ConversionError$();
|
|
107751
|
+
if ((x$3 === err)) {
|
|
107752
|
+
return "NumberFormatException"
|
|
107753
|
+
} else {
|
|
107754
|
+
return ("error." + $n(err).name__T())
|
|
107755
|
+
}
|
|
107756
|
+
}
|
|
107757
|
+
});
|
|
107758
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrValidateExpr__Lio_kaitai_struct_format_AttrLikeSpec__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_KSError__Z__Lio_kaitai_struct_exprlang_Ast$expr__s_Option__V = (function(attr, checkExpr, err, useIo, actual, expected) {
|
|
107759
|
+
var this$1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator);
|
|
107760
|
+
$p_Lio_kaitai_struct_languages_ZigCompiler__attrValidate__Lio_kaitai_struct_format_AttrLikeSpec__T__Lio_kaitai_struct_datatype_KSError__Z__Lio_kaitai_struct_exprlang_Ast$expr__s_Option__V(this, attr, (("!(" + this$1.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(checkExpr, 0)) + ")"), err, useIo, actual, expected)
|
|
107761
|
+
});
|
|
107762
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrValidateInEnum__Lio_kaitai_struct_format_AttrLikeSpec__Lio_kaitai_struct_datatype_DataType$EnumType__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_ValidationNotInEnumError__Z__V = (function(attr, et, valueExpr, err, useIo) {
|
|
107763
|
+
var this$1 = $n(this.Lio_kaitai_struct_languages_ZigCompiler__f_translator);
|
|
107764
|
+
$p_Lio_kaitai_struct_languages_ZigCompiler__attrValidate__Lio_kaitai_struct_format_AttrLikeSpec__T__Lio_kaitai_struct_datatype_KSError__Z__Lio_kaitai_struct_exprlang_Ast$expr__s_Option__V(this, attr, (this$1.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(valueExpr, 0) + " == null"), err, useIo, valueExpr, $m_s_None$())
|
|
107765
|
+
});
|
|
107766
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.attrValidateExpr$default$6__s_Option = (function() {
|
|
107767
|
+
return $m_s_None$()
|
|
107768
|
+
});
|
|
107769
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.translator__Lio_kaitai_struct_translators_AbstractTranslator = (function() {
|
|
107770
|
+
return this.Lio_kaitai_struct_languages_ZigCompiler__f_translator
|
|
107771
|
+
});
|
|
107772
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.translator__Lio_kaitai_struct_translators_BaseTranslator = (function() {
|
|
107773
|
+
return this.Lio_kaitai_struct_languages_ZigCompiler__f_translator
|
|
107774
|
+
});
|
|
107775
|
+
var $d_Lio_kaitai_struct_languages_ZigCompiler = new $TypeData().initClass({
|
|
107776
|
+
Lio_kaitai_struct_languages_ZigCompiler: 0
|
|
107777
|
+
}, false, "io.kaitai.struct.languages.ZigCompiler", {
|
|
107778
|
+
Lio_kaitai_struct_languages_ZigCompiler: 1,
|
|
107779
|
+
Lio_kaitai_struct_languages_components_LanguageCompiler: 1,
|
|
107780
|
+
O: 1,
|
|
107781
|
+
Lio_kaitai_struct_languages_components_SwitchOps: 1,
|
|
107782
|
+
Lio_kaitai_struct_languages_components_ValidateOps: 1,
|
|
107783
|
+
Lio_kaitai_struct_languages_components_ExceptionNames: 1,
|
|
107784
|
+
Lio_kaitai_struct_languages_components_ExtraAttrs: 1,
|
|
107785
|
+
Lio_kaitai_struct_languages_components_SingleOutputFile: 1,
|
|
107786
|
+
Lio_kaitai_struct_languages_components_UpperCamelCaseClasses: 1,
|
|
107787
|
+
Lio_kaitai_struct_languages_components_ObjectOrientedLanguage: 1,
|
|
107788
|
+
Lio_kaitai_struct_languages_components_EveryReadIsExpression: 1,
|
|
107789
|
+
Lio_kaitai_struct_languages_components_CommonReads: 1,
|
|
107790
|
+
Lio_kaitai_struct_languages_components_UniversalFooter: 1,
|
|
107791
|
+
Lio_kaitai_struct_languages_components_UniversalDoc: 1,
|
|
107792
|
+
Lio_kaitai_struct_languages_components_AllocateIOLocalVar: 1,
|
|
107793
|
+
Lio_kaitai_struct_languages_components_SwitchIfOps: 1,
|
|
107794
|
+
Lio_kaitai_struct_languages_components_NoNeedForFullClassPath: 1
|
|
107795
|
+
});
|
|
107796
|
+
$c_Lio_kaitai_struct_languages_ZigCompiler.prototype.$classData = $d_Lio_kaitai_struct_languages_ZigCompiler;
|
|
106046
107797
|
function $ct_sc_IndexedSeqView$DropRight__sc_IndexedSeqOps__I__($thiz, underlying, n) {
|
|
106047
107798
|
$ct_sc_SeqView$DropRight__sc_SeqOps__I__($thiz, underlying, n);
|
|
106048
107799
|
return $thiz
|
|
@@ -110847,6 +112598,9 @@ $c_sci_Map$Map1.prototype.updated__O__O__sci_Map = (function(key, value) {
|
|
|
110847
112598
|
$c_sci_Map$Map1.prototype.foreach__F1__V = (function(f) {
|
|
110848
112599
|
$n(f).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map1__f_key1, this.sci_Map$Map1__f_value1))
|
|
110849
112600
|
});
|
|
112601
|
+
$c_sci_Map$Map1.prototype.exists__F1__Z = (function(p) {
|
|
112602
|
+
return $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map1__f_key1, this.sci_Map$Map1__f_value1)))
|
|
112603
|
+
});
|
|
110850
112604
|
$c_sci_Map$Map1.prototype.forall__F1__Z = (function(p) {
|
|
110851
112605
|
return $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map1__f_key1, this.sci_Map$Map1__f_value1)))
|
|
110852
112606
|
});
|
|
@@ -110972,6 +112726,9 @@ $c_sci_Map$Map2.prototype.foreach__F1__V = (function(f) {
|
|
|
110972
112726
|
$n(f).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$key1, this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$value1));
|
|
110973
112727
|
$n(f).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$key2, this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$value2))
|
|
110974
112728
|
});
|
|
112729
|
+
$c_sci_Map$Map2.prototype.exists__F1__Z = (function(p) {
|
|
112730
|
+
return ($uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$key1, this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$value1))) || $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$key2, this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$value2))))
|
|
112731
|
+
});
|
|
110975
112732
|
$c_sci_Map$Map2.prototype.forall__F1__Z = (function(p) {
|
|
110976
112733
|
return ($uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$key1, this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$value1))) && $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$key2, this.sci_Map$Map2__f_scala$collection$immutable$Map$Map2$$value2))))
|
|
110977
112734
|
});
|
|
@@ -111140,6 +112897,9 @@ $c_sci_Map$Map3.prototype.foreach__F1__V = (function(f) {
|
|
|
111140
112897
|
$n(f).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$key2, this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$value2));
|
|
111141
112898
|
$n(f).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$key3, this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$value3))
|
|
111142
112899
|
});
|
|
112900
|
+
$c_sci_Map$Map3.prototype.exists__F1__Z = (function(p) {
|
|
112901
|
+
return (($uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$key1, this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$value1))) || $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$key2, this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$value2)))) || $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$key3, this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$value3))))
|
|
112902
|
+
});
|
|
111143
112903
|
$c_sci_Map$Map3.prototype.forall__F1__Z = (function(p) {
|
|
111144
112904
|
return (($uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$key1, this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$value1))) && $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$key2, this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$value2)))) && $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$key3, this.sci_Map$Map3__f_scala$collection$immutable$Map$Map3$$value3))))
|
|
111145
112905
|
});
|
|
@@ -111349,6 +113109,9 @@ $c_sci_Map$Map4.prototype.foreach__F1__V = (function(f) {
|
|
|
111349
113109
|
$n(f).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key3, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value3));
|
|
111350
113110
|
$n(f).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key4, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value4))
|
|
111351
113111
|
});
|
|
113112
|
+
$c_sci_Map$Map4.prototype.exists__F1__Z = (function(p) {
|
|
113113
|
+
return ((($uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key1, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value1))) || $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key2, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value2)))) || $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key3, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value3)))) || $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key4, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value4))))
|
|
113114
|
+
});
|
|
111352
113115
|
$c_sci_Map$Map4.prototype.forall__F1__Z = (function(p) {
|
|
111353
113116
|
return ((($uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key1, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value1))) && $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key2, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value2)))) && $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key3, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value3)))) && $uZ($n(p).apply__O__O($ct_T2__O__O__(new $c_T2(), this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$key4, this.sci_Map$Map4__f_scala$collection$immutable$Map$Map4$$value4))))
|
|
111354
113117
|
});
|