kaitai-struct-compiler 0.11.0-SNAPSHOT20240401.112327.fda00d3 → 0.11.0-SNAPSHOT20240403.134844.751f059
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 +62 -244
- package/package.json +1 -1
|
@@ -3010,8 +3010,8 @@ function $m_Lio_kaitai_struct_Utils$() {
|
|
|
3010
3010
|
function $c_Lio_kaitai_struct_Version$() {
|
|
3011
3011
|
this.Lio_kaitai_struct_Version$__f_version = null;
|
|
3012
3012
|
this.Lio_kaitai_struct_Version$__f_gitTime = null;
|
|
3013
|
-
this.Lio_kaitai_struct_Version$__f_version = "0.11-
|
|
3014
|
-
this.Lio_kaitai_struct_Version$__f_gitTime = "2024-04-
|
|
3013
|
+
this.Lio_kaitai_struct_Version$__f_version = "0.11-SNAPSHOT20240403.134844.751f059";
|
|
3014
|
+
this.Lio_kaitai_struct_Version$__f_gitTime = "2024-04-03T13:48:44+00:00"
|
|
3015
3015
|
}
|
|
3016
3016
|
$c_Lio_kaitai_struct_Version$.prototype = new $h_O();
|
|
3017
3017
|
$c_Lio_kaitai_struct_Version$.prototype.constructor = $c_Lio_kaitai_struct_Version$;
|
|
@@ -44365,16 +44365,11 @@ $c_Lio_kaitai_struct_languages_CppCompiler$.prototype.kaitaiType2NativeType__Lio
|
|
|
44365
44365
|
if ((x$21 === x1$2)) {
|
|
44366
44366
|
return (typeStr + "*")
|
|
44367
44367
|
} else {
|
|
44368
|
-
var x$23 = $m_Lio_kaitai_struct_CppRuntimeConfig$
|
|
44368
|
+
var x$23 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
44369
44369
|
if ((x$23 === x1$2)) {
|
|
44370
|
-
return (("std::
|
|
44370
|
+
return ($n(x60).isOwning__Z() ? (("std::unique_ptr<" + typeStr) + ">") : (typeStr + "*"))
|
|
44371
44371
|
} else {
|
|
44372
|
-
|
|
44373
|
-
if ((x$25 === x1$2)) {
|
|
44374
|
-
return ($n(x60).isOwning__Z() ? (("std::unique_ptr<" + typeStr) + ">") : (typeStr + "*"))
|
|
44375
|
-
} else {
|
|
44376
|
-
throw new $c_s_MatchError(x1$2)
|
|
44377
|
-
}
|
|
44372
|
+
throw new $c_s_MatchError(x1$2)
|
|
44378
44373
|
}
|
|
44379
44374
|
}
|
|
44380
44375
|
};
|
|
@@ -44387,12 +44382,12 @@ $c_Lio_kaitai_struct_languages_CppCompiler$.prototype.kaitaiType2NativeType__Lio
|
|
|
44387
44382
|
var this$1 = $n(x62);
|
|
44388
44383
|
var inType = this$1.Lio_kaitai_struct_datatype_DataType$ArrayType__f_elType;
|
|
44389
44384
|
var x1$3 = $n(config).Lio_kaitai_struct_CppRuntimeConfig__f_pointers;
|
|
44390
|
-
var x$
|
|
44391
|
-
if ((x$
|
|
44385
|
+
var x$25 = $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$();
|
|
44386
|
+
if ((x$25 === x1$3)) {
|
|
44392
44387
|
return (("std::vector<" + this.kaitaiType2NativeType__Lio_kaitai_struct_CppRuntimeConfig__Lio_kaitai_struct_datatype_DataType__Z__T(config, inType, absolute)) + ">*")
|
|
44393
44388
|
} else {
|
|
44394
|
-
var x$
|
|
44395
|
-
if ((x$
|
|
44389
|
+
var x$27 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
44390
|
+
if ((x$27 === x1$3)) {
|
|
44396
44391
|
return (("std::unique_ptr<std::vector<" + this.kaitaiType2NativeType__Lio_kaitai_struct_CppRuntimeConfig__Lio_kaitai_struct_datatype_DataType__Z__T(config, inType, absolute)) + ">>")
|
|
44397
44392
|
} else {
|
|
44398
44393
|
throw new $c_s_MatchError(x1$3)
|
|
@@ -44405,63 +44400,42 @@ $c_Lio_kaitai_struct_languages_CppCompiler$.prototype.kaitaiType2NativeType__Lio
|
|
|
44405
44400
|
var inType$2 = this$2.Lio_kaitai_struct_datatype_DataType$ArrayType__f_elType;
|
|
44406
44401
|
return (("std::vector<" + this.kaitaiType2NativeType__Lio_kaitai_struct_CppRuntimeConfig__Lio_kaitai_struct_datatype_DataType__Z__T(config, inType$2, absolute)) + ">*")
|
|
44407
44402
|
};
|
|
44408
|
-
var x$
|
|
44409
|
-
if ((x$
|
|
44403
|
+
var x$29 = $m_Lio_kaitai_struct_datatype_DataType$OwnedKaitaiStreamType$();
|
|
44404
|
+
if ((x$29 === x1)) {
|
|
44410
44405
|
var x1$4 = $n(config).Lio_kaitai_struct_CppRuntimeConfig__f_pointers;
|
|
44411
|
-
var x$
|
|
44412
|
-
if ((x$
|
|
44406
|
+
var x$31 = $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$();
|
|
44407
|
+
if ((x$31 === x1$4)) {
|
|
44413
44408
|
return "kaitai::kstream*"
|
|
44414
44409
|
} else {
|
|
44415
|
-
var x$
|
|
44416
|
-
if ((x$
|
|
44410
|
+
var x$33 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
44411
|
+
if ((x$33 === x1$4)) {
|
|
44417
44412
|
return "std::unique_ptr<kaitai::kstream>"
|
|
44418
44413
|
} else {
|
|
44419
44414
|
throw new $c_s_MatchError(x1$4)
|
|
44420
44415
|
}
|
|
44421
44416
|
}
|
|
44422
44417
|
};
|
|
44423
|
-
var x$
|
|
44424
|
-
if ((x$
|
|
44418
|
+
var x$35 = $m_Lio_kaitai_struct_datatype_DataType$KaitaiStreamType$();
|
|
44419
|
+
if ((x$35 === x1)) {
|
|
44425
44420
|
return "kaitai::kstream*"
|
|
44426
44421
|
};
|
|
44427
|
-
var x$
|
|
44428
|
-
if ((x$
|
|
44422
|
+
var x$37 = $m_Lio_kaitai_struct_datatype_DataType$KaitaiStructType$();
|
|
44423
|
+
if ((x$37 === x1)) {
|
|
44429
44424
|
var x1$5 = $n(config).Lio_kaitai_struct_CppRuntimeConfig__f_pointers;
|
|
44430
|
-
var x$
|
|
44431
|
-
if ((x$
|
|
44425
|
+
var x$39 = $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$();
|
|
44426
|
+
if ((x$39 === x1$5)) {
|
|
44432
44427
|
return "kaitai::kstruct*"
|
|
44433
44428
|
} else {
|
|
44434
|
-
var x$
|
|
44435
|
-
if ((x$
|
|
44436
|
-
return "std::
|
|
44429
|
+
var x$41 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
44430
|
+
if ((x$41 === x1$5)) {
|
|
44431
|
+
return "std::unique_ptr<kaitai::kstruct>"
|
|
44437
44432
|
} else {
|
|
44438
|
-
|
|
44439
|
-
if ((x$45 === x1$5)) {
|
|
44440
|
-
return "std::unique_ptr<kaitai::kstruct>"
|
|
44441
|
-
} else {
|
|
44442
|
-
throw new $c_s_MatchError(x1$5)
|
|
44443
|
-
}
|
|
44433
|
+
throw new $c_s_MatchError(x1$5)
|
|
44444
44434
|
}
|
|
44445
44435
|
}
|
|
44446
44436
|
};
|
|
44447
44437
|
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$CalcKaitaiStructType)) {
|
|
44448
|
-
|
|
44449
|
-
var x$47 = $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$();
|
|
44450
|
-
if ((x$47 === x1$6)) {
|
|
44451
|
-
return "kaitai::kstruct*"
|
|
44452
|
-
} else {
|
|
44453
|
-
var x$49 = $m_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$();
|
|
44454
|
-
if ((x$49 === x1$6)) {
|
|
44455
|
-
return "std::shared_ptr<kaitai::kstruct>"
|
|
44456
|
-
} else {
|
|
44457
|
-
var x$51 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
44458
|
-
if ((x$51 === x1$6)) {
|
|
44459
|
-
return "kaitai::kstruct*"
|
|
44460
|
-
} else {
|
|
44461
|
-
throw new $c_s_MatchError(x1$6)
|
|
44462
|
-
}
|
|
44463
|
-
}
|
|
44464
|
-
}
|
|
44438
|
+
return "kaitai::kstruct*"
|
|
44465
44439
|
};
|
|
44466
44440
|
if ((x1 instanceof $c_Lio_kaitai_struct_datatype_DataType$SwitchType)) {
|
|
44467
44441
|
var x70 = $as_Lio_kaitai_struct_datatype_DataType$SwitchType(x1);
|
|
@@ -56313,53 +56287,6 @@ function $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$() {
|
|
|
56313
56287
|
return $n_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$
|
|
56314
56288
|
}
|
|
56315
56289
|
/** @constructor */
|
|
56316
|
-
function $c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$() {
|
|
56317
|
-
/*<skip>*/
|
|
56318
|
-
}
|
|
56319
|
-
$c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype = new $h_O();
|
|
56320
|
-
$c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype.constructor = $c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$;
|
|
56321
|
-
/** @constructor */
|
|
56322
|
-
function $h_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$() {
|
|
56323
|
-
/*<skip>*/
|
|
56324
|
-
}
|
|
56325
|
-
$h_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype = $c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype;
|
|
56326
|
-
$c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype.productPrefix__T = (function() {
|
|
56327
|
-
return "SharedPointers"
|
|
56328
|
-
});
|
|
56329
|
-
$c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype.productArity__I = (function() {
|
|
56330
|
-
return 0
|
|
56331
|
-
});
|
|
56332
|
-
$c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype.productElement__I__O = (function(x$1) {
|
|
56333
|
-
return $m_sr_Statics$().ioobe__I__O(x$1)
|
|
56334
|
-
});
|
|
56335
|
-
$c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype.productIterator__sc_Iterator = (function() {
|
|
56336
|
-
return new $c_sr_ScalaRunTime$$anon$1(this)
|
|
56337
|
-
});
|
|
56338
|
-
$c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype.hashCode__I = (function() {
|
|
56339
|
-
return (-1012780677)
|
|
56340
|
-
});
|
|
56341
|
-
$c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype.toString__T = (function() {
|
|
56342
|
-
return "SharedPointers"
|
|
56343
|
-
});
|
|
56344
|
-
var $d_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$ = new $TypeData().initClass({
|
|
56345
|
-
Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$: 0
|
|
56346
|
-
}, false, "io.kaitai.struct.CppRuntimeConfig$SharedPointers$", {
|
|
56347
|
-
Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$: 1,
|
|
56348
|
-
O: 1,
|
|
56349
|
-
Lio_kaitai_struct_CppRuntimeConfig$Pointers: 1,
|
|
56350
|
-
s_Product: 1,
|
|
56351
|
-
s_Equals: 1,
|
|
56352
|
-
Ljava_io_Serializable: 1
|
|
56353
|
-
});
|
|
56354
|
-
$c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$.prototype.$classData = $d_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$;
|
|
56355
|
-
var $n_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$;
|
|
56356
|
-
function $m_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$() {
|
|
56357
|
-
if ((!$n_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$)) {
|
|
56358
|
-
$n_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$ = new $c_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$()
|
|
56359
|
-
};
|
|
56360
|
-
return $n_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$
|
|
56361
|
-
}
|
|
56362
|
-
/** @constructor */
|
|
56363
56290
|
function $c_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$() {
|
|
56364
56291
|
/*<skip>*/
|
|
56365
56292
|
}
|
|
@@ -88396,31 +88323,6 @@ $c_Lio_kaitai_struct_translators_CppTranslator.prototype.doIfExp__Lio_kaitai_str
|
|
|
88396
88323
|
return (((((("((" + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(condition, 0)) + ") ? (") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(ifTrue, 0)) + ") : (") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(ifFalse, 0)) + "))")
|
|
88397
88324
|
});
|
|
88398
88325
|
$c_Lio_kaitai_struct_translators_CppTranslator.prototype.doCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__T = (function(value, typeName) {
|
|
88399
|
-
var x1 = $n($n(this.Lio_kaitai_struct_translators_CppTranslator__f_config).Lio_kaitai_struct_RuntimeConfig__f_cppConfig).Lio_kaitai_struct_CppRuntimeConfig__f_pointers;
|
|
88400
|
-
var x = $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$();
|
|
88401
|
-
if ((x === x1)) {
|
|
88402
|
-
var $$x1 = true
|
|
88403
|
-
} else {
|
|
88404
|
-
var x$3 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
88405
|
-
var $$x1 = (x$3 === x1)
|
|
88406
|
-
};
|
|
88407
|
-
if ($$x1) {
|
|
88408
|
-
return this.cppStaticCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__T(value, typeName)
|
|
88409
|
-
} else {
|
|
88410
|
-
var x$5 = $m_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$();
|
|
88411
|
-
if ((x$5 === x1)) {
|
|
88412
|
-
if ((typeName instanceof $c_Lio_kaitai_struct_datatype_DataType$UserType)) {
|
|
88413
|
-
var x2 = $as_Lio_kaitai_struct_datatype_DataType$UserType(typeName);
|
|
88414
|
-
return (((("std::static_pointer_cast<" + $m_Lio_kaitai_struct_languages_CppCompiler$().types2class__sci_List__T($n($as_Lio_kaitai_struct_format_ClassSpec($n($n(x2).Lio_kaitai_struct_datatype_DataType$UserType__f_classSpec).get__O())).Lio_kaitai_struct_format_ClassSpec__f_name)) + ">(") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 0)) + ")")
|
|
88415
|
-
} else {
|
|
88416
|
-
return this.cppStaticCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__T(value, typeName)
|
|
88417
|
-
}
|
|
88418
|
-
} else {
|
|
88419
|
-
throw new $c_s_MatchError(x1)
|
|
88420
|
-
}
|
|
88421
|
-
}
|
|
88422
|
-
});
|
|
88423
|
-
$c_Lio_kaitai_struct_translators_CppTranslator.prototype.cppStaticCast__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType__T = (function(value, typeName) {
|
|
88424
88326
|
return (((("static_cast<" + $m_Lio_kaitai_struct_languages_CppCompiler$().kaitaiType2NativeType__Lio_kaitai_struct_CppRuntimeConfig__Lio_kaitai_struct_datatype_DataType__Z__T($n(this.Lio_kaitai_struct_translators_CppTranslator__f_config).Lio_kaitai_struct_RuntimeConfig__f_cppConfig, typeName, false)) + ">(") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__I__T(value, 0)) + ")")
|
|
88425
88327
|
});
|
|
88426
88328
|
$c_Lio_kaitai_struct_translators_CppTranslator.prototype.strToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(s, base) {
|
|
@@ -90247,18 +90149,12 @@ $c_Lio_kaitai_struct_languages_CppCompiler.prototype.fileHeader__T__V = (functio
|
|
|
90247
90149
|
this$4.addLocal__T__V("kaitai/kaitaistruct.h");
|
|
90248
90150
|
$n(this.Lio_kaitai_struct_languages_CppCompiler__f_importListHdr).addSystem__T__V("stdint.h");
|
|
90249
90151
|
var x1 = $n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_config).Lio_kaitai_struct_RuntimeConfig__f_cppConfig).Lio_kaitai_struct_CppRuntimeConfig__f_pointers;
|
|
90250
|
-
var x = $m_Lio_kaitai_struct_CppRuntimeConfig$
|
|
90152
|
+
var x = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
90251
90153
|
if ((x === x1)) {
|
|
90252
|
-
var $$x1 = true
|
|
90253
|
-
} else {
|
|
90254
|
-
var x$3 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
90255
|
-
var $$x1 = (x$3 === x1)
|
|
90256
|
-
};
|
|
90257
|
-
if ($$x1) {
|
|
90258
90154
|
$n(this.Lio_kaitai_struct_languages_CppCompiler__f_importListHdr).addSystem__T__V("memory")
|
|
90259
90155
|
} else {
|
|
90260
|
-
var x$
|
|
90261
|
-
if ((!(x$
|
|
90156
|
+
var x$3 = $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$();
|
|
90157
|
+
if ((!(x$3 === x1))) {
|
|
90262
90158
|
throw new $c_s_MatchError(x1)
|
|
90263
90159
|
}
|
|
90264
90160
|
};
|
|
@@ -90308,26 +90204,9 @@ $c_Lio_kaitai_struct_languages_CppCompiler.prototype.classHeader__sci_List__V =
|
|
|
90308
90204
|
var array = [$as_T($n(name).last__O())];
|
|
90309
90205
|
var elems = $ct_sjsr_WrappedVarArgs__sjs_js_Array__(new $c_sjsr_WrappedVarArgs(), array);
|
|
90310
90206
|
var className = $n($$x1).types2class__sci_List__T($m_sci_Nil$().prependedAll__sc_IterableOnce__sci_List(elems));
|
|
90311
|
-
var x1 = $n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_config).Lio_kaitai_struct_RuntimeConfig__f_cppConfig).Lio_kaitai_struct_CppRuntimeConfig__f_pointers;
|
|
90312
|
-
var x = $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$();
|
|
90313
|
-
if ((x === x1)) {
|
|
90314
|
-
var $$x2 = true
|
|
90315
|
-
} else {
|
|
90316
|
-
var x$3 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
90317
|
-
var $$x2 = (x$3 === x1)
|
|
90318
|
-
};
|
|
90319
|
-
if ($$x2) {
|
|
90320
|
-
var extraInherits = ""
|
|
90321
|
-
} else {
|
|
90322
|
-
var x$5 = $m_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$();
|
|
90323
|
-
if ((!(x$5 === x1))) {
|
|
90324
|
-
throw new $c_s_MatchError(x1)
|
|
90325
|
-
};
|
|
90326
|
-
var extraInherits = ((", std::enable_shared_from_this<" + className) + ">")
|
|
90327
|
-
};
|
|
90328
90207
|
var this$5 = $n(this.Lio_kaitai_struct_languages_CppCompiler__f_outHdr);
|
|
90329
90208
|
$n(this$5.Lio_kaitai_struct_StringLanguageOutputWriter__f_sb).append__T__scm_StringBuilder("\n");
|
|
90330
|
-
$n(this.Lio_kaitai_struct_languages_CppCompiler__f_outHdr).puts__T__V(((
|
|
90209
|
+
$n(this.Lio_kaitai_struct_languages_CppCompiler__f_outHdr).puts__T__V((("class " + className) + " : public kaitai::kstruct {"));
|
|
90331
90210
|
$n(this.Lio_kaitai_struct_languages_CppCompiler__f_outHdr).inc__V();
|
|
90332
90211
|
this.Lio_kaitai_struct_languages_CppCompiler__f_accessMode = this.PrivateAccess__Lio_kaitai_struct_languages_CppCompiler$PrivateAccess$();
|
|
90333
90212
|
this.ensureMode__Lio_kaitai_struct_languages_CppCompiler$AccessMode__V(this.PublicAccess__Lio_kaitai_struct_languages_CppCompiler$PublicAccess$())
|
|
@@ -90401,70 +90280,37 @@ $c_Lio_kaitai_struct_languages_CppCompiler.prototype.classConstructorHeader__sci
|
|
|
90401
90280
|
$n(this$9.Lio_kaitai_struct_StringLanguageOutputWriter__f_sb).append__T__scm_StringBuilder("\n");
|
|
90402
90281
|
$n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).puts__T__V((((((((((($m_Lio_kaitai_struct_languages_CppCompiler$().types2class__sci_List__T(name) + "::") + classNameBrief) + "(") + paramsArg) + ((tIo + " ") + pIo)) + ", ") + ((tParent + " ") + pParent)) + ", ") + (((((tRoot + " ") + pRoot) + endianSuffixSrc) + ") : kaitai::kstruct(") + pIo)) + ") {"));
|
|
90403
90282
|
$n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).inc__V();
|
|
90404
|
-
var x = $n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_config).Lio_kaitai_struct_RuntimeConfig__f_cppConfig).Lio_kaitai_struct_CppRuntimeConfig__f_pointers;
|
|
90405
|
-
var x$3 = $m_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$();
|
|
90406
|
-
if ((x !== null)) {
|
|
90407
|
-
var this$10 = $n(x);
|
|
90408
|
-
var $$x4 = (this$10 === x$3)
|
|
90409
|
-
} else {
|
|
90410
|
-
var $$x4 = false
|
|
90411
|
-
};
|
|
90412
|
-
if ($$x4) {
|
|
90413
|
-
$n(this.Lio_kaitai_struct_languages_CppCompiler__f_outSrc).puts__T__V((((("const auto weakPtrTrick = std::shared_ptr<" + classNameBrief) + ">(this, [](") + classNameBrief) + "*){});"))
|
|
90414
|
-
};
|
|
90415
90283
|
this.handleAssignmentSimple__Lio_kaitai_struct_format_Identifier__T__V($m_Lio_kaitai_struct_format_ParentIdentifier$(), pParent);
|
|
90416
|
-
|
|
90417
|
-
|
|
90418
|
-
var x1$2 = $n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_config).Lio_kaitai_struct_RuntimeConfig__f_cppConfig).Lio_kaitai_struct_CppRuntimeConfig__f_pointers;
|
|
90419
|
-
var x$6 = $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$();
|
|
90420
|
-
if ((x$6 === x1$2)) {
|
|
90421
|
-
var $$x6 = true
|
|
90422
|
-
} else {
|
|
90423
|
-
var x$8 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
90424
|
-
var $$x6 = (x$8 === x1$2)
|
|
90425
|
-
};
|
|
90426
|
-
if ($$x6) {
|
|
90427
|
-
var $$x5 = "this"
|
|
90428
|
-
} else {
|
|
90429
|
-
var x$10 = $m_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$();
|
|
90430
|
-
if ((!(x$10 === x1$2))) {
|
|
90431
|
-
throw new $c_s_MatchError(x1$2)
|
|
90432
|
-
};
|
|
90433
|
-
var $$x5 = "shared_from_this()"
|
|
90434
|
-
}
|
|
90435
|
-
} else {
|
|
90436
|
-
var $$x5 = pRoot
|
|
90437
|
-
};
|
|
90438
|
-
this.handleAssignmentSimple__Lio_kaitai_struct_format_Identifier__T__V($$x7, $$x5);
|
|
90439
|
-
var x1$3 = $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;
|
|
90284
|
+
this.handleAssignmentSimple__Lio_kaitai_struct_format_Identifier__T__V($m_Lio_kaitai_struct_format_RootIdentifier$(), (((name === null) ? (rootClassName === null) : $n(name).equals__O__Z(rootClassName)) ? "this" : pRoot));
|
|
90285
|
+
var x1$2 = $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;
|
|
90440
90286
|
matchEnd12: {
|
|
90441
|
-
var $$
|
|
90442
|
-
if ((x1$
|
|
90443
|
-
var x2 = $as_s_Some(x1$
|
|
90287
|
+
var $$x4;
|
|
90288
|
+
if ((x1$2 instanceof $c_s_Some)) {
|
|
90289
|
+
var x2 = $as_s_Some(x1$2);
|
|
90444
90290
|
if (($n(x2).s_Some__f_value instanceof $c_Lio_kaitai_struct_datatype_CalcEndian)) {
|
|
90445
|
-
var $$
|
|
90291
|
+
var $$x4 = true;
|
|
90446
90292
|
break matchEnd12
|
|
90447
90293
|
}
|
|
90448
90294
|
};
|
|
90449
|
-
if ((x1$
|
|
90450
|
-
var x4 = $as_s_Some(x1$
|
|
90295
|
+
if ((x1$2 instanceof $c_s_Some)) {
|
|
90296
|
+
var x4 = $as_s_Some(x1$2);
|
|
90451
90297
|
var p5 = $as_Lio_kaitai_struct_datatype_Endianness($n(x4).s_Some__f_value);
|
|
90452
|
-
var x$
|
|
90453
|
-
if ((x$
|
|
90454
|
-
var $$
|
|
90298
|
+
var x$4 = $m_Lio_kaitai_struct_datatype_InheritedEndian$();
|
|
90299
|
+
if ((x$4 === p5)) {
|
|
90300
|
+
var $$x4 = true;
|
|
90455
90301
|
break matchEnd12
|
|
90456
90302
|
}
|
|
90457
90303
|
};
|
|
90458
|
-
var $$
|
|
90304
|
+
var $$x4 = false
|
|
90459
90305
|
};
|
|
90460
|
-
if ($$
|
|
90306
|
+
if ($$x4) {
|
|
90461
90307
|
this.ensureMode__Lio_kaitai_struct_languages_CppCompiler$AccessMode__V(this.PrivateAccess__Lio_kaitai_struct_languages_CppCompiler$PrivateAccess$());
|
|
90462
90308
|
$n(this.Lio_kaitai_struct_languages_CppCompiler__f_outHdr).puts__T__V("int m__is_le;");
|
|
90463
90309
|
this.handleAssignmentSimple__Lio_kaitai_struct_format_Identifier__T__V($m_Lio_kaitai_struct_format_EndianIdentifier$(), (isHybrid ? "p_is_le" : "-1"));
|
|
90464
90310
|
this.ensureMode__Lio_kaitai_struct_languages_CppCompiler$AccessMode__V(this.PublicAccess__Lio_kaitai_struct_languages_CppCompiler$PublicAccess$())
|
|
90465
90311
|
};
|
|
90466
|
-
var this$
|
|
90467
|
-
var these = this$
|
|
90312
|
+
var this$10 = $n(params);
|
|
90313
|
+
var these = this$10;
|
|
90468
90314
|
while ((!$n(these).isEmpty__Z())) {
|
|
90469
90315
|
var arg1$2 = $n(these).head__O();
|
|
90470
90316
|
var p = $as_Lio_kaitai_struct_format_ParamDefSpec(arg1$2);
|
|
@@ -91136,59 +90982,37 @@ $c_Lio_kaitai_struct_languages_CppCompiler.prototype.parseExpr__Lio_kaitai_struc
|
|
|
91136
90982
|
};
|
|
91137
90983
|
var x$3 = $m_s_None$();
|
|
91138
90984
|
if ((x$3 === x1$2)) {
|
|
91139
|
-
var
|
|
91140
|
-
|
|
91141
|
-
if ((x$5 === x1$3)) {
|
|
91142
|
-
var $$x1 = true
|
|
91143
|
-
} else {
|
|
91144
|
-
var x$7 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
91145
|
-
var $$x1 = (x$7 === x1$3)
|
|
91146
|
-
};
|
|
91147
|
-
if ($$x1) {
|
|
91148
|
-
var parent = "this";
|
|
91149
|
-
break matchEnd9
|
|
91150
|
-
} else {
|
|
91151
|
-
var x$9 = $m_Lio_kaitai_struct_CppRuntimeConfig$SharedPointers$();
|
|
91152
|
-
if ((!(x$9 === x1$3))) {
|
|
91153
|
-
throw new $c_s_MatchError(x1$3)
|
|
91154
|
-
};
|
|
91155
|
-
var parent = "shared_from_this()";
|
|
91156
|
-
break matchEnd9
|
|
91157
|
-
}
|
|
90985
|
+
var parent = "this";
|
|
90986
|
+
break matchEnd9
|
|
91158
90987
|
};
|
|
91159
90988
|
throw new $c_s_MatchError(x1$2)
|
|
91160
90989
|
};
|
|
91161
|
-
var x1$
|
|
91162
|
-
matchEnd6
|
|
90990
|
+
var x1$3 = $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;
|
|
90991
|
+
matchEnd6: {
|
|
91163
90992
|
var addEndian;
|
|
91164
|
-
if ((x1$
|
|
91165
|
-
var x2$3 = $as_s_Some(x1$
|
|
90993
|
+
if ((x1$3 instanceof $c_s_Some)) {
|
|
90994
|
+
var x2$3 = $as_s_Some(x1$3);
|
|
91166
90995
|
var p3$2 = $as_Lio_kaitai_struct_datatype_Endianness($n(x2$3).s_Some__f_value);
|
|
91167
|
-
var x$
|
|
91168
|
-
if ((x$
|
|
90996
|
+
var x$5 = $m_Lio_kaitai_struct_datatype_InheritedEndian$();
|
|
90997
|
+
if ((x$5 === p3$2)) {
|
|
91169
90998
|
var addEndian = ", m__is_le";
|
|
91170
|
-
break matchEnd6
|
|
90999
|
+
break matchEnd6
|
|
91171
91000
|
}
|
|
91172
91001
|
};
|
|
91173
91002
|
var addEndian = ""
|
|
91174
91003
|
};
|
|
91175
91004
|
var addArgs = ((((", " + parent) + ", ") + this.privateMemberName__Lio_kaitai_struct_format_Identifier__T($m_Lio_kaitai_struct_format_RootIdentifier$())) + addEndian)
|
|
91176
91005
|
};
|
|
91177
|
-
var x1$
|
|
91178
|
-
var x$
|
|
91179
|
-
if ((x$
|
|
91006
|
+
var x1$4 = $n($n(this.Lio_kaitai_struct_languages_components_LanguageCompiler__f_config).Lio_kaitai_struct_RuntimeConfig__f_cppConfig).Lio_kaitai_struct_CppRuntimeConfig__f_pointers;
|
|
91007
|
+
var x$7 = $m_Lio_kaitai_struct_CppRuntimeConfig$RawPointers$();
|
|
91008
|
+
if ((x$7 === x1$4)) {
|
|
91180
91009
|
return (((((("new " + $m_Lio_kaitai_struct_languages_CppCompiler$().types2class__sci_List__T($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name)) + "(") + addParams) + io) + addArgs) + ")")
|
|
91181
91010
|
} else {
|
|
91182
|
-
var x$
|
|
91183
|
-
if ((x$
|
|
91184
|
-
return (((((("std::
|
|
91011
|
+
var x$9 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
91012
|
+
if ((x$9 === x1$4)) {
|
|
91013
|
+
return (((((((("std::unique_ptr<" + $m_Lio_kaitai_struct_languages_CppCompiler$().types2class__sci_List__T($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name)) + ">(new ") + $m_Lio_kaitai_struct_languages_CppCompiler$().types2class__sci_List__T($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name)) + "(") + addParams) + io) + addArgs) + "))")
|
|
91185
91014
|
} else {
|
|
91186
|
-
|
|
91187
|
-
if ((x$17 === x1$5)) {
|
|
91188
|
-
return (((((((("std::unique_ptr<" + $m_Lio_kaitai_struct_languages_CppCompiler$().types2class__sci_List__T($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name)) + ">(new ") + $m_Lio_kaitai_struct_languages_CppCompiler$().types2class__sci_List__T($n(x10).Lio_kaitai_struct_datatype_DataType$UserType__f_name)) + "(") + addParams) + io) + addArgs) + "))")
|
|
91189
|
-
} else {
|
|
91190
|
-
throw new $c_s_MatchError(x1$5)
|
|
91191
|
-
}
|
|
91015
|
+
throw new $c_s_MatchError(x1$4)
|
|
91192
91016
|
}
|
|
91193
91017
|
}
|
|
91194
91018
|
} else {
|
|
@@ -91471,14 +91295,8 @@ $c_Lio_kaitai_struct_languages_CppCompiler.prototype.nullPtr__T = (function() {
|
|
|
91471
91295
|
if ((x === x1)) {
|
|
91472
91296
|
return "0"
|
|
91473
91297
|
} else {
|
|
91474
|
-
var x$3 = $m_Lio_kaitai_struct_CppRuntimeConfig$
|
|
91298
|
+
var x$3 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
91475
91299
|
if ((x$3 === x1)) {
|
|
91476
|
-
var $$x1 = true
|
|
91477
|
-
} else {
|
|
91478
|
-
var x$5 = $m_Lio_kaitai_struct_CppRuntimeConfig$UniqueAndRawPointers$();
|
|
91479
|
-
var $$x1 = (x$5 === x1)
|
|
91480
|
-
};
|
|
91481
|
-
if ($$x1) {
|
|
91482
91300
|
return "nullptr"
|
|
91483
91301
|
} else {
|
|
91484
91302
|
throw new $c_s_MatchError(x1)
|
package/package.json
CHANGED