@tsplc/compiler 0.4.4 → 0.5.1

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/codesys.js CHANGED
@@ -2540,7 +2540,7 @@ import {
2540
2540
  } from "@tsplc/compiler/ir";
2541
2541
  import { serviceOfPath } from "@tsplc/server";
2542
2542
  // packages/compiler/package.json
2543
- var version = "0.4.4";
2543
+ var version = "0.5.1";
2544
2544
 
2545
2545
  // packages/compiler/src/codesys/sources.ts
2546
2546
  import { existsSync, readFileSync } from "node:fs";
@@ -3157,10 +3157,12 @@ function debugTypes(types, target, blocks, fields, extras, sources) {
3157
3157
  type.id,
3158
3158
  {
3159
3159
  kind: "scalar",
3160
- iec: stringTypeName(type)
3160
+ iec: stringTypeName(type),
3161
+ capacity: type.capacity
3161
3162
  }
3162
3163
  ];
3163
- case "enum":
3164
+ case "enum": {
3165
+ const texts = type.members.flatMap((member) => member.text === undefined ? [] : [[member.name, member.text]]);
3164
3166
  return [
3165
3167
  type.id,
3166
3168
  {
@@ -3169,9 +3171,11 @@ function debugTypes(types, target, blocks, fields, extras, sources) {
3169
3171
  members: Object.fromEntries(type.members.map((member) => [
3170
3172
  member.name,
3171
3173
  Number(member.value)
3172
- ]))
3174
+ ])),
3175
+ ...texts.length && { texts: Object.fromEntries(texts) }
3173
3176
  }
3174
3177
  ];
3178
+ }
3175
3179
  case "array":
3176
3180
  return [
3177
3181
  type.id,
@@ -3179,7 +3183,8 @@ function debugTypes(types, target, blocks, fields, extras, sources) {
3179
3183
  kind: "array",
3180
3184
  element: type.element,
3181
3185
  length: type.length,
3182
- lower: type.lowerBound
3186
+ lower: type.lowerBound,
3187
+ ...type.index && { index: type.index }
3183
3188
  }
3184
3189
  ];
3185
3190
  case "record":
@@ -5030,5 +5035,5 @@ export {
5030
5035
  publicationSelectors
5031
5036
  };
5032
5037
 
5033
- //# debugId=B3D658D4562B65AF64756E2164756E21
5038
+ //# debugId=37DD43D8EC04752B64756E2164756E21
5034
5039
  //# sourceMappingURL=codesys.js.map