jww-parser-mbt 2025.12.5 → 2025.12.6
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/dist/index.cjs +59 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +59 -53
- package/dist/index.mjs.map +1 -1
- package/dist/moonbit.d.ts +57 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -994,58 +994,58 @@ const f4ah6o$jww_parser$core$$default$46$record$47$742 = {
|
|
|
994
994
|
protect: 0,
|
|
995
995
|
name: ""
|
|
996
996
|
};
|
|
997
|
-
const f4ah6o$jww_parser$core$$parse$46$constr$47$
|
|
998
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
997
|
+
const f4ah6o$jww_parser$core$$parse$46$constr$47$1012 = 8;
|
|
998
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1049 = {
|
|
999
999
|
_0: "CONTINUOUS",
|
|
1000
1000
|
_1: "Solid line",
|
|
1001
1001
|
_2: ""
|
|
1002
1002
|
};
|
|
1003
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1003
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1050 = {
|
|
1004
1004
|
_0: "DASHED",
|
|
1005
1005
|
_1: "Dashed",
|
|
1006
1006
|
_2: ""
|
|
1007
1007
|
};
|
|
1008
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1008
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1051 = {
|
|
1009
1009
|
_0: "DOTTED",
|
|
1010
1010
|
_1: "Dotted",
|
|
1011
1011
|
_2: ""
|
|
1012
1012
|
};
|
|
1013
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1013
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1052 = {
|
|
1014
1014
|
_0: "DASHDOT",
|
|
1015
1015
|
_1: "Dash dot",
|
|
1016
1016
|
_2: ""
|
|
1017
1017
|
};
|
|
1018
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1018
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1053 = {
|
|
1019
1019
|
_0: "DOT2",
|
|
1020
1020
|
_1: "Dot (small)",
|
|
1021
1021
|
_2: ""
|
|
1022
1022
|
};
|
|
1023
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1023
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1054 = {
|
|
1024
1024
|
_0: "DASHDOT2",
|
|
1025
1025
|
_1: "Dash dot (small)",
|
|
1026
1026
|
_2: ""
|
|
1027
1027
|
};
|
|
1028
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1028
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1055 = {
|
|
1029
1029
|
_0: "DASHDOTDOT",
|
|
1030
1030
|
_1: "Dash dot dot",
|
|
1031
1031
|
_2: ""
|
|
1032
1032
|
};
|
|
1033
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1033
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1056 = {
|
|
1034
1034
|
_0: "DIVIDE",
|
|
1035
1035
|
_1: "Divide",
|
|
1036
1036
|
_2: ""
|
|
1037
1037
|
};
|
|
1038
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1038
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1057 = {
|
|
1039
1039
|
_0: "CENTER",
|
|
1040
1040
|
_1: "Center",
|
|
1041
1041
|
_2: ""
|
|
1042
1042
|
};
|
|
1043
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1043
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1058 = {
|
|
1044
1044
|
_0: "BORDER",
|
|
1045
1045
|
_1: "Border",
|
|
1046
1046
|
_2: ""
|
|
1047
1047
|
};
|
|
1048
|
-
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$
|
|
1048
|
+
const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1059 = {
|
|
1049
1049
|
_0: "HIDDEN",
|
|
1050
1050
|
_1: "Hidden",
|
|
1051
1051
|
_2: ""
|
|
@@ -9825,16 +9825,17 @@ function f4ah6o$jww_parser$core$$parse_entity_by_class(class_name, reader, versi
|
|
|
9825
9825
|
}
|
|
9826
9826
|
function f4ah6o$jww_parser$core$$parse_entity_with_pid_tracking(reader, version, pid_to_class, next_pid) {
|
|
9827
9827
|
const class_id = f4ah6o$jww_parser$core$$Reader$read_word(reader);
|
|
9828
|
-
let
|
|
9828
|
+
let class_name = "";
|
|
9829
|
+
let updated_next_pid = next_pid;
|
|
9829
9830
|
if (class_id === 65535) {
|
|
9830
9831
|
f4ah6o$jww_parser$core$$Reader$read_word(reader);
|
|
9831
9832
|
const name_bytes = f4ah6o$jww_parser$core$$Reader$read_bytes(reader, f4ah6o$jww_parser$core$$Reader$read_word(reader));
|
|
9832
9833
|
let name_chars = "";
|
|
9833
|
-
const
|
|
9834
|
+
const _end161 = name_bytes.length;
|
|
9834
9835
|
let _tmp = 0;
|
|
9835
9836
|
while (true) {
|
|
9836
9837
|
const i = _tmp;
|
|
9837
|
-
if (i <
|
|
9838
|
+
if (i < _end161) {
|
|
9838
9839
|
const _tmp$2 = name_chars;
|
|
9839
9840
|
$bound_check(name_bytes, i);
|
|
9840
9841
|
const _p = name_bytes[i];
|
|
@@ -9843,13 +9844,10 @@ function f4ah6o$jww_parser$core$$parse_entity_with_pid_tracking(reader, version,
|
|
|
9843
9844
|
continue;
|
|
9844
9845
|
} else break;
|
|
9845
9846
|
}
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
_1: pid_to_class,
|
|
9851
|
-
_2: (next_pid >>> 0) + 1 | 0
|
|
9852
|
-
};
|
|
9847
|
+
class_name = name_chars;
|
|
9848
|
+
const pid = updated_next_pid;
|
|
9849
|
+
if (pid < 65536) moonbitlang$core$array$$Array$set$13$(pid_to_class, pid, class_name);
|
|
9850
|
+
updated_next_pid = (pid >>> 0) + 1 | 0;
|
|
9853
9851
|
} else if (class_id === 32768) return {
|
|
9854
9852
|
entity: void 0,
|
|
9855
9853
|
pid_to_class,
|
|
@@ -9859,29 +9857,36 @@ function f4ah6o$jww_parser$core$$parse_entity_with_pid_tracking(reader, version,
|
|
|
9859
9857
|
const class_pid = class_id & 32767;
|
|
9860
9858
|
if (class_pid < 65536) {
|
|
9861
9859
|
const name = moonbitlang$core$array$$Array$at$13$(pid_to_class, class_pid);
|
|
9862
|
-
if (name === "")
|
|
9860
|
+
if (name === "") {
|
|
9861
|
+
f4ah6o$jww_parser$core$$parse_entity_base(reader, version);
|
|
9862
|
+
f4ah6o$jww_parser$core$Reader$read_double(reader);
|
|
9863
|
+
f4ah6o$jww_parser$core$Reader$read_double(reader);
|
|
9864
|
+
f4ah6o$jww_parser$core$Reader$read_double(reader);
|
|
9865
|
+
f4ah6o$jww_parser$core$Reader$read_double(reader);
|
|
9866
|
+
return {
|
|
9867
|
+
entity: void 0,
|
|
9868
|
+
pid_to_class,
|
|
9869
|
+
next_pid: (next_pid >>> 0) + 1 | 0
|
|
9870
|
+
};
|
|
9871
|
+
}
|
|
9872
|
+
class_name = name;
|
|
9873
|
+
} else {
|
|
9874
|
+
f4ah6o$jww_parser$core$$parse_entity_base(reader, version);
|
|
9875
|
+
f4ah6o$jww_parser$core$Reader$read_double(reader);
|
|
9876
|
+
f4ah6o$jww_parser$core$Reader$read_double(reader);
|
|
9877
|
+
f4ah6o$jww_parser$core$Reader$read_double(reader);
|
|
9878
|
+
f4ah6o$jww_parser$core$Reader$read_double(reader);
|
|
9879
|
+
return {
|
|
9863
9880
|
entity: void 0,
|
|
9864
9881
|
pid_to_class,
|
|
9865
9882
|
next_pid: (next_pid >>> 0) + 1 | 0
|
|
9866
9883
|
};
|
|
9867
|
-
|
|
9868
|
-
_0: name,
|
|
9869
|
-
_1: pid_to_class,
|
|
9870
|
-
_2: next_pid
|
|
9871
|
-
};
|
|
9872
|
-
} else return {
|
|
9873
|
-
entity: void 0,
|
|
9874
|
-
pid_to_class,
|
|
9875
|
-
next_pid: (next_pid >>> 0) + 1 | 0
|
|
9876
|
-
};
|
|
9884
|
+
}
|
|
9877
9885
|
}
|
|
9878
|
-
const _class_name = _bind._0;
|
|
9879
|
-
const _updated_p2c = _bind._1;
|
|
9880
|
-
const _updated_next_pid = _bind._2;
|
|
9881
9886
|
return {
|
|
9882
|
-
entity: f4ah6o$jww_parser$core$$parse_entity_by_class(
|
|
9883
|
-
pid_to_class
|
|
9884
|
-
next_pid: (
|
|
9887
|
+
entity: f4ah6o$jww_parser$core$$parse_entity_by_class(class_name, reader, version),
|
|
9888
|
+
pid_to_class,
|
|
9889
|
+
next_pid: (updated_next_pid >>> 0) + 1 | 0
|
|
9885
9890
|
};
|
|
9886
9891
|
}
|
|
9887
9892
|
function f4ah6o$jww_parser$core$$parse_entity_list(data, offset, version) {
|
|
@@ -9904,6 +9909,7 @@ function f4ah6o$jww_parser$core$$parse_entity_list(data, offset, version) {
|
|
|
9904
9909
|
while (true) {
|
|
9905
9910
|
const _ = _tmp$2;
|
|
9906
9911
|
if (_ < count) {
|
|
9912
|
+
if ((reader.data.length - reader.pos | 0) < 4) break;
|
|
9907
9913
|
const result = f4ah6o$jww_parser$core$$parse_entity_with_pid_tracking(reader, version, pid_to_class, next_pid);
|
|
9908
9914
|
const _x = result.entity;
|
|
9909
9915
|
if (_x === void 0) {
|
|
@@ -10036,19 +10042,19 @@ function f4ah6o$jww_parser$core$$parse_block_def_list(data, offset, version) {
|
|
|
10036
10042
|
}
|
|
10037
10043
|
function f4ah6o$jww_parser$core$$set_layer_names(layer_groups) {
|
|
10038
10044
|
const result = moonbitlang$core$array$$Array$new$46$inner$11$(0);
|
|
10039
|
-
const
|
|
10045
|
+
const _end234 = layer_groups.length;
|
|
10040
10046
|
let _tmp = 0;
|
|
10041
10047
|
while (true) {
|
|
10042
10048
|
const g_idx = _tmp;
|
|
10043
|
-
if (g_idx <
|
|
10049
|
+
if (g_idx < _end234) {
|
|
10044
10050
|
const lg = moonbitlang$core$array$$Array$at$11$(layer_groups, g_idx);
|
|
10045
10051
|
const group_name = lg.name === "" ? `Group${moonbitlang$core$int$$Int$to_string$46$inner(g_idx, 10)}` : lg.name;
|
|
10046
10052
|
const layers = moonbitlang$core$array$$Array$new$46$inner$12$(0);
|
|
10047
|
-
const
|
|
10053
|
+
const _end242 = lg.layers.length;
|
|
10048
10054
|
let _tmp$2 = 0;
|
|
10049
10055
|
while (true) {
|
|
10050
10056
|
const l_idx = _tmp$2;
|
|
10051
|
-
if (l_idx <
|
|
10057
|
+
if (l_idx < _end242) {
|
|
10052
10058
|
const l = moonbitlang$core$array$$Array$at$12$(lg.layers, l_idx);
|
|
10053
10059
|
const layer_name = l.name === "" ? `${moonbitlang$core$int$$Int$to_string$46$inner(g_idx, 10)}-${moonbitlang$core$int$$Int$to_string$46$inner(l_idx, 10)}` : l.name;
|
|
10054
10060
|
moonbitlang$core$array$$Array$push$12$(layers, {
|
|
@@ -10076,7 +10082,7 @@ function f4ah6o$jww_parser$core$$set_layer_names(layer_groups) {
|
|
|
10076
10082
|
}
|
|
10077
10083
|
function f4ah6o$jww_parser$core$$parse(data) {
|
|
10078
10084
|
if (data.length < 8) return f4ah6o$jww_parser$core$$Document$default();
|
|
10079
|
-
if (moonbitlang$core$builtin$$op_notequal$9$(moonbitlang$core$bytes$$Bytes$from_array(moonbitlang$core$array$$Array$sub$46$inner$3$(moonbitlang$core$bytes$$Bytes$to_array(data), 0, f4ah6o$jww_parser$core$$parse$46$constr$47$
|
|
10085
|
+
if (moonbitlang$core$builtin$$op_notequal$9$(moonbitlang$core$bytes$$Bytes$from_array(moonbitlang$core$array$$Array$sub$46$inner$3$(moonbitlang$core$bytes$$Bytes$to_array(data), 0, f4ah6o$jww_parser$core$$parse$46$constr$47$1012)), $bytes_literal$1)) return f4ah6o$jww_parser$core$$Document$default();
|
|
10080
10086
|
const reader = f4ah6o$jww_parser$core$$Reader$new(moonbitlang$core$bytes$$Bytes$from_array(moonbitlang$core$array$$Array$sub$46$inner$3$(moonbitlang$core$bytes$$Bytes$to_array(data), 8, data.length)));
|
|
10081
10087
|
const version = f4ah6o$jww_parser$core$$Reader$read_dword(reader);
|
|
10082
10088
|
const memo = f4ah6o$jww_parser$core$$read_cstring(reader);
|
|
@@ -10179,17 +10185,17 @@ function f4ah6o$jww_parser$dxf$$ltype_table() {
|
|
|
10179
10185
|
output = `${output}2\nLTYPE\n`;
|
|
10180
10186
|
output = `${output}70\n11\n`;
|
|
10181
10187
|
const ltypes = [
|
|
10182
|
-
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1041,
|
|
10183
|
-
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1042,
|
|
10184
|
-
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1043,
|
|
10185
|
-
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1044,
|
|
10186
|
-
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1045,
|
|
10187
|
-
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1046,
|
|
10188
|
-
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1047,
|
|
10189
|
-
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1048,
|
|
10190
10188
|
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1049,
|
|
10191
10189
|
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1050,
|
|
10192
|
-
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1051
|
|
10190
|
+
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1051,
|
|
10191
|
+
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1052,
|
|
10192
|
+
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1053,
|
|
10193
|
+
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1054,
|
|
10194
|
+
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1055,
|
|
10195
|
+
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1056,
|
|
10196
|
+
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1057,
|
|
10197
|
+
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1058,
|
|
10198
|
+
f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1059
|
|
10193
10199
|
];
|
|
10194
10200
|
const _len = ltypes.length;
|
|
10195
10201
|
let _tmp = 0;
|