diff --git a/devel/lib/_npm/kaitai-struct-compiler/kaitai-struct-compiler.js b/devel/lib/_npm/kaitai-struct-compiler/kaitai-struct-compiler.js index 5a2e2c1..bf760a8 100644 --- a/devel/lib/_npm/kaitai-struct-compiler/kaitai-struct-compiler.js +++ b/devel/lib/_npm/kaitai-struct-compiler/kaitai-struct-compiler.js @@ -3027,8 +3027,8 @@ function $m_Lio_kaitai_struct_Utils$() { function $c_Lio_kaitai_struct_Version$() { this.Lio_kaitai_struct_Version$__f_version = null; this.Lio_kaitai_struct_Version$__f_gitTime = null; - this.Lio_kaitai_struct_Version$__f_version = "0.11-SNAPSHOT20241002.233639.542b241"; - this.Lio_kaitai_struct_Version$__f_gitTime = "2024-10-02T23:36:39Z" + this.Lio_kaitai_struct_Version$__f_version = "0.11-SNAPSHOT20241226.230133.d3b189e"; + this.Lio_kaitai_struct_Version$__f_gitTime = "2024-12-26T23:01:33Z" } $c_Lio_kaitai_struct_Version$.prototype = new $h_O(); $c_Lio_kaitai_struct_Version$.prototype.constructor = $c_Lio_kaitai_struct_Version$; @@ -51869,8 +51869,11 @@ function $f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__attrUs } else { var tempVarName = $thiz.localTemporaryName__Lio_kaitai_struct_format_Identifier__T(id); $thiz.handleAssignmentTempVar__Lio_kaitai_struct_datatype_DataType__T__T__V(dataType, tempVarName, expr); - $f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__handleAssignment__Lio_kaitai_struct_format_Identifier__T__Lio_kaitai_struct_format_RepeatSpec__Z__V($thiz, id, tempVarName, rep, false); - $thiz.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V(tempVarName, dataType, assignType) + $thiz.tryFinally__F0__F0__V(new $c_sjsr_AnonFunction0((() => { + $thiz.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V(tempVarName, dataType, assignType) + })), new $c_sjsr_AnonFunction0((() => { + $f_Lio_kaitai_struct_languages_components_EveryReadIsExpression__handleAssignment__Lio_kaitai_struct_format_Identifier__T__Lio_kaitai_struct_format_RepeatSpec__Z__V($thiz, id, tempVarName, rep, false) + }))) } } } @@ -65519,8 +65522,20 @@ function $f_Lio_kaitai_struct_languages_components_GoReads__attrUserTypeParse__L }; var newIO = io }; - var expr = $n($thiz.Lio_kaitai_struct_languages_GoCompiler__f_translator).userType__Lio_kaitai_struct_datatype_DataType$UserType__T__Lio_kaitai_struct_translators_ResultLocalVar(dataType, newIO); - $f_Lio_kaitai_struct_languages_components_GoReads__handleAssignment__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_translators_TranslatorResult__Lio_kaitai_struct_format_RepeatSpec__Z__V($thiz, id, expr, rep, false) + var expr = $thiz.parseExpr__Lio_kaitai_struct_datatype_DataType__T__s_Option__T(dataType, newIO, defEndian); + var v = new $c_Lio_kaitai_struct_translators_ResultLocalVar($n($thiz.Lio_kaitai_struct_languages_GoCompiler__f_translator).allocateLocalVar__I()); + var tempVarName = $n($thiz.Lio_kaitai_struct_languages_GoCompiler__f_translator).resToStr__Lio_kaitai_struct_translators_TranslatorResult__T(v); + if ($n($n($as_Lio_kaitai_struct_languages_components_LanguageCompiler($thiz)).Lio_kaitai_struct_languages_components_LanguageCompiler__f_config).Lio_kaitai_struct_RuntimeConfig__f_autoRead) { + $n($as_Lio_kaitai_struct_languages_components_ValidateOps($thiz)).handleAssignmentTempVar__Lio_kaitai_struct_datatype_DataType__T__T__V(dataType, tempVarName, expr); + $thiz.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType$UserType__T__V(tempVarName, dataType, newIO); + $n($thiz.Lio_kaitai_struct_languages_GoCompiler__f_translator).outAddErrCheck__V(); + $f_Lio_kaitai_struct_languages_components_GoReads__handleAssignment__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_translators_TranslatorResult__Lio_kaitai_struct_format_RepeatSpec__Z__V($thiz, id, v, rep, false) + } else { + $n($as_Lio_kaitai_struct_languages_components_ValidateOps($thiz)).handleAssignmentTempVar__Lio_kaitai_struct_datatype_DataType__T__T__V(dataType, tempVarName, expr); + $thiz.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType$UserType__T__V(tempVarName, dataType, newIO); + $f_Lio_kaitai_struct_languages_components_GoReads__handleAssignment__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_translators_TranslatorResult__Lio_kaitai_struct_format_RepeatSpec__Z__V($thiz, id, v, rep, false); + $n($thiz.Lio_kaitai_struct_languages_GoCompiler__f_translator).outAddErrCheck__V() + } } function $f_Lio_kaitai_struct_languages_components_GoReads__handleAssignment__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_translators_TranslatorResult__Lio_kaitai_struct_format_RepeatSpec__Z__V($thiz, id, expr, rep, isRaw) { var x = $m_Lio_kaitai_struct_format_RepeatEos$(); @@ -85023,54 +85038,6 @@ $c_Lio_kaitai_struct_translators_GoTranslator.prototype.boolToInt__Lio_kaitai_st $n(this.Lio_kaitai_struct_translators_GoTranslator__f_out).puts__T__V("}"); return new $c_Lio_kaitai_struct_translators_ResultLocalVar(v) }); -$c_Lio_kaitai_struct_translators_GoTranslator.prototype.userType__Lio_kaitai_struct_datatype_DataType$UserType__T__Lio_kaitai_struct_translators_ResultLocalVar = (function(t, io) { - var v = this.allocateLocalVar__I(); - if ($n(t).isExternal__Lio_kaitai_struct_format_ClassSpec__Z($n(this.Lio_kaitai_struct_translators_GoTranslator__f_provider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass)) { - var x1$2___1 = "nil"; - var x1$2___2 = "nil" - } else { - var rc8 = false; - var x2 = null; - var x1 = $n(t).Lio_kaitai_struct_datatype_DataType$UserType__f_forcedParent; - matchEnd9: { - var parent; - if ((x1 instanceof $c_s_Some)) { - rc8 = true; - x2 = $as_s_Some(x1); - var p3 = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x2).s_Some__f_value); - var x = $m_Lio_kaitai_struct_datatype_DataType$().Lio_kaitai_struct_datatype_DataType$__f_USER_TYPE_NO_PARENT; - if (((x === null) ? (p3 === null) : $n(x).equals__O__Z(p3))) { - var parent = "nil"; - break matchEnd9 - } - }; - if (rc8) { - var fp = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x2).s_Some__f_value); - var parent = this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(fp, 0); - break matchEnd9 - }; - var x$3 = $m_s_None$(); - if ((x$3 === x1)) { - var parent = "this"; - break matchEnd9 - }; - throw new $c_s_MatchError(x1) - }; - var x1$2___1 = parent; - var x1$2___2 = "this._root" - }; - var parent$2 = $as_T(x1$2___1); - var root = $as_T(x1$2___2); - var this$2 = $n($as_sc_IterableOnceOps($n($n(t).Lio_kaitai_struct_datatype_DataType$UserType__f_args).map__F1__O(new $c_sjsr_AnonFunction1(((a$2) => { - var a = $as_Lio_kaitai_struct_exprlang_Ast$expr(a$2); - return this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(a, 0) - }))))); - var addParams = $f_sc_IterableOnceOps__mkString__T__T__T__T(this$2, "", ", ", ""); - $n(this.Lio_kaitai_struct_translators_GoTranslator__f_out).puts__T__V((((((this.localVarName__I__T(v) + " := New") + $m_Lio_kaitai_struct_languages_GoCompiler$().types2class__sci_List__T($n($as_Lio_kaitai_struct_format_ClassSpec($n($n(t).Lio_kaitai_struct_datatype_DataType$UserType__f_classSpec).get__O())).Lio_kaitai_struct_format_ClassSpec__f_name)) + "(") + addParams) + ")")); - $n(this.Lio_kaitai_struct_translators_GoTranslator__f_out).puts__T__V((((((((("err = " + this.localVarName__I__T(v)) + ".Read(") + io) + ", ") + parent$2) + ", ") + root) + ")")); - this.outAddErrCheck__V(); - return new $c_Lio_kaitai_struct_translators_ResultLocalVar(v) -}); $c_Lio_kaitai_struct_translators_GoTranslator.prototype.trInterpolatedStringLiteral__sci_Seq__Lio_kaitai_struct_translators_TranslatorResult = (function(exprs) { if ((exprs !== null)) { $n($m_s_package$().s_package$__f_Seq); @@ -87936,10 +87903,10 @@ $c_Lio_kaitai_struct_translators_PerlTranslator.prototype.anyField__Lio_kaitai_s return ((this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 0) + "->") + this.doName__T__T(attrName)) }); $c_Lio_kaitai_struct_translators_PerlTranslator.prototype.doLocalName__T__T = (function(s) { - return (((s === "_") || (s === "_on")) ? ("$" + s) : (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_INDEX === s) ? this.doName__T__T(s) : ("$self->" + this.doName__T__T(s)))) + return (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_SWITCH_ON === s) ? "$_on" : ((($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR === s) || ($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_INDEX === s)) ? this.doName__T__T(s) : ("$self->" + this.doName__T__T(s)))) }); $c_Lio_kaitai_struct_translators_PerlTranslator.prototype.doName__T__T = (function(s) { - return (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR === s) ? "$_" : (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR2 === s) ? "$_buf" : (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_INDEX === s) ? "$i" : (s + "()")))) + return (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR === s) ? "$_it" : (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_ITERATOR2 === s) ? "$_buf" : (($m_Lio_kaitai_struct_format_Identifier$().Lio_kaitai_struct_format_Identifier$__f_INDEX === s) ? "$i" : (s + "()")))) }); $c_Lio_kaitai_struct_translators_PerlTranslator.prototype.doInternalName__Lio_kaitai_struct_format_Identifier__T = (function(id) { return $m_Lio_kaitai_struct_languages_PerlCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id) @@ -93237,6 +93204,22 @@ $c_Lio_kaitai_struct_languages_CppCompiler.prototype.userTypeDebugRead__T__Lio_k var expr = ((!((assignType === null) ? (dataType === null) : $n(assignType).equals__O__Z(dataType))) ? (((("static_cast<" + this.kaitaiType2NativeType__Lio_kaitai_struct_datatype_DataType__Z__T(dataType, false)) + ">(") + id) + ")") : id); $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).puts__T__V((expr + "->_read();")) }); +$c_Lio_kaitai_struct_languages_CppCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).puts__T__V("try {"); + $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).inc__V(); + var this$1 = $n(tryBlock); + this$1.apply__O(); + $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).dec__V(); + $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).puts__T__V("} catch(...) {"); + $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).inc__V(); + var this$2 = $n(finallyBlock); + this$2.apply__O(); + $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).puts__T__V("throw;"); + $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).dec__V(); + $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).puts__T__V("}"); + var this$3 = $n(finallyBlock); + this$3.apply__O() +}); $c_Lio_kaitai_struct_languages_CppCompiler.prototype.switchRequiresIfs__Lio_kaitai_struct_datatype_DataType__Z = (function(onType) { return (!((onType instanceof $c_Lio_kaitai_struct_datatype_DataType$IntType) || (onType instanceof $c_Lio_kaitai_struct_datatype_DataType$EnumType))) }); @@ -94724,44 +94707,55 @@ $c_Lio_kaitai_struct_languages_GoCompiler.prototype.parseExpr__Lio_kaitai_struct return (((((io + ".ReadBitsInt") + $m_Lio_kaitai_struct_Utils$().upperCamelCase__T__T($n(bitEndian$2).toSuffix__T())) + "(") + width) + ")") } else if ((dataType instanceof $c_Lio_kaitai_struct_datatype_DataType$UserType)) { var x10 = $as_Lio_kaitai_struct_datatype_DataType$UserType(dataType); - 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)) { - var addArgs = "" - } else { - var rc8 = false; - var x2$2 = null; - var x1$2 = $n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_forcedParent; - matchEnd9: { - var parent; - if ((x1$2 instanceof $c_s_Some)) { - rc8 = true; - x2$2 = $as_s_Some(x1$2); - var p3 = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x2$2).s_Some__f_value); - var x = $m_Lio_kaitai_struct_datatype_DataType$().Lio_kaitai_struct_datatype_DataType$__f_USER_TYPE_NO_PARENT; - if (((x === null) ? (p3 === null) : $n(x).equals__O__Z(p3))) { - var parent = "null"; - break matchEnd9 - } - }; - if (rc8) { - var fp = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x2$2).s_Some__f_value); - var this$1 = $n(this.Lio_kaitai_struct_languages_GoCompiler__f_translator); - var parent = this$1.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(fp, 0); - break matchEnd9 - }; - var x$3 = $m_s_None$(); - if ((x$3 === x1$2)) { - var parent = "this"; - break matchEnd9 - }; - throw new $c_s_MatchError(x1$2) - }; - var addArgs = ((", " + parent) + ", _root") - }; - return (((($m_Lio_kaitai_struct_languages_GoCompiler$().types2class__sci_List__T($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name) + "(") + io) + addArgs) + ")") + var this$2 = $n($as_sc_IterableOnceOps($n($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_args).map__F1__O(new $c_sjsr_AnonFunction1(((a$2) => { + var a = $as_Lio_kaitai_struct_exprlang_Ast$expr(a$2); + return $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, a) + }))))); + var addParams = $f_sc_IterableOnceOps__mkString__T__T__T__T(this$2, "", ", ", ""); + return (((("New" + $m_Lio_kaitai_struct_languages_GoCompiler$().types2class__sci_List__T($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_name)) + "(") + addParams) + ")") } else { throw new $c_s_MatchError(dataType) } }); +$c_Lio_kaitai_struct_languages_GoCompiler.prototype.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType$UserType__T__V = (function(id, t, io) { + if ($n(t).isExternal__Lio_kaitai_struct_format_ClassSpec__Z($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f_nowClass)) { + var x1$2___1 = "nil"; + var x1$2___2 = "nil" + } else { + var rc8 = false; + var x2 = null; + var x1 = $n(t).Lio_kaitai_struct_datatype_DataType$UserType__f_forcedParent; + matchEnd9: { + var parent; + if ((x1 instanceof $c_s_Some)) { + rc8 = true; + x2 = $as_s_Some(x1); + var p3 = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x2).s_Some__f_value); + var x = $m_Lio_kaitai_struct_datatype_DataType$().Lio_kaitai_struct_datatype_DataType$__f_USER_TYPE_NO_PARENT; + if (((x === null) ? (p3 === null) : $n(x).equals__O__Z(p3))) { + var parent = "nil"; + break matchEnd9 + } + }; + if (rc8) { + var fp = $as_Lio_kaitai_struct_exprlang_Ast$expr($n(x2).s_Some__f_value); + var parent = $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, fp); + break matchEnd9 + }; + var x$3 = $m_s_None$(); + if ((x$3 === x1)) { + var parent = "this"; + break matchEnd9 + }; + throw new $c_s_MatchError(x1) + }; + var x1$2___1 = parent; + var x1$2___2 = "this._root" + }; + var parent$2 = $as_T(x1$2___1); + var root = $as_T(x1$2___2); + $n(this.Lio_kaitai_struct_languages_GoCompiler__f_out).puts__T__V((((((((("err = " + id) + ".Read(") + io) + ", ") + parent$2) + ", ") + root) + ")")) +}); $c_Lio_kaitai_struct_languages_GoCompiler.prototype.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, on) { $n(this.Lio_kaitai_struct_languages_GoCompiler__f_out).puts__T__V((("switch (" + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, on)) + ") {")) }); @@ -95691,6 +95685,19 @@ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.bytesPadTermExpr__T_ $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V = (function(id, dataType, assignType) { $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V((id + "._read();")) }); +$c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V("try {"); + $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).inc__V(); + var this$1 = $n(tryBlock); + this$1.apply__O(); + $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V("} finally {"); + $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).inc__V(); + var this$2 = $n(finallyBlock); + this$2.apply__O(); + $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_JavaScriptCompiler__f_out).puts__T__V("}") +}); $c_Lio_kaitai_struct_languages_JavaScriptCompiler.prototype.switchRequiresIfs__Lio_kaitai_struct_datatype_DataType__Z = (function(onType) { return (!((onType instanceof $c_Lio_kaitai_struct_datatype_DataType$IntType) || ((onType instanceof $c_Lio_kaitai_struct_datatype_DataType$BooleanType) || ((onType instanceof $c_Lio_kaitai_struct_datatype_DataType$EnumType) || (onType instanceof $c_Lio_kaitai_struct_datatype_DataType$StrType))))) }); @@ -96548,6 +96555,19 @@ $c_Lio_kaitai_struct_languages_PHPCompiler.prototype.bytesPadTermExpr__T__s_Opti $c_Lio_kaitai_struct_languages_PHPCompiler.prototype.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V = (function(id, dataType, assignType) { $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_out).puts__T__V((id + "->_read();")) }); +$c_Lio_kaitai_struct_languages_PHPCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_out).puts__T__V("try {"); + $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_out).inc__V(); + var this$1 = $n(tryBlock); + this$1.apply__O(); + $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_out).puts__T__V("} finally {"); + $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_out).inc__V(); + var this$2 = $n(finallyBlock); + this$2.apply__O(); + $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_out).puts__T__V("}") +}); $c_Lio_kaitai_struct_languages_PHPCompiler.prototype.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, on) { $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_translator).detectType__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType(on); $n(this.Lio_kaitai_struct_languages_PHPCompiler__f_out).puts__T__V((("switch (" + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, on)) + ") {")); @@ -96772,12 +96792,6 @@ $c_Lio_kaitai_struct_languages_PerlCompiler.prototype.createSubstream__Lio_kaita $c_Lio_kaitai_struct_languages_PerlCompiler.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) { 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) }); -$c_Lio_kaitai_struct_languages_PerlCompiler.prototype.handleAssignmentTempVar__Lio_kaitai_struct_datatype_DataType__T__T__V = (function(dataType, id, expr) { - $m_s_Predef$().$qmark$qmark$qmark__E() -}); -$c_Lio_kaitai_struct_languages_PerlCompiler.prototype.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V = (function(id, dataType, assignType) { - $m_s_Predef$().$qmark$qmark$qmark__E() -}); $c_Lio_kaitai_struct_languages_PerlCompiler.prototype.instanceCalculate__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(instName, dataType, value) { $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) }); @@ -97120,6 +97134,8 @@ $c_Lio_kaitai_struct_languages_PerlCompiler.prototype.handleAssignmentRepeatExpr this.handleAssignmentRepeatEos__Lio_kaitai_struct_format_Identifier__T__V(id, expr) }); $c_Lio_kaitai_struct_languages_PerlCompiler.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) { + this.blockScopeHeader__V(); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V((("my " + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_translator).doName__T__T("_")) + ";")); $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("do {"); $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).inc__V() }); @@ -97141,11 +97157,22 @@ $c_Lio_kaitai_struct_languages_PerlCompiler.prototype.handleAssignmentRepeatUnti $c_Lio_kaitai_struct_languages_PerlCompiler.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) { $n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f__currentIteratorType = new $c_s_Some(dataType); $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).dec__V(); - $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V((("} until (" + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, untilExpr)) + ");")) + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V((("} until (" + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, untilExpr)) + ");")); + this.universalFooter__V() }); $c_Lio_kaitai_struct_languages_PerlCompiler.prototype.handleAssignmentSimple__Lio_kaitai_struct_format_Identifier__T__V = (function(id, expr) { $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V(((($m_Lio_kaitai_struct_languages_PerlCompiler$().privateMemberName__Lio_kaitai_struct_format_Identifier__T(id) + " = ") + expr) + ";")) }); +$c_Lio_kaitai_struct_languages_PerlCompiler.prototype.handleAssignmentTempVar__Lio_kaitai_struct_datatype_DataType__T__T__V = (function(dataType, id, expr) { + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V((((("my " + id) + " = ") + expr) + ";")) +}); +$c_Lio_kaitai_struct_languages_PerlCompiler.prototype.blockScopeHeader__V = (function() { + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("{"); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).inc__V() +}); +$c_Lio_kaitai_struct_languages_PerlCompiler.prototype.blockScopeFooter__V = (function() { + this.universalFooter__V() +}); $c_Lio_kaitai_struct_languages_PerlCompiler.prototype.parseExpr__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__T__s_Option__T = (function(dataType, assignType, io, defEndian) { if ($is_Lio_kaitai_struct_datatype_DataType$ReadableType(dataType)) { var x2 = $as_Lio_kaitai_struct_datatype_DataType$ReadableType(dataType); @@ -97248,6 +97275,30 @@ $c_Lio_kaitai_struct_languages_PerlCompiler.prototype.bytesPadTermExpr__T__s_Opt }; return expr2 }); +$c_Lio_kaitai_struct_languages_PerlCompiler.prototype.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V = (function(id, dataType, assignType) { + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V((id + "->_read();")) +}); +$c_Lio_kaitai_struct_languages_PerlCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("eval {"); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).inc__V(); + var this$1 = $n(tryBlock); + this$1.apply__O(); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("1;"); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("} or do {"); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).inc__V(); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("$failed = 1;"); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("$err = $@;"); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("};"); + var this$2 = $n(finallyBlock); + this$2.apply__O(); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("if ($failed) {"); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).inc__V(); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("die $err;"); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_PerlCompiler__f_out).puts__T__V("}") +}); $c_Lio_kaitai_struct_languages_PerlCompiler.prototype.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, on) { /**/ }); @@ -98420,6 +98471,22 @@ $c_Lio_kaitai_struct_languages_CSharpCompiler.prototype.userTypeDebugRead__T__Li var expr = ((!((assignType === null) ? (dataType === null) : $n(assignType).equals__O__Z(dataType))) ? (((("((" + $m_Lio_kaitai_struct_languages_CSharpCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_ImportList__Lio_kaitai_struct_datatype_DataType__T(this.Lio_kaitai_struct_languages_CSharpCompiler__f_importList, dataType)) + ") (") + id) + "))") : id); $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).puts__T__V((expr + "._read();")) }); +$c_Lio_kaitai_struct_languages_CSharpCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).puts__T__V("try"); + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).puts__T__V("{"); + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).inc__V(); + var this$1 = $n(tryBlock); + this$1.apply__O(); + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).puts__T__V("}"); + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).puts__T__V("finally"); + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).puts__T__V("{"); + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).inc__V(); + var this$2 = $n(finallyBlock); + this$2.apply__O(); + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_CSharpCompiler__f_out).puts__T__V("}") +}); $c_Lio_kaitai_struct_languages_CSharpCompiler.prototype.switchRequiresIfs__Lio_kaitai_struct_datatype_DataType__Z = (function(onType) { return (!((onType instanceof $c_Lio_kaitai_struct_datatype_DataType$IntType) || ((onType instanceof $c_Lio_kaitai_struct_datatype_DataType$EnumType) || (onType instanceof $c_Lio_kaitai_struct_datatype_DataType$StrType)))) }); @@ -99297,6 +99364,21 @@ $c_Lio_kaitai_struct_languages_LuaCompiler.prototype.bytesPadTermExpr__T__s_Opti $c_Lio_kaitai_struct_languages_LuaCompiler.prototype.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V = (function(id, dataType, assignType) { $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).puts__T__V((id + ":_read()")) }); +$c_Lio_kaitai_struct_languages_LuaCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).puts__T__V("local success, err = pcall(function()"); + $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).inc__V(); + var this$1 = $n(tryBlock); + this$1.apply__O(); + $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).puts__T__V("end)"); + var this$2 = $n(finallyBlock); + this$2.apply__O(); + $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).puts__T__V("if not success then"); + $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).inc__V(); + $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).puts__T__V("error(err)"); + $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_LuaCompiler__f_out).puts__T__V("end") +}); $c_Lio_kaitai_struct_languages_LuaCompiler.prototype.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, on) { /**/ }); @@ -99444,6 +99526,9 @@ $c_Lio_kaitai_struct_languages_NimCompiler.prototype.createSubstream__Lio_kaitai $c_Lio_kaitai_struct_languages_NimCompiler.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) { 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) }); +$c_Lio_kaitai_struct_languages_NimCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $m_s_Predef$().$qmark$qmark$qmark__E() +}); $c_Lio_kaitai_struct_languages_NimCompiler.prototype.attrParse__Lio_kaitai_struct_format_AttrLikeSpec__Lio_kaitai_struct_format_Identifier__s_Option__V = (function(attr, id, defEndian) { $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) }); @@ -100910,6 +100995,19 @@ $c_Lio_kaitai_struct_languages_RubyCompiler.prototype.bytesPadTermExpr__T__s_Opt $c_Lio_kaitai_struct_languages_RubyCompiler.prototype.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V = (function(id, dataType, assignType) { $n(this.Lio_kaitai_struct_languages_RubyCompiler__f_out).puts__T__V((id + "._read")) }); +$c_Lio_kaitai_struct_languages_RubyCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $n(this.Lio_kaitai_struct_languages_RubyCompiler__f_out).puts__T__V("begin"); + $n(this.Lio_kaitai_struct_languages_RubyCompiler__f_out).inc__V(); + var this$1 = $n(tryBlock); + this$1.apply__O(); + $n(this.Lio_kaitai_struct_languages_RubyCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_RubyCompiler__f_out).puts__T__V("ensure"); + $n(this.Lio_kaitai_struct_languages_RubyCompiler__f_out).inc__V(); + var this$2 = $n(finallyBlock); + this$2.apply__O(); + $n(this.Lio_kaitai_struct_languages_RubyCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_RubyCompiler__f_out).puts__T__V("end") +}); $c_Lio_kaitai_struct_languages_RubyCompiler.prototype.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, on) { $n(this.Lio_kaitai_struct_languages_RubyCompiler__f_out).puts__T__V(("case " + $f_Lio_kaitai_struct_languages_components_ObjectOrientedLanguage__expression__Lio_kaitai_struct_exprlang_Ast$expr__T(this, on))) }); @@ -101126,6 +101224,9 @@ $c_Lio_kaitai_struct_languages_RustCompiler.prototype.results__Lio_kaitai_struct $c_Lio_kaitai_struct_languages_RustCompiler.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) { 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) }); +$c_Lio_kaitai_struct_languages_RustCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $m_s_Predef$().$qmark$qmark$qmark__E() +}); $c_Lio_kaitai_struct_languages_RustCompiler.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) { /**/ }); @@ -104000,6 +104101,19 @@ $c_Lio_kaitai_struct_languages_JavaCompiler.prototype.userTypeDebugRead__T__Lio_ }; $n(this.Lio_kaitai_struct_languages_JavaCompiler__f_out).puts__T__V((expr + "._read();")) }); +$c_Lio_kaitai_struct_languages_JavaCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $n(this.Lio_kaitai_struct_languages_JavaCompiler__f_out).puts__T__V("try {"); + $n(this.Lio_kaitai_struct_languages_JavaCompiler__f_out).inc__V(); + var this$1 = $n(tryBlock); + this$1.apply__O(); + $n(this.Lio_kaitai_struct_languages_JavaCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_JavaCompiler__f_out).puts__T__V("} finally {"); + $n(this.Lio_kaitai_struct_languages_JavaCompiler__f_out).inc__V(); + var this$2 = $n(finallyBlock); + this$2.apply__O(); + $n(this.Lio_kaitai_struct_languages_JavaCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_JavaCompiler__f_out).puts__T__V("}") +}); $c_Lio_kaitai_struct_languages_JavaCompiler.prototype.switchCasesRender__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__sci_Map__F1__F1__V = (function(id, on, cases, normalCaseProc, elseCaseProc) { var onType = $as_Lio_kaitai_struct_datatype_DataType($n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_typeProvider).Lio_kaitai_struct_ClassTypeProvider__f__currentSwitchType).get__O()); var isNullable = (onType instanceof $c_Lio_kaitai_struct_datatype_DataType$EnumType); @@ -104968,6 +105082,18 @@ $c_Lio_kaitai_struct_languages_PythonCompiler.prototype.bytesPadTermExpr__T__s_O $c_Lio_kaitai_struct_languages_PythonCompiler.prototype.userTypeDebugRead__T__Lio_kaitai_struct_datatype_DataType__Lio_kaitai_struct_datatype_DataType__V = (function(id, dataType, assignType) { $n(this.Lio_kaitai_struct_languages_PythonCompiler__f_out).puts__T__V((id + "._read()")) }); +$c_Lio_kaitai_struct_languages_PythonCompiler.prototype.tryFinally__F0__F0__V = (function(tryBlock, finallyBlock) { + $n(this.Lio_kaitai_struct_languages_PythonCompiler__f_out).puts__T__V("try:"); + $n(this.Lio_kaitai_struct_languages_PythonCompiler__f_out).inc__V(); + var this$1 = $n(tryBlock); + this$1.apply__O(); + $n(this.Lio_kaitai_struct_languages_PythonCompiler__f_out).dec__V(); + $n(this.Lio_kaitai_struct_languages_PythonCompiler__f_out).puts__T__V("finally:"); + $n(this.Lio_kaitai_struct_languages_PythonCompiler__f_out).inc__V(); + var this$2 = $n(finallyBlock); + this$2.apply__O(); + $n(this.Lio_kaitai_struct_languages_PythonCompiler__f_out).dec__V() +}); $c_Lio_kaitai_struct_languages_PythonCompiler.prototype.switchStart__Lio_kaitai_struct_format_Identifier__Lio_kaitai_struct_exprlang_Ast$expr__V = (function(id, on) { /**/ });