kaitai-struct-compiler 0.10.0-SNAPSHOT20220801.120454.5340ff36 → 0.10.0-SNAPSHOT20220801.215207.be695f54
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 +40 -17
- package/package.json +1 -1
|
@@ -1290,6 +1290,16 @@ function $isArrayOf_Lio_kaitai_struct_exprlang_Ast$cmpop(obj, depth) {
|
|
|
1290
1290
|
function $asArrayOf_Lio_kaitai_struct_exprlang_Ast$cmpop(obj, depth) {
|
|
1291
1291
|
return (($isArrayOf_Lio_kaitai_struct_exprlang_Ast$cmpop(obj, depth) || (obj === null)) ? obj : $throwArrayCastException(obj, "Lio.kaitai.struct.exprlang.Ast$cmpop;", depth))
|
|
1292
1292
|
}
|
|
1293
|
+
function $f_Lio_kaitai_struct_exprlang_Ast$expr__evaluateStrConst__s_Option($thiz) {
|
|
1294
|
+
var x1 = $m_Lio_kaitai_struct_exprlang_ConstEvaluator$().evaluate__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_ConstEvaluator$value($thiz);
|
|
1295
|
+
if ((x1 instanceof $c_Lio_kaitai_struct_exprlang_ConstEvaluator$value$Str)) {
|
|
1296
|
+
var x2 = $as_Lio_kaitai_struct_exprlang_ConstEvaluator$value$Str(x1);
|
|
1297
|
+
var x = x2.value$1;
|
|
1298
|
+
return new $c_s_Some().init___O(x)
|
|
1299
|
+
} else {
|
|
1300
|
+
return $m_s_None$()
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1293
1303
|
function $is_Lio_kaitai_struct_exprlang_Ast$expr(obj) {
|
|
1294
1304
|
return (!(!((obj && obj.$classData) && obj.$classData.ancestors.Lio_kaitai_struct_exprlang_Ast$expr)))
|
|
1295
1305
|
}
|
|
@@ -4494,9 +4504,9 @@ function $h_Lio_kaitai_struct_Version$() {
|
|
|
4494
4504
|
$h_Lio_kaitai_struct_Version$.prototype = $c_Lio_kaitai_struct_Version$.prototype;
|
|
4495
4505
|
$c_Lio_kaitai_struct_Version$.prototype.init___ = (function() {
|
|
4496
4506
|
this.name$1 = "kaitai-struct-compiler-js";
|
|
4497
|
-
this.version$1 = "0.10-SNAPSHOT20220801.
|
|
4498
|
-
this.gitCommit$1 = "
|
|
4499
|
-
this.gitTime$1 = "2022-08-
|
|
4507
|
+
this.version$1 = "0.10-SNAPSHOT20220801.215207.be695f54";
|
|
4508
|
+
this.gitCommit$1 = "be695f54";
|
|
4509
|
+
this.gitTime$1 = "2022-08-01T21:52:07+00:00";
|
|
4500
4510
|
return this
|
|
4501
4511
|
});
|
|
4502
4512
|
var $d_Lio_kaitai_struct_Version$ = new $TypeData().initClass({
|
|
@@ -47912,6 +47922,12 @@ $c_Lio_kaitai_struct_exprlang_Ast$expr$EnumById.prototype.productPrefix__T = (fu
|
|
|
47912
47922
|
$c_Lio_kaitai_struct_exprlang_Ast$expr$EnumById.prototype.productArity__I = (function() {
|
|
47913
47923
|
return 3
|
|
47914
47924
|
});
|
|
47925
|
+
$c_Lio_kaitai_struct_exprlang_Ast$expr$EnumById.prototype.init___Lio_kaitai_struct_exprlang_Ast$identifier__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$typeId = (function(enumName, id, inType) {
|
|
47926
|
+
this.enumName$1 = enumName;
|
|
47927
|
+
this.id$1 = id;
|
|
47928
|
+
this.inType$1 = inType;
|
|
47929
|
+
return this
|
|
47930
|
+
});
|
|
47915
47931
|
$c_Lio_kaitai_struct_exprlang_Ast$expr$EnumById.prototype.equals__O__Z = (function(x$1) {
|
|
47916
47932
|
if ((this === x$1)) {
|
|
47917
47933
|
return true
|
|
@@ -47937,12 +47953,6 @@ $c_Lio_kaitai_struct_exprlang_Ast$expr$EnumById.prototype.equals__O__Z = (functi
|
|
|
47937
47953
|
return false
|
|
47938
47954
|
}
|
|
47939
47955
|
});
|
|
47940
|
-
$c_Lio_kaitai_struct_exprlang_Ast$expr$EnumById.prototype.init___Lio_kaitai_struct_exprlang_Ast$identifier__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$typeId = (function(enumName, id, inType) {
|
|
47941
|
-
this.enumName$1 = enumName;
|
|
47942
|
-
this.id$1 = id;
|
|
47943
|
-
this.inType$1 = inType;
|
|
47944
|
-
return this
|
|
47945
|
-
});
|
|
47946
47956
|
$c_Lio_kaitai_struct_exprlang_Ast$expr$EnumById.prototype.productElement__I__O = (function(x$1) {
|
|
47947
47957
|
switch (x$1) {
|
|
47948
47958
|
case 0: {
|
|
@@ -48753,14 +48763,14 @@ $h_Lio_kaitai_struct_exprlang_Ast$expr$UnaryOp.prototype = $c_Lio_kaitai_struct_
|
|
|
48753
48763
|
$c_Lio_kaitai_struct_exprlang_Ast$expr$UnaryOp.prototype.productPrefix__T = (function() {
|
|
48754
48764
|
return "UnaryOp"
|
|
48755
48765
|
});
|
|
48766
|
+
$c_Lio_kaitai_struct_exprlang_Ast$expr$UnaryOp.prototype.productArity__I = (function() {
|
|
48767
|
+
return 2
|
|
48768
|
+
});
|
|
48756
48769
|
$c_Lio_kaitai_struct_exprlang_Ast$expr$UnaryOp.prototype.init___Lio_kaitai_struct_exprlang_Ast$unaryop__Lio_kaitai_struct_exprlang_Ast$expr = (function(op, operand) {
|
|
48757
48770
|
this.op$1 = op;
|
|
48758
48771
|
this.operand$1 = operand;
|
|
48759
48772
|
return this
|
|
48760
48773
|
});
|
|
48761
|
-
$c_Lio_kaitai_struct_exprlang_Ast$expr$UnaryOp.prototype.productArity__I = (function() {
|
|
48762
|
-
return 2
|
|
48763
|
-
});
|
|
48764
48774
|
$c_Lio_kaitai_struct_exprlang_Ast$expr$UnaryOp.prototype.equals__O__Z = (function(x$1) {
|
|
48765
48775
|
if ((this === x$1)) {
|
|
48766
48776
|
return true
|
|
@@ -66702,12 +66712,12 @@ $c_Lio_kaitai_struct_translators_JavaTranslator.prototype.arraySize__Lio_kaitai_
|
|
|
66702
66712
|
return this.arraySize__Lio_kaitai_struct_exprlang_Ast$expr__T(a)
|
|
66703
66713
|
});
|
|
66704
66714
|
$c_Lio_kaitai_struct_translators_JavaTranslator.prototype.doStrCompareOp__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$cmpop__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(left, op, right) {
|
|
66705
|
-
var x
|
|
66706
|
-
if ((
|
|
66715
|
+
var x = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$Eq$();
|
|
66716
|
+
if ((x === op)) {
|
|
66707
66717
|
return (((this.translate__Lio_kaitai_struct_exprlang_Ast$expr__T(left) + ".equals(") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__T(right)) + ")")
|
|
66708
66718
|
} else {
|
|
66709
|
-
var x$
|
|
66710
|
-
if ((
|
|
66719
|
+
var x$3 = $m_Lio_kaitai_struct_exprlang_Ast$cmpop$NotEq$();
|
|
66720
|
+
if ((x$3 === op)) {
|
|
66711
66721
|
return (((("!(" + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__T(left)) + ").equals(") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__T(right)) + ")")
|
|
66712
66722
|
} else {
|
|
66713
66723
|
return (((((("(" + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__T(left)) + ".compareTo(") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__T(right)) + ") ") + $f_Lio_kaitai_struct_translators_CommonOps__cmpOp__Lio_kaitai_struct_exprlang_Ast$cmpop__T(this, op)) + " 0)")
|
|
@@ -68055,7 +68065,20 @@ $c_Lio_kaitai_struct_translators_RubyTranslator.prototype.strToInt__Lio_kaitai_s
|
|
|
68055
68065
|
return this.strToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_exprlang_Ast$expr__T(s, base)
|
|
68056
68066
|
});
|
|
68057
68067
|
$c_Lio_kaitai_struct_translators_RubyTranslator.prototype.bytesToStr__T__Lio_kaitai_struct_exprlang_Ast$expr__T = (function(bytesExpr, encoding) {
|
|
68058
|
-
|
|
68068
|
+
var encodingOpt = $f_Lio_kaitai_struct_exprlang_Ast$expr__evaluateStrConst__s_Option(encoding);
|
|
68069
|
+
if ((encodingOpt instanceof $c_s_Some)) {
|
|
68070
|
+
var x2 = $as_s_Some(encodingOpt);
|
|
68071
|
+
var encodingConst = $as_T(x2.value$2);
|
|
68072
|
+
var encodingConstLower = $as_T(encodingConst.toLowerCase());
|
|
68073
|
+
var needEncode = ((encodingConstLower !== "utf8") && (encodingConstLower !== "utf-8"))
|
|
68074
|
+
} else {
|
|
68075
|
+
var x = $m_s_None$();
|
|
68076
|
+
if ((!(x === encodingOpt))) {
|
|
68077
|
+
throw new $c_s_MatchError().init___O(encodingOpt)
|
|
68078
|
+
};
|
|
68079
|
+
var needEncode = true
|
|
68080
|
+
};
|
|
68081
|
+
return ((((("(" + bytesExpr) + ").force_encoding(") + this.translate__Lio_kaitai_struct_exprlang_Ast$expr__T(encoding)) + ")") + (needEncode ? ".encode('UTF-8')" : ""))
|
|
68059
68082
|
});
|
|
68060
68083
|
$c_Lio_kaitai_struct_translators_RubyTranslator.prototype.enumToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType$EnumType__O = (function(value, et) {
|
|
68061
68084
|
return this.enumToInt__Lio_kaitai_struct_exprlang_Ast$expr__Lio_kaitai_struct_datatype_DataType$EnumType__T(value, et)
|
package/package.json
CHANGED