kaitai-struct-compiler 0.11.0-SNAPSHOT20250820.75756.bd29078 → 0.11.0-SNAPSHOT20250824.122638.67a4753
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 +39 -7
- package/package.json +1 -1
|
@@ -3033,8 +3033,8 @@ function $m_Lio_kaitai_struct_Utils$() {
|
|
|
3033
3033
|
function $c_Lio_kaitai_struct_Version$() {
|
|
3034
3034
|
this.Lio_kaitai_struct_Version$__f_version = null;
|
|
3035
3035
|
this.Lio_kaitai_struct_Version$__f_gitTime = null;
|
|
3036
|
-
this.Lio_kaitai_struct_Version$__f_version = "0.11-
|
|
3037
|
-
this.Lio_kaitai_struct_Version$__f_gitTime = "2025-08-
|
|
3036
|
+
this.Lio_kaitai_struct_Version$__f_version = "0.11-SNAPSHOT20250824.122638.67a4753";
|
|
3037
|
+
this.Lio_kaitai_struct_Version$__f_gitTime = "2025-08-24T12:26:38Z"
|
|
3038
3038
|
}
|
|
3039
3039
|
$c_Lio_kaitai_struct_Version$.prototype = new $h_O();
|
|
3040
3040
|
$c_Lio_kaitai_struct_Version$.prototype.constructor = $c_Lio_kaitai_struct_Version$;
|
|
@@ -84345,7 +84345,7 @@ $c_Lio_kaitai_struct_translators_BaseTranslator.prototype.translate__Lio_kaitai_
|
|
|
84345
84345
|
throw new $c_s_MatchError(v)
|
|
84346
84346
|
});
|
|
84347
84347
|
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.doCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__T = (function(value, typeName) {
|
|
84348
|
-
return this.translate__Lio_kaitai_struct_exprlang_Ast$
|
|
84348
|
+
return this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 999)
|
|
84349
84349
|
});
|
|
84350
84350
|
$c_Lio_kaitai_struct_translators_BaseTranslator.prototype.doByteSizeOfType__Lio_kaitai_struct_exprlang_Ast$typeId__T = (function(typeName) {
|
|
84351
84351
|
var this$1 = $m_s_math_BigInt$();
|
|
@@ -85031,6 +85031,38 @@ $c_Lio_kaitai_struct_translators_GoTranslator.prototype.trEnumByLabel__sci_List_
|
|
|
85031
85031
|
$c_Lio_kaitai_struct_translators_GoTranslator.prototype.trEnumById__sci_List__T__Lio_kaitai_struct_translators_ResultString = (function(enumTypeAbs, id) {
|
|
85032
85032
|
return new $c_Lio_kaitai_struct_translators_ResultString(((($m_Lio_kaitai_struct_languages_GoCompiler$().types2class__sci_List__T(enumTypeAbs) + "(") + id) + ")"))
|
|
85033
85033
|
});
|
|
85034
|
+
$c_Lio_kaitai_struct_translators_GoTranslator.prototype.doCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_translators_TranslatorResult = (function(value, typeName) {
|
|
85035
|
+
var valueType = this.detectType__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType(value);
|
|
85036
|
+
var x = $m_Lio_kaitai_struct_datatype_DataType$KaitaiStructType$();
|
|
85037
|
+
if ((x === valueType)) {
|
|
85038
|
+
var $$x1 = true
|
|
85039
|
+
} else if ((valueType instanceof $c_Lio_kaitai_struct_datatype_DataType$CalcKaitaiStructType)) {
|
|
85040
|
+
var $$x1 = true
|
|
85041
|
+
} else {
|
|
85042
|
+
var x$3 = $m_Lio_kaitai_struct_datatype_DataType$AnyType$();
|
|
85043
|
+
var $$x1 = (x$3 === valueType)
|
|
85044
|
+
};
|
|
85045
|
+
if ($$x1) {
|
|
85046
|
+
return new $c_Lio_kaitai_struct_translators_ResultString((((this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 999) + ".(") + $m_Lio_kaitai_struct_languages_GoCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__T(typeName)) + ")"))
|
|
85047
|
+
} else {
|
|
85048
|
+
var x$5 = $m_Lio_kaitai_struct_datatype_DataType$KaitaiStreamType$();
|
|
85049
|
+
if ((x$5 === valueType)) {
|
|
85050
|
+
var $$x2 = true
|
|
85051
|
+
} else {
|
|
85052
|
+
var x$7 = $m_Lio_kaitai_struct_datatype_DataType$OwnedKaitaiStreamType$();
|
|
85053
|
+
if ((x$7 === valueType)) {
|
|
85054
|
+
var $$x2 = true
|
|
85055
|
+
} else {
|
|
85056
|
+
var $$x2 = (valueType instanceof $c_Lio_kaitai_struct_datatype_DataType$UserType)
|
|
85057
|
+
}
|
|
85058
|
+
};
|
|
85059
|
+
if ($$x2) {
|
|
85060
|
+
return new $c_Lio_kaitai_struct_translators_ResultString((((("(" + $m_Lio_kaitai_struct_languages_GoCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__T(typeName)) + ")(") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 0)) + ")"))
|
|
85061
|
+
} else {
|
|
85062
|
+
return new $c_Lio_kaitai_struct_translators_ResultString(((($m_Lio_kaitai_struct_languages_GoCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__T(typeName) + "(") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 0)) + ")"))
|
|
85063
|
+
}
|
|
85064
|
+
}
|
|
85065
|
+
});
|
|
85034
85066
|
$c_Lio_kaitai_struct_translators_GoTranslator.prototype.doArrayLiteral__Lio_kaitai_struct_datatype_DataType__sci_Seq__Lio_kaitai_struct_translators_ResultString = (function(t, value) {
|
|
85035
85067
|
var $$x1 = $m_Lio_kaitai_struct_languages_GoCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__T(t);
|
|
85036
85068
|
var this$2 = $n($as_sc_IterableOnceOps($n(value).map__F1__O(new $c_sjsr_AnonFunction1(((v$2) => {
|
|
@@ -85341,7 +85373,7 @@ $c_Lio_kaitai_struct_translators_GoTranslator.prototype.doArrayLiteral__Lio_kait
|
|
|
85341
85373
|
return this.doArrayLiteral__Lio_kaitai_struct_datatype_DataType__sci_Seq__Lio_kaitai_struct_translators_ResultString(t, value)
|
|
85342
85374
|
});
|
|
85343
85375
|
$c_Lio_kaitai_struct_translators_GoTranslator.prototype.doCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__O = (function(value, typeName) {
|
|
85344
|
-
$
|
|
85376
|
+
return this.doCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_translators_TranslatorResult(value, typeName)
|
|
85345
85377
|
});
|
|
85346
85378
|
var $d_Lio_kaitai_struct_translators_GoTranslator = new $TypeData().initClass({
|
|
85347
85379
|
Lio_kaitai_struct_translators_GoTranslator: 0
|
|
@@ -102004,7 +102036,7 @@ $c_Lio_kaitai_struct_languages_RustCompiler.prototype.attributeReader__Lio_kaita
|
|
|
102004
102036
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V("}");
|
|
102005
102037
|
fn = (fn + "_enum")
|
|
102006
102038
|
};
|
|
102007
|
-
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V((((("pub fn " + fn) + "(&self) -> Ref<") + typeName) + "> {"));
|
|
102039
|
+
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V((((("pub fn " + fn) + "(&self) -> Ref<'_, ") + typeName) + "> {"));
|
|
102008
102040
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).inc__V();
|
|
102009
102041
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V((("self." + $m_Lio_kaitai_struct_languages_RustCompiler$().idToStr__Lio_kaitai_struct_format_Identifier__T(attrName)) + ".borrow()"));
|
|
102010
102042
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).dec__V();
|
|
@@ -102328,7 +102360,7 @@ $c_Lio_kaitai_struct_languages_RustCompiler.prototype.instanceHeader__sci_List__
|
|
|
102328
102360
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V("&self");
|
|
102329
102361
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).dec__V();
|
|
102330
102362
|
var typeName = $m_Lio_kaitai_struct_languages_RustCompiler$().kaitaiTypeToNativeType__s_Option__Lio_kaitai_struct_format_ClassSpec__Lio_kaitai_struct_datatype_DataType__Z__Z__T(new $c_s_Some(instName), $n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass, dataType, false, false);
|
|
102331
|
-
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V(((") -> KResult<Ref<" + typeName) + ">> {"));
|
|
102363
|
+
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V(((") -> KResult<Ref<'_, " + typeName) + ">> {"));
|
|
102332
102364
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).inc__V();
|
|
102333
102365
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V("let _io = self._io.borrow();");
|
|
102334
102366
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V("let _rrc = self._root.get_value().borrow().upgrade();");
|
|
@@ -103034,7 +103066,7 @@ $c_Lio_kaitai_struct_languages_RustCompiler.prototype.switchTypeEnum__Lio_kaitai
|
|
|
103034
103066
|
nativeType = ("" + nativeTypeEx);
|
|
103035
103067
|
clone = ".clone()"
|
|
103036
103068
|
} else {
|
|
103037
|
-
nativeType = (("Ref<" + nativeType) + ">")
|
|
103069
|
+
nativeType = (("Ref<'_, " + nativeType) + ">")
|
|
103038
103070
|
};
|
|
103039
103071
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).puts__T__V((((("pub fn " + fn) + "(&self) -> ") + nativeType) + " {"));
|
|
103040
103072
|
$n(this.Lio_kaitai_struct_languages_RustCompiler__f_out).inc__V();
|
package/package.json
CHANGED