jww-parser-mbt 2025.12.5 → 2025.12.7

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